diff options
Diffstat (limited to 'indra')
367 files changed, 8647 insertions, 11621 deletions
diff --git a/indra/llcommon/imageids.h b/indra/llcommon/imageids.h index cc7c70e29f..bdbd2329d1 100644 --- a/indra/llcommon/imageids.h +++ b/indra/llcommon/imageids.h @@ -43,60 +43,34 @@ // pre-cached on viewer // Grass Images -//const LLUUID IMG_GRASS1 ("990c4086-46ce-49bd-8cae-afcc23a08f4e"); // dataserver -//const LLUUID IMG_GRASS2 ("869e2dcf-21b9-402d-a36d-9a23365cf723"); // dataserver -//const LLUUID IMG_GRASS3 ("8f97e7a7-f664-4967-9e8f-8d9e8039c1b7"); // dataserver - -//const LLUUID IMG_GRASS4 ("8a05131d-35b7-4812-bcfc-a989b0f954ef"); // dataserver - -//const LLUUID IMG_GRASS5 ("7d092acb-c69a-4122-b09b-f285e009b185"); // dataserver - -const LLUUID IMG_CLEAR ("11ee27f5-43c0-414e-afd5-d7f5688c351f"); // VIEWER const LLUUID IMG_SMOKE ("b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d"); // VIEWER const LLUUID IMG_DEFAULT ("d2114404-dd59-4a4d-8e6c-49359e91bbf0"); // VIEWER -//const LLUUID IMG_SAND ("0ff70ead-4562-45f9-9e8a-52b1a3286868"); // VIEWER 1.5k -//const LLUUID IMG_GRASS ("5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508"); // VIEWER 1.2k -//const LLUUID IMG_ROCK ("402f8b24-5f9d-4905-b5f8-37baff603e88"); // VIEWER 1.2k -//const LLUUID IMG_ROCKFACE ("9c88539c-fd04-46b8-bea2-ddf1bcffe3bd"); // VIEWER 1.2k const LLUUID IMG_SUN ("cce0f112-878f-4586-a2e2-a8f104bba271"); // dataserver const LLUUID IMG_MOON ("d07f6eed-b96a-47cd-b51d-400ad4a1c428"); // dataserver const LLUUID IMG_CLOUD_POOF ("fc4b9f0b-d008-45c6-96a4-01dd947ac621"); // dataserver const LLUUID IMG_SHOT ("35f217a3-f618-49cf-bbca-c86d486551a9"); // dataserver const LLUUID IMG_SPARK ("d2e75ac1-d0fb-4532-820e-a20034ac814d"); // dataserver const LLUUID IMG_FIRE ("aca40aa8-44cf-44ca-a0fa-93e1a2986f82"); // dataserver -//const LLUUID IMG_WATER ("e510b068-d20d-4612-a08d-fde4d5c15789"); // VIEWER const LLUUID IMG_FACE_SELECT ("a85ac674-cb75-4af6-9499-df7c5aaf7a28"); // face selector - -//const LLUUID IMG_SHADOW ("5e1de0a8-f9f8-4237-9396-d221126a7c4a"); // dataserver -//const LLUUID IMG_AVATARSHADOW ("c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d"); // dataserver -//const LLUUID IMG_BOXSHADOW ("8d86b8cc-4889-408a-8b72-c1961bae53d7"); // dataserver -//const LLUUID IMG_EYE ("5e3551ae-9971-4814-af99-5117591e937b"); // dataserver -//const LLUUID IMG_BLUE_FLAME ("d8b62059-7b31-4511-a479-1fe45117948f"); // dataserver - const LLUUID IMG_DEFAULT_AVATAR ("c228d1cf-4b5d-4ba8-84f4-899a0796aa97"); // dataserver -//const LLUUID IMG_ENERGY_BEAM ("09e7bc54-11b9-442a-ae3d-f52e599e466a"); // dataserver -//const LLUUID IMG_ENERGY_BEAM2 ("de651394-f926-48db-b666-e49d83af1bbc"); // dataserver - -//const LLUUID IMG_BRICK_PATH ("a9d0019b-3783-4c7f-959c-322d301918bc"); // dataserver const LLUUID IMG_EXPLOSION ("68edcf47-ccd7-45b8-9f90-1649d7f12806"); // On dataserver const LLUUID IMG_EXPLOSION_2 ("21ce046c-83fe-430a-b629-c7660ac78d7c"); // On dataserver const LLUUID IMG_EXPLOSION_3 ("fedea30a-1be8-47a6-bc06-337a04a39c4b"); // On dataserver const LLUUID IMG_EXPLOSION_4 ("abf0d56b-82e5-47a2-a8ad-74741bb2c29e"); // On dataserver -//const LLUUID IMG_EXPLOSION_5 ("60f2dec7-675b-4950-b614-85b907d552ea"); // On dataserver -//const LLUUID IMG_SPLASH_SPRITE ("8a101f63-fe45-49e7-9f8a-e64817daa475"); // On dataserver const LLUUID IMG_SMOKE_POOF ("1e63e323-5fe0-452e-92f8-b98bd0f764e3"); // On dataserver const LLUUID IMG_BIG_EXPLOSION_1 ("5e47a0dc-97bf-44e0-8b40-de06718cee9d"); // On dataserver const LLUUID IMG_BIG_EXPLOSION_2 ("9c8eca51-53d5-42a7-bb58-cef070395db8"); // On dataserver -//const LLUUID IMG_BLUE_BLOOD ("8bc2e3f8-097e-4c87-b417-b0d699d07189"); // On dataserver -const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); -//const LLUUID IMG_BLOOM2 ("9fb76e81-eca0-4b6a-96e1-a6c5a685150b"); -//const LLUUID IMG_BLOOM3 ("fb1fecba-9585-415b-ad15-6e6e3d6c5479"); +const LLUUID IMG_BLOOM1 ("3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef"); // VIEWER +const LLUUID TERRAIN_DIRT_DETAIL ("0bc58228-74a0-7e83-89bc-5c23464bcec5"); // VIEWER +const LLUUID TERRAIN_GRASS_DETAIL ("63338ede-0037-c4fd-855b-015d77112fc8"); // VIEWER +const LLUUID TERRAIN_MOUNTAIN_DETAIL ("303cd381-8560-7579-23f1-f0a880799740"); // VIEWER +const LLUUID TERRAIN_ROCK_DETAIL ("53a2f406-4895-1d13-d541-d2e3b86bc19c"); // VIEWER -const LLUUID IMG_PTT_SPEAKER ("89e9fc7c-0b16-457d-be4f-136270759c4d"); // On cache +const LLUUID DEFAULT_WATER_NORMAL ("822ded49-9a6c-f61c-cb89-6df54f42cdf4"); // VIEWER #endif diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index b0a47b6820..cc57e658fb 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -419,6 +419,31 @@ protected: // Foo* instance = FooSingleton::getInstance(); // // As currently written, it is not thread-safe. +#if LL_WINDOWS && _MSC_VER < 1400 // this is Visual C++ 2003 or earlier +// workaround for VC7 compiler bug +// adapted from http://www.codeproject.com/KB/tips/VC2003MeyersSingletonBug.aspx +// our version doesn't introduce a nested struct so that you can still declare LLSingleton<MyClass> +// a friend and hide your constructor + +template <typename T> +class LLSingleton +{ +public: + static T* getInstance() + { + LLSingleton<T> singleton; + return singleton.get(); + } +private: + T* get() + { + static T instance; + return &instance; + } + +}; +#else + template <typename T> class LLSingleton { @@ -430,6 +455,8 @@ public: } }; +#endif + //---------------------------------------------------------------------------- // Return the resident set size of the current process, in bytes. diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index db19bd6ec6..a61b9cb0c0 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -43,6 +43,7 @@ #if JPEG_SUPPORT #include "llimagejpeg.h" #endif +#include "llimagepng.h" #include "llimagedxt.h" //--------------------------------------------------------------------------- @@ -460,8 +461,8 @@ void LLImageRaw::composite( LLImageRaw* src ) { LLImageRaw* dst = this; // Just for clarity. - llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); - llassert( (3 == dst->getComponents()) || (4 == dst->getComponents()) ); + llassert(3 == src->getComponents()); + llassert(3 == dst->getComponents()); if( 3 == dst->getComponents() ) { @@ -489,11 +490,6 @@ void LLImageRaw::composite( LLImageRaw* src ) } } } - else - { - // 4 == dst->mComponents - llassert(0); // not implemented yet. - } } // Src and dst can be any size. Src has 4 components. Dst has 3 components. @@ -659,7 +655,7 @@ void LLImageRaw::copyUnscaled(LLImageRaw* src) { LLImageRaw* dst = this; // Just for clarity. - llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); + llassert( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); llassert( src->getComponents() == dst->getComponents() ); llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ); @@ -742,7 +738,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) LLMemType mt1((LLMemType::EMemType)mMemType); LLImageRaw* dst = this; // Just for clarity. - llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); + llassert( (1 == src->getComponents()) || (3 == src->getComponents()) || (4 == src->getComponents()) ); llassert( src->getComponents() == dst->getComponents() ); if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) @@ -773,7 +769,7 @@ void LLImageRaw::copyScaled( LLImageRaw* src ) void LLImageRaw::scale( S32 new_width, S32 new_height, BOOL scale_image_data ) { LLMemType mt1((LLMemType::EMemType)mMemType); - llassert( (3 == getComponents()) || (4 == getComponents()) ); + llassert((1 == getComponents()) || (3 == getComponents()) || (4 == getComponents()) ); S32 old_width = getWidth(); S32 old_height = getHeight(); @@ -1063,7 +1059,7 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3 static struct { const char* exten; - S8 codec; + EImageCodec codec; } file_extensions[] = { @@ -1098,7 +1094,7 @@ static LLString find_file(LLString &name, S8 *codec) return LLString(""); } -static S8 get_codec(const LLString& exten) +EImageCodec LLImageBase::getCodecFromExtension(const LLString& exten) { for (int i=0; i<(int)(NUM_FILE_EXTENSIONS); i++) { @@ -1121,7 +1117,7 @@ bool LLImageRaw::createFromFile(const LLString &filename, bool j2c_lowest_mip_on { exten = name.substr(dotidx+1); LLString::toLower(exten); - codec = get_codec(exten); + codec = getCodecFromExtension(exten); } else { @@ -1264,6 +1260,9 @@ LLImageFormatted* LLImageFormatted::createFromType(S8 codec) case IMG_CODEC_DXT: image = new LLImageDXT(); break; + case IMG_CODEC_PNG: + image = new LLImagePNG(); + break; default: image = NULL; break; @@ -1284,7 +1283,7 @@ LLImageFormatted* LLImageFormatted::createFromExtension(const LLString& instring { exten = instring; } - S8 codec = get_codec(exten); + S8 codec = getCodecFromExtension(exten); return createFromType(codec); } //---------------------------------------------------------------------------- diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 65a7c54a50..ca19198332 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -60,7 +60,7 @@ class LLImageFormatted; class LLImageRaw; class LLColor4U; -enum +typedef enum e_image_codec { IMG_CODEC_INVALID = 0, IMG_CODEC_RGB = 1, @@ -71,7 +71,7 @@ enum IMG_CODEC_DXT = 6, IMG_CODEC_PNG = 7, IMG_CODEC_EOF = 8 -}; +} EImageCodec; //============================================================================ @@ -124,6 +124,8 @@ public: static void setSizeOverride(BOOL enabled) { sSizeOverride = enabled; } + static EImageCodec getCodecFromExtension(const LLString& exten); + private: U8 *mData; S32 mDataSize; diff --git a/indra/llinventory/lleconomy.cpp b/indra/llinventory/lleconomy.cpp index 24e9bf1cb7..3500caa3b2 100644 --- a/indra/llinventory/lleconomy.cpp +++ b/indra/llinventory/lleconomy.cpp @@ -35,7 +35,6 @@ #include "message.h" #include "v3math.h" -LLGlobalEconomy *gGlobalEconomy = NULL; LLGlobalEconomy::LLGlobalEconomy() : mObjectCount( -1 ), @@ -55,35 +54,33 @@ LLGlobalEconomy::~LLGlobalEconomy() { } // static -void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, void** user_data) +void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data) { S32 i; F32 f; - LLGlobalEconomy *this_ptr = (LLGlobalEconomy*)user_data; - msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCapacity, i); - this_ptr->setObjectCapacity(i); + econ_data->setObjectCapacity(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCount, i); - this_ptr->setObjectCount(i); + econ_data->setObjectCount(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceEnergyUnit, i); - this_ptr->setPriceEnergyUnit(i); + econ_data->setPriceEnergyUnit(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceObjectClaim, i); - this_ptr->setPriceObjectClaim(i); + econ_data->setPriceObjectClaim(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDecay, i); - this_ptr->setPricePublicObjectDecay(i); + econ_data->setPricePublicObjectDecay(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDelete, i); - this_ptr->setPricePublicObjectDelete(i); + econ_data->setPricePublicObjectDelete(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i); - this_ptr->setPriceUpload(i); + econ_data->setPriceUpload(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i); - this_ptr->setPriceRentLight(i); + econ_data->setPriceRentLight(i); msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i); - this_ptr->setTeleportMinPrice(i); + econ_data->setTeleportMinPrice(i); msg->getF32Fast(_PREHASH_Info, _PREHASH_TeleportPriceExponent, f); - this_ptr->setTeleportPriceExponent(f); + econ_data->setTeleportPriceExponent(f); msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i); - this_ptr->setPriceGroupCreate(i); + econ_data->setPriceGroupCreate(i); } S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const @@ -154,10 +151,10 @@ void LLRegionEconomy::processEconomyData(LLMessageSystem *msg, void** user_data) S32 i; F32 f; - LLGlobalEconomy::processEconomyData(msg, user_data); - LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data; + LLGlobalEconomy::processEconomyData(msg, this_ptr); + msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelClaim, i); this_ptr->setBasePriceParcelClaimDefault(i); msg->getF32(_PREHASH_Info, _PREHASH_PriceParcelClaimFactor, f); diff --git a/indra/llinventory/lleconomy.h b/indra/llinventory/lleconomy.h index d1e1adcb93..4ac7cb4605 100644 --- a/indra/llinventory/lleconomy.h +++ b/indra/llinventory/lleconomy.h @@ -31,6 +31,8 @@ #ifndef LL_LLECONOMY_H #define LL_LLECONOMY_H +#include "llmemory.h" + class LLMessageSystem; class LLVector3; @@ -40,9 +42,14 @@ public: LLGlobalEconomy(); virtual ~LLGlobalEconomy(); + // This class defines its singleton internally as a typedef instead of inheriting from + // LLSingleton like most others because the LLRegionEconomy sub-class might also + // become a singleton and this pattern will more easily disambiguate them. + typedef LLSingleton<LLGlobalEconomy> Singleton; + virtual void print(); - static void processEconomyData(LLMessageSystem *msg, void **user_data); + static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data); S32 calculateTeleportCost(F32 distance) const; S32 calculateLightRent(const LLVector3& object_size) const; @@ -136,6 +143,4 @@ private: }; -extern LLGlobalEconomy* gGlobalEconomy; - #endif diff --git a/indra/llmath/llrect.h b/indra/llmath/llrect.h index 1fa5a741d5..17fa981c7c 100644 --- a/indra/llmath/llrect.h +++ b/indra/llmath/llrect.h @@ -227,6 +227,11 @@ public: return mLeft == mRight || mBottom == mTop; } + bool notNull() const + { + return !isNull(); + } + LLRectBase& unionWith(const LLRectBase &other) { mLeft = llmin(mLeft, other.mLeft); diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 58214749ca..85fb0a7782 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -156,7 +156,7 @@ public: LLMessageVariable(const char *name, const EMsgVariableType type, const S32 size) : mType(type), mSize(size) { - mName = gMessageStringTable.getString(name); + mName = LLMessageStringTable::getInstance()->getString(name); } ~LLMessageVariable() {} @@ -187,7 +187,7 @@ class LLMessageBlock public: LLMessageBlock(const char *name, EMsgBlockType type, S32 number = 1) : mType(type), mNumber(number), mTotalSize(0) { - mName = gMessageStringTable.getString(name); + mName = LLMessageStringTable::getInstance()->getString(name); } ~LLMessageBlock() @@ -293,7 +293,7 @@ public: mHandlerFunc(NULL), mUserData(NULL) { - mName = gMessageStringTable.getString(name); + mName = LLMessageStringTable::getInstance()->getString(name); } ~LLMessageTemplate() diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index aca7a60bf1..8d961de6c9 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -201,7 +201,7 @@ void LLMessageHandlerBridge::post(LLHTTPNode::ResponsePtr response, const LLSD& context, const LLSD& input) const { std::string name = context["request"]["wildcard"]["message-name"]; - char* namePtr = gMessageStringTable.getString(name.c_str()); + char* namePtr = LLMessageStringTable::getInstance()->getString(name.c_str()); lldebugs << "Setting mLastSender " << input["sender"].asString() << llendl; gMessageSystem->mLastSender = LLHost(input["sender"].asString()); @@ -469,7 +469,7 @@ static LLMessageSystem::message_template_name_map_t::const_iterator findTemplate(const LLMessageSystem::message_template_name_map_t& templates, std::string name) { - const char* namePrehash = gMessageStringTable.getString(name.c_str()); + const char* namePrehash = LLMessageStringTable::getInstance()->getString(name.c_str()); if(NULL == namePrehash) {return templates.end();} return templates.find(namePrehash); } @@ -770,7 +770,7 @@ BOOL LLMessageSystem::checkMessages( S64 frame_count ) /* Code for dumping the complete contents of a message. Keep for future use in optimizing messages. if( 1 ) { - static char* object_update = gMessageStringTable.getString("ObjectUpdate"); + static char* object_update = LLMessageStringTable::getInstance()->getString("ObjectUpdate"); if(object_update == mTemplateMessageReader->getMessageName() ) { llinfos << "ObjectUpdate:" << llendl; @@ -1018,7 +1018,7 @@ BOOL LLMessageSystem::isSendFull(const char* blockname) char* stringTableName = NULL; if(NULL != blockname) { - stringTableName = gMessageStringTable.getString(blockname); + stringTableName = LLMessageStringTable::getInstance()->getString(blockname); } return isSendFullFast(stringTableName); } @@ -2139,7 +2139,7 @@ void LLMessageSystem::dispatch( LLHTTPNode::ResponsePtr responsep) { if ((gMessageSystem->mMessageTemplates.find - (gMessageStringTable.getString(msg_name.c_str())) == + (LLMessageStringTable::getInstance()->getString(msg_name.c_str())) == gMessageSystem->mMessageTemplates.end()) && !LLMessageConfig::isValidMessage(msg_name)) { @@ -2173,7 +2173,7 @@ static void check_for_unrecognized_messages( end = map.endMap(); iter != end; ++iter) { - const char* name = gMessageStringTable.getString(iter->first.c_str()); + const char* name = LLMessageStringTable::getInstance()->getString(iter->first.c_str()); if (templates.find(name) == templates.end()) { @@ -2441,13 +2441,11 @@ void dump_prehash_files() fprintf(fp, "\n\nextern F32 gPrehashVersionNumber;\n\n"); for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { - if (!gMessageStringTable.mEmpty[i] && gMessageStringTable.mString[i][0] != '.') + if (!LLMessageStringTable::getInstance()->mEmpty[i] && LLMessageStringTable::getInstance()->mString[i][0] != '.') { - fprintf(fp, "extern char * _PREHASH_%s;\n", gMessageStringTable.mString[i]); + fprintf(fp, "extern char * _PREHASH_%s;\n", LLMessageStringTable::getInstance()->mString[i]); } } - fprintf(fp, "\n\nvoid init_prehash_data();\n\n"); - fprintf(fp, "\n\n"); fprintf(fp, "\n\n#endif\n"); fclose(fp); } @@ -2472,21 +2470,11 @@ void dump_prehash_files() fprintf(fp, "\n\nF32 gPrehashVersionNumber = %.3ff;\n\n", gMessageSystem->mMessageFileVersionNumber); for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) { - if (!gMessageStringTable.mEmpty[i] && gMessageStringTable.mString[i][0] != '.') + if (!LLMessageStringTable::getInstance()->mEmpty[i] && LLMessageStringTable::getInstance()->mString[i][0] != '.') { - fprintf(fp, "char * _PREHASH_%s;\n", gMessageStringTable.mString[i]); + fprintf(fp, "char * _PREHASH_%s = LLMessageStringTable::getInstance()->getString(\"%s\");\n", LLMessageStringTable::getInstance()->mString[i], LLMessageStringTable::getInstance()->mString[i]); } } - fprintf(fp, "\nvoid init_prehash_data()\n"); - fprintf(fp, "{\n"); - for (i = 0; i < MESSAGE_NUMBER_OF_HASH_BUCKETS; i++) - { - if (!gMessageStringTable.mEmpty[i] && gMessageStringTable.mString[i][0] != '.') - { - fprintf(fp, "\t_PREHASH_%s = gMessageStringTable.getString(\"%s\");\n", gMessageStringTable.mString[i], gMessageStringTable.mString[i]); - } - } - fprintf(fp, "}\n"); fclose(fp); } } @@ -2528,7 +2516,6 @@ BOOL start_messaging_system( } else { - init_prehash_data(); if (gMessageSystem->mMessageFileVersionNumber != gPrehashVersionNumber) { llinfos << "Message template version does not match prehash version number" << llendl; @@ -2991,7 +2978,7 @@ void LLMessageSystem::setHandlerFuncFast(const char *name, void (*handler_func)( bool LLMessageSystem::callHandler(const char *name, bool trustedSource, LLMessageSystem* msg) { - name = gMessageStringTable.getString(name); + name = LLMessageStringTable::getInstance()->getString(name); message_template_name_map_t::const_iterator iter; iter = mMessageTemplates.find(name); if(iter == mMessageTemplates.end()) @@ -3474,7 +3461,7 @@ void LLMessageSystem::newMessageFast(const char *name) void LLMessageSystem::newMessage(const char *name) { - newMessageFast(gMessageStringTable.getString(name)); + newMessageFast(LLMessageStringTable::getInstance()->getString(name)); } void LLMessageSystem::addBinaryDataFast(const char *varname, const void *data, S32 size) @@ -3484,7 +3471,7 @@ void LLMessageSystem::addBinaryDataFast(const char *varname, const void *data, S void LLMessageSystem::addBinaryData(const char *varname, const void *data, S32 size) { - mMessageBuilder->addBinaryData(gMessageStringTable.getString(varname),data, size); + mMessageBuilder->addBinaryData(LLMessageStringTable::getInstance()->getString(varname),data, size); } void LLMessageSystem::addS8Fast(const char *varname, S8 v) @@ -3494,7 +3481,7 @@ void LLMessageSystem::addS8Fast(const char *varname, S8 v) void LLMessageSystem::addS8(const char *varname, S8 v) { - mMessageBuilder->addS8(gMessageStringTable.getString(varname), v); + mMessageBuilder->addS8(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addU8Fast(const char *varname, U8 v) @@ -3504,7 +3491,7 @@ void LLMessageSystem::addU8Fast(const char *varname, U8 v) void LLMessageSystem::addU8(const char *varname, U8 v) { - mMessageBuilder->addU8(gMessageStringTable.getString(varname), v); + mMessageBuilder->addU8(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addS16Fast(const char *varname, S16 v) @@ -3514,7 +3501,7 @@ void LLMessageSystem::addS16Fast(const char *varname, S16 v) void LLMessageSystem::addS16(const char *varname, S16 v) { - mMessageBuilder->addS16(gMessageStringTable.getString(varname), v); + mMessageBuilder->addS16(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addU16Fast(const char *varname, U16 v) @@ -3524,7 +3511,7 @@ void LLMessageSystem::addU16Fast(const char *varname, U16 v) void LLMessageSystem::addU16(const char *varname, U16 v) { - mMessageBuilder->addU16(gMessageStringTable.getString(varname), v); + mMessageBuilder->addU16(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addF32Fast(const char *varname, F32 v) @@ -3534,7 +3521,7 @@ void LLMessageSystem::addF32Fast(const char *varname, F32 v) void LLMessageSystem::addF32(const char *varname, F32 v) { - mMessageBuilder->addF32(gMessageStringTable.getString(varname), v); + mMessageBuilder->addF32(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addS32Fast(const char *varname, S32 v) @@ -3544,7 +3531,7 @@ void LLMessageSystem::addS32Fast(const char *varname, S32 v) void LLMessageSystem::addS32(const char *varname, S32 v) { - mMessageBuilder->addS32(gMessageStringTable.getString(varname), v); + mMessageBuilder->addS32(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addU32Fast(const char *varname, U32 v) @@ -3554,7 +3541,7 @@ void LLMessageSystem::addU32Fast(const char *varname, U32 v) void LLMessageSystem::addU32(const char *varname, U32 v) { - mMessageBuilder->addU32(gMessageStringTable.getString(varname), v); + mMessageBuilder->addU32(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addU64Fast(const char *varname, U64 v) @@ -3564,7 +3551,7 @@ void LLMessageSystem::addU64Fast(const char *varname, U64 v) void LLMessageSystem::addU64(const char *varname, U64 v) { - mMessageBuilder->addU64(gMessageStringTable.getString(varname), v); + mMessageBuilder->addU64(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addF64Fast(const char *varname, F64 v) @@ -3574,7 +3561,7 @@ void LLMessageSystem::addF64Fast(const char *varname, F64 v) void LLMessageSystem::addF64(const char *varname, F64 v) { - mMessageBuilder->addF64(gMessageStringTable.getString(varname), v); + mMessageBuilder->addF64(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addIPAddrFast(const char *varname, U32 v) @@ -3584,7 +3571,7 @@ void LLMessageSystem::addIPAddrFast(const char *varname, U32 v) void LLMessageSystem::addIPAddr(const char *varname, U32 v) { - mMessageBuilder->addIPAddr(gMessageStringTable.getString(varname), v); + mMessageBuilder->addIPAddr(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addIPPortFast(const char *varname, U16 v) @@ -3594,7 +3581,7 @@ void LLMessageSystem::addIPPortFast(const char *varname, U16 v) void LLMessageSystem::addIPPort(const char *varname, U16 v) { - mMessageBuilder->addIPPort(gMessageStringTable.getString(varname), v); + mMessageBuilder->addIPPort(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addBOOLFast(const char* varname, BOOL v) @@ -3604,7 +3591,7 @@ void LLMessageSystem::addBOOLFast(const char* varname, BOOL v) void LLMessageSystem::addBOOL(const char* varname, BOOL v) { - mMessageBuilder->addBOOL(gMessageStringTable.getString(varname), v); + mMessageBuilder->addBOOL(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addStringFast(const char* varname, const char* v) @@ -3614,7 +3601,7 @@ void LLMessageSystem::addStringFast(const char* varname, const char* v) void LLMessageSystem::addString(const char* varname, const char* v) { - mMessageBuilder->addString(gMessageStringTable.getString(varname), v); + mMessageBuilder->addString(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addStringFast(const char* varname, const std::string& v) @@ -3624,7 +3611,7 @@ void LLMessageSystem::addStringFast(const char* varname, const std::string& v) void LLMessageSystem::addString(const char* varname, const std::string& v) { - mMessageBuilder->addString(gMessageStringTable.getString(varname), v); + mMessageBuilder->addString(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addVector3Fast(const char *varname, const LLVector3& v) @@ -3634,7 +3621,7 @@ void LLMessageSystem::addVector3Fast(const char *varname, const LLVector3& v) void LLMessageSystem::addVector3(const char *varname, const LLVector3& v) { - mMessageBuilder->addVector3(gMessageStringTable.getString(varname), v); + mMessageBuilder->addVector3(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addVector4Fast(const char *varname, const LLVector4& v) @@ -3644,7 +3631,7 @@ void LLMessageSystem::addVector4Fast(const char *varname, const LLVector4& v) void LLMessageSystem::addVector4(const char *varname, const LLVector4& v) { - mMessageBuilder->addVector4(gMessageStringTable.getString(varname), v); + mMessageBuilder->addVector4(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addVector3dFast(const char *varname, const LLVector3d& v) @@ -3654,7 +3641,7 @@ void LLMessageSystem::addVector3dFast(const char *varname, const LLVector3d& v) void LLMessageSystem::addVector3d(const char *varname, const LLVector3d& v) { - mMessageBuilder->addVector3d(gMessageStringTable.getString(varname), v); + mMessageBuilder->addVector3d(LLMessageStringTable::getInstance()->getString(varname), v); } void LLMessageSystem::addQuatFast(const char *varname, const LLQuaternion& v) @@ -3664,7 +3651,7 @@ void LLMessageSystem::addQuatFast(const char *varname, const LLQuaternion& v) void LLMessageSystem::addQuat(const char *varname, const LLQuaternion& v) { - mMessageBuilder->addQuat(gMessageStringTable.getString(varname), v); + mMessageBuilder->addQuat(LLMessageStringTable::getInstance()->getString(varname), v); } @@ -3675,7 +3662,7 @@ void LLMessageSystem::addUUIDFast(const char *varname, const LLUUID& v) void LLMessageSystem::addUUID(const char *varname, const LLUUID& v) { - mMessageBuilder->addUUID(gMessageStringTable.getString(varname), v); + mMessageBuilder->addUUID(LLMessageStringTable::getInstance()->getString(varname), v); } S32 LLMessageSystem::getCurrentSendTotal() const @@ -3692,8 +3679,8 @@ void LLMessageSystem::getS8Fast(const char *block, const char *var, S8 &u, void LLMessageSystem::getS8(const char *block, const char *var, S8 &u, S32 blocknum) { - getS8Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), u, blocknum); + getS8Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), u, blocknum); } void LLMessageSystem::getU8Fast(const char *block, const char *var, U8 &u, @@ -3705,8 +3692,8 @@ void LLMessageSystem::getU8Fast(const char *block, const char *var, U8 &u, void LLMessageSystem::getU8(const char *block, const char *var, U8 &u, S32 blocknum) { - getU8Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), u, blocknum); + getU8Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), u, blocknum); } void LLMessageSystem::getBOOLFast(const char *block, const char *var, BOOL &b, @@ -3718,8 +3705,8 @@ void LLMessageSystem::getBOOLFast(const char *block, const char *var, BOOL &b, void LLMessageSystem::getBOOL(const char *block, const char *var, BOOL &b, S32 blocknum) { - getBOOLFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), b, blocknum); + getBOOLFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), b, blocknum); } void LLMessageSystem::getS16Fast(const char *block, const char *var, S16 &d, @@ -3731,8 +3718,8 @@ void LLMessageSystem::getS16Fast(const char *block, const char *var, S16 &d, void LLMessageSystem::getS16(const char *block, const char *var, S16 &d, S32 blocknum) { - getS16Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getS16Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getU16Fast(const char *block, const char *var, U16 &d, @@ -3744,8 +3731,8 @@ void LLMessageSystem::getU16Fast(const char *block, const char *var, U16 &d, void LLMessageSystem::getU16(const char *block, const char *var, U16 &d, S32 blocknum) { - getU16Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getU16Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getS32Fast(const char *block, const char *var, S32 &d, @@ -3757,8 +3744,8 @@ void LLMessageSystem::getS32Fast(const char *block, const char *var, S32 &d, void LLMessageSystem::getS32(const char *block, const char *var, S32 &d, S32 blocknum) { - getS32Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getS32Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getU32Fast(const char *block, const char *var, U32 &d, @@ -3770,8 +3757,8 @@ void LLMessageSystem::getU32Fast(const char *block, const char *var, U32 &d, void LLMessageSystem::getU32(const char *block, const char *var, U32 &d, S32 blocknum) { - getU32Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getU32Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getU64Fast(const char *block, const char *var, U64 &d, @@ -3784,8 +3771,8 @@ void LLMessageSystem::getU64(const char *block, const char *var, U64 &d, S32 blocknum) { - getU64Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getU64Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getBinaryDataFast(const char *blockname, @@ -3802,8 +3789,8 @@ void LLMessageSystem::getBinaryData(const char *blockname, void *datap, S32 size, S32 blocknum, S32 max_size) { - getBinaryDataFast(gMessageStringTable.getString(blockname), - gMessageStringTable.getString(varname), + getBinaryDataFast(LLMessageStringTable::getInstance()->getString(blockname), + LLMessageStringTable::getInstance()->getString(varname), datap, size, blocknum, max_size); } @@ -3816,8 +3803,8 @@ void LLMessageSystem::getF32Fast(const char *block, const char *var, F32 &d, void LLMessageSystem::getF32(const char *block, const char *var, F32 &d, S32 blocknum) { - getF32Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getF32Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } void LLMessageSystem::getF64Fast(const char *block, const char *var, F64 &d, @@ -3829,8 +3816,8 @@ void LLMessageSystem::getF64Fast(const char *block, const char *var, F64 &d, void LLMessageSystem::getF64(const char *block, const char *var, F64 &d, S32 blocknum) { - getF64Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), d, blocknum); + getF64Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), d, blocknum); } @@ -3843,8 +3830,8 @@ void LLMessageSystem::getVector3Fast(const char *block, const char *var, void LLMessageSystem::getVector3(const char *block, const char *var, LLVector3 &v, S32 blocknum ) { - getVector3Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), v, blocknum); + getVector3Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), v, blocknum); } void LLMessageSystem::getVector4Fast(const char *block, const char *var, @@ -3856,8 +3843,8 @@ void LLMessageSystem::getVector4Fast(const char *block, const char *var, void LLMessageSystem::getVector4(const char *block, const char *var, LLVector4 &v, S32 blocknum ) { - getVector4Fast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), v, blocknum); + getVector4Fast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), v, blocknum); } void LLMessageSystem::getVector3dFast(const char *block, const char *var, @@ -3869,8 +3856,8 @@ void LLMessageSystem::getVector3dFast(const char *block, const char *var, void LLMessageSystem::getVector3d(const char *block, const char *var, LLVector3d &v, S32 blocknum ) { - getVector3dFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), v, blocknum); + getVector3dFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), v, blocknum); } void LLMessageSystem::getQuatFast(const char *block, const char *var, @@ -3882,8 +3869,8 @@ void LLMessageSystem::getQuatFast(const char *block, const char *var, void LLMessageSystem::getQuat(const char *block, const char *var, LLQuaternion &q, S32 blocknum) { - getQuatFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), q, blocknum); + getQuatFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), q, blocknum); } void LLMessageSystem::getUUIDFast(const char *block, const char *var, @@ -3895,8 +3882,8 @@ void LLMessageSystem::getUUIDFast(const char *block, const char *var, void LLMessageSystem::getUUID(const char *block, const char *var, LLUUID &u, S32 blocknum ) { - getUUIDFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), u, blocknum); + getUUIDFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), u, blocknum); } void LLMessageSystem::getIPAddrFast(const char *block, const char *var, @@ -3908,8 +3895,8 @@ void LLMessageSystem::getIPAddrFast(const char *block, const char *var, void LLMessageSystem::getIPAddr(const char *block, const char *var, U32 &u, S32 blocknum) { - getIPAddrFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), u, blocknum); + getIPAddrFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), u, blocknum); } void LLMessageSystem::getIPPortFast(const char *block, const char *var, @@ -3921,8 +3908,8 @@ void LLMessageSystem::getIPPortFast(const char *block, const char *var, void LLMessageSystem::getIPPort(const char *block, const char *var, U16 &u, S32 blocknum) { - getIPPortFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), u, + getIPPortFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), u, blocknum); } @@ -3940,8 +3927,8 @@ void LLMessageSystem::getStringFast(const char *block, const char *var, void LLMessageSystem::getString(const char *block, const char *var, S32 buffer_size, char *s, S32 blocknum ) { - getStringFast(gMessageStringTable.getString(block), - gMessageStringTable.getString(var), buffer_size, s, + getStringFast(LLMessageStringTable::getInstance()->getString(block), + LLMessageStringTable::getInstance()->getString(var), buffer_size, s, blocknum); } @@ -3952,7 +3939,7 @@ S32 LLMessageSystem::getNumberOfBlocksFast(const char *blockname) S32 LLMessageSystem::getNumberOfBlocks(const char *blockname) { - return getNumberOfBlocksFast(gMessageStringTable.getString(blockname)); + return getNumberOfBlocksFast(LLMessageStringTable::getInstance()->getString(blockname)); } S32 LLMessageSystem::getSizeFast(const char *blockname, const char *varname) @@ -3962,8 +3949,8 @@ S32 LLMessageSystem::getSizeFast(const char *blockname, const char *varname) S32 LLMessageSystem::getSize(const char *blockname, const char *varname) { - return getSizeFast(gMessageStringTable.getString(blockname), - gMessageStringTable.getString(varname)); + return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), + LLMessageStringTable::getInstance()->getString(varname)); } // size in bytes of variable length data @@ -3976,8 +3963,8 @@ S32 LLMessageSystem::getSizeFast(const char *blockname, S32 blocknum, S32 LLMessageSystem::getSize(const char *blockname, S32 blocknum, const char *varname) { - return getSizeFast(gMessageStringTable.getString(blockname), blocknum, - gMessageStringTable.getString(varname)); + return getSizeFast(LLMessageStringTable::getInstance()->getString(blockname), blocknum, + LLMessageStringTable::getInstance()->getString(varname)); } S32 LLMessageSystem::getReceiveSize() const diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h index 61d34b7fc1..7d3c0e93ec 100644 --- a/indra/llmessage/message.h +++ b/indra/llmessage/message.h @@ -68,7 +68,7 @@ const U32 MESSAGE_NUMBER_OF_HASH_BUCKETS = 8192; const S32 MESSAGE_MAX_PER_FRAME = 400; -class LLMessageStringTable +class LLMessageStringTable : public LLSingleton<LLMessageStringTable> { public: LLMessageStringTable(); @@ -81,7 +81,6 @@ public: char mString[MESSAGE_NUMBER_OF_HASH_BUCKETS][MESSAGE_MAX_STRINGS_LENGTH]; /* Flawfinder: ignore */ }; -extern LLMessageStringTable gMessageStringTable; // Individual Messages are described with the following format // Note that to ease parsing, keywords are used @@ -302,7 +301,7 @@ public: void setHandlerFuncFast(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = NULL); void setHandlerFunc(const char *name, void (*handler_func)(LLMessageSystem *msgsystem, void **user_data), void **user_data = NULL) { - setHandlerFuncFast(gMessageStringTable.getString(name), handler_func, user_data); + setHandlerFuncFast(LLMessageStringTable::getInstance()->getString(name), handler_func, user_data); } // Set a callback function for a message system exception. @@ -339,7 +338,7 @@ public: BOOL isMessageFast(const char *msg); BOOL isMessage(const char *msg) { - return isMessageFast(gMessageStringTable.getString(msg)); + return isMessageFast(LLMessageStringTable::getInstance()->getString(msg)); } void dumpPacketToLog(); @@ -372,7 +371,7 @@ public: void nextBlockFast(const char *blockname); void nextBlock(const char *blockname) { - nextBlockFast(gMessageStringTable.getString(blockname)); + nextBlockFast(LLMessageStringTable::getInstance()->getString(blockname)); } public: diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 5190c93731..0d537e0575 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -39,2673 +39,1336 @@ F32 gPrehashVersionNumber = 2.000f; -char * _PREHASH_X; -char * _PREHASH_Y; -char * _PREHASH_Z; -char * _PREHASH_AddFlags; -char * _PREHASH_FailureInfo; -char * _PREHASH_MapData; -char * _PREHASH_AddItem; -char * _PREHASH_MeanCollision; -char * _PREHASH_RezScript; -char * _PREHASH_AvatarSitResponse; -char * _PREHASH_InventoryAssetResponse; -char * _PREHASH_KillObject; -char * _PREHASH_ProposalID; -char * _PREHASH_SerialNum; -char * _PREHASH_Duration; -char * _PREHASH_ScriptQuestion; -char * _PREHASH_AddCircuitCode; -char * _PREHASH_UseCircuitCode; -char * _PREHASH_ViewerCircuitCode; -char * _PREHASH_ScriptAnswerYes; -char * _PREHASH_PartnerID; -char * _PREHASH_DirLandQuery; -char * _PREHASH_TeleportStart; -char * _PREHASH_AboutText; -char * _PREHASH_VisualParam; -char * _PREHASH_GroupPrims; -char * _PREHASH_SelectedPrims; -char * _PREHASH_ID; -char * _PREHASH_UUIDNameRequest; -char * _PREHASH_UUIDGroupNameRequest; -char * _PREHASH_GroupAccountTransactionsRequest; -char * _PREHASH_MapNameRequest; -char * _PREHASH_UpdateSimulator; -char * _PREHASH_BillableFactor; -char * _PREHASH_ObjectBonusFactor; -char * _PREHASH_EnableSimulator; -char * _PREHASH_DisableSimulator; -char * _PREHASH_ConfirmEnableSimulator; -char * _PREHASH_LayerType; -char * _PREHASH_OwnerRole; -char * _PREHASH_ParcelOverlay; -char * _PREHASH_GroupOwned; -char * _PREHASH_IP; -char * _PREHASH_ChatFromViewer; -char * _PREHASH_AvgAgentsInView; -char * _PREHASH_AgentsInView; -char * _PREHASH_GroupTitle; -char * _PREHASH_MapLayerReply; -char * _PREHASH_CompoundMsgID; -char * _PREHASH_CameraConstraint; -char * _PREHASH_DownloadTotals; -char * _PREHASH_GenCounter; -char * _PREHASH_FrozenData; -char * _PREHASH_ChildAgentDying; -char * _PREHASH_To; -char * _PREHASH_CopyInventoryFromNotecard; -char * _PREHASH_RezObjectFromNotecard; -char * _PREHASH_ParcelDirFeeCurrent; -char * _PREHASH_SeedCapability; -char * _PREHASH_ObjectDuplicate; -char * _PREHASH_InventoryData; -char * _PREHASH_ReplyData; -char * _PREHASH_ResetList; -char * _PREHASH_MediaID; -char * _PREHASH_RelatedRights; -char * _PREHASH_RedirectGridX; -char * _PREHASH_RedirectGridY; -char * _PREHASH_TransferID; -char * _PREHASH_TexturesChanged; -char * _PREHASH_UserLookAt; -char * _PREHASH_TestBlock1; -char * _PREHASH_SensedData; -char * _PREHASH_UpdateBlock; -char * _PREHASH_ClassifiedGodDelete; -char * _PREHASH_ObjectGrabUpdate; -char * _PREHASH_LocationPos; -char * _PREHASH_TaxDate; -char * _PREHASH_StartDateTime; -char * _PREHASH_ObjectUpdateCached; -char * _PREHASH_Packets; -char * _PREHASH_FailureType; -char * _PREHASH_UpdateGroupInfo; -char * _PREHASH_ObjectPermissions; -char * _PREHASH_RevokePermissions; -char * _PREHASH_UpdateFlags; -char * _PREHASH_ObjectExportSelected; -char * _PREHASH_RezSelected; -char * _PREHASH_AutoPilot; -char * _PREHASH_UpdateMuteListEntry; -char * _PREHASH_RemoveMuteListEntry; -char * _PREHASH_SetSimStatusInDatabase; -char * _PREHASH_SetSimPresenceInDatabase; -char * _PREHASH_CameraProperty; -char * _PREHASH_BrushSize; -char * _PREHASH_SimulatorSetMap; -char * _PREHASH_RegionPresenceRequestByRegionID; -char * _PREHASH_ParcelObjectOwnersReply; -char * _PREHASH_GroupMembersReply; -char * _PREHASH_GroupRoleMembersReply; -char * _PREHASH_RequestRegionInfo; -char * _PREHASH_AABBMax; -char * _PREHASH_RequestPayPrice; -char * _PREHASH_SimulatorPresentAtLocation; -char * _PREHASH_AgentRequestSit; -char * _PREHASH_AABBMin; -char * _PREHASH_ClassifiedFlags; -char * _PREHASH_ControlFlags; -char * _PREHASH_TeleportRequest; -char * _PREHASH_ScriptTeleportRequest; -char * _PREHASH_EstateCovenantRequest; -char * _PREHASH_DateUTC; -char * _PREHASH_TaskIDs; -char * _PREHASH_RequestResult; -char * _PREHASH_CanAcceptAgents; -char * _PREHASH_ObjectSaleInfo; -char * _PREHASH_KillChildAgents; -char * _PREHASH_Balance; -char * _PREHASH_DerezContainer; -char * _PREHASH_ObjectData; -char * _PREHASH_CameraAtAxis; -char * _PREHASH_InfoBlock; -char * _PREHASH_OwnershipCost; -char * _PREHASH_AvatarNotesUpdate; -char * _PREHASH_PID; -char * _PREHASH_DirPopularReply; -char * _PREHASH_TerrainHeightRange00; -char * _PREHASH_SimData; -char * _PREHASH_TerrainHeightRange01; -char * _PREHASH_TerrainHeightRange10; -char * _PREHASH_TerrainHeightRange11; -char * _PREHASH_UpdateInventoryItem; -char * _PREHASH_UpdateCreateInventoryItem; -char * _PREHASH_MoveInventoryItem; -char * _PREHASH_CopyInventoryItem; -char * _PREHASH_RemoveInventoryItem; -char * _PREHASH_CreateInventoryItem; -char * _PREHASH_PathTwistBegin; -char * _PREHASH_CRC; -char * _PREHASH_AttachmentPoint; -char * _PREHASH_TelehubBlock; -char * _PREHASH_FOVBlock; -char * _PREHASH_StartLocationData; -char * _PREHASH_PositionData; -char * _PREHASH_TimeSinceLast; -char * _PREHASH_MapImage; -char * _PREHASH_Objects; -char * _PREHASH_URL; -char * _PREHASH_CreationDate; -char * _PREHASH_JointPivot; -char * _PREHASH_FPS; -char * _PREHASH_HasTelehub; -char * _PREHASH_PathEnd; -char * _PREHASH_ScriptDataReply; -char * _PREHASH_MapBlockReply; -char * _PREHASH_PropertiesData; -char * _PREHASH_ViewerEffect; -char * _PREHASH_FreezeUser; -char * _PREHASH_OwnerPrims; -char * _PREHASH_ObjectGrab; -char * _PREHASH_ToAgentID; -char * _PREHASH_SimulatorMapUpdate; -char * _PREHASH_TransferPacket; -char * _PREHASH_ObjectName; -char * _PREHASH_GroupPowers; -char * _PREHASH_OriginalName; -char * _PREHASH_CompletePingCheck; -char * _PREHASH_OnlineStatus; -char * _PREHASH_ObjectDrop; -char * _PREHASH_UseBigPackets; -char * _PREHASH_GroupNoticesListReply; -char * _PREHASH_ParcelAccessListReply; -char * _PREHASH_RpcChannelReply; -char * _PREHASH_RegionPresenceResponse; -char * _PREHASH_CharterMember; -char * _PREHASH_EdgeData; -char * _PREHASH_NameData; -char * _PREHASH_RegionPushOverride; -char * _PREHASH_SimName; -char * _PREHASH_UserReport; -char * _PREHASH_DownloadPriority; -char * _PREHASH_ToAgentId; -char * _PREHASH_DirPopularQuery; -char * _PREHASH_Mag; -char * _PREHASH_ParcelPropertiesRequestByID; -char * _PREHASH_ObjectLink; -char * _PREHASH_RpcScriptReplyInbound; -char * _PREHASH_RezData; -char * _PREHASH_RemoveInventoryObjects; -char * _PREHASH_GroupProposalBallot; -char * _PREHASH_RPCServerIP; -char * _PREHASH_Far; -char * _PREHASH_GodSessionID; -char * _PREHASH_FLAboutText; -char * _PREHASH_RegionHandshakeReply; -char * _PREHASH_GroupActiveProposalItemReply; -char * _PREHASH_MapItemReply; -char * _PREHASH_Seconds; -char * _PREHASH_UpdateUserInfo; -char * _PREHASH_AggregatePermTexturesOwner; -char * _PREHASH_Set; -char * _PREHASH_NewName; -char * _PREHASH_Key; -char * _PREHASH_AgentID; -char * _PREHASH_EventNotificationRemoveRequest; -char * _PREHASH_NewFolderID; -char * _PREHASH_Arc; -char * _PREHASH_RegionX; -char * _PREHASH_RegionY; -char * _PREHASH_RequestData; -char * _PREHASH_Msg; -char * _PREHASH_Top; -char * _PREHASH_MiscStats; -char * _PREHASH_ImageID; -char * _PREHASH_DataPacket; -char * _PREHASH_You; -char * _PREHASH_ScriptControlChange; -char * _PREHASH_LoadURL; -char * _PREHASH_SetCPURatio; -char * _PREHASH_NameValueData; -char * _PREHASH_AtomicPassObject; -char * _PREHASH_ErrorMessage; -char * _PREHASH_ViewerFrozenMessage; -char * _PREHASH_HealthMessage; -char * _PREHASH_LogTextMessage; -char * _PREHASH_TimeDilation; -char * _PREHASH_RemoveContribution; -char * _PREHASH_Contribution; -char * _PREHASH_SetGroupContribution; -char * _PREHASH_Offline; -char * _PREHASH_AgentIsNowWearing; -char * _PREHASH_Members; -char * _PREHASH_FailedResends; -char * _PREHASH_SecPerDay; -char * _PREHASH_CameraCenter; -char * _PREHASH_CameraLeftAxis; -char * _PREHASH_ExBlock; -char * _PREHASH_Channel; -char * _PREHASH_NetTest; -char * _PREHASH_DiscardLevel; -char * _PREHASH_LayerID; -char * _PREHASH_GrabOffset; -char * _PREHASH_SimPort; -char * _PREHASH_PricePerMeter; -char * _PREHASH_RegionFlags; -char * _PREHASH_VoteResult; -char * _PREHASH_ParcelDirFeeEstimate; -char * _PREHASH_ModifyBlock; -char * _PREHASH_InventoryBlock; -char * _PREHASH_ReplyBlock; -char * _PREHASH_ValidUntil; -char * _PREHASH_VelocityInterpolateOn; -char * _PREHASH_ClassifiedDelete; -char * _PREHASH_RegionDenyAnonymous; -char * _PREHASH_FLImageID; -char * _PREHASH_AllowPublish; -char * _PREHASH_SitName; -char * _PREHASH_RegionsVisited; -char * _PREHASH_DirClassifiedReply; -char * _PREHASH_AvatarClassifiedReply; -char * _PREHASH_MediaURL; -char * _PREHASH_CompleteAgentMovement; -char * _PREHASH_ClassifiedID; -char * _PREHASH_LocalID; -char * _PREHASH_SpaceIP; -char * _PREHASH_RemoveItem; -char * _PREHASH_LogFailedMoneyTransaction; -char * _PREHASH_ViewerStartAuction; -char * _PREHASH_StartAuction; -char * _PREHASH_DuplicateFlags; -char * _PREHASH_RegionInfo2; -char * _PREHASH_TextColor; -char * _PREHASH_SlaveID; -char * _PREHASH_Charter; -char * _PREHASH_AlertData; -char * _PREHASH_TargetBlock; -char * _PREHASH_CheckParcelAuctions; -char * _PREHASH_ParcelAuctions; -char * _PREHASH_OwnerIsGroup; -char * _PREHASH_NameValuePair; -char * _PREHASH_RemoveNameValuePair; -char * _PREHASH_BulkUpdateInventory; -char * _PREHASH_UpdateTaskInventory; -char * _PREHASH_RemoveTaskInventory; -char * _PREHASH_MoveTaskInventory; -char * _PREHASH_RequestTaskInventory; -char * _PREHASH_ReplyTaskInventory; -char * _PREHASH_AggregatePermInventory; -char * _PREHASH_GroupAccountTransactionsReply; -char * _PREHASH_SimulatorInfo; -char * _PREHASH_WearableData; -char * _PREHASH_Enabled; -char * _PREHASH_Savings; -char * _PREHASH_SimulatorLoad; -char * _PREHASH_InternalRegionIP; -char * _PREHASH_ExternalRegionIP; -char * _PREHASH_TotalPairs; -char * _PREHASH_CreateGroupRequest; -char * _PREHASH_JoinGroupRequest; -char * _PREHASH_LeaveGroupRequest; -char * _PREHASH_InviteGroupRequest; -char * _PREHASH_LiveHelpGroupRequest; -char * _PREHASH_PriceParcelClaimFactor; -char * _PREHASH_BillableArea; -char * _PREHASH_ObjectID; -char * _PREHASH_ObjectFlagUpdate; -char * _PREHASH_GroupRoleUpdate; -char * _PREHASH_RequestInventoryAsset; -char * _PREHASH_ChangedGrid; -char * _PREHASH_AgentDropGroup; -char * _PREHASH_Details; -char * _PREHASH_LocationX; -char * _PREHASH_SaleType; -char * _PREHASH_LocationY; -char * _PREHASH_LocationZ; -char * _PREHASH_EconomyData; -char * _PREHASH_HeadRotation; -char * _PREHASH_DeleteOnCompletion; -char * _PREHASH_PublicPort; -char * _PREHASH_DirClassifiedQuery; -char * _PREHASH_CallbackID; -char * _PREHASH_RequestParcelTransfer; -char * _PREHASH_RoleCount; -char * _PREHASH_ObjectCapacity; -char * _PREHASH_RequestID; -char * _PREHASH_RequestXfer; -char * _PREHASH_ObjectTaxCurrent; -char * _PREHASH_LightTaxCurrent; -char * _PREHASH_LandTaxCurrent; -char * _PREHASH_GroupTaxCurrent; -char * _PREHASH_FetchInventoryDescendents; -char * _PREHASH_InventoryDescendents; -char * _PREHASH_Descendents; -char * _PREHASH_PurgeInventoryDescendents; -char * _PREHASH_ShowDir; -char * _PREHASH_IsOwner; -char * _PREHASH_Timestamp; -char * _PREHASH_GlobalPos; -char * _PREHASH_GrabOffsetInitial; -char * _PREHASH_IsTrial; -char * _PREHASH_ObjectDuplicateOnRay; -char * _PREHASH_GroupMembershipCount; -char * _PREHASH_MethodData; -char * _PREHASH_ActivateGestures; -char * _PREHASH_DeactivateGestures; -char * _PREHASH_ProposalData; -char * _PREHASH_PosGlobal; -char * _PREHASH_SearchID; -char * _PREHASH_RezMultipleAttachmentsFromInv; -char * _PREHASH_SearchName; -char * _PREHASH_VersionString; -char * _PREHASH_CreateGroupReply; -char * _PREHASH_LeaveGroupReply; -char * _PREHASH_ActualArea; -char * _PREHASH_Message; -char * _PREHASH_ClickAction; -char * _PREHASH_AssetUploadComplete; -char * _PREHASH_RequestType; -char * _PREHASH_UUID; -char * _PREHASH_BaseMask; -char * _PREHASH_NetBlock; -char * _PREHASH_GlobalX; -char * _PREHASH_GlobalY; -char * _PREHASH_CopyRotates; -char * _PREHASH_KickUserAck; -char * _PREHASH_TopPick; -char * _PREHASH_SessionID; -char * _PREHASH_GlobalZ; -char * _PREHASH_DeclineFriendship; -char * _PREHASH_FormFriendship; -char * _PREHASH_TerminateFriendship; -char * _PREHASH_TaskData; -char * _PREHASH_SimWideMaxPrims; -char * _PREHASH_TotalPrims; -char * _PREHASH_ProfileBegin; -char * _PREHASH_Request; -char * _PREHASH_GroupAccountDetailsRequest; -char * _PREHASH_GroupActiveProposalsRequest; -char * _PREHASH_StringValue; -char * _PREHASH_Version; -char * _PREHASH_OtherCount; -char * _PREHASH_MemberCount; -char * _PREHASH_ChatData; -char * _PREHASH_IsGroupOwned; -char * _PREHASH_EnergyEfficiency; -char * _PREHASH_PickInfoUpdate; -char * _PREHASH_PickDelete; -char * _PREHASH_ScriptReset; -char * _PREHASH_Requester; -char * _PREHASH_ForSale; -char * _PREHASH_NearestLandingRegionReply; -char * _PREHASH_ParcelID; -char * _PREHASH_Godlike; -char * _PREHASH_TotalDebits; -char * _PREHASH_Direction; -char * _PREHASH_HealthData; -char * _PREHASH_LeftAxis; -char * _PREHASH_LocationBlock; -char * _PREHASH_ObjectImage; -char * _PREHASH_TerrainStartHeight00; -char * _PREHASH_TerrainStartHeight01; -char * _PREHASH_TerrainStartHeight10; -char * _PREHASH_TerrainStartHeight11; -char * _PREHASH_WaterHeight; -char * _PREHASH_FetchInventoryReply; -char * _PREHASH_GroupAccountSummaryReply; -char * _PREHASH_AttachedSound; -char * _PREHASH_ParamInUse; -char * _PREHASH_GodKickUser; -char * _PREHASH_PickName; -char * _PREHASH_TaskName; -char * _PREHASH_ObjectCount; -char * _PREHASH_RegionPresenceRequestByHandle; -char * _PREHASH_RezSingleAttachmentFromInv; -char * _PREHASH_ChildAgentUpdate; -char * _PREHASH_IsOwnerGroup; -char * _PREHASH_AgentHeightWidth; -char * _PREHASH_VerticalAngle; -char * _PREHASH_WearableType; -char * _PREHASH_AggregatePermNextOwner; -char * _PREHASH_ShowInList; -char * _PREHASH_UpdateParcel; -char * _PREHASH_SetAlwaysRun; -char * _PREHASH_NVPair; -char * _PREHASH_SearchType; -char * _PREHASH_ObjectSpinStart; -char * _PREHASH_UseEstateSun; -char * _PREHASH_RegionID; -char * _PREHASH_AbuseRegionID; -char * _PREHASH_Creator; -char * _PREHASH_ProposalText; -char * _PREHASH_DirEventsReply; -char * _PREHASH_EventInfoReply; -char * _PREHASH_UserInfoReply; -char * _PREHASH_PathRadiusOffset; -char * _PREHASH_TextureData; -char * _PREHASH_ChatPass; -char * _PREHASH_TargetID; -char * _PREHASH_DefaultPayPrice; -char * _PREHASH_UserLocation; -char * _PREHASH_MaxPrims; -char * _PREHASH_LandmarkID; -char * _PREHASH_InitiateDownload; -char * _PREHASH_Name; -char * _PREHASH_OtherCleanTime; -char * _PREHASH_ParcelSetOtherCleanTime; -char * _PREHASH_TeleportPriceExponent; -char * _PREHASH_Gain; -char * _PREHASH_PacketAck; -char * _PREHASH_PathSkew; -char * _PREHASH_SimulatorShutdownRequest; -char * _PREHASH_NearestLandingRegionRequest; -char * _PREHASH_OtherID; -char * _PREHASH_MemberID; -char * _PREHASH_MapLayerRequest; -char * _PREHASH_ObjectScale; -char * _PREHASH_TargetIP; -char * _PREHASH_Redo; -char * _PREHASH_MoneyBalance; -char * _PREHASH_TrackAgent; -char * _PREHASH_MaxX; -char * _PREHASH_Data; -char * _PREHASH_MaxY; -char * _PREHASH_TextureAnim; -char * _PREHASH_ReturnIDs; -char * _PREHASH_Date; -char * _PREHASH_AgentWearablesUpdate; -char * _PREHASH_AgentDataUpdate; -char * _PREHASH_GroupDataUpdate; -char * _PREHASH_Hash; -char * _PREHASH_AgentGroupDataUpdate; -char * _PREHASH_Left; -char * _PREHASH_Mask; -char * _PREHASH_ForceMouselook; -char * _PREHASH_Success; -char * _PREHASH_ObjectGroup; -char * _PREHASH_SunHour; -char * _PREHASH_MinX; -char * _PREHASH_ScriptSensorReply; -char * _PREHASH_MinY; -char * _PREHASH_Command; -char * _PREHASH_Desc; -char * _PREHASH_AttachmentNeedsSave; -char * _PREHASH_HistoryItemData; -char * _PREHASH_AgentCachedTexture; -char * _PREHASH_Subject; -char * _PREHASH_East; -char * _PREHASH_QueryReplies; -char * _PREHASH_ObjectCategory; -char * _PREHASH_Time; -char * _PREHASH_CreateLandmarkForEvent; -char * _PREHASH_ParentID; -char * _PREHASH_Ping; -char * _PREHASH_Perp; -char * _PREHASH_Code; -char * _PREHASH_InvType; -char * _PREHASH_AgentFOV; -char * _PREHASH_Audible; -char * _PREHASH_AuctionData; -char * _PREHASH_IDBlock; -char * _PREHASH_West; -char * _PREHASH_Undo; -char * _PREHASH_TotalNumItems; -char * _PREHASH_Info; -char * _PREHASH_Area; -char * _PREHASH_SimCrashed; -char * _PREHASH_Text; -char * _PREHASH_PriceGroupCreate; -char * _PREHASH_ObjectShape; -char * _PREHASH_GroupRoleDataReply; -char * _PREHASH_MuteCRC; -char * _PREHASH_Size; -char * _PREHASH_FromAddress; -char * _PREHASH_Body; -char * _PREHASH_FileData; -char * _PREHASH_List; -char * _PREHASH_KickUser; -char * _PREHASH_OtherPrims; -char * _PREHASH_RunTime; -char * _PREHASH_GrantUserRights; -char * _PREHASH_RpcScriptRequestInboundForward; -char * _PREHASH_More; -char * _PREHASH_Majority; -char * _PREHASH_MetersTraveled; -char * _PREHASH_Stat; -char * _PREHASH_SoundID; -char * _PREHASH_Item; -char * _PREHASH_User; -char * _PREHASH_Prey; -char * _PREHASH_RayStart; -char * _PREHASH_UsecSinceStart; -char * _PREHASH_ParcelData; -char * _PREHASH_CameraUpAxis; -char * _PREHASH_ScriptDialog; -char * _PREHASH_MasterParcelData; -char * _PREHASH_Invalid; -char * _PREHASH_ProfileCurve; -char * _PREHASH_ParcelAccessListUpdate; -char * _PREHASH_MuteListUpdate; -char * _PREHASH_SendPacket; -char * _PREHASH_SendXferPacket; -char * _PREHASH_RegionDenyIdentified; -char * _PREHASH_NotecardItemID; -char * _PREHASH_LastName; -char * _PREHASH_From; -char * _PREHASH_RoleChange; -char * _PREHASH_Port; -char * _PREHASH_MemberTitle; -char * _PREHASH_LogParcelChanges; -char * _PREHASH_AgentCachedTextureResponse; -char * _PREHASH_DeRezObject; -char * _PREHASH_IsTemporary; -char * _PREHASH_InsigniaID; -char * _PREHASH_CheckFlags; -char * _PREHASH_EventID; -char * _PREHASH_Selected; -char * _PREHASH_FromAgentId; -char * _PREHASH_Type; -char * _PREHASH_ChatType; -char * _PREHASH_ReportData; -char * _PREHASH_RequestBlock; -char * _PREHASH_GrantData; -char * _PREHASH_DetachAttachmentIntoInv; -char * _PREHASH_ParcelDisableObjects; -char * _PREHASH_Sections; -char * _PREHASH_GodLevel; -char * _PREHASH_PayPriceReply; -char * _PREHASH_QueryID; -char * _PREHASH_CameraEyeOffset; -char * _PREHASH_AgentPosition; -char * _PREHASH_GrabPosition; -char * _PREHASH_OnlineNotification; -char * _PREHASH_OfflineNotification; -char * _PREHASH_SendPostcard; -char * _PREHASH_RequestFlags; -char * _PREHASH_GroupAccountSummaryRequest; -char * _PREHASH_GroupVoteHistoryRequest; -char * _PREHASH_ParamValue; -char * _PREHASH_MaxAgents; -char * _PREHASH_CreateNewOutfitAttachments; -char * _PREHASH_RegionHandle; -char * _PREHASH_TeleportProgress; -char * _PREHASH_AgentQuitCopy; -char * _PREHASH_AvatarInterestsUpdate; -char * _PREHASH_GroupNoticeID; -char * _PREHASH_ParcelName; -char * _PREHASH_PriceObjectRent; -char * _PREHASH_OfferCallingCard; -char * _PREHASH_AcceptCallingCard; -char * _PREHASH_DeclineCallingCard; -char * _PREHASH_AgentAccess; -char * _PREHASH_DataHomeLocationReply; -char * _PREHASH_EventLocationReply; -char * _PREHASH_TerseDateID; -char * _PREHASH_ObjectOwner; -char * _PREHASH_AssetID; -char * _PREHASH_AlertMessage; -char * _PREHASH_AgentAlertMessage; -char * _PREHASH_EstateOwnerMessage; -char * _PREHASH_ParcelMediaCommandMessage; -char * _PREHASH_Auction; -char * _PREHASH_Category; -char * _PREHASH_FilePath; -char * _PREHASH_ItemFlags; -char * _PREHASH_Invoice; -char * _PREHASH_IntervalDays; -char * _PREHASH_PathScaleX; -char * _PREHASH_FromTaskID; -char * _PREHASH_PathScaleY; -char * _PREHASH_TimeInfo; -char * _PREHASH_PublicCount; -char * _PREHASH_ParcelJoin; -char * _PREHASH_GroupRolesCount; -char * _PREHASH_SimulatorBlock; -char * _PREHASH_GroupID; -char * _PREHASH_AgentVel; -char * _PREHASH_RequestImage; -char * _PREHASH_NetStats; -char * _PREHASH_AgentPos; -char * _PREHASH_AgentSit; -char * _PREHASH_Material; -char * _PREHASH_ObjectDeGrab; -char * _PREHASH_VelocityInterpolateOff; -char * _PREHASH_AuthorizedBuyerID; -char * _PREHASH_AvatarPropertiesReply; -char * _PREHASH_GroupProfileReply; -char * _PREHASH_SimOwner; -char * _PREHASH_SalePrice; -char * _PREHASH_Animation; -char * _PREHASH_OwnerID; -char * _PREHASH_NearestLandingRegionUpdated; -char * _PREHASH_PassToAgent; -char * _PREHASH_PreyAgent; -char * _PREHASH_SimStats; -char * _PREHASH_LogoutReply; -char * _PREHASH_FeatureDisabled; -char * _PREHASH_PhysicalAvatarEventList; -char * _PREHASH_ObjectLocalID; -char * _PREHASH_Dropped; -char * _PREHASH_WebProfilesDisabled; -char * _PREHASH_Destination; -char * _PREHASH_MasterID; -char * _PREHASH_TransferData; -char * _PREHASH_WantToMask; -char * _PREHASH_ParcelSelectObjects; -char * _PREHASH_ExtraParams; -char * _PREHASH_CreatorID; -char * _PREHASH_Summary; -char * _PREHASH_BuyObjectInventory; -char * _PREHASH_FetchInventory; -char * _PREHASH_InventoryID; -char * _PREHASH_PacketNumber; -char * _PREHASH_SetFollowCamProperties; -char * _PREHASH_ClearFollowCamProperties; -char * _PREHASH_SequenceID; -char * _PREHASH_DataServerLogout; -char * _PREHASH_NameValue; -char * _PREHASH_PathShearX; -char * _PREHASH_PathShearY; -char * _PREHASH_Velocity; -char * _PREHASH_SecPerYear; -char * _PREHASH_FirstName; -char * _PREHASH_AttachedSoundGainChange; -char * _PREHASH_LocationID; -char * _PREHASH_Running; -char * _PREHASH_AgentThrottle; -char * _PREHASH_NeighborList; -char * _PREHASH_PathTaperX; -char * _PREHASH_PathTaperY; -char * _PREHASH_AgentRelated; -char * _PREHASH_GranterBlock; -char * _PREHASH_UseCachedMuteList; -char * _PREHASH_FailStats; -char * _PREHASH_Tempfile; -char * _PREHASH_BuyerID; -char * _PREHASH_DirPeopleReply; -char * _PREHASH_TransferInfo; -char * _PREHASH_AvatarPickerRequestBackend; -char * _PREHASH_AvatarPropertiesRequestBackend; -char * _PREHASH_UpdateData; -char * _PREHASH_SimFPS; -char * _PREHASH_ReporterID; -char * _PREHASH_ButtonLabel; -char * _PREHASH_GranterID; -char * _PREHASH_WantToText; -char * _PREHASH_ReportType; -char * _PREHASH_SimulatorReady; -char * _PREHASH_DataBlock; -char * _PREHASH_AnimationSourceList; -char * _PREHASH_SubscribeLoad; -char * _PREHASH_UnsubscribeLoad; -char * _PREHASH_Packet; -char * _PREHASH_UndoLand; -char * _PREHASH_SimAccess; -char * _PREHASH_AbuserID; -char * _PREHASH_MembershipFee; -char * _PREHASH_InviteGroupResponse; -char * _PREHASH_CreateInventoryFolder; -char * _PREHASH_UpdateInventoryFolder; -char * _PREHASH_MoveInventoryFolder; -char * _PREHASH_RemoveInventoryFolder; -char * _PREHASH_MoneyData; -char * _PREHASH_ObjectDeselect; -char * _PREHASH_NewAssetID; -char * _PREHASH_ObjectAdd; -char * _PREHASH_RayEndIsIntersection; -char * _PREHASH_CompleteAuction; -char * _PREHASH_CircuitCode; -char * _PREHASH_AgentMovementComplete; -char * _PREHASH_ViewerIP; -char * _PREHASH_Header; -char * _PREHASH_GestureFlags; -char * _PREHASH_XferID; -char * _PREHASH_StatValue; -char * _PREHASH_TaskID; -char * _PREHASH_PickID; -char * _PREHASH_RayEnd; -char * _PREHASH_Throttles; -char * _PREHASH_RebakeAvatarTextures; -char * _PREHASH_UpAxis; -char * _PREHASH_AgentTextures; -char * _PREHASH_NotecardData; -char * _PREHASH_Radius; -char * _PREHASH_OffCircuit; -char * _PREHASH_Access; -char * _PREHASH_TitleRoleID; -char * _PREHASH_SquareMetersCredit; -char * _PREHASH_Filename; -char * _PREHASH_ClassifiedInfoRequest; -char * _PREHASH_ParcelInfoRequest; -char * _PREHASH_ParcelObjectOwnersRequest; -char * _PREHASH_TeleportLandmarkRequest; -char * _PREHASH_EventInfoRequest; -char * _PREHASH_MoneyBalanceRequest; -char * _PREHASH_GroupMembersRequest; -char * _PREHASH_GroupRoleMembersRequest; -char * _PREHASH_ChatFromSimulator; -char * _PREHASH_OldFolderID; -char * _PREHASH_UserInfoRequest; -char * _PREHASH_TextureID; -char * _PREHASH_ProfileURL; -char * _PREHASH_Handle; -char * _PREHASH_ButtonIndex; -char * _PREHASH_GetScriptRunning; -char * _PREHASH_SetScriptRunning; -char * _PREHASH_Health; -char * _PREHASH_CircuitInfo; -char * _PREHASH_ObjectBuy; -char * _PREHASH_ProfileEnd; -char * _PREHASH_Effect; -char * _PREHASH_TestMessage; -char * _PREHASH_ScriptMailRegistration; -char * _PREHASH_AgentSetAppearance; -char * _PREHASH_AvatarAppearance; -char * _PREHASH_RegionData; -char * _PREHASH_RequestingRegionData; -char * _PREHASH_LandingRegionData; -char * _PREHASH_SitTransform; -char * _PREHASH_TerrainBase0; -char * _PREHASH_SkillsMask; -char * _PREHASH_AtAxis; -char * _PREHASH_TerrainBase1; -char * _PREHASH_Reason; -char * _PREHASH_TerrainBase2; -char * _PREHASH_TerrainBase3; -char * _PREHASH_Params; -char * _PREHASH_PingID; -char * _PREHASH_Change; -char * _PREHASH_Height; -char * _PREHASH_Region; -char * _PREHASH_TelehubInfo; -char * _PREHASH_StateSave; -char * _PREHASH_RoleData; -char * _PREHASH_AgentAnimation; -char * _PREHASH_AvatarAnimation; -char * _PREHASH_LogDwellTime; -char * _PREHASH_ParcelGodMarkAsContent; -char * _PREHASH_UsePhysics; -char * _PREHASH_RegionDenyTransacted; -char * _PREHASH_JointType; -char * _PREHASH_ObjectTaxEstimate; -char * _PREHASH_LightTaxEstimate; -char * _PREHASH_LandTaxEstimate; -char * _PREHASH_TeleportLandingStatusChanged; -char * _PREHASH_GroupTaxEstimate; -char * _PREHASH_AvgViewerFPS; -char * _PREHASH_Buttons; -char * _PREHASH_Sender; -char * _PREHASH_Dialog; -char * _PREHASH_TargetData; -char * _PREHASH_DestID; -char * _PREHASH_PricePublicObjectDelete; -char * _PREHASH_ObjectDelete; -char * _PREHASH_Delete; -char * _PREHASH_EventGodDelete; -char * _PREHASH_LastTaxDate; -char * _PREHASH_MapImageID; -char * _PREHASH_EndDateTime; -char * _PREHASH_TerrainDetail0; -char * _PREHASH_TerrainDetail1; -char * _PREHASH_TerrainDetail2; -char * _PREHASH_TerrainDetail3; -char * _PREHASH_Offset; -char * _PREHASH_ObjectDelink; -char * _PREHASH_TargetObject; -char * _PREHASH_IsEstateManager; -char * _PREHASH_CancelAuction; -char * _PREHASH_ObjectDetach; -char * _PREHASH_Compressed; -char * _PREHASH_PathBegin; -char * _PREHASH_BypassRaycast; -char * _PREHASH_WinnerID; -char * _PREHASH_ChannelType; -char * _PREHASH_NonExemptMembers; -char * _PREHASH_Agents; -char * _PREHASH_MemberData; -char * _PREHASH_ToGroupID; -char * _PREHASH_ImageNotInDatabase; -char * _PREHASH_StartDate; -char * _PREHASH_AnimID; -char * _PREHASH_Serial; -char * _PREHASH_AbuseRegionName; -char * _PREHASH_ModifyLand; -char * _PREHASH_Digest; -char * _PREHASH_Victim; -char * _PREHASH_Script; -char * _PREHASH_PickInfoReply; -char * _PREHASH_MoneyBalanceReply; -char * _PREHASH_RoutedMoneyBalanceReply; -char * _PREHASH_RoleID; -char * _PREHASH_RegionInfo; -char * _PREHASH_GodUpdateRegionInfo; -char * _PREHASH_StartAnim; -char * _PREHASH_Action; -char * _PREHASH_Location; -char * _PREHASH_Rights; -char * _PREHASH_SearchDir; -char * _PREHASH_TransferRequest; -char * _PREHASH_ScriptSensorRequest; -char * _PREHASH_MoneyTransferRequest; -char * _PREHASH_EjectGroupMemberRequest; -char * _PREHASH_SkillsText; -char * _PREHASH_Resent; -char * _PREHASH_Center; -char * _PREHASH_SharedData; -char * _PREHASH_PSBlock; -char * _PREHASH_UUIDNameBlock; -char * _PREHASH_GroupTitleUpdate; -char * _PREHASH_Method; -char * _PREHASH_TouchName; -char * _PREHASH_UpdateType; -char * _PREHASH_KickedFromEstateID; -char * _PREHASH_CandidateID; -char * _PREHASH_ParamData; -char * _PREHASH_GodlikeMessage; -char * _PREHASH_SystemMessage; -char * _PREHASH_BodyRotation; -char * _PREHASH_SearchRegions; -char * _PREHASH_AnimationData; -char * _PREHASH_StatID; -char * _PREHASH_ItemID; -char * _PREHASH_ScriptDialogReply; -char * _PREHASH_RegionIDAndHandleReply; -char * _PREHASH_CameraAtOffset; -char * _PREHASH_VoteID; -char * _PREHASH_ParcelGodForceOwner; -char * _PREHASH_Filter; -char * _PREHASH_InviteData; -char * _PREHASH_PCode; -char * _PREHASH_SearchPos; -char * _PREHASH_PreyID; -char * _PREHASH_TerrainLowerLimit; -char * _PREHASH_EventFlags; -char * _PREHASH_TallyVotes; -char * _PREHASH_Result; -char * _PREHASH_LookAt; -char * _PREHASH_SearchOrder; -char * _PREHASH_PayButton; -char * _PREHASH_SelfCount; -char * _PREHASH_PacketCount; -char * _PREHASH_ParcelBuyPass; -char * _PREHASH_OldItemID; -char * _PREHASH_RegionPort; -char * _PREHASH_PriceEnergyUnit; -char * _PREHASH_Bitmap; -char * _PREHASH_CacheMissType; -char * _PREHASH_VFileID; -char * _PREHASH_GroupInsigniaID; -char * _PREHASH_Online; -char * _PREHASH_KickFlags; -char * _PREHASH_CovenantID; -char * _PREHASH_SysCPU; -char * _PREHASH_EMail; -char * _PREHASH_AggregatePermTextures; -char * _PREHASH_ChatChannel; -char * _PREHASH_ReturnID; -char * _PREHASH_ObjectAttach; -char * _PREHASH_TargetPort; -char * _PREHASH_ObjectSpinStop; -char * _PREHASH_FullID; -char * _PREHASH_ActivateGroup; -char * _PREHASH_SysGPU; -char * _PREHASH_AvatarInterestsReply; -char * _PREHASH_StartLure; -char * _PREHASH_SysRAM; -char * _PREHASH_ObjectPosition; -char * _PREHASH_SitPosition; -char * _PREHASH_StartTime; -char * _PREHASH_BornOn; -char * _PREHASH_CameraCollidePlane; -char * _PREHASH_EconomyDataRequest; -char * _PREHASH_TeleportLureRequest; -char * _PREHASH_FolderID; -char * _PREHASH_RegionHandleRequest; -char * _PREHASH_ScriptDataRequest; -char * _PREHASH_GroupRoleDataRequest; -char * _PREHASH_GroupTitlesRequest; -char * _PREHASH_AgentWearablesRequest; -char * _PREHASH_MapBlockRequest; -char * _PREHASH_LureID; -char * _PREHASH_CopyCenters; -char * _PREHASH_ParamList; -char * _PREHASH_InventorySerial; -char * _PREHASH_EdgeDataPacket; -char * _PREHASH_AvatarPickerReply; -char * _PREHASH_ParcelDwellReply; -char * _PREHASH_IsForSale; -char * _PREHASH_MuteID; -char * _PREHASH_MeanCollisionAlert; -char * _PREHASH_CanAcceptTasks; -char * _PREHASH_ItemData; -char * _PREHASH_AnimationList; -char * _PREHASH_Reputation; -char * _PREHASH_IntValue; -char * _PREHASH_TargetType; -char * _PREHASH_Amount; -char * _PREHASH_HasAttachment; -char * _PREHASH_UpdateAttachment; -char * _PREHASH_RemoveAttachment; -char * _PREHASH_HeightWidthBlock; -char * _PREHASH_RequestObjectPropertiesFamily; -char * _PREHASH_ObjectPropertiesFamily; -char * _PREHASH_UserData; -char * _PREHASH_IsReadable; -char * _PREHASH_PathCurve; -char * _PREHASH_Status; -char * _PREHASH_FromGroup; -char * _PREHASH_AlreadyVoted; -char * _PREHASH_PlacesReply; -char * _PREHASH_DirPlacesReply; -char * _PREHASH_ParcelBuy; -char * _PREHASH_DirFindQueryBackend; -char * _PREHASH_DirPlacesQueryBackend; -char * _PREHASH_DirClassifiedQueryBackend; -char * _PREHASH_DirLandQueryBackend; -char * _PREHASH_DirPopularQueryBackend; -char * _PREHASH_HistoryData; -char * _PREHASH_SnapshotID; -char * _PREHASH_Aspect; -char * _PREHASH_ParamSize; -char * _PREHASH_VoteCast; -char * _PREHASH_CastsShadows; -char * _PREHASH_EveryoneMask; -char * _PREHASH_ObjectSpinUpdate; -char * _PREHASH_MaturePublish; -char * _PREHASH_UseExistingAsset; -char * _PREHASH_Powers; -char * _PREHASH_ParcelLocalID; -char * _PREHASH_TeleportCancel; -char * _PREHASH_UnixTime; -char * _PREHASH_QueryFlags; -char * _PREHASH_AlwaysRun; -char * _PREHASH_Bottom; -char * _PREHASH_ButtonData; -char * _PREHASH_SoundData; -char * _PREHASH_ViewerStats; -char * _PREHASH_RegionHandshake; -char * _PREHASH_ObjectDescription; -char * _PREHASH_Description; -char * _PREHASH_ParamType; -char * _PREHASH_UUIDNameReply; -char * _PREHASH_UUIDGroupNameReply; -char * _PREHASH_SaveAssetIntoInventory; -char * _PREHASH_UserInfo; -char * _PREHASH_AnimSequenceID; -char * _PREHASH_NVPairs; -char * _PREHASH_GroupNoticesListRequest; -char * _PREHASH_ParcelAccessListRequest; -char * _PREHASH_MuteListRequest; -char * _PREHASH_RpcChannelRequest; -char * _PREHASH_LandStatRequest; -char * _PREHASH_PlacesQuery; -char * _PREHASH_DirPlacesQuery; -char * _PREHASH_SortOrder; -char * _PREHASH_Hunter; -char * _PREHASH_SunAngVelocity; -char * _PREHASH_BinaryBucket; -char * _PREHASH_ImagePacket; -char * _PREHASH_StartGroupProposal; -char * _PREHASH_EnergyLevel; -char * _PREHASH_PriceForListing; -char * _PREHASH_Scale; -char * _PREHASH_EstateCovenantReply; -char * _PREHASH_ParentEstateID; -char * _PREHASH_Extra2; -char * _PREHASH_Throttle; -char * _PREHASH_SimIP; -char * _PREHASH_GodID; -char * _PREHASH_TeleportMinPrice; -char * _PREHASH_VoteItem; -char * _PREHASH_ObjectRotation; -char * _PREHASH_SitRotation; -char * _PREHASH_SnapSelection; -char * _PREHASH_SoundTrigger; -char * _PREHASH_TerrainRaiseLimit; -char * _PREHASH_Quorum; -char * _PREHASH_AgentBlock; -char * _PREHASH_CommandBlock; -char * _PREHASH_PricePublicObjectDecay; -char * _PREHASH_SpawnPointPos; -char * _PREHASH_VolumeDetail; -char * _PREHASH_FromAgentName; -char * _PREHASH_Range; -char * _PREHASH_DirectoryVisibility; -char * _PREHASH_PublicIP; -char * _PREHASH_TeleportFailed; -char * _PREHASH_PreloadSound; -char * _PREHASH_ScreenshotID; -char * _PREHASH_CovenantTimestamp; -char * _PREHASH_OldestUnacked; -char * _PREHASH_SimulatorIP; -char * _PREHASH_Value; -char * _PREHASH_JointAxisOrAnchor; -char * _PREHASH_Test0; -char * _PREHASH_Test1; -char * _PREHASH_Test2; -char * _PREHASH_SunPhase; -char * _PREHASH_ParcelDivide; -char * _PREHASH_PriceObjectClaim; -char * _PREHASH_Field; -char * _PREHASH_Ratio; -char * _PREHASH_JoinGroupReply; -char * _PREHASH_LiveHelpGroupReply; -char * _PREHASH_Score; -char * _PREHASH_Image; -char * _PREHASH_ObjectClickAction; -char * _PREHASH_Parameter; -char * _PREHASH_Flags; -char * _PREHASH_Plane; -char * _PREHASH_Width; -char * _PREHASH_Right; -char * _PREHASH_DirFindQuery; -char * _PREHASH_Textures; -char * _PREHASH_EventData; -char * _PREHASH_Final; -char * _PREHASH_System; -char * _PREHASH_TelehubPos; -char * _PREHASH_ReportAutosaveCrash; -char * _PREHASH_CreateTrustedCircuit; -char * _PREHASH_DenyTrustedCircuit; -char * _PREHASH_RequestTrustedCircuit; -char * _PREHASH_Codec; -char * _PREHASH_Modal; -char * _PREHASH_ChildAgentUnknown; -char * _PREHASH_LandingType; -char * _PREHASH_ScriptRunningReply; -char * _PREHASH_Reply; -char * _PREHASH_GroupAccountDetailsReply; -char * _PREHASH_TelehubRot; -char * _PREHASH_AcceptFriendship; -char * _PREHASH_ItemType; -char * _PREHASH_DwellInfo; -char * _PREHASH_AgentResume; -char * _PREHASH_MailFilter; -char * _PREHASH_Disconnect; -char * _PREHASH_SimPosition; -char * _PREHASH_SimWideTotalPrims; -char * _PREHASH_Index; -char * _PREHASH_SimFilename; -char * _PREHASH_LastOwnerID; -char * _PREHASH_GroupNoticeRequest; -char * _PREHASH_EmailMessageRequest; -char * _PREHASH_MapItemRequest; -char * _PREHASH_AgentCount; -char * _PREHASH_MessageBlock; -char * _PREHASH_FuseBlock; -char * _PREHASH_AgentGroupData; -char * _PREHASH_ClassifiedInfoUpdate; -char * _PREHASH_RegionPos; -char * _PREHASH_ParcelMediaUpdate; -char * _PREHASH_NoticeID; -char * _PREHASH_GridX; -char * _PREHASH_GridY; -char * _PREHASH_Title; -char * _PREHASH_AuctionID; -char * _PREHASH_VoteType; -char * _PREHASH_CategoryID; -char * _PREHASH_Token; -char * _PREHASH_AggregatePerms; -char * _PREHASH_ObjectSelect; -char * _PREHASH_ForceObjectSelect; -char * _PREHASH_Price; -char * _PREHASH_SunDirection; -char * _PREHASH_FromName; -char * _PREHASH_ChangeInventoryItemFlags; -char * _PREHASH_Force; -char * _PREHASH_TransactionBlock; -char * _PREHASH_PowersMask; -char * _PREHASH_Stamp; -char * _PREHASH_TotalCredits; -char * _PREHASH_State; -char * _PREHASH_TextureIndex; -char * _PREHASH_InviteeID; -char * _PREHASH_ParcelReclaim; -char * _PREHASH_Money; -char * _PREHASH_PathTwist; -char * _PREHASH_AuthBuyerID; -char * _PREHASH_Color; -char * _PREHASH_SourceType; -char * _PREHASH_World; -char * _PREHASH_QueryData; -char * _PREHASH_Users; -char * _PREHASH_SysOS; -char * _PREHASH_Notes; -char * _PREHASH_AvatarID; -char * _PREHASH_FounderID; -char * _PREHASH_EndPointID; -char * _PREHASH_LocationLookAt; -char * _PREHASH_Sound; -char * _PREHASH_Cover; -char * _PREHASH_TotalObjectCount; -char * _PREHASH_TextureEntry; -char * _PREHASH_SquareMetersCommitted; -char * _PREHASH_ChannelID; -char * _PREHASH_Dwell; -char * _PREHASH_North; -char * _PREHASH_AgentUpdate; -char * _PREHASH_PickGodDelete; -char * _PREHASH_HostName; -char * _PREHASH_PriceParcelClaim; -char * _PREHASH_ParcelClaim; -char * _PREHASH_AgentPowers; -char * _PREHASH_ProfileHollow; -char * _PREHASH_GroupRoleChanges; -char * _PREHASH_Count; -char * _PREHASH_South; -char * _PREHASH_ObjectUpdateCompressed; -char * _PREHASH_MuteFlags; -char * _PREHASH_Group; -char * _PREHASH_AgentPause; -char * _PREHASH_LanguagesText; -char * _PREHASH_Error; -char * _PREHASH_InternalScriptMail; -char * _PREHASH_FindAgent; -char * _PREHASH_AgentData; -char * _PREHASH_FolderData; -char * _PREHASH_AssetBlock; -char * _PREHASH_AcceptNotices; -char * _PREHASH_SetGroupAcceptNotices; -char * _PREHASH_CloseCircuit; -char * _PREHASH_TeleportFinish; -char * _PREHASH_PathRevolutions; -char * _PREHASH_ClassifiedInfoReply; -char * _PREHASH_ParcelInfoReply; -char * _PREHASH_AutosaveData; -char * _PREHASH_SetStartLocation; -char * _PREHASH_PassHours; -char * _PREHASH_AttachmentPt; -char * _PREHASH_ParcelFlags; -char * _PREHASH_NumVotes; -char * _PREHASH_AvatarPickerRequest; -char * _PREHASH_TeleportLocationRequest; -char * _PREHASH_DataHomeLocationRequest; -char * _PREHASH_EventNotificationAddRequest; -char * _PREHASH_ParcelDwellRequest; -char * _PREHASH_EventLocationRequest; -char * _PREHASH_SetStartLocationRequest; -char * _PREHASH_QueryStart; -char * _PREHASH_EjectData; -char * _PREHASH_AvatarTextureUpdate; -char * _PREHASH_RPCServerPort; -char * _PREHASH_Bytes; -char * _PREHASH_Extra; -char * _PREHASH_ForceScriptControlRelease; -char * _PREHASH_ParcelRelease; -char * _PREHASH_VFileType; -char * _PREHASH_EjectGroupMemberReply; -char * _PREHASH_ImageData; -char * _PREHASH_SimulatorViewerTimeMessage; -char * _PREHASH_Rotation; -char * _PREHASH_Selection; -char * _PREHASH_TransactionData; -char * _PREHASH_OperationData; -char * _PREHASH_ExpirationDate; -char * _PREHASH_ParcelDeedToGroup; -char * _PREHASH_AvatarPicksReply; -char * _PREHASH_GroupTitlesReply; -char * _PREHASH_AgentInfo; -char * _PREHASH_MoneyTransferBackend; -char * _PREHASH_NextOwnerMask; -char * _PREHASH_MuteData; -char * _PREHASH_PassPrice; -char * _PREHASH_SourceID; -char * _PREHASH_ChangeUserRights; -char * _PREHASH_TeleportFlags; -char * _PREHASH_SlaveParcelData; -char * _PREHASH_AssetData; -char * _PREHASH_MultipleObjectUpdate; -char * _PREHASH_ObjectUpdate; -char * _PREHASH_ImprovedTerseObjectUpdate; -char * _PREHASH_ConfirmXferPacket; -char * _PREHASH_StartPingCheck; -char * _PREHASH_SimWideDeletes; -char * _PREHASH_LandStatReply; -char * _PREHASH_IsPhantom; -char * _PREHASH_AgentList; -char * _PREHASH_SimApproved; -char * _PREHASH_RezObject; -char * _PREHASH_TaskLocalID; -char * _PREHASH_ClaimDate; -char * _PREHASH_MergeParcel; -char * _PREHASH_Priority; -char * _PREHASH_QueryText; -char * _PREHASH_GroupNoticeAdd; -char * _PREHASH_ReturnType; -char * _PREHASH_FetchFolders; -char * _PREHASH_SimulatorPublicHostBlock; -char * _PREHASH_HeaderData; -char * _PREHASH_RequestMultipleObjects; -char * _PREHASH_RetrieveInstantMessages; -char * _PREHASH_OpenCircuit; -char * _PREHASH_CrossedRegion; -char * _PREHASH_DirGroupsReply; -char * _PREHASH_AvatarGroupsReply; -char * _PREHASH_EmailMessageReply; -char * _PREHASH_GroupVoteHistoryItemReply; -char * _PREHASH_ViewerPosition; -char * _PREHASH_Position; -char * _PREHASH_ParentEstate; -char * _PREHASH_EstateName; -char * _PREHASH_MuteName; -char * _PREHASH_ParcelRename; -char * _PREHASH_ViewerFilename; -char * _PREHASH_UserReportInternal; -char * _PREHASH_AvatarPropertiesRequest; -char * _PREHASH_ParcelPropertiesRequest; -char * _PREHASH_GroupProfileRequest; -char * _PREHASH_AgentDataUpdateRequest; -char * _PREHASH_PriceObjectScaleFactor; -char * _PREHASH_OpenEnrollment; -char * _PREHASH_GroupData; -char * _PREHASH_RequestGodlikePowers; -char * _PREHASH_GrantGodlikePowers; -char * _PREHASH_TransactionID; -char * _PREHASH_DestinationID; -char * _PREHASH_Controls; -char * _PREHASH_FirstDetachAll; -char * _PREHASH_EstateID; -char * _PREHASH_ImprovedInstantMessage; -char * _PREHASH_CheckParcelSales; -char * _PREHASH_ParcelSales; -char * _PREHASH_CurrentInterval; -char * _PREHASH_PriceRentLight; -char * _PREHASH_MediaAutoScale; -char * _PREHASH_NeighborBlock; -char * _PREHASH_LayerData; -char * _PREHASH_NVPairData; -char * _PREHASH_TeleportLocal; -char * _PREHASH_EjecteeID; -char * _PREHASH_VoteInitiator; -char * _PREHASH_TypeData; -char * _PREHASH_OwnerIDs; -char * _PREHASH_SystemKickUser; -char * _PREHASH_TransactionTime; -char * _PREHASH_TimeToLive; -char * _PREHASH_OldAgentID; -char * _PREHASH_MusicURL; -char * _PREHASH_ParcelPrimBonus; -char * _PREHASH_EjectUser; -char * _PREHASH_CoarseLocationUpdate; -char * _PREHASH_ChildAgentPositionUpdate; -char * _PREHASH_StoreLocal; -char * _PREHASH_GroupName; -char * _PREHASH_PriceParcelRent; -char * _PREHASH_SimStatus; -char * _PREHASH_TransactionSuccess; -char * _PREHASH_LureType; -char * _PREHASH_GroupMask; -char * _PREHASH_SitObject; -char * _PREHASH_Override; -char * _PREHASH_LocomotionState; -char * _PREHASH_PriceUpload; -char * _PREHASH_RemoveParcel; -char * _PREHASH_ConfirmAuctionStart; -char * _PREHASH_RpcScriptRequestInbound; -char * _PREHASH_ActiveGroupID; -char * _PREHASH_ParcelReturnObjects; -char * _PREHASH_TotalObjects; -char * _PREHASH_ObjectExtraParams; -char * _PREHASH_Questions; -char * _PREHASH_TransferAbort; -char * _PREHASH_TransferInventory; -char * _PREHASH_RayTargetID; -char * _PREHASH_ClaimPrice; -char * _PREHASH_ObjectProperties; -char * _PREHASH_ParcelProperties; -char * _PREHASH_EstateOwnerID; -char * _PREHASH_LogoutRequest; -char * _PREHASH_AssetUploadRequest; -char * _PREHASH_TransactionType; -char * _PREHASH_AvatarPropertiesUpdate; -char * _PREHASH_ParcelPropertiesUpdate; -char * _PREHASH_FetchItems; -char * _PREHASH_AbortXfer; -char * _PREHASH_DeRezAck; -char * _PREHASH_TakeControls; -char * _PREHASH_DirLandReply; -char * _PREHASH_MuteType; -char * _PREHASH_IMViaEMail; -char * _PREHASH_RentPrice; -char * _PREHASH_GenericMessage; -char * _PREHASH_ChildAgentAlive; -char * _PREHASH_AssetType; -char * _PREHASH_SpawnPointBlock; -char * _PREHASH_AttachmentBlock; -char * _PREHASH_ObjectMaterial; -char * _PREHASH_OwnerName; -char * _PREHASH_AvatarNotesReply; -char * _PREHASH_CacheID; -char * _PREHASH_OwnerMask; -char * _PREHASH_TransferInventoryAck; -char * _PREHASH_RegionDenyAgeUnverified; -char * _PREHASH_AgeVerificationBlock; - - -void init_prehash_data() -{ - _PREHASH_X = gMessageStringTable.getString("X"); - _PREHASH_Y = gMessageStringTable.getString("Y"); - _PREHASH_Z = gMessageStringTable.getString("Z"); - _PREHASH_AddFlags = gMessageStringTable.getString("AddFlags"); - _PREHASH_FailureInfo = gMessageStringTable.getString("FailureInfo"); - _PREHASH_MapData = gMessageStringTable.getString("MapData"); - _PREHASH_AddItem = gMessageStringTable.getString("AddItem"); - _PREHASH_MeanCollision = gMessageStringTable.getString("MeanCollision"); - _PREHASH_RezScript = gMessageStringTable.getString("RezScript"); - _PREHASH_AvatarSitResponse = gMessageStringTable.getString("AvatarSitResponse"); - _PREHASH_InventoryAssetResponse = gMessageStringTable.getString("InventoryAssetResponse"); - _PREHASH_KillObject = gMessageStringTable.getString("KillObject"); - _PREHASH_ProposalID = gMessageStringTable.getString("ProposalID"); - _PREHASH_SerialNum = gMessageStringTable.getString("SerialNum"); - _PREHASH_Duration = gMessageStringTable.getString("Duration"); - _PREHASH_ScriptQuestion = gMessageStringTable.getString("ScriptQuestion"); - _PREHASH_AddCircuitCode = gMessageStringTable.getString("AddCircuitCode"); - _PREHASH_UseCircuitCode = gMessageStringTable.getString("UseCircuitCode"); - _PREHASH_ViewerCircuitCode = gMessageStringTable.getString("ViewerCircuitCode"); - _PREHASH_ScriptAnswerYes = gMessageStringTable.getString("ScriptAnswerYes"); - _PREHASH_PartnerID = gMessageStringTable.getString("PartnerID"); - _PREHASH_DirLandQuery = gMessageStringTable.getString("DirLandQuery"); - _PREHASH_TeleportStart = gMessageStringTable.getString("TeleportStart"); - _PREHASH_AboutText = gMessageStringTable.getString("AboutText"); - _PREHASH_VisualParam = gMessageStringTable.getString("VisualParam"); - _PREHASH_GroupPrims = gMessageStringTable.getString("GroupPrims"); - _PREHASH_SelectedPrims = gMessageStringTable.getString("SelectedPrims"); - _PREHASH_ID = gMessageStringTable.getString("ID"); - _PREHASH_UUIDNameRequest = gMessageStringTable.getString("UUIDNameRequest"); - _PREHASH_UUIDGroupNameRequest = gMessageStringTable.getString("UUIDGroupNameRequest"); - _PREHASH_GroupAccountTransactionsRequest = gMessageStringTable.getString("GroupAccountTransactionsRequest"); - _PREHASH_MapNameRequest = gMessageStringTable.getString("MapNameRequest"); - _PREHASH_UpdateSimulator = gMessageStringTable.getString("UpdateSimulator"); - _PREHASH_BillableFactor = gMessageStringTable.getString("BillableFactor"); - _PREHASH_ObjectBonusFactor = gMessageStringTable.getString("ObjectBonusFactor"); - _PREHASH_EnableSimulator = gMessageStringTable.getString("EnableSimulator"); - _PREHASH_DisableSimulator = gMessageStringTable.getString("DisableSimulator"); - _PREHASH_ConfirmEnableSimulator = gMessageStringTable.getString("ConfirmEnableSimulator"); - _PREHASH_LayerType = gMessageStringTable.getString("LayerType"); - _PREHASH_OwnerRole = gMessageStringTable.getString("OwnerRole"); - _PREHASH_ParcelOverlay = gMessageStringTable.getString("ParcelOverlay"); - _PREHASH_GroupOwned = gMessageStringTable.getString("GroupOwned"); - _PREHASH_IP = gMessageStringTable.getString("IP"); - _PREHASH_ChatFromViewer = gMessageStringTable.getString("ChatFromViewer"); - _PREHASH_AvgAgentsInView = gMessageStringTable.getString("AvgAgentsInView"); - _PREHASH_AgentsInView = gMessageStringTable.getString("AgentsInView"); - _PREHASH_GroupTitle = gMessageStringTable.getString("GroupTitle"); - _PREHASH_MapLayerReply = gMessageStringTable.getString("MapLayerReply"); - _PREHASH_CompoundMsgID = gMessageStringTable.getString("CompoundMsgID"); - _PREHASH_CameraConstraint = gMessageStringTable.getString("CameraConstraint"); - _PREHASH_DownloadTotals = gMessageStringTable.getString("DownloadTotals"); - _PREHASH_GenCounter = gMessageStringTable.getString("GenCounter"); - _PREHASH_FrozenData = gMessageStringTable.getString("FrozenData"); - _PREHASH_ChildAgentDying = gMessageStringTable.getString("ChildAgentDying"); - _PREHASH_To = gMessageStringTable.getString("To"); - _PREHASH_CopyInventoryFromNotecard = gMessageStringTable.getString("CopyInventoryFromNotecard"); - _PREHASH_RezObjectFromNotecard = gMessageStringTable.getString("RezObjectFromNotecard"); - _PREHASH_ParcelDirFeeCurrent = gMessageStringTable.getString("ParcelDirFeeCurrent"); - _PREHASH_SeedCapability = gMessageStringTable.getString("SeedCapability"); - _PREHASH_ObjectDuplicate = gMessageStringTable.getString("ObjectDuplicate"); - _PREHASH_InventoryData = gMessageStringTable.getString("InventoryData"); - _PREHASH_ReplyData = gMessageStringTable.getString("ReplyData"); - _PREHASH_ResetList = gMessageStringTable.getString("ResetList"); - _PREHASH_MediaID = gMessageStringTable.getString("MediaID"); - _PREHASH_RelatedRights = gMessageStringTable.getString("RelatedRights"); - _PREHASH_RedirectGridX = gMessageStringTable.getString("RedirectGridX"); - _PREHASH_RedirectGridY = gMessageStringTable.getString("RedirectGridY"); - _PREHASH_TransferID = gMessageStringTable.getString("TransferID"); - _PREHASH_TexturesChanged = gMessageStringTable.getString("TexturesChanged"); - _PREHASH_UserLookAt = gMessageStringTable.getString("UserLookAt"); - _PREHASH_TestBlock1 = gMessageStringTable.getString("TestBlock1"); - _PREHASH_SensedData = gMessageStringTable.getString("SensedData"); - _PREHASH_UpdateBlock = gMessageStringTable.getString("UpdateBlock"); - _PREHASH_ClassifiedGodDelete = gMessageStringTable.getString("ClassifiedGodDelete"); - _PREHASH_ObjectGrabUpdate = gMessageStringTable.getString("ObjectGrabUpdate"); - _PREHASH_LocationPos = gMessageStringTable.getString("LocationPos"); - _PREHASH_TaxDate = gMessageStringTable.getString("TaxDate"); - _PREHASH_StartDateTime = gMessageStringTable.getString("StartDateTime"); - _PREHASH_ObjectUpdateCached = gMessageStringTable.getString("ObjectUpdateCached"); - _PREHASH_Packets = gMessageStringTable.getString("Packets"); - _PREHASH_FailureType = gMessageStringTable.getString("FailureType"); - _PREHASH_UpdateGroupInfo = gMessageStringTable.getString("UpdateGroupInfo"); - _PREHASH_ObjectPermissions = gMessageStringTable.getString("ObjectPermissions"); - _PREHASH_RevokePermissions = gMessageStringTable.getString("RevokePermissions"); - _PREHASH_UpdateFlags = gMessageStringTable.getString("UpdateFlags"); - _PREHASH_ObjectExportSelected = gMessageStringTable.getString("ObjectExportSelected"); - _PREHASH_RezSelected = gMessageStringTable.getString("RezSelected"); - _PREHASH_AutoPilot = gMessageStringTable.getString("AutoPilot"); - _PREHASH_UpdateMuteListEntry = gMessageStringTable.getString("UpdateMuteListEntry"); - _PREHASH_RemoveMuteListEntry = gMessageStringTable.getString("RemoveMuteListEntry"); - _PREHASH_SetSimStatusInDatabase = gMessageStringTable.getString("SetSimStatusInDatabase"); - _PREHASH_SetSimPresenceInDatabase = gMessageStringTable.getString("SetSimPresenceInDatabase"); - _PREHASH_CameraProperty = gMessageStringTable.getString("CameraProperty"); - _PREHASH_BrushSize = gMessageStringTable.getString("BrushSize"); - _PREHASH_SimulatorSetMap = gMessageStringTable.getString("SimulatorSetMap"); - _PREHASH_RegionPresenceRequestByRegionID = gMessageStringTable.getString("RegionPresenceRequestByRegionID"); - _PREHASH_ParcelObjectOwnersReply = gMessageStringTable.getString("ParcelObjectOwnersReply"); - _PREHASH_GroupMembersReply = gMessageStringTable.getString("GroupMembersReply"); - _PREHASH_GroupRoleMembersReply = gMessageStringTable.getString("GroupRoleMembersReply"); - _PREHASH_RequestRegionInfo = gMessageStringTable.getString("RequestRegionInfo"); - _PREHASH_AABBMax = gMessageStringTable.getString("AABBMax"); - _PREHASH_RequestPayPrice = gMessageStringTable.getString("RequestPayPrice"); - _PREHASH_SimulatorPresentAtLocation = gMessageStringTable.getString("SimulatorPresentAtLocation"); - _PREHASH_AgentRequestSit = gMessageStringTable.getString("AgentRequestSit"); - _PREHASH_AABBMin = gMessageStringTable.getString("AABBMin"); - _PREHASH_ClassifiedFlags = gMessageStringTable.getString("ClassifiedFlags"); - _PREHASH_ControlFlags = gMessageStringTable.getString("ControlFlags"); - _PREHASH_TeleportRequest = gMessageStringTable.getString("TeleportRequest"); - _PREHASH_ScriptTeleportRequest = gMessageStringTable.getString("ScriptTeleportRequest"); - _PREHASH_EstateCovenantRequest = gMessageStringTable.getString("EstateCovenantRequest"); - _PREHASH_DateUTC = gMessageStringTable.getString("DateUTC"); - _PREHASH_TaskIDs = gMessageStringTable.getString("TaskIDs"); - _PREHASH_RequestResult = gMessageStringTable.getString("RequestResult"); - _PREHASH_CanAcceptAgents = gMessageStringTable.getString("CanAcceptAgents"); - _PREHASH_ObjectSaleInfo = gMessageStringTable.getString("ObjectSaleInfo"); - _PREHASH_KillChildAgents = gMessageStringTable.getString("KillChildAgents"); - _PREHASH_Balance = gMessageStringTable.getString("Balance"); - _PREHASH_DerezContainer = gMessageStringTable.getString("DerezContainer"); - _PREHASH_ObjectData = gMessageStringTable.getString("ObjectData"); - _PREHASH_CameraAtAxis = gMessageStringTable.getString("CameraAtAxis"); - _PREHASH_InfoBlock = gMessageStringTable.getString("InfoBlock"); - _PREHASH_OwnershipCost = gMessageStringTable.getString("OwnershipCost"); - _PREHASH_AvatarNotesUpdate = gMessageStringTable.getString("AvatarNotesUpdate"); - _PREHASH_PID = gMessageStringTable.getString("PID"); - _PREHASH_DirPopularReply = gMessageStringTable.getString("DirPopularReply"); - _PREHASH_TerrainHeightRange00 = gMessageStringTable.getString("TerrainHeightRange00"); - _PREHASH_SimData = gMessageStringTable.getString("SimData"); - _PREHASH_TerrainHeightRange01 = gMessageStringTable.getString("TerrainHeightRange01"); - _PREHASH_TerrainHeightRange10 = gMessageStringTable.getString("TerrainHeightRange10"); - _PREHASH_TerrainHeightRange11 = gMessageStringTable.getString("TerrainHeightRange11"); - _PREHASH_UpdateInventoryItem = gMessageStringTable.getString("UpdateInventoryItem"); - _PREHASH_UpdateCreateInventoryItem = gMessageStringTable.getString("UpdateCreateInventoryItem"); - _PREHASH_MoveInventoryItem = gMessageStringTable.getString("MoveInventoryItem"); - _PREHASH_CopyInventoryItem = gMessageStringTable.getString("CopyInventoryItem"); - _PREHASH_RemoveInventoryItem = gMessageStringTable.getString("RemoveInventoryItem"); - _PREHASH_CreateInventoryItem = gMessageStringTable.getString("CreateInventoryItem"); - _PREHASH_PathTwistBegin = gMessageStringTable.getString("PathTwistBegin"); - _PREHASH_CRC = gMessageStringTable.getString("CRC"); - _PREHASH_AttachmentPoint = gMessageStringTable.getString("AttachmentPoint"); - _PREHASH_TelehubBlock = gMessageStringTable.getString("TelehubBlock"); - _PREHASH_FOVBlock = gMessageStringTable.getString("FOVBlock"); - _PREHASH_StartLocationData = gMessageStringTable.getString("StartLocationData"); - _PREHASH_PositionData = gMessageStringTable.getString("PositionData"); - _PREHASH_TimeSinceLast = gMessageStringTable.getString("TimeSinceLast"); - _PREHASH_MapImage = gMessageStringTable.getString("MapImage"); - _PREHASH_Objects = gMessageStringTable.getString("Objects"); - _PREHASH_URL = gMessageStringTable.getString("URL"); - _PREHASH_CreationDate = gMessageStringTable.getString("CreationDate"); - _PREHASH_JointPivot = gMessageStringTable.getString("JointPivot"); - _PREHASH_FPS = gMessageStringTable.getString("FPS"); - _PREHASH_HasTelehub = gMessageStringTable.getString("HasTelehub"); - _PREHASH_PathEnd = gMessageStringTable.getString("PathEnd"); - _PREHASH_ScriptDataReply = gMessageStringTable.getString("ScriptDataReply"); - _PREHASH_MapBlockReply = gMessageStringTable.getString("MapBlockReply"); - _PREHASH_PropertiesData = gMessageStringTable.getString("PropertiesData"); - _PREHASH_ViewerEffect = gMessageStringTable.getString("ViewerEffect"); - _PREHASH_FreezeUser = gMessageStringTable.getString("FreezeUser"); - _PREHASH_OwnerPrims = gMessageStringTable.getString("OwnerPrims"); - _PREHASH_ObjectGrab = gMessageStringTable.getString("ObjectGrab"); - _PREHASH_ToAgentID = gMessageStringTable.getString("ToAgentID"); - _PREHASH_SimulatorMapUpdate = gMessageStringTable.getString("SimulatorMapUpdate"); - _PREHASH_TransferPacket = gMessageStringTable.getString("TransferPacket"); - _PREHASH_ObjectName = gMessageStringTable.getString("ObjectName"); - _PREHASH_GroupPowers = gMessageStringTable.getString("GroupPowers"); - _PREHASH_OriginalName = gMessageStringTable.getString("OriginalName"); - _PREHASH_CompletePingCheck = gMessageStringTable.getString("CompletePingCheck"); - _PREHASH_OnlineStatus = gMessageStringTable.getString("OnlineStatus"); - _PREHASH_ObjectDrop = gMessageStringTable.getString("ObjectDrop"); - _PREHASH_UseBigPackets = gMessageStringTable.getString("UseBigPackets"); - _PREHASH_GroupNoticesListReply = gMessageStringTable.getString("GroupNoticesListReply"); - _PREHASH_ParcelAccessListReply = gMessageStringTable.getString("ParcelAccessListReply"); - _PREHASH_RpcChannelReply = gMessageStringTable.getString("RpcChannelReply"); - _PREHASH_RegionPresenceResponse = gMessageStringTable.getString("RegionPresenceResponse"); - _PREHASH_CharterMember = gMessageStringTable.getString("CharterMember"); - _PREHASH_EdgeData = gMessageStringTable.getString("EdgeData"); - _PREHASH_NameData = gMessageStringTable.getString("NameData"); - _PREHASH_RegionPushOverride = gMessageStringTable.getString("RegionPushOverride"); - _PREHASH_SimName = gMessageStringTable.getString("SimName"); - _PREHASH_UserReport = gMessageStringTable.getString("UserReport"); - _PREHASH_DownloadPriority = gMessageStringTable.getString("DownloadPriority"); - _PREHASH_ToAgentId = gMessageStringTable.getString("ToAgentId"); - _PREHASH_DirPopularQuery = gMessageStringTable.getString("DirPopularQuery"); - _PREHASH_Mag = gMessageStringTable.getString("Mag"); - _PREHASH_ParcelPropertiesRequestByID = gMessageStringTable.getString("ParcelPropertiesRequestByID"); - _PREHASH_ObjectLink = gMessageStringTable.getString("ObjectLink"); - _PREHASH_RpcScriptReplyInbound = gMessageStringTable.getString("RpcScriptReplyInbound"); - _PREHASH_RezData = gMessageStringTable.getString("RezData"); - _PREHASH_RemoveInventoryObjects = gMessageStringTable.getString("RemoveInventoryObjects"); - _PREHASH_GroupProposalBallot = gMessageStringTable.getString("GroupProposalBallot"); - _PREHASH_RPCServerIP = gMessageStringTable.getString("RPCServerIP"); - _PREHASH_Far = gMessageStringTable.getString("Far"); - _PREHASH_GodSessionID = gMessageStringTable.getString("GodSessionID"); - _PREHASH_FLAboutText = gMessageStringTable.getString("FLAboutText"); - _PREHASH_RegionHandshakeReply = gMessageStringTable.getString("RegionHandshakeReply"); - _PREHASH_GroupActiveProposalItemReply = gMessageStringTable.getString("GroupActiveProposalItemReply"); - _PREHASH_MapItemReply = gMessageStringTable.getString("MapItemReply"); - _PREHASH_Seconds = gMessageStringTable.getString("Seconds"); - _PREHASH_UpdateUserInfo = gMessageStringTable.getString("UpdateUserInfo"); - _PREHASH_AggregatePermTexturesOwner = gMessageStringTable.getString("AggregatePermTexturesOwner"); - _PREHASH_Set = gMessageStringTable.getString("Set"); - _PREHASH_NewName = gMessageStringTable.getString("NewName"); - _PREHASH_Key = gMessageStringTable.getString("Key"); - _PREHASH_AgentID = gMessageStringTable.getString("AgentID"); - _PREHASH_EventNotificationRemoveRequest = gMessageStringTable.getString("EventNotificationRemoveRequest"); - _PREHASH_NewFolderID = gMessageStringTable.getString("NewFolderID"); - _PREHASH_Arc = gMessageStringTable.getString("Arc"); - _PREHASH_RegionX = gMessageStringTable.getString("RegionX"); - _PREHASH_RegionY = gMessageStringTable.getString("RegionY"); - _PREHASH_RequestData = gMessageStringTable.getString("RequestData"); - _PREHASH_Msg = gMessageStringTable.getString("Msg"); - _PREHASH_Top = gMessageStringTable.getString("Top"); - _PREHASH_MiscStats = gMessageStringTable.getString("MiscStats"); - _PREHASH_ImageID = gMessageStringTable.getString("ImageID"); - _PREHASH_DataPacket = gMessageStringTable.getString("DataPacket"); - _PREHASH_You = gMessageStringTable.getString("You"); - _PREHASH_ScriptControlChange = gMessageStringTable.getString("ScriptControlChange"); - _PREHASH_LoadURL = gMessageStringTable.getString("LoadURL"); - _PREHASH_SetCPURatio = gMessageStringTable.getString("SetCPURatio"); - _PREHASH_NameValueData = gMessageStringTable.getString("NameValueData"); - _PREHASH_AtomicPassObject = gMessageStringTable.getString("AtomicPassObject"); - _PREHASH_ErrorMessage = gMessageStringTable.getString("ErrorMessage"); - _PREHASH_ViewerFrozenMessage = gMessageStringTable.getString("ViewerFrozenMessage"); - _PREHASH_HealthMessage = gMessageStringTable.getString("HealthMessage"); - _PREHASH_LogTextMessage = gMessageStringTable.getString("LogTextMessage"); - _PREHASH_TimeDilation = gMessageStringTable.getString("TimeDilation"); - _PREHASH_RemoveContribution = gMessageStringTable.getString("RemoveContribution"); - _PREHASH_Contribution = gMessageStringTable.getString("Contribution"); - _PREHASH_SetGroupContribution = gMessageStringTable.getString("SetGroupContribution"); - _PREHASH_Offline = gMessageStringTable.getString("Offline"); - _PREHASH_AgentIsNowWearing = gMessageStringTable.getString("AgentIsNowWearing"); - _PREHASH_Members = gMessageStringTable.getString("Members"); - _PREHASH_FailedResends = gMessageStringTable.getString("FailedResends"); - _PREHASH_SecPerDay = gMessageStringTable.getString("SecPerDay"); - _PREHASH_CameraCenter = gMessageStringTable.getString("CameraCenter"); - _PREHASH_CameraLeftAxis = gMessageStringTable.getString("CameraLeftAxis"); - _PREHASH_ExBlock = gMessageStringTable.getString("ExBlock"); - _PREHASH_Channel = gMessageStringTable.getString("Channel"); - _PREHASH_NetTest = gMessageStringTable.getString("NetTest"); - _PREHASH_DiscardLevel = gMessageStringTable.getString("DiscardLevel"); - _PREHASH_LayerID = gMessageStringTable.getString("LayerID"); - _PREHASH_GrabOffset = gMessageStringTable.getString("GrabOffset"); - _PREHASH_SimPort = gMessageStringTable.getString("SimPort"); - _PREHASH_PricePerMeter = gMessageStringTable.getString("PricePerMeter"); - _PREHASH_RegionFlags = gMessageStringTable.getString("RegionFlags"); - _PREHASH_VoteResult = gMessageStringTable.getString("VoteResult"); - _PREHASH_ParcelDirFeeEstimate = gMessageStringTable.getString("ParcelDirFeeEstimate"); - _PREHASH_ModifyBlock = gMessageStringTable.getString("ModifyBlock"); - _PREHASH_InventoryBlock = gMessageStringTable.getString("InventoryBlock"); - _PREHASH_ReplyBlock = gMessageStringTable.getString("ReplyBlock"); - _PREHASH_ValidUntil = gMessageStringTable.getString("ValidUntil"); - _PREHASH_VelocityInterpolateOn = gMessageStringTable.getString("VelocityInterpolateOn"); - _PREHASH_ClassifiedDelete = gMessageStringTable.getString("ClassifiedDelete"); - _PREHASH_RegionDenyAnonymous = gMessageStringTable.getString("RegionDenyAnonymous"); - _PREHASH_FLImageID = gMessageStringTable.getString("FLImageID"); - _PREHASH_AllowPublish = gMessageStringTable.getString("AllowPublish"); - _PREHASH_SitName = gMessageStringTable.getString("SitName"); - _PREHASH_RegionsVisited = gMessageStringTable.getString("RegionsVisited"); - _PREHASH_DirClassifiedReply = gMessageStringTable.getString("DirClassifiedReply"); - _PREHASH_AvatarClassifiedReply = gMessageStringTable.getString("AvatarClassifiedReply"); - _PREHASH_MediaURL = gMessageStringTable.getString("MediaURL"); - _PREHASH_CompleteAgentMovement = gMessageStringTable.getString("CompleteAgentMovement"); - _PREHASH_ClassifiedID = gMessageStringTable.getString("ClassifiedID"); - _PREHASH_LocalID = gMessageStringTable.getString("LocalID"); - _PREHASH_SpaceIP = gMessageStringTable.getString("SpaceIP"); - _PREHASH_RemoveItem = gMessageStringTable.getString("RemoveItem"); - _PREHASH_LogFailedMoneyTransaction = gMessageStringTable.getString("LogFailedMoneyTransaction"); - _PREHASH_ViewerStartAuction = gMessageStringTable.getString("ViewerStartAuction"); - _PREHASH_StartAuction = gMessageStringTable.getString("StartAuction"); - _PREHASH_DuplicateFlags = gMessageStringTable.getString("DuplicateFlags"); - _PREHASH_RegionInfo2 = gMessageStringTable.getString("RegionInfo2"); - _PREHASH_TextColor = gMessageStringTable.getString("TextColor"); - _PREHASH_SlaveID = gMessageStringTable.getString("SlaveID"); - _PREHASH_Charter = gMessageStringTable.getString("Charter"); - _PREHASH_AlertData = gMessageStringTable.getString("AlertData"); - _PREHASH_TargetBlock = gMessageStringTable.getString("TargetBlock"); - _PREHASH_CheckParcelAuctions = gMessageStringTable.getString("CheckParcelAuctions"); - _PREHASH_ParcelAuctions = gMessageStringTable.getString("ParcelAuctions"); - _PREHASH_OwnerIsGroup = gMessageStringTable.getString("OwnerIsGroup"); - _PREHASH_NameValuePair = gMessageStringTable.getString("NameValuePair"); - _PREHASH_RemoveNameValuePair = gMessageStringTable.getString("RemoveNameValuePair"); - _PREHASH_BulkUpdateInventory = gMessageStringTable.getString("BulkUpdateInventory"); - _PREHASH_UpdateTaskInventory = gMessageStringTable.getString("UpdateTaskInventory"); - _PREHASH_RemoveTaskInventory = gMessageStringTable.getString("RemoveTaskInventory"); - _PREHASH_MoveTaskInventory = gMessageStringTable.getString("MoveTaskInventory"); - _PREHASH_RequestTaskInventory = gMessageStringTable.getString("RequestTaskInventory"); - _PREHASH_ReplyTaskInventory = gMessageStringTable.getString("ReplyTaskInventory"); - _PREHASH_AggregatePermInventory = gMessageStringTable.getString("AggregatePermInventory"); - _PREHASH_GroupAccountTransactionsReply = gMessageStringTable.getString("GroupAccountTransactionsReply"); - _PREHASH_SimulatorInfo = gMessageStringTable.getString("SimulatorInfo"); - _PREHASH_WearableData = gMessageStringTable.getString("WearableData"); - _PREHASH_Enabled = gMessageStringTable.getString("Enabled"); - _PREHASH_Savings = gMessageStringTable.getString("Savings"); - _PREHASH_SimulatorLoad = gMessageStringTable.getString("SimulatorLoad"); - _PREHASH_InternalRegionIP = gMessageStringTable.getString("InternalRegionIP"); - _PREHASH_ExternalRegionIP = gMessageStringTable.getString("ExternalRegionIP"); - _PREHASH_TotalPairs = gMessageStringTable.getString("TotalPairs"); - _PREHASH_CreateGroupRequest = gMessageStringTable.getString("CreateGroupRequest"); - _PREHASH_JoinGroupRequest = gMessageStringTable.getString("JoinGroupRequest"); - _PREHASH_LeaveGroupRequest = gMessageStringTable.getString("LeaveGroupRequest"); - _PREHASH_InviteGroupRequest = gMessageStringTable.getString("InviteGroupRequest"); - _PREHASH_LiveHelpGroupRequest = gMessageStringTable.getString("LiveHelpGroupRequest"); - _PREHASH_PriceParcelClaimFactor = gMessageStringTable.getString("PriceParcelClaimFactor"); - _PREHASH_BillableArea = gMessageStringTable.getString("BillableArea"); - _PREHASH_ObjectID = gMessageStringTable.getString("ObjectID"); - _PREHASH_ObjectFlagUpdate = gMessageStringTable.getString("ObjectFlagUpdate"); - _PREHASH_GroupRoleUpdate = gMessageStringTable.getString("GroupRoleUpdate"); - _PREHASH_RequestInventoryAsset = gMessageStringTable.getString("RequestInventoryAsset"); - _PREHASH_ChangedGrid = gMessageStringTable.getString("ChangedGrid"); - _PREHASH_AgentDropGroup = gMessageStringTable.getString("AgentDropGroup"); - _PREHASH_Details = gMessageStringTable.getString("Details"); - _PREHASH_LocationX = gMessageStringTable.getString("LocationX"); - _PREHASH_SaleType = gMessageStringTable.getString("SaleType"); - _PREHASH_LocationY = gMessageStringTable.getString("LocationY"); - _PREHASH_LocationZ = gMessageStringTable.getString("LocationZ"); - _PREHASH_EconomyData = gMessageStringTable.getString("EconomyData"); - _PREHASH_HeadRotation = gMessageStringTable.getString("HeadRotation"); - _PREHASH_DeleteOnCompletion = gMessageStringTable.getString("DeleteOnCompletion"); - _PREHASH_PublicPort = gMessageStringTable.getString("PublicPort"); - _PREHASH_DirClassifiedQuery = gMessageStringTable.getString("DirClassifiedQuery"); - _PREHASH_CallbackID = gMessageStringTable.getString("CallbackID"); - _PREHASH_RequestParcelTransfer = gMessageStringTable.getString("RequestParcelTransfer"); - _PREHASH_RoleCount = gMessageStringTable.getString("RoleCount"); - _PREHASH_ObjectCapacity = gMessageStringTable.getString("ObjectCapacity"); - _PREHASH_RequestID = gMessageStringTable.getString("RequestID"); - _PREHASH_RequestXfer = gMessageStringTable.getString("RequestXfer"); - _PREHASH_ObjectTaxCurrent = gMessageStringTable.getString("ObjectTaxCurrent"); - _PREHASH_LightTaxCurrent = gMessageStringTable.getString("LightTaxCurrent"); - _PREHASH_LandTaxCurrent = gMessageStringTable.getString("LandTaxCurrent"); - _PREHASH_GroupTaxCurrent = gMessageStringTable.getString("GroupTaxCurrent"); - _PREHASH_FetchInventoryDescendents = gMessageStringTable.getString("FetchInventoryDescendents"); - _PREHASH_InventoryDescendents = gMessageStringTable.getString("InventoryDescendents"); - _PREHASH_Descendents = gMessageStringTable.getString("Descendents"); - _PREHASH_PurgeInventoryDescendents = gMessageStringTable.getString("PurgeInventoryDescendents"); - _PREHASH_ShowDir = gMessageStringTable.getString("ShowDir"); - _PREHASH_IsOwner = gMessageStringTable.getString("IsOwner"); - _PREHASH_Timestamp = gMessageStringTable.getString("Timestamp"); - _PREHASH_GlobalPos = gMessageStringTable.getString("GlobalPos"); - _PREHASH_GrabOffsetInitial = gMessageStringTable.getString("GrabOffsetInitial"); - _PREHASH_IsTrial = gMessageStringTable.getString("IsTrial"); - _PREHASH_ObjectDuplicateOnRay = gMessageStringTable.getString("ObjectDuplicateOnRay"); - _PREHASH_GroupMembershipCount = gMessageStringTable.getString("GroupMembershipCount"); - _PREHASH_MethodData = gMessageStringTable.getString("MethodData"); - _PREHASH_ActivateGestures = gMessageStringTable.getString("ActivateGestures"); - _PREHASH_DeactivateGestures = gMessageStringTable.getString("DeactivateGestures"); - _PREHASH_ProposalData = gMessageStringTable.getString("ProposalData"); - _PREHASH_PosGlobal = gMessageStringTable.getString("PosGlobal"); - _PREHASH_SearchID = gMessageStringTable.getString("SearchID"); - _PREHASH_RezMultipleAttachmentsFromInv = gMessageStringTable.getString("RezMultipleAttachmentsFromInv"); - _PREHASH_SearchName = gMessageStringTable.getString("SearchName"); - _PREHASH_VersionString = gMessageStringTable.getString("VersionString"); - _PREHASH_CreateGroupReply = gMessageStringTable.getString("CreateGroupReply"); - _PREHASH_LeaveGroupReply = gMessageStringTable.getString("LeaveGroupReply"); - _PREHASH_ActualArea = gMessageStringTable.getString("ActualArea"); - _PREHASH_Message = gMessageStringTable.getString("Message"); - _PREHASH_ClickAction = gMessageStringTable.getString("ClickAction"); - _PREHASH_AssetUploadComplete = gMessageStringTable.getString("AssetUploadComplete"); - _PREHASH_RequestType = gMessageStringTable.getString("RequestType"); - _PREHASH_UUID = gMessageStringTable.getString("UUID"); - _PREHASH_BaseMask = gMessageStringTable.getString("BaseMask"); - _PREHASH_NetBlock = gMessageStringTable.getString("NetBlock"); - _PREHASH_GlobalX = gMessageStringTable.getString("GlobalX"); - _PREHASH_GlobalY = gMessageStringTable.getString("GlobalY"); - _PREHASH_CopyRotates = gMessageStringTable.getString("CopyRotates"); - _PREHASH_KickUserAck = gMessageStringTable.getString("KickUserAck"); - _PREHASH_TopPick = gMessageStringTable.getString("TopPick"); - _PREHASH_SessionID = gMessageStringTable.getString("SessionID"); - _PREHASH_GlobalZ = gMessageStringTable.getString("GlobalZ"); - _PREHASH_DeclineFriendship = gMessageStringTable.getString("DeclineFriendship"); - _PREHASH_FormFriendship = gMessageStringTable.getString("FormFriendship"); - _PREHASH_TerminateFriendship = gMessageStringTable.getString("TerminateFriendship"); - _PREHASH_TaskData = gMessageStringTable.getString("TaskData"); - _PREHASH_SimWideMaxPrims = gMessageStringTable.getString("SimWideMaxPrims"); - _PREHASH_TotalPrims = gMessageStringTable.getString("TotalPrims"); - _PREHASH_ProfileBegin = gMessageStringTable.getString("ProfileBegin"); - _PREHASH_Request = gMessageStringTable.getString("Request"); - _PREHASH_GroupAccountDetailsRequest = gMessageStringTable.getString("GroupAccountDetailsRequest"); - _PREHASH_GroupActiveProposalsRequest = gMessageStringTable.getString("GroupActiveProposalsRequest"); - _PREHASH_StringValue = gMessageStringTable.getString("StringValue"); - _PREHASH_Version = gMessageStringTable.getString("Version"); - _PREHASH_OtherCount = gMessageStringTable.getString("OtherCount"); - _PREHASH_MemberCount = gMessageStringTable.getString("MemberCount"); - _PREHASH_ChatData = gMessageStringTable.getString("ChatData"); - _PREHASH_IsGroupOwned = gMessageStringTable.getString("IsGroupOwned"); - _PREHASH_EnergyEfficiency = gMessageStringTable.getString("EnergyEfficiency"); - _PREHASH_PickInfoUpdate = gMessageStringTable.getString("PickInfoUpdate"); - _PREHASH_PickDelete = gMessageStringTable.getString("PickDelete"); - _PREHASH_ScriptReset = gMessageStringTable.getString("ScriptReset"); - _PREHASH_Requester = gMessageStringTable.getString("Requester"); - _PREHASH_ForSale = gMessageStringTable.getString("ForSale"); - _PREHASH_NearestLandingRegionReply = gMessageStringTable.getString("NearestLandingRegionReply"); - _PREHASH_ParcelID = gMessageStringTable.getString("ParcelID"); - _PREHASH_Godlike = gMessageStringTable.getString("Godlike"); - _PREHASH_TotalDebits = gMessageStringTable.getString("TotalDebits"); - _PREHASH_Direction = gMessageStringTable.getString("Direction"); - _PREHASH_HealthData = gMessageStringTable.getString("HealthData"); - _PREHASH_LeftAxis = gMessageStringTable.getString("LeftAxis"); - _PREHASH_LocationBlock = gMessageStringTable.getString("LocationBlock"); - _PREHASH_ObjectImage = gMessageStringTable.getString("ObjectImage"); - _PREHASH_TerrainStartHeight00 = gMessageStringTable.getString("TerrainStartHeight00"); - _PREHASH_TerrainStartHeight01 = gMessageStringTable.getString("TerrainStartHeight01"); - _PREHASH_TerrainStartHeight10 = gMessageStringTable.getString("TerrainStartHeight10"); - _PREHASH_TerrainStartHeight11 = gMessageStringTable.getString("TerrainStartHeight11"); - _PREHASH_WaterHeight = gMessageStringTable.getString("WaterHeight"); - _PREHASH_FetchInventoryReply = gMessageStringTable.getString("FetchInventoryReply"); - _PREHASH_GroupAccountSummaryReply = gMessageStringTable.getString("GroupAccountSummaryReply"); - _PREHASH_AttachedSound = gMessageStringTable.getString("AttachedSound"); - _PREHASH_ParamInUse = gMessageStringTable.getString("ParamInUse"); - _PREHASH_GodKickUser = gMessageStringTable.getString("GodKickUser"); - _PREHASH_PickName = gMessageStringTable.getString("PickName"); - _PREHASH_TaskName = gMessageStringTable.getString("TaskName"); - _PREHASH_ObjectCount = gMessageStringTable.getString("ObjectCount"); - _PREHASH_RegionPresenceRequestByHandle = gMessageStringTable.getString("RegionPresenceRequestByHandle"); - _PREHASH_RezSingleAttachmentFromInv = gMessageStringTable.getString("RezSingleAttachmentFromInv"); - _PREHASH_ChildAgentUpdate = gMessageStringTable.getString("ChildAgentUpdate"); - _PREHASH_IsOwnerGroup = gMessageStringTable.getString("IsOwnerGroup"); - _PREHASH_AgentHeightWidth = gMessageStringTable.getString("AgentHeightWidth"); - _PREHASH_VerticalAngle = gMessageStringTable.getString("VerticalAngle"); - _PREHASH_WearableType = gMessageStringTable.getString("WearableType"); - _PREHASH_AggregatePermNextOwner = gMessageStringTable.getString("AggregatePermNextOwner"); - _PREHASH_ShowInList = gMessageStringTable.getString("ShowInList"); - _PREHASH_UpdateParcel = gMessageStringTable.getString("UpdateParcel"); - _PREHASH_SetAlwaysRun = gMessageStringTable.getString("SetAlwaysRun"); - _PREHASH_NVPair = gMessageStringTable.getString("NVPair"); - _PREHASH_SearchType = gMessageStringTable.getString("SearchType"); - _PREHASH_ObjectSpinStart = gMessageStringTable.getString("ObjectSpinStart"); - _PREHASH_UseEstateSun = gMessageStringTable.getString("UseEstateSun"); - _PREHASH_RegionID = gMessageStringTable.getString("RegionID"); - _PREHASH_AbuseRegionID = gMessageStringTable.getString("AbuseRegionID"); - _PREHASH_Creator = gMessageStringTable.getString("Creator"); - _PREHASH_ProposalText = gMessageStringTable.getString("ProposalText"); - _PREHASH_DirEventsReply = gMessageStringTable.getString("DirEventsReply"); - _PREHASH_EventInfoReply = gMessageStringTable.getString("EventInfoReply"); - _PREHASH_UserInfoReply = gMessageStringTable.getString("UserInfoReply"); - _PREHASH_PathRadiusOffset = gMessageStringTable.getString("PathRadiusOffset"); - _PREHASH_TextureData = gMessageStringTable.getString("TextureData"); - _PREHASH_ChatPass = gMessageStringTable.getString("ChatPass"); - _PREHASH_TargetID = gMessageStringTable.getString("TargetID"); - _PREHASH_DefaultPayPrice = gMessageStringTable.getString("DefaultPayPrice"); - _PREHASH_UserLocation = gMessageStringTable.getString("UserLocation"); - _PREHASH_MaxPrims = gMessageStringTable.getString("MaxPrims"); - _PREHASH_LandmarkID = gMessageStringTable.getString("LandmarkID"); - _PREHASH_InitiateDownload = gMessageStringTable.getString("InitiateDownload"); - _PREHASH_Name = gMessageStringTable.getString("Name"); - _PREHASH_OtherCleanTime = gMessageStringTable.getString("OtherCleanTime"); - _PREHASH_ParcelSetOtherCleanTime = gMessageStringTable.getString("ParcelSetOtherCleanTime"); - _PREHASH_TeleportPriceExponent = gMessageStringTable.getString("TeleportPriceExponent"); - _PREHASH_Gain = gMessageStringTable.getString("Gain"); - _PREHASH_PacketAck = gMessageStringTable.getString("PacketAck"); - _PREHASH_PathSkew = gMessageStringTable.getString("PathSkew"); - _PREHASH_SimulatorShutdownRequest = gMessageStringTable.getString("SimulatorShutdownRequest"); - _PREHASH_NearestLandingRegionRequest = gMessageStringTable.getString("NearestLandingRegionRequest"); - _PREHASH_OtherID = gMessageStringTable.getString("OtherID"); - _PREHASH_MemberID = gMessageStringTable.getString("MemberID"); - _PREHASH_MapLayerRequest = gMessageStringTable.getString("MapLayerRequest"); - _PREHASH_ObjectScale = gMessageStringTable.getString("ObjectScale"); - _PREHASH_TargetIP = gMessageStringTable.getString("TargetIP"); - _PREHASH_Redo = gMessageStringTable.getString("Redo"); - _PREHASH_MoneyBalance = gMessageStringTable.getString("MoneyBalance"); - _PREHASH_TrackAgent = gMessageStringTable.getString("TrackAgent"); - _PREHASH_MaxX = gMessageStringTable.getString("MaxX"); - _PREHASH_Data = gMessageStringTable.getString("Data"); - _PREHASH_MaxY = gMessageStringTable.getString("MaxY"); - _PREHASH_TextureAnim = gMessageStringTable.getString("TextureAnim"); - _PREHASH_ReturnIDs = gMessageStringTable.getString("ReturnIDs"); - _PREHASH_Date = gMessageStringTable.getString("Date"); - _PREHASH_AgentWearablesUpdate = gMessageStringTable.getString("AgentWearablesUpdate"); - _PREHASH_AgentDataUpdate = gMessageStringTable.getString("AgentDataUpdate"); - _PREHASH_GroupDataUpdate = gMessageStringTable.getString("GroupDataUpdate"); - _PREHASH_Hash = gMessageStringTable.getString("Hash"); - _PREHASH_AgentGroupDataUpdate = gMessageStringTable.getString("AgentGroupDataUpdate"); - _PREHASH_Left = gMessageStringTable.getString("Left"); - _PREHASH_Mask = gMessageStringTable.getString("Mask"); - _PREHASH_ForceMouselook = gMessageStringTable.getString("ForceMouselook"); - _PREHASH_Success = gMessageStringTable.getString("Success"); - _PREHASH_ObjectGroup = gMessageStringTable.getString("ObjectGroup"); - _PREHASH_SunHour = gMessageStringTable.getString("SunHour"); - _PREHASH_MinX = gMessageStringTable.getString("MinX"); - _PREHASH_ScriptSensorReply = gMessageStringTable.getString("ScriptSensorReply"); - _PREHASH_MinY = gMessageStringTable.getString("MinY"); - _PREHASH_Command = gMessageStringTable.getString("Command"); - _PREHASH_Desc = gMessageStringTable.getString("Desc"); - _PREHASH_AttachmentNeedsSave = gMessageStringTable.getString("AttachmentNeedsSave"); - _PREHASH_HistoryItemData = gMessageStringTable.getString("HistoryItemData"); - _PREHASH_AgentCachedTexture = gMessageStringTable.getString("AgentCachedTexture"); - _PREHASH_Subject = gMessageStringTable.getString("Subject"); - _PREHASH_East = gMessageStringTable.getString("East"); - _PREHASH_QueryReplies = gMessageStringTable.getString("QueryReplies"); - _PREHASH_ObjectCategory = gMessageStringTable.getString("ObjectCategory"); - _PREHASH_Time = gMessageStringTable.getString("Time"); - _PREHASH_CreateLandmarkForEvent = gMessageStringTable.getString("CreateLandmarkForEvent"); - _PREHASH_ParentID = gMessageStringTable.getString("ParentID"); - _PREHASH_Ping = gMessageStringTable.getString("Ping"); - _PREHASH_Perp = gMessageStringTable.getString("Perp"); - _PREHASH_Code = gMessageStringTable.getString("Code"); - _PREHASH_InvType = gMessageStringTable.getString("InvType"); - _PREHASH_AgentFOV = gMessageStringTable.getString("AgentFOV"); - _PREHASH_Audible = gMessageStringTable.getString("Audible"); - _PREHASH_AuctionData = gMessageStringTable.getString("AuctionData"); - _PREHASH_IDBlock = gMessageStringTable.getString("IDBlock"); - _PREHASH_West = gMessageStringTable.getString("West"); - _PREHASH_Undo = gMessageStringTable.getString("Undo"); - _PREHASH_TotalNumItems = gMessageStringTable.getString("TotalNumItems"); - _PREHASH_Info = gMessageStringTable.getString("Info"); - _PREHASH_Area = gMessageStringTable.getString("Area"); - _PREHASH_SimCrashed = gMessageStringTable.getString("SimCrashed"); - _PREHASH_Text = gMessageStringTable.getString("Text"); - _PREHASH_PriceGroupCreate = gMessageStringTable.getString("PriceGroupCreate"); - _PREHASH_ObjectShape = gMessageStringTable.getString("ObjectShape"); - _PREHASH_GroupRoleDataReply = gMessageStringTable.getString("GroupRoleDataReply"); - _PREHASH_MuteCRC = gMessageStringTable.getString("MuteCRC"); - _PREHASH_Size = gMessageStringTable.getString("Size"); - _PREHASH_FromAddress = gMessageStringTable.getString("FromAddress"); - _PREHASH_Body = gMessageStringTable.getString("Body"); - _PREHASH_FileData = gMessageStringTable.getString("FileData"); - _PREHASH_List = gMessageStringTable.getString("List"); - _PREHASH_KickUser = gMessageStringTable.getString("KickUser"); - _PREHASH_OtherPrims = gMessageStringTable.getString("OtherPrims"); - _PREHASH_RunTime = gMessageStringTable.getString("RunTime"); - _PREHASH_GrantUserRights = gMessageStringTable.getString("GrantUserRights"); - _PREHASH_RpcScriptRequestInboundForward = gMessageStringTable.getString("RpcScriptRequestInboundForward"); - _PREHASH_More = gMessageStringTable.getString("More"); - _PREHASH_Majority = gMessageStringTable.getString("Majority"); - _PREHASH_MetersTraveled = gMessageStringTable.getString("MetersTraveled"); - _PREHASH_Stat = gMessageStringTable.getString("Stat"); - _PREHASH_SoundID = gMessageStringTable.getString("SoundID"); - _PREHASH_Item = gMessageStringTable.getString("Item"); - _PREHASH_User = gMessageStringTable.getString("User"); - _PREHASH_Prey = gMessageStringTable.getString("Prey"); - _PREHASH_RayStart = gMessageStringTable.getString("RayStart"); - _PREHASH_UsecSinceStart = gMessageStringTable.getString("UsecSinceStart"); - _PREHASH_ParcelData = gMessageStringTable.getString("ParcelData"); - _PREHASH_CameraUpAxis = gMessageStringTable.getString("CameraUpAxis"); - _PREHASH_ScriptDialog = gMessageStringTable.getString("ScriptDialog"); - _PREHASH_MasterParcelData = gMessageStringTable.getString("MasterParcelData"); - _PREHASH_Invalid = gMessageStringTable.getString("Invalid"); - _PREHASH_ProfileCurve = gMessageStringTable.getString("ProfileCurve"); - _PREHASH_ParcelAccessListUpdate = gMessageStringTable.getString("ParcelAccessListUpdate"); - _PREHASH_MuteListUpdate = gMessageStringTable.getString("MuteListUpdate"); - _PREHASH_SendPacket = gMessageStringTable.getString("SendPacket"); - _PREHASH_SendXferPacket = gMessageStringTable.getString("SendXferPacket"); - _PREHASH_RegionDenyIdentified = gMessageStringTable.getString("RegionDenyIdentified"); - _PREHASH_NotecardItemID = gMessageStringTable.getString("NotecardItemID"); - _PREHASH_LastName = gMessageStringTable.getString("LastName"); - _PREHASH_From = gMessageStringTable.getString("From"); - _PREHASH_RoleChange = gMessageStringTable.getString("RoleChange"); - _PREHASH_Port = gMessageStringTable.getString("Port"); - _PREHASH_MemberTitle = gMessageStringTable.getString("MemberTitle"); - _PREHASH_LogParcelChanges = gMessageStringTable.getString("LogParcelChanges"); - _PREHASH_AgentCachedTextureResponse = gMessageStringTable.getString("AgentCachedTextureResponse"); - _PREHASH_DeRezObject = gMessageStringTable.getString("DeRezObject"); - _PREHASH_IsTemporary = gMessageStringTable.getString("IsTemporary"); - _PREHASH_InsigniaID = gMessageStringTable.getString("InsigniaID"); - _PREHASH_CheckFlags = gMessageStringTable.getString("CheckFlags"); - _PREHASH_EventID = gMessageStringTable.getString("EventID"); - _PREHASH_Selected = gMessageStringTable.getString("Selected"); - _PREHASH_FromAgentId = gMessageStringTable.getString("FromAgentId"); - _PREHASH_Type = gMessageStringTable.getString("Type"); - _PREHASH_ChatType = gMessageStringTable.getString("ChatType"); - _PREHASH_ReportData = gMessageStringTable.getString("ReportData"); - _PREHASH_RequestBlock = gMessageStringTable.getString("RequestBlock"); - _PREHASH_GrantData = gMessageStringTable.getString("GrantData"); - _PREHASH_DetachAttachmentIntoInv = gMessageStringTable.getString("DetachAttachmentIntoInv"); - _PREHASH_ParcelDisableObjects = gMessageStringTable.getString("ParcelDisableObjects"); - _PREHASH_Sections = gMessageStringTable.getString("Sections"); - _PREHASH_GodLevel = gMessageStringTable.getString("GodLevel"); - _PREHASH_PayPriceReply = gMessageStringTable.getString("PayPriceReply"); - _PREHASH_QueryID = gMessageStringTable.getString("QueryID"); - _PREHASH_CameraEyeOffset = gMessageStringTable.getString("CameraEyeOffset"); - _PREHASH_AgentPosition = gMessageStringTable.getString("AgentPosition"); - _PREHASH_GrabPosition = gMessageStringTable.getString("GrabPosition"); - _PREHASH_OnlineNotification = gMessageStringTable.getString("OnlineNotification"); - _PREHASH_OfflineNotification = gMessageStringTable.getString("OfflineNotification"); - _PREHASH_SendPostcard = gMessageStringTable.getString("SendPostcard"); - _PREHASH_RequestFlags = gMessageStringTable.getString("RequestFlags"); - _PREHASH_GroupAccountSummaryRequest = gMessageStringTable.getString("GroupAccountSummaryRequest"); - _PREHASH_GroupVoteHistoryRequest = gMessageStringTable.getString("GroupVoteHistoryRequest"); - _PREHASH_ParamValue = gMessageStringTable.getString("ParamValue"); - _PREHASH_MaxAgents = gMessageStringTable.getString("MaxAgents"); - _PREHASH_CreateNewOutfitAttachments = gMessageStringTable.getString("CreateNewOutfitAttachments"); - _PREHASH_RegionHandle = gMessageStringTable.getString("RegionHandle"); - _PREHASH_TeleportProgress = gMessageStringTable.getString("TeleportProgress"); - _PREHASH_AgentQuitCopy = gMessageStringTable.getString("AgentQuitCopy"); - _PREHASH_AvatarInterestsUpdate = gMessageStringTable.getString("AvatarInterestsUpdate"); - _PREHASH_GroupNoticeID = gMessageStringTable.getString("GroupNoticeID"); - _PREHASH_ParcelName = gMessageStringTable.getString("ParcelName"); - _PREHASH_PriceObjectRent = gMessageStringTable.getString("PriceObjectRent"); - _PREHASH_OfferCallingCard = gMessageStringTable.getString("OfferCallingCard"); - _PREHASH_AcceptCallingCard = gMessageStringTable.getString("AcceptCallingCard"); - _PREHASH_DeclineCallingCard = gMessageStringTable.getString("DeclineCallingCard"); - _PREHASH_AgentAccess = gMessageStringTable.getString("AgentAccess"); - _PREHASH_DataHomeLocationReply = gMessageStringTable.getString("DataHomeLocationReply"); - _PREHASH_EventLocationReply = gMessageStringTable.getString("EventLocationReply"); - _PREHASH_TerseDateID = gMessageStringTable.getString("TerseDateID"); - _PREHASH_ObjectOwner = gMessageStringTable.getString("ObjectOwner"); - _PREHASH_AssetID = gMessageStringTable.getString("AssetID"); - _PREHASH_AlertMessage = gMessageStringTable.getString("AlertMessage"); - _PREHASH_AgentAlertMessage = gMessageStringTable.getString("AgentAlertMessage"); - _PREHASH_EstateOwnerMessage = gMessageStringTable.getString("EstateOwnerMessage"); - _PREHASH_ParcelMediaCommandMessage = gMessageStringTable.getString("ParcelMediaCommandMessage"); - _PREHASH_Auction = gMessageStringTable.getString("Auction"); - _PREHASH_Category = gMessageStringTable.getString("Category"); - _PREHASH_FilePath = gMessageStringTable.getString("FilePath"); - _PREHASH_ItemFlags = gMessageStringTable.getString("ItemFlags"); - _PREHASH_Invoice = gMessageStringTable.getString("Invoice"); - _PREHASH_IntervalDays = gMessageStringTable.getString("IntervalDays"); - _PREHASH_PathScaleX = gMessageStringTable.getString("PathScaleX"); - _PREHASH_FromTaskID = gMessageStringTable.getString("FromTaskID"); - _PREHASH_PathScaleY = gMessageStringTable.getString("PathScaleY"); - _PREHASH_TimeInfo = gMessageStringTable.getString("TimeInfo"); - _PREHASH_PublicCount = gMessageStringTable.getString("PublicCount"); - _PREHASH_ParcelJoin = gMessageStringTable.getString("ParcelJoin"); - _PREHASH_GroupRolesCount = gMessageStringTable.getString("GroupRolesCount"); - _PREHASH_SimulatorBlock = gMessageStringTable.getString("SimulatorBlock"); - _PREHASH_GroupID = gMessageStringTable.getString("GroupID"); - _PREHASH_AgentVel = gMessageStringTable.getString("AgentVel"); - _PREHASH_RequestImage = gMessageStringTable.getString("RequestImage"); - _PREHASH_NetStats = gMessageStringTable.getString("NetStats"); - _PREHASH_AgentPos = gMessageStringTable.getString("AgentPos"); - _PREHASH_AgentSit = gMessageStringTable.getString("AgentSit"); - _PREHASH_Material = gMessageStringTable.getString("Material"); - _PREHASH_ObjectDeGrab = gMessageStringTable.getString("ObjectDeGrab"); - _PREHASH_VelocityInterpolateOff = gMessageStringTable.getString("VelocityInterpolateOff"); - _PREHASH_AuthorizedBuyerID = gMessageStringTable.getString("AuthorizedBuyerID"); - _PREHASH_AvatarPropertiesReply = gMessageStringTable.getString("AvatarPropertiesReply"); - _PREHASH_GroupProfileReply = gMessageStringTable.getString("GroupProfileReply"); - _PREHASH_SimOwner = gMessageStringTable.getString("SimOwner"); - _PREHASH_SalePrice = gMessageStringTable.getString("SalePrice"); - _PREHASH_Animation = gMessageStringTable.getString("Animation"); - _PREHASH_OwnerID = gMessageStringTable.getString("OwnerID"); - _PREHASH_NearestLandingRegionUpdated = gMessageStringTable.getString("NearestLandingRegionUpdated"); - _PREHASH_PassToAgent = gMessageStringTable.getString("PassToAgent"); - _PREHASH_PreyAgent = gMessageStringTable.getString("PreyAgent"); - _PREHASH_SimStats = gMessageStringTable.getString("SimStats"); - _PREHASH_LogoutReply = gMessageStringTable.getString("LogoutReply"); - _PREHASH_FeatureDisabled = gMessageStringTable.getString("FeatureDisabled"); - _PREHASH_PhysicalAvatarEventList = gMessageStringTable.getString("PhysicalAvatarEventList"); - _PREHASH_ObjectLocalID = gMessageStringTable.getString("ObjectLocalID"); - _PREHASH_Dropped = gMessageStringTable.getString("Dropped"); - _PREHASH_WebProfilesDisabled = gMessageStringTable.getString("WebProfilesDisabled"); - _PREHASH_Destination = gMessageStringTable.getString("Destination"); - _PREHASH_MasterID = gMessageStringTable.getString("MasterID"); - _PREHASH_TransferData = gMessageStringTable.getString("TransferData"); - _PREHASH_WantToMask = gMessageStringTable.getString("WantToMask"); - _PREHASH_ParcelSelectObjects = gMessageStringTable.getString("ParcelSelectObjects"); - _PREHASH_ExtraParams = gMessageStringTable.getString("ExtraParams"); - _PREHASH_CreatorID = gMessageStringTable.getString("CreatorID"); - _PREHASH_Summary = gMessageStringTable.getString("Summary"); - _PREHASH_BuyObjectInventory = gMessageStringTable.getString("BuyObjectInventory"); - _PREHASH_FetchInventory = gMessageStringTable.getString("FetchInventory"); - _PREHASH_InventoryID = gMessageStringTable.getString("InventoryID"); - _PREHASH_PacketNumber = gMessageStringTable.getString("PacketNumber"); - _PREHASH_SetFollowCamProperties = gMessageStringTable.getString("SetFollowCamProperties"); - _PREHASH_ClearFollowCamProperties = gMessageStringTable.getString("ClearFollowCamProperties"); - _PREHASH_SequenceID = gMessageStringTable.getString("SequenceID"); - _PREHASH_DataServerLogout = gMessageStringTable.getString("DataServerLogout"); - _PREHASH_NameValue = gMessageStringTable.getString("NameValue"); - _PREHASH_PathShearX = gMessageStringTable.getString("PathShearX"); - _PREHASH_PathShearY = gMessageStringTable.getString("PathShearY"); - _PREHASH_Velocity = gMessageStringTable.getString("Velocity"); - _PREHASH_SecPerYear = gMessageStringTable.getString("SecPerYear"); - _PREHASH_FirstName = gMessageStringTable.getString("FirstName"); - _PREHASH_AttachedSoundGainChange = gMessageStringTable.getString("AttachedSoundGainChange"); - _PREHASH_LocationID = gMessageStringTable.getString("LocationID"); - _PREHASH_Running = gMessageStringTable.getString("Running"); - _PREHASH_AgentThrottle = gMessageStringTable.getString("AgentThrottle"); - _PREHASH_NeighborList = gMessageStringTable.getString("NeighborList"); - _PREHASH_PathTaperX = gMessageStringTable.getString("PathTaperX"); - _PREHASH_PathTaperY = gMessageStringTable.getString("PathTaperY"); - _PREHASH_AgentRelated = gMessageStringTable.getString("AgentRelated"); - _PREHASH_GranterBlock = gMessageStringTable.getString("GranterBlock"); - _PREHASH_UseCachedMuteList = gMessageStringTable.getString("UseCachedMuteList"); - _PREHASH_FailStats = gMessageStringTable.getString("FailStats"); - _PREHASH_Tempfile = gMessageStringTable.getString("Tempfile"); - _PREHASH_BuyerID = gMessageStringTable.getString("BuyerID"); - _PREHASH_DirPeopleReply = gMessageStringTable.getString("DirPeopleReply"); - _PREHASH_TransferInfo = gMessageStringTable.getString("TransferInfo"); - _PREHASH_AvatarPickerRequestBackend = gMessageStringTable.getString("AvatarPickerRequestBackend"); - _PREHASH_AvatarPropertiesRequestBackend = gMessageStringTable.getString("AvatarPropertiesRequestBackend"); - _PREHASH_UpdateData = gMessageStringTable.getString("UpdateData"); - _PREHASH_SimFPS = gMessageStringTable.getString("SimFPS"); - _PREHASH_ReporterID = gMessageStringTable.getString("ReporterID"); - _PREHASH_ButtonLabel = gMessageStringTable.getString("ButtonLabel"); - _PREHASH_GranterID = gMessageStringTable.getString("GranterID"); - _PREHASH_WantToText = gMessageStringTable.getString("WantToText"); - _PREHASH_ReportType = gMessageStringTable.getString("ReportType"); - _PREHASH_SimulatorReady = gMessageStringTable.getString("SimulatorReady"); - _PREHASH_DataBlock = gMessageStringTable.getString("DataBlock"); - _PREHASH_AnimationSourceList = gMessageStringTable.getString("AnimationSourceList"); - _PREHASH_SubscribeLoad = gMessageStringTable.getString("SubscribeLoad"); - _PREHASH_UnsubscribeLoad = gMessageStringTable.getString("UnsubscribeLoad"); - _PREHASH_Packet = gMessageStringTable.getString("Packet"); - _PREHASH_UndoLand = gMessageStringTable.getString("UndoLand"); - _PREHASH_SimAccess = gMessageStringTable.getString("SimAccess"); - _PREHASH_AbuserID = gMessageStringTable.getString("AbuserID"); - _PREHASH_MembershipFee = gMessageStringTable.getString("MembershipFee"); - _PREHASH_InviteGroupResponse = gMessageStringTable.getString("InviteGroupResponse"); - _PREHASH_CreateInventoryFolder = gMessageStringTable.getString("CreateInventoryFolder"); - _PREHASH_UpdateInventoryFolder = gMessageStringTable.getString("UpdateInventoryFolder"); - _PREHASH_MoveInventoryFolder = gMessageStringTable.getString("MoveInventoryFolder"); - _PREHASH_RemoveInventoryFolder = gMessageStringTable.getString("RemoveInventoryFolder"); - _PREHASH_MoneyData = gMessageStringTable.getString("MoneyData"); - _PREHASH_ObjectDeselect = gMessageStringTable.getString("ObjectDeselect"); - _PREHASH_NewAssetID = gMessageStringTable.getString("NewAssetID"); - _PREHASH_ObjectAdd = gMessageStringTable.getString("ObjectAdd"); - _PREHASH_RayEndIsIntersection = gMessageStringTable.getString("RayEndIsIntersection"); - _PREHASH_CompleteAuction = gMessageStringTable.getString("CompleteAuction"); - _PREHASH_CircuitCode = gMessageStringTable.getString("CircuitCode"); - _PREHASH_AgentMovementComplete = gMessageStringTable.getString("AgentMovementComplete"); - _PREHASH_ViewerIP = gMessageStringTable.getString("ViewerIP"); - _PREHASH_Header = gMessageStringTable.getString("Header"); - _PREHASH_GestureFlags = gMessageStringTable.getString("GestureFlags"); - _PREHASH_XferID = gMessageStringTable.getString("XferID"); - _PREHASH_StatValue = gMessageStringTable.getString("StatValue"); - _PREHASH_TaskID = gMessageStringTable.getString("TaskID"); - _PREHASH_PickID = gMessageStringTable.getString("PickID"); - _PREHASH_RayEnd = gMessageStringTable.getString("RayEnd"); - _PREHASH_Throttles = gMessageStringTable.getString("Throttles"); - _PREHASH_RebakeAvatarTextures = gMessageStringTable.getString("RebakeAvatarTextures"); - _PREHASH_UpAxis = gMessageStringTable.getString("UpAxis"); - _PREHASH_AgentTextures = gMessageStringTable.getString("AgentTextures"); - _PREHASH_NotecardData = gMessageStringTable.getString("NotecardData"); - _PREHASH_Radius = gMessageStringTable.getString("Radius"); - _PREHASH_OffCircuit = gMessageStringTable.getString("OffCircuit"); - _PREHASH_Access = gMessageStringTable.getString("Access"); - _PREHASH_TitleRoleID = gMessageStringTable.getString("TitleRoleID"); - _PREHASH_SquareMetersCredit = gMessageStringTable.getString("SquareMetersCredit"); - _PREHASH_Filename = gMessageStringTable.getString("Filename"); - _PREHASH_ClassifiedInfoRequest = gMessageStringTable.getString("ClassifiedInfoRequest"); - _PREHASH_ParcelInfoRequest = gMessageStringTable.getString("ParcelInfoRequest"); - _PREHASH_ParcelObjectOwnersRequest = gMessageStringTable.getString("ParcelObjectOwnersRequest"); - _PREHASH_TeleportLandmarkRequest = gMessageStringTable.getString("TeleportLandmarkRequest"); - _PREHASH_EventInfoRequest = gMessageStringTable.getString("EventInfoRequest"); - _PREHASH_MoneyBalanceRequest = gMessageStringTable.getString("MoneyBalanceRequest"); - _PREHASH_GroupMembersRequest = gMessageStringTable.getString("GroupMembersRequest"); - _PREHASH_GroupRoleMembersRequest = gMessageStringTable.getString("GroupRoleMembersRequest"); - _PREHASH_ChatFromSimulator = gMessageStringTable.getString("ChatFromSimulator"); - _PREHASH_OldFolderID = gMessageStringTable.getString("OldFolderID"); - _PREHASH_UserInfoRequest = gMessageStringTable.getString("UserInfoRequest"); - _PREHASH_TextureID = gMessageStringTable.getString("TextureID"); - _PREHASH_ProfileURL = gMessageStringTable.getString("ProfileURL"); - _PREHASH_Handle = gMessageStringTable.getString("Handle"); - _PREHASH_ButtonIndex = gMessageStringTable.getString("ButtonIndex"); - _PREHASH_GetScriptRunning = gMessageStringTable.getString("GetScriptRunning"); - _PREHASH_SetScriptRunning = gMessageStringTable.getString("SetScriptRunning"); - _PREHASH_Health = gMessageStringTable.getString("Health"); - _PREHASH_CircuitInfo = gMessageStringTable.getString("CircuitInfo"); - _PREHASH_ObjectBuy = gMessageStringTable.getString("ObjectBuy"); - _PREHASH_ProfileEnd = gMessageStringTable.getString("ProfileEnd"); - _PREHASH_Effect = gMessageStringTable.getString("Effect"); - _PREHASH_TestMessage = gMessageStringTable.getString("TestMessage"); - _PREHASH_ScriptMailRegistration = gMessageStringTable.getString("ScriptMailRegistration"); - _PREHASH_AgentSetAppearance = gMessageStringTable.getString("AgentSetAppearance"); - _PREHASH_AvatarAppearance = gMessageStringTable.getString("AvatarAppearance"); - _PREHASH_RegionData = gMessageStringTable.getString("RegionData"); - _PREHASH_RequestingRegionData = gMessageStringTable.getString("RequestingRegionData"); - _PREHASH_LandingRegionData = gMessageStringTable.getString("LandingRegionData"); - _PREHASH_SitTransform = gMessageStringTable.getString("SitTransform"); - _PREHASH_TerrainBase0 = gMessageStringTable.getString("TerrainBase0"); - _PREHASH_SkillsMask = gMessageStringTable.getString("SkillsMask"); - _PREHASH_AtAxis = gMessageStringTable.getString("AtAxis"); - _PREHASH_TerrainBase1 = gMessageStringTable.getString("TerrainBase1"); - _PREHASH_Reason = gMessageStringTable.getString("Reason"); - _PREHASH_TerrainBase2 = gMessageStringTable.getString("TerrainBase2"); - _PREHASH_TerrainBase3 = gMessageStringTable.getString("TerrainBase3"); - _PREHASH_Params = gMessageStringTable.getString("Params"); - _PREHASH_PingID = gMessageStringTable.getString("PingID"); - _PREHASH_Change = gMessageStringTable.getString("Change"); - _PREHASH_Height = gMessageStringTable.getString("Height"); - _PREHASH_Region = gMessageStringTable.getString("Region"); - _PREHASH_TelehubInfo = gMessageStringTable.getString("TelehubInfo"); - _PREHASH_StateSave = gMessageStringTable.getString("StateSave"); - _PREHASH_RoleData = gMessageStringTable.getString("RoleData"); - _PREHASH_AgentAnimation = gMessageStringTable.getString("AgentAnimation"); - _PREHASH_AvatarAnimation = gMessageStringTable.getString("AvatarAnimation"); - _PREHASH_LogDwellTime = gMessageStringTable.getString("LogDwellTime"); - _PREHASH_ParcelGodMarkAsContent = gMessageStringTable.getString("ParcelGodMarkAsContent"); - _PREHASH_UsePhysics = gMessageStringTable.getString("UsePhysics"); - _PREHASH_RegionDenyTransacted = gMessageStringTable.getString("RegionDenyTransacted"); - _PREHASH_JointType = gMessageStringTable.getString("JointType"); - _PREHASH_ObjectTaxEstimate = gMessageStringTable.getString("ObjectTaxEstimate"); - _PREHASH_LightTaxEstimate = gMessageStringTable.getString("LightTaxEstimate"); - _PREHASH_LandTaxEstimate = gMessageStringTable.getString("LandTaxEstimate"); - _PREHASH_TeleportLandingStatusChanged = gMessageStringTable.getString("TeleportLandingStatusChanged"); - _PREHASH_GroupTaxEstimate = gMessageStringTable.getString("GroupTaxEstimate"); - _PREHASH_AvgViewerFPS = gMessageStringTable.getString("AvgViewerFPS"); - _PREHASH_Buttons = gMessageStringTable.getString("Buttons"); - _PREHASH_Sender = gMessageStringTable.getString("Sender"); - _PREHASH_Dialog = gMessageStringTable.getString("Dialog"); - _PREHASH_TargetData = gMessageStringTable.getString("TargetData"); - _PREHASH_DestID = gMessageStringTable.getString("DestID"); - _PREHASH_PricePublicObjectDelete = gMessageStringTable.getString("PricePublicObjectDelete"); - _PREHASH_ObjectDelete = gMessageStringTable.getString("ObjectDelete"); - _PREHASH_Delete = gMessageStringTable.getString("Delete"); - _PREHASH_EventGodDelete = gMessageStringTable.getString("EventGodDelete"); - _PREHASH_LastTaxDate = gMessageStringTable.getString("LastTaxDate"); - _PREHASH_MapImageID = gMessageStringTable.getString("MapImageID"); - _PREHASH_EndDateTime = gMessageStringTable.getString("EndDateTime"); - _PREHASH_TerrainDetail0 = gMessageStringTable.getString("TerrainDetail0"); - _PREHASH_TerrainDetail1 = gMessageStringTable.getString("TerrainDetail1"); - _PREHASH_TerrainDetail2 = gMessageStringTable.getString("TerrainDetail2"); - _PREHASH_TerrainDetail3 = gMessageStringTable.getString("TerrainDetail3"); - _PREHASH_Offset = gMessageStringTable.getString("Offset"); - _PREHASH_ObjectDelink = gMessageStringTable.getString("ObjectDelink"); - _PREHASH_TargetObject = gMessageStringTable.getString("TargetObject"); - _PREHASH_IsEstateManager = gMessageStringTable.getString("IsEstateManager"); - _PREHASH_CancelAuction = gMessageStringTable.getString("CancelAuction"); - _PREHASH_ObjectDetach = gMessageStringTable.getString("ObjectDetach"); - _PREHASH_Compressed = gMessageStringTable.getString("Compressed"); - _PREHASH_PathBegin = gMessageStringTable.getString("PathBegin"); - _PREHASH_BypassRaycast = gMessageStringTable.getString("BypassRaycast"); - _PREHASH_WinnerID = gMessageStringTable.getString("WinnerID"); - _PREHASH_ChannelType = gMessageStringTable.getString("ChannelType"); - _PREHASH_NonExemptMembers = gMessageStringTable.getString("NonExemptMembers"); - _PREHASH_Agents = gMessageStringTable.getString("Agents"); - _PREHASH_MemberData = gMessageStringTable.getString("MemberData"); - _PREHASH_ToGroupID = gMessageStringTable.getString("ToGroupID"); - _PREHASH_ImageNotInDatabase = gMessageStringTable.getString("ImageNotInDatabase"); - _PREHASH_StartDate = gMessageStringTable.getString("StartDate"); - _PREHASH_AnimID = gMessageStringTable.getString("AnimID"); - _PREHASH_Serial = gMessageStringTable.getString("Serial"); - _PREHASH_AbuseRegionName = gMessageStringTable.getString("AbuseRegionName"); - _PREHASH_ModifyLand = gMessageStringTable.getString("ModifyLand"); - _PREHASH_Digest = gMessageStringTable.getString("Digest"); - _PREHASH_Victim = gMessageStringTable.getString("Victim"); - _PREHASH_Script = gMessageStringTable.getString("Script"); - _PREHASH_PickInfoReply = gMessageStringTable.getString("PickInfoReply"); - _PREHASH_MoneyBalanceReply = gMessageStringTable.getString("MoneyBalanceReply"); - _PREHASH_RoutedMoneyBalanceReply = gMessageStringTable.getString("RoutedMoneyBalanceReply"); - _PREHASH_RoleID = gMessageStringTable.getString("RoleID"); - _PREHASH_RegionInfo = gMessageStringTable.getString("RegionInfo"); - _PREHASH_GodUpdateRegionInfo = gMessageStringTable.getString("GodUpdateRegionInfo"); - _PREHASH_StartAnim = gMessageStringTable.getString("StartAnim"); - _PREHASH_Action = gMessageStringTable.getString("Action"); - _PREHASH_Location = gMessageStringTable.getString("Location"); - _PREHASH_Rights = gMessageStringTable.getString("Rights"); - _PREHASH_SearchDir = gMessageStringTable.getString("SearchDir"); - _PREHASH_TransferRequest = gMessageStringTable.getString("TransferRequest"); - _PREHASH_ScriptSensorRequest = gMessageStringTable.getString("ScriptSensorRequest"); - _PREHASH_MoneyTransferRequest = gMessageStringTable.getString("MoneyTransferRequest"); - _PREHASH_EjectGroupMemberRequest = gMessageStringTable.getString("EjectGroupMemberRequest"); - _PREHASH_SkillsText = gMessageStringTable.getString("SkillsText"); - _PREHASH_Resent = gMessageStringTable.getString("Resent"); - _PREHASH_Center = gMessageStringTable.getString("Center"); - _PREHASH_SharedData = gMessageStringTable.getString("SharedData"); - _PREHASH_PSBlock = gMessageStringTable.getString("PSBlock"); - _PREHASH_UUIDNameBlock = gMessageStringTable.getString("UUIDNameBlock"); - _PREHASH_GroupTitleUpdate = gMessageStringTable.getString("GroupTitleUpdate"); - _PREHASH_Method = gMessageStringTable.getString("Method"); - _PREHASH_TouchName = gMessageStringTable.getString("TouchName"); - _PREHASH_UpdateType = gMessageStringTable.getString("UpdateType"); - _PREHASH_KickedFromEstateID = gMessageStringTable.getString("KickedFromEstateID"); - _PREHASH_CandidateID = gMessageStringTable.getString("CandidateID"); - _PREHASH_ParamData = gMessageStringTable.getString("ParamData"); - _PREHASH_GodlikeMessage = gMessageStringTable.getString("GodlikeMessage"); - _PREHASH_SystemMessage = gMessageStringTable.getString("SystemMessage"); - _PREHASH_BodyRotation = gMessageStringTable.getString("BodyRotation"); - _PREHASH_SearchRegions = gMessageStringTable.getString("SearchRegions"); - _PREHASH_AnimationData = gMessageStringTable.getString("AnimationData"); - _PREHASH_StatID = gMessageStringTable.getString("StatID"); - _PREHASH_ItemID = gMessageStringTable.getString("ItemID"); - _PREHASH_ScriptDialogReply = gMessageStringTable.getString("ScriptDialogReply"); - _PREHASH_RegionIDAndHandleReply = gMessageStringTable.getString("RegionIDAndHandleReply"); - _PREHASH_CameraAtOffset = gMessageStringTable.getString("CameraAtOffset"); - _PREHASH_VoteID = gMessageStringTable.getString("VoteID"); - _PREHASH_ParcelGodForceOwner = gMessageStringTable.getString("ParcelGodForceOwner"); - _PREHASH_Filter = gMessageStringTable.getString("Filter"); - _PREHASH_InviteData = gMessageStringTable.getString("InviteData"); - _PREHASH_PCode = gMessageStringTable.getString("PCode"); - _PREHASH_SearchPos = gMessageStringTable.getString("SearchPos"); - _PREHASH_PreyID = gMessageStringTable.getString("PreyID"); - _PREHASH_TerrainLowerLimit = gMessageStringTable.getString("TerrainLowerLimit"); - _PREHASH_EventFlags = gMessageStringTable.getString("EventFlags"); - _PREHASH_TallyVotes = gMessageStringTable.getString("TallyVotes"); - _PREHASH_Result = gMessageStringTable.getString("Result"); - _PREHASH_LookAt = gMessageStringTable.getString("LookAt"); - _PREHASH_SearchOrder = gMessageStringTable.getString("SearchOrder"); - _PREHASH_PayButton = gMessageStringTable.getString("PayButton"); - _PREHASH_SelfCount = gMessageStringTable.getString("SelfCount"); - _PREHASH_PacketCount = gMessageStringTable.getString("PacketCount"); - _PREHASH_ParcelBuyPass = gMessageStringTable.getString("ParcelBuyPass"); - _PREHASH_OldItemID = gMessageStringTable.getString("OldItemID"); - _PREHASH_RegionPort = gMessageStringTable.getString("RegionPort"); - _PREHASH_PriceEnergyUnit = gMessageStringTable.getString("PriceEnergyUnit"); - _PREHASH_Bitmap = gMessageStringTable.getString("Bitmap"); - _PREHASH_CacheMissType = gMessageStringTable.getString("CacheMissType"); - _PREHASH_VFileID = gMessageStringTable.getString("VFileID"); - _PREHASH_GroupInsigniaID = gMessageStringTable.getString("GroupInsigniaID"); - _PREHASH_Online = gMessageStringTable.getString("Online"); - _PREHASH_KickFlags = gMessageStringTable.getString("KickFlags"); - _PREHASH_CovenantID = gMessageStringTable.getString("CovenantID"); - _PREHASH_SysCPU = gMessageStringTable.getString("SysCPU"); - _PREHASH_EMail = gMessageStringTable.getString("EMail"); - _PREHASH_AggregatePermTextures = gMessageStringTable.getString("AggregatePermTextures"); - _PREHASH_ChatChannel = gMessageStringTable.getString("ChatChannel"); - _PREHASH_ReturnID = gMessageStringTable.getString("ReturnID"); - _PREHASH_ObjectAttach = gMessageStringTable.getString("ObjectAttach"); - _PREHASH_TargetPort = gMessageStringTable.getString("TargetPort"); - _PREHASH_ObjectSpinStop = gMessageStringTable.getString("ObjectSpinStop"); - _PREHASH_FullID = gMessageStringTable.getString("FullID"); - _PREHASH_ActivateGroup = gMessageStringTable.getString("ActivateGroup"); - _PREHASH_SysGPU = gMessageStringTable.getString("SysGPU"); - _PREHASH_AvatarInterestsReply = gMessageStringTable.getString("AvatarInterestsReply"); - _PREHASH_StartLure = gMessageStringTable.getString("StartLure"); - _PREHASH_SysRAM = gMessageStringTable.getString("SysRAM"); - _PREHASH_ObjectPosition = gMessageStringTable.getString("ObjectPosition"); - _PREHASH_SitPosition = gMessageStringTable.getString("SitPosition"); - _PREHASH_StartTime = gMessageStringTable.getString("StartTime"); - _PREHASH_BornOn = gMessageStringTable.getString("BornOn"); - _PREHASH_CameraCollidePlane = gMessageStringTable.getString("CameraCollidePlane"); - _PREHASH_EconomyDataRequest = gMessageStringTable.getString("EconomyDataRequest"); - _PREHASH_TeleportLureRequest = gMessageStringTable.getString("TeleportLureRequest"); - _PREHASH_FolderID = gMessageStringTable.getString("FolderID"); - _PREHASH_RegionHandleRequest = gMessageStringTable.getString("RegionHandleRequest"); - _PREHASH_ScriptDataRequest = gMessageStringTable.getString("ScriptDataRequest"); - _PREHASH_GroupRoleDataRequest = gMessageStringTable.getString("GroupRoleDataRequest"); - _PREHASH_GroupTitlesRequest = gMessageStringTable.getString("GroupTitlesRequest"); - _PREHASH_AgentWearablesRequest = gMessageStringTable.getString("AgentWearablesRequest"); - _PREHASH_MapBlockRequest = gMessageStringTable.getString("MapBlockRequest"); - _PREHASH_LureID = gMessageStringTable.getString("LureID"); - _PREHASH_CopyCenters = gMessageStringTable.getString("CopyCenters"); - _PREHASH_ParamList = gMessageStringTable.getString("ParamList"); - _PREHASH_InventorySerial = gMessageStringTable.getString("InventorySerial"); - _PREHASH_EdgeDataPacket = gMessageStringTable.getString("EdgeDataPacket"); - _PREHASH_AvatarPickerReply = gMessageStringTable.getString("AvatarPickerReply"); - _PREHASH_ParcelDwellReply = gMessageStringTable.getString("ParcelDwellReply"); - _PREHASH_IsForSale = gMessageStringTable.getString("IsForSale"); - _PREHASH_MuteID = gMessageStringTable.getString("MuteID"); - _PREHASH_MeanCollisionAlert = gMessageStringTable.getString("MeanCollisionAlert"); - _PREHASH_CanAcceptTasks = gMessageStringTable.getString("CanAcceptTasks"); - _PREHASH_ItemData = gMessageStringTable.getString("ItemData"); - _PREHASH_AnimationList = gMessageStringTable.getString("AnimationList"); - _PREHASH_Reputation = gMessageStringTable.getString("Reputation"); - _PREHASH_IntValue = gMessageStringTable.getString("IntValue"); - _PREHASH_TargetType = gMessageStringTable.getString("TargetType"); - _PREHASH_Amount = gMessageStringTable.getString("Amount"); - _PREHASH_HasAttachment = gMessageStringTable.getString("HasAttachment"); - _PREHASH_UpdateAttachment = gMessageStringTable.getString("UpdateAttachment"); - _PREHASH_RemoveAttachment = gMessageStringTable.getString("RemoveAttachment"); - _PREHASH_HeightWidthBlock = gMessageStringTable.getString("HeightWidthBlock"); - _PREHASH_RequestObjectPropertiesFamily = gMessageStringTable.getString("RequestObjectPropertiesFamily"); - _PREHASH_ObjectPropertiesFamily = gMessageStringTable.getString("ObjectPropertiesFamily"); - _PREHASH_UserData = gMessageStringTable.getString("UserData"); - _PREHASH_IsReadable = gMessageStringTable.getString("IsReadable"); - _PREHASH_PathCurve = gMessageStringTable.getString("PathCurve"); - _PREHASH_Status = gMessageStringTable.getString("Status"); - _PREHASH_FromGroup = gMessageStringTable.getString("FromGroup"); - _PREHASH_AlreadyVoted = gMessageStringTable.getString("AlreadyVoted"); - _PREHASH_PlacesReply = gMessageStringTable.getString("PlacesReply"); - _PREHASH_DirPlacesReply = gMessageStringTable.getString("DirPlacesReply"); - _PREHASH_ParcelBuy = gMessageStringTable.getString("ParcelBuy"); - _PREHASH_DirFindQueryBackend = gMessageStringTable.getString("DirFindQueryBackend"); - _PREHASH_DirPlacesQueryBackend = gMessageStringTable.getString("DirPlacesQueryBackend"); - _PREHASH_DirClassifiedQueryBackend = gMessageStringTable.getString("DirClassifiedQueryBackend"); - _PREHASH_DirLandQueryBackend = gMessageStringTable.getString("DirLandQueryBackend"); - _PREHASH_DirPopularQueryBackend = gMessageStringTable.getString("DirPopularQueryBackend"); - _PREHASH_HistoryData = gMessageStringTable.getString("HistoryData"); - _PREHASH_SnapshotID = gMessageStringTable.getString("SnapshotID"); - _PREHASH_Aspect = gMessageStringTable.getString("Aspect"); - _PREHASH_ParamSize = gMessageStringTable.getString("ParamSize"); - _PREHASH_VoteCast = gMessageStringTable.getString("VoteCast"); - _PREHASH_CastsShadows = gMessageStringTable.getString("CastsShadows"); - _PREHASH_EveryoneMask = gMessageStringTable.getString("EveryoneMask"); - _PREHASH_ObjectSpinUpdate = gMessageStringTable.getString("ObjectSpinUpdate"); - _PREHASH_MaturePublish = gMessageStringTable.getString("MaturePublish"); - _PREHASH_UseExistingAsset = gMessageStringTable.getString("UseExistingAsset"); - _PREHASH_Powers = gMessageStringTable.getString("Powers"); - _PREHASH_ParcelLocalID = gMessageStringTable.getString("ParcelLocalID"); - _PREHASH_TeleportCancel = gMessageStringTable.getString("TeleportCancel"); - _PREHASH_UnixTime = gMessageStringTable.getString("UnixTime"); - _PREHASH_QueryFlags = gMessageStringTable.getString("QueryFlags"); - _PREHASH_AlwaysRun = gMessageStringTable.getString("AlwaysRun"); - _PREHASH_Bottom = gMessageStringTable.getString("Bottom"); - _PREHASH_ButtonData = gMessageStringTable.getString("ButtonData"); - _PREHASH_SoundData = gMessageStringTable.getString("SoundData"); - _PREHASH_ViewerStats = gMessageStringTable.getString("ViewerStats"); - _PREHASH_RegionHandshake = gMessageStringTable.getString("RegionHandshake"); - _PREHASH_ObjectDescription = gMessageStringTable.getString("ObjectDescription"); - _PREHASH_Description = gMessageStringTable.getString("Description"); - _PREHASH_ParamType = gMessageStringTable.getString("ParamType"); - _PREHASH_UUIDNameReply = gMessageStringTable.getString("UUIDNameReply"); - _PREHASH_UUIDGroupNameReply = gMessageStringTable.getString("UUIDGroupNameReply"); - _PREHASH_SaveAssetIntoInventory = gMessageStringTable.getString("SaveAssetIntoInventory"); - _PREHASH_UserInfo = gMessageStringTable.getString("UserInfo"); - _PREHASH_AnimSequenceID = gMessageStringTable.getString("AnimSequenceID"); - _PREHASH_NVPairs = gMessageStringTable.getString("NVPairs"); - _PREHASH_GroupNoticesListRequest = gMessageStringTable.getString("GroupNoticesListRequest"); - _PREHASH_ParcelAccessListRequest = gMessageStringTable.getString("ParcelAccessListRequest"); - _PREHASH_MuteListRequest = gMessageStringTable.getString("MuteListRequest"); - _PREHASH_RpcChannelRequest = gMessageStringTable.getString("RpcChannelRequest"); - _PREHASH_LandStatRequest = gMessageStringTable.getString("LandStatRequest"); - _PREHASH_PlacesQuery = gMessageStringTable.getString("PlacesQuery"); - _PREHASH_DirPlacesQuery = gMessageStringTable.getString("DirPlacesQuery"); - _PREHASH_SortOrder = gMessageStringTable.getString("SortOrder"); - _PREHASH_Hunter = gMessageStringTable.getString("Hunter"); - _PREHASH_SunAngVelocity = gMessageStringTable.getString("SunAngVelocity"); - _PREHASH_BinaryBucket = gMessageStringTable.getString("BinaryBucket"); - _PREHASH_ImagePacket = gMessageStringTable.getString("ImagePacket"); - _PREHASH_StartGroupProposal = gMessageStringTable.getString("StartGroupProposal"); - _PREHASH_EnergyLevel = gMessageStringTable.getString("EnergyLevel"); - _PREHASH_PriceForListing = gMessageStringTable.getString("PriceForListing"); - _PREHASH_Scale = gMessageStringTable.getString("Scale"); - _PREHASH_EstateCovenantReply = gMessageStringTable.getString("EstateCovenantReply"); - _PREHASH_ParentEstateID = gMessageStringTable.getString("ParentEstateID"); - _PREHASH_Extra2 = gMessageStringTable.getString("Extra2"); - _PREHASH_Throttle = gMessageStringTable.getString("Throttle"); - _PREHASH_SimIP = gMessageStringTable.getString("SimIP"); - _PREHASH_GodID = gMessageStringTable.getString("GodID"); - _PREHASH_TeleportMinPrice = gMessageStringTable.getString("TeleportMinPrice"); - _PREHASH_VoteItem = gMessageStringTable.getString("VoteItem"); - _PREHASH_ObjectRotation = gMessageStringTable.getString("ObjectRotation"); - _PREHASH_SitRotation = gMessageStringTable.getString("SitRotation"); - _PREHASH_SnapSelection = gMessageStringTable.getString("SnapSelection"); - _PREHASH_SoundTrigger = gMessageStringTable.getString("SoundTrigger"); - _PREHASH_TerrainRaiseLimit = gMessageStringTable.getString("TerrainRaiseLimit"); - _PREHASH_Quorum = gMessageStringTable.getString("Quorum"); - _PREHASH_AgentBlock = gMessageStringTable.getString("AgentBlock"); - _PREHASH_CommandBlock = gMessageStringTable.getString("CommandBlock"); - _PREHASH_PricePublicObjectDecay = gMessageStringTable.getString("PricePublicObjectDecay"); - _PREHASH_SpawnPointPos = gMessageStringTable.getString("SpawnPointPos"); - _PREHASH_VolumeDetail = gMessageStringTable.getString("VolumeDetail"); - _PREHASH_FromAgentName = gMessageStringTable.getString("FromAgentName"); - _PREHASH_Range = gMessageStringTable.getString("Range"); - _PREHASH_DirectoryVisibility = gMessageStringTable.getString("DirectoryVisibility"); - _PREHASH_PublicIP = gMessageStringTable.getString("PublicIP"); - _PREHASH_TeleportFailed = gMessageStringTable.getString("TeleportFailed"); - _PREHASH_PreloadSound = gMessageStringTable.getString("PreloadSound"); - _PREHASH_ScreenshotID = gMessageStringTable.getString("ScreenshotID"); - _PREHASH_CovenantTimestamp = gMessageStringTable.getString("CovenantTimestamp"); - _PREHASH_OldestUnacked = gMessageStringTable.getString("OldestUnacked"); - _PREHASH_SimulatorIP = gMessageStringTable.getString("SimulatorIP"); - _PREHASH_Value = gMessageStringTable.getString("Value"); - _PREHASH_JointAxisOrAnchor = gMessageStringTable.getString("JointAxisOrAnchor"); - _PREHASH_Test0 = gMessageStringTable.getString("Test0"); - _PREHASH_Test1 = gMessageStringTable.getString("Test1"); - _PREHASH_Test2 = gMessageStringTable.getString("Test2"); - _PREHASH_SunPhase = gMessageStringTable.getString("SunPhase"); - _PREHASH_ParcelDivide = gMessageStringTable.getString("ParcelDivide"); - _PREHASH_PriceObjectClaim = gMessageStringTable.getString("PriceObjectClaim"); - _PREHASH_Field = gMessageStringTable.getString("Field"); - _PREHASH_Ratio = gMessageStringTable.getString("Ratio"); - _PREHASH_JoinGroupReply = gMessageStringTable.getString("JoinGroupReply"); - _PREHASH_LiveHelpGroupReply = gMessageStringTable.getString("LiveHelpGroupReply"); - _PREHASH_Score = gMessageStringTable.getString("Score"); - _PREHASH_Image = gMessageStringTable.getString("Image"); - _PREHASH_ObjectClickAction = gMessageStringTable.getString("ObjectClickAction"); - _PREHASH_Parameter = gMessageStringTable.getString("Parameter"); - _PREHASH_Flags = gMessageStringTable.getString("Flags"); - _PREHASH_Plane = gMessageStringTable.getString("Plane"); - _PREHASH_Width = gMessageStringTable.getString("Width"); - _PREHASH_Right = gMessageStringTable.getString("Right"); - _PREHASH_DirFindQuery = gMessageStringTable.getString("DirFindQuery"); - _PREHASH_Textures = gMessageStringTable.getString("Textures"); - _PREHASH_EventData = gMessageStringTable.getString("EventData"); - _PREHASH_Final = gMessageStringTable.getString("Final"); - _PREHASH_System = gMessageStringTable.getString("System"); - _PREHASH_TelehubPos = gMessageStringTable.getString("TelehubPos"); - _PREHASH_ReportAutosaveCrash = gMessageStringTable.getString("ReportAutosaveCrash"); - _PREHASH_CreateTrustedCircuit = gMessageStringTable.getString("CreateTrustedCircuit"); - _PREHASH_DenyTrustedCircuit = gMessageStringTable.getString("DenyTrustedCircuit"); - _PREHASH_RequestTrustedCircuit = gMessageStringTable.getString("RequestTrustedCircuit"); - _PREHASH_Codec = gMessageStringTable.getString("Codec"); - _PREHASH_Modal = gMessageStringTable.getString("Modal"); - _PREHASH_ChildAgentUnknown = gMessageStringTable.getString("ChildAgentUnknown"); - _PREHASH_LandingType = gMessageStringTable.getString("LandingType"); - _PREHASH_ScriptRunningReply = gMessageStringTable.getString("ScriptRunningReply"); - _PREHASH_Reply = gMessageStringTable.getString("Reply"); - _PREHASH_GroupAccountDetailsReply = gMessageStringTable.getString("GroupAccountDetailsReply"); - _PREHASH_TelehubRot = gMessageStringTable.getString("TelehubRot"); - _PREHASH_AcceptFriendship = gMessageStringTable.getString("AcceptFriendship"); - _PREHASH_ItemType = gMessageStringTable.getString("ItemType"); - _PREHASH_DwellInfo = gMessageStringTable.getString("DwellInfo"); - _PREHASH_AgentResume = gMessageStringTable.getString("AgentResume"); - _PREHASH_MailFilter = gMessageStringTable.getString("MailFilter"); - _PREHASH_Disconnect = gMessageStringTable.getString("Disconnect"); - _PREHASH_SimPosition = gMessageStringTable.getString("SimPosition"); - _PREHASH_SimWideTotalPrims = gMessageStringTable.getString("SimWideTotalPrims"); - _PREHASH_Index = gMessageStringTable.getString("Index"); - _PREHASH_SimFilename = gMessageStringTable.getString("SimFilename"); - _PREHASH_LastOwnerID = gMessageStringTable.getString("LastOwnerID"); - _PREHASH_GroupNoticeRequest = gMessageStringTable.getString("GroupNoticeRequest"); - _PREHASH_EmailMessageRequest = gMessageStringTable.getString("EmailMessageRequest"); - _PREHASH_MapItemRequest = gMessageStringTable.getString("MapItemRequest"); - _PREHASH_AgentCount = gMessageStringTable.getString("AgentCount"); - _PREHASH_MessageBlock = gMessageStringTable.getString("MessageBlock"); - _PREHASH_FuseBlock = gMessageStringTable.getString("FuseBlock"); - _PREHASH_AgentGroupData = gMessageStringTable.getString("AgentGroupData"); - _PREHASH_ClassifiedInfoUpdate = gMessageStringTable.getString("ClassifiedInfoUpdate"); - _PREHASH_RegionPos = gMessageStringTable.getString("RegionPos"); - _PREHASH_ParcelMediaUpdate = gMessageStringTable.getString("ParcelMediaUpdate"); - _PREHASH_NoticeID = gMessageStringTable.getString("NoticeID"); - _PREHASH_GridX = gMessageStringTable.getString("GridX"); - _PREHASH_GridY = gMessageStringTable.getString("GridY"); - _PREHASH_Title = gMessageStringTable.getString("Title"); - _PREHASH_AuctionID = gMessageStringTable.getString("AuctionID"); - _PREHASH_VoteType = gMessageStringTable.getString("VoteType"); - _PREHASH_CategoryID = gMessageStringTable.getString("CategoryID"); - _PREHASH_Token = gMessageStringTable.getString("Token"); - _PREHASH_AggregatePerms = gMessageStringTable.getString("AggregatePerms"); - _PREHASH_ObjectSelect = gMessageStringTable.getString("ObjectSelect"); - _PREHASH_ForceObjectSelect = gMessageStringTable.getString("ForceObjectSelect"); - _PREHASH_Price = gMessageStringTable.getString("Price"); - _PREHASH_SunDirection = gMessageStringTable.getString("SunDirection"); - _PREHASH_FromName = gMessageStringTable.getString("FromName"); - _PREHASH_ChangeInventoryItemFlags = gMessageStringTable.getString("ChangeInventoryItemFlags"); - _PREHASH_Force = gMessageStringTable.getString("Force"); - _PREHASH_TransactionBlock = gMessageStringTable.getString("TransactionBlock"); - _PREHASH_PowersMask = gMessageStringTable.getString("PowersMask"); - _PREHASH_Stamp = gMessageStringTable.getString("Stamp"); - _PREHASH_TotalCredits = gMessageStringTable.getString("TotalCredits"); - _PREHASH_State = gMessageStringTable.getString("State"); - _PREHASH_TextureIndex = gMessageStringTable.getString("TextureIndex"); - _PREHASH_InviteeID = gMessageStringTable.getString("InviteeID"); - _PREHASH_ParcelReclaim = gMessageStringTable.getString("ParcelReclaim"); - _PREHASH_Money = gMessageStringTable.getString("Money"); - _PREHASH_PathTwist = gMessageStringTable.getString("PathTwist"); - _PREHASH_AuthBuyerID = gMessageStringTable.getString("AuthBuyerID"); - _PREHASH_Color = gMessageStringTable.getString("Color"); - _PREHASH_SourceType = gMessageStringTable.getString("SourceType"); - _PREHASH_World = gMessageStringTable.getString("World"); - _PREHASH_QueryData = gMessageStringTable.getString("QueryData"); - _PREHASH_Users = gMessageStringTable.getString("Users"); - _PREHASH_SysOS = gMessageStringTable.getString("SysOS"); - _PREHASH_Notes = gMessageStringTable.getString("Notes"); - _PREHASH_AvatarID = gMessageStringTable.getString("AvatarID"); - _PREHASH_FounderID = gMessageStringTable.getString("FounderID"); - _PREHASH_EndPointID = gMessageStringTable.getString("EndPointID"); - _PREHASH_LocationLookAt = gMessageStringTable.getString("LocationLookAt"); - _PREHASH_Sound = gMessageStringTable.getString("Sound"); - _PREHASH_Cover = gMessageStringTable.getString("Cover"); - _PREHASH_TotalObjectCount = gMessageStringTable.getString("TotalObjectCount"); - _PREHASH_TextureEntry = gMessageStringTable.getString("TextureEntry"); - _PREHASH_SquareMetersCommitted = gMessageStringTable.getString("SquareMetersCommitted"); - _PREHASH_ChannelID = gMessageStringTable.getString("ChannelID"); - _PREHASH_Dwell = gMessageStringTable.getString("Dwell"); - _PREHASH_North = gMessageStringTable.getString("North"); - _PREHASH_AgentUpdate = gMessageStringTable.getString("AgentUpdate"); - _PREHASH_PickGodDelete = gMessageStringTable.getString("PickGodDelete"); - _PREHASH_HostName = gMessageStringTable.getString("HostName"); - _PREHASH_PriceParcelClaim = gMessageStringTable.getString("PriceParcelClaim"); - _PREHASH_ParcelClaim = gMessageStringTable.getString("ParcelClaim"); - _PREHASH_AgentPowers = gMessageStringTable.getString("AgentPowers"); - _PREHASH_ProfileHollow = gMessageStringTable.getString("ProfileHollow"); - _PREHASH_GroupRoleChanges = gMessageStringTable.getString("GroupRoleChanges"); - _PREHASH_Count = gMessageStringTable.getString("Count"); - _PREHASH_South = gMessageStringTable.getString("South"); - _PREHASH_ObjectUpdateCompressed = gMessageStringTable.getString("ObjectUpdateCompressed"); - _PREHASH_MuteFlags = gMessageStringTable.getString("MuteFlags"); - _PREHASH_Group = gMessageStringTable.getString("Group"); - _PREHASH_AgentPause = gMessageStringTable.getString("AgentPause"); - _PREHASH_LanguagesText = gMessageStringTable.getString("LanguagesText"); - _PREHASH_Error = gMessageStringTable.getString("Error"); - _PREHASH_InternalScriptMail = gMessageStringTable.getString("InternalScriptMail"); - _PREHASH_FindAgent = gMessageStringTable.getString("FindAgent"); - _PREHASH_AgentData = gMessageStringTable.getString("AgentData"); - _PREHASH_FolderData = gMessageStringTable.getString("FolderData"); - _PREHASH_AssetBlock = gMessageStringTable.getString("AssetBlock"); - _PREHASH_AcceptNotices = gMessageStringTable.getString("AcceptNotices"); - _PREHASH_SetGroupAcceptNotices = gMessageStringTable.getString("SetGroupAcceptNotices"); - _PREHASH_CloseCircuit = gMessageStringTable.getString("CloseCircuit"); - _PREHASH_TeleportFinish = gMessageStringTable.getString("TeleportFinish"); - _PREHASH_PathRevolutions = gMessageStringTable.getString("PathRevolutions"); - _PREHASH_ClassifiedInfoReply = gMessageStringTable.getString("ClassifiedInfoReply"); - _PREHASH_ParcelInfoReply = gMessageStringTable.getString("ParcelInfoReply"); - _PREHASH_AutosaveData = gMessageStringTable.getString("AutosaveData"); - _PREHASH_SetStartLocation = gMessageStringTable.getString("SetStartLocation"); - _PREHASH_PassHours = gMessageStringTable.getString("PassHours"); - _PREHASH_AttachmentPt = gMessageStringTable.getString("AttachmentPt"); - _PREHASH_ParcelFlags = gMessageStringTable.getString("ParcelFlags"); - _PREHASH_NumVotes = gMessageStringTable.getString("NumVotes"); - _PREHASH_AvatarPickerRequest = gMessageStringTable.getString("AvatarPickerRequest"); - _PREHASH_TeleportLocationRequest = gMessageStringTable.getString("TeleportLocationRequest"); - _PREHASH_DataHomeLocationRequest = gMessageStringTable.getString("DataHomeLocationRequest"); - _PREHASH_EventNotificationAddRequest = gMessageStringTable.getString("EventNotificationAddRequest"); - _PREHASH_ParcelDwellRequest = gMessageStringTable.getString("ParcelDwellRequest"); - _PREHASH_EventLocationRequest = gMessageStringTable.getString("EventLocationRequest"); - _PREHASH_SetStartLocationRequest = gMessageStringTable.getString("SetStartLocationRequest"); - _PREHASH_QueryStart = gMessageStringTable.getString("QueryStart"); - _PREHASH_EjectData = gMessageStringTable.getString("EjectData"); - _PREHASH_AvatarTextureUpdate = gMessageStringTable.getString("AvatarTextureUpdate"); - _PREHASH_RPCServerPort = gMessageStringTable.getString("RPCServerPort"); - _PREHASH_Bytes = gMessageStringTable.getString("Bytes"); - _PREHASH_Extra = gMessageStringTable.getString("Extra"); - _PREHASH_ForceScriptControlRelease = gMessageStringTable.getString("ForceScriptControlRelease"); - _PREHASH_ParcelRelease = gMessageStringTable.getString("ParcelRelease"); - _PREHASH_VFileType = gMessageStringTable.getString("VFileType"); - _PREHASH_EjectGroupMemberReply = gMessageStringTable.getString("EjectGroupMemberReply"); - _PREHASH_ImageData = gMessageStringTable.getString("ImageData"); - _PREHASH_SimulatorViewerTimeMessage = gMessageStringTable.getString("SimulatorViewerTimeMessage"); - _PREHASH_Rotation = gMessageStringTable.getString("Rotation"); - _PREHASH_Selection = gMessageStringTable.getString("Selection"); - _PREHASH_TransactionData = gMessageStringTable.getString("TransactionData"); - _PREHASH_OperationData = gMessageStringTable.getString("OperationData"); - _PREHASH_ExpirationDate = gMessageStringTable.getString("ExpirationDate"); - _PREHASH_ParcelDeedToGroup = gMessageStringTable.getString("ParcelDeedToGroup"); - _PREHASH_AvatarPicksReply = gMessageStringTable.getString("AvatarPicksReply"); - _PREHASH_GroupTitlesReply = gMessageStringTable.getString("GroupTitlesReply"); - _PREHASH_AgentInfo = gMessageStringTable.getString("AgentInfo"); - _PREHASH_MoneyTransferBackend = gMessageStringTable.getString("MoneyTransferBackend"); - _PREHASH_NextOwnerMask = gMessageStringTable.getString("NextOwnerMask"); - _PREHASH_MuteData = gMessageStringTable.getString("MuteData"); - _PREHASH_PassPrice = gMessageStringTable.getString("PassPrice"); - _PREHASH_SourceID = gMessageStringTable.getString("SourceID"); - _PREHASH_ChangeUserRights = gMessageStringTable.getString("ChangeUserRights"); - _PREHASH_TeleportFlags = gMessageStringTable.getString("TeleportFlags"); - _PREHASH_SlaveParcelData = gMessageStringTable.getString("SlaveParcelData"); - _PREHASH_AssetData = gMessageStringTable.getString("AssetData"); - _PREHASH_MultipleObjectUpdate = gMessageStringTable.getString("MultipleObjectUpdate"); - _PREHASH_ObjectUpdate = gMessageStringTable.getString("ObjectUpdate"); - _PREHASH_ImprovedTerseObjectUpdate = gMessageStringTable.getString("ImprovedTerseObjectUpdate"); - _PREHASH_ConfirmXferPacket = gMessageStringTable.getString("ConfirmXferPacket"); - _PREHASH_StartPingCheck = gMessageStringTable.getString("StartPingCheck"); - _PREHASH_SimWideDeletes = gMessageStringTable.getString("SimWideDeletes"); - _PREHASH_LandStatReply = gMessageStringTable.getString("LandStatReply"); - _PREHASH_IsPhantom = gMessageStringTable.getString("IsPhantom"); - _PREHASH_AgentList = gMessageStringTable.getString("AgentList"); - _PREHASH_SimApproved = gMessageStringTable.getString("SimApproved"); - _PREHASH_RezObject = gMessageStringTable.getString("RezObject"); - _PREHASH_TaskLocalID = gMessageStringTable.getString("TaskLocalID"); - _PREHASH_ClaimDate = gMessageStringTable.getString("ClaimDate"); - _PREHASH_MergeParcel = gMessageStringTable.getString("MergeParcel"); - _PREHASH_Priority = gMessageStringTable.getString("Priority"); - _PREHASH_QueryText = gMessageStringTable.getString("QueryText"); - _PREHASH_GroupNoticeAdd = gMessageStringTable.getString("GroupNoticeAdd"); - _PREHASH_ReturnType = gMessageStringTable.getString("ReturnType"); - _PREHASH_FetchFolders = gMessageStringTable.getString("FetchFolders"); - _PREHASH_SimulatorPublicHostBlock = gMessageStringTable.getString("SimulatorPublicHostBlock"); - _PREHASH_HeaderData = gMessageStringTable.getString("HeaderData"); - _PREHASH_RequestMultipleObjects = gMessageStringTable.getString("RequestMultipleObjects"); - _PREHASH_RetrieveInstantMessages = gMessageStringTable.getString("RetrieveInstantMessages"); - _PREHASH_OpenCircuit = gMessageStringTable.getString("OpenCircuit"); - _PREHASH_CrossedRegion = gMessageStringTable.getString("CrossedRegion"); - _PREHASH_DirGroupsReply = gMessageStringTable.getString("DirGroupsReply"); - _PREHASH_AvatarGroupsReply = gMessageStringTable.getString("AvatarGroupsReply"); - _PREHASH_EmailMessageReply = gMessageStringTable.getString("EmailMessageReply"); - _PREHASH_GroupVoteHistoryItemReply = gMessageStringTable.getString("GroupVoteHistoryItemReply"); - _PREHASH_ViewerPosition = gMessageStringTable.getString("ViewerPosition"); - _PREHASH_Position = gMessageStringTable.getString("Position"); - _PREHASH_ParentEstate = gMessageStringTable.getString("ParentEstate"); - _PREHASH_EstateName = gMessageStringTable.getString("EstateName"); - _PREHASH_MuteName = gMessageStringTable.getString("MuteName"); - _PREHASH_ParcelRename = gMessageStringTable.getString("ParcelRename"); - _PREHASH_ViewerFilename = gMessageStringTable.getString("ViewerFilename"); - _PREHASH_UserReportInternal = gMessageStringTable.getString("UserReportInternal"); - _PREHASH_AvatarPropertiesRequest = gMessageStringTable.getString("AvatarPropertiesRequest"); - _PREHASH_ParcelPropertiesRequest = gMessageStringTable.getString("ParcelPropertiesRequest"); - _PREHASH_GroupProfileRequest = gMessageStringTable.getString("GroupProfileRequest"); - _PREHASH_AgentDataUpdateRequest = gMessageStringTable.getString("AgentDataUpdateRequest"); - _PREHASH_PriceObjectScaleFactor = gMessageStringTable.getString("PriceObjectScaleFactor"); - _PREHASH_OpenEnrollment = gMessageStringTable.getString("OpenEnrollment"); - _PREHASH_GroupData = gMessageStringTable.getString("GroupData"); - _PREHASH_RequestGodlikePowers = gMessageStringTable.getString("RequestGodlikePowers"); - _PREHASH_GrantGodlikePowers = gMessageStringTable.getString("GrantGodlikePowers"); - _PREHASH_TransactionID = gMessageStringTable.getString("TransactionID"); - _PREHASH_DestinationID = gMessageStringTable.getString("DestinationID"); - _PREHASH_Controls = gMessageStringTable.getString("Controls"); - _PREHASH_FirstDetachAll = gMessageStringTable.getString("FirstDetachAll"); - _PREHASH_EstateID = gMessageStringTable.getString("EstateID"); - _PREHASH_ImprovedInstantMessage = gMessageStringTable.getString("ImprovedInstantMessage"); - _PREHASH_CheckParcelSales = gMessageStringTable.getString("CheckParcelSales"); - _PREHASH_ParcelSales = gMessageStringTable.getString("ParcelSales"); - _PREHASH_CurrentInterval = gMessageStringTable.getString("CurrentInterval"); - _PREHASH_PriceRentLight = gMessageStringTable.getString("PriceRentLight"); - _PREHASH_MediaAutoScale = gMessageStringTable.getString("MediaAutoScale"); - _PREHASH_NeighborBlock = gMessageStringTable.getString("NeighborBlock"); - _PREHASH_LayerData = gMessageStringTable.getString("LayerData"); - _PREHASH_NVPairData = gMessageStringTable.getString("NVPairData"); - _PREHASH_TeleportLocal = gMessageStringTable.getString("TeleportLocal"); - _PREHASH_EjecteeID = gMessageStringTable.getString("EjecteeID"); - _PREHASH_VoteInitiator = gMessageStringTable.getString("VoteInitiator"); - _PREHASH_TypeData = gMessageStringTable.getString("TypeData"); - _PREHASH_OwnerIDs = gMessageStringTable.getString("OwnerIDs"); - _PREHASH_SystemKickUser = gMessageStringTable.getString("SystemKickUser"); - _PREHASH_TransactionTime = gMessageStringTable.getString("TransactionTime"); - _PREHASH_TimeToLive = gMessageStringTable.getString("TimeToLive"); - _PREHASH_OldAgentID = gMessageStringTable.getString("OldAgentID"); - _PREHASH_MusicURL = gMessageStringTable.getString("MusicURL"); - _PREHASH_ParcelPrimBonus = gMessageStringTable.getString("ParcelPrimBonus"); - _PREHASH_EjectUser = gMessageStringTable.getString("EjectUser"); - _PREHASH_CoarseLocationUpdate = gMessageStringTable.getString("CoarseLocationUpdate"); - _PREHASH_ChildAgentPositionUpdate = gMessageStringTable.getString("ChildAgentPositionUpdate"); - _PREHASH_StoreLocal = gMessageStringTable.getString("StoreLocal"); - _PREHASH_GroupName = gMessageStringTable.getString("GroupName"); - _PREHASH_PriceParcelRent = gMessageStringTable.getString("PriceParcelRent"); - _PREHASH_SimStatus = gMessageStringTable.getString("SimStatus"); - _PREHASH_TransactionSuccess = gMessageStringTable.getString("TransactionSuccess"); - _PREHASH_LureType = gMessageStringTable.getString("LureType"); - _PREHASH_GroupMask = gMessageStringTable.getString("GroupMask"); - _PREHASH_SitObject = gMessageStringTable.getString("SitObject"); - _PREHASH_Override = gMessageStringTable.getString("Override"); - _PREHASH_LocomotionState = gMessageStringTable.getString("LocomotionState"); - _PREHASH_PriceUpload = gMessageStringTable.getString("PriceUpload"); - _PREHASH_RemoveParcel = gMessageStringTable.getString("RemoveParcel"); - _PREHASH_ConfirmAuctionStart = gMessageStringTable.getString("ConfirmAuctionStart"); - _PREHASH_RpcScriptRequestInbound = gMessageStringTable.getString("RpcScriptRequestInbound"); - _PREHASH_ActiveGroupID = gMessageStringTable.getString("ActiveGroupID"); - _PREHASH_ParcelReturnObjects = gMessageStringTable.getString("ParcelReturnObjects"); - _PREHASH_TotalObjects = gMessageStringTable.getString("TotalObjects"); - _PREHASH_ObjectExtraParams = gMessageStringTable.getString("ObjectExtraParams"); - _PREHASH_Questions = gMessageStringTable.getString("Questions"); - _PREHASH_TransferAbort = gMessageStringTable.getString("TransferAbort"); - _PREHASH_TransferInventory = gMessageStringTable.getString("TransferInventory"); - _PREHASH_RayTargetID = gMessageStringTable.getString("RayTargetID"); - _PREHASH_ClaimPrice = gMessageStringTable.getString("ClaimPrice"); - _PREHASH_ObjectProperties = gMessageStringTable.getString("ObjectProperties"); - _PREHASH_ParcelProperties = gMessageStringTable.getString("ParcelProperties"); - _PREHASH_EstateOwnerID = gMessageStringTable.getString("EstateOwnerID"); - _PREHASH_LogoutRequest = gMessageStringTable.getString("LogoutRequest"); - _PREHASH_AssetUploadRequest = gMessageStringTable.getString("AssetUploadRequest"); - _PREHASH_TransactionType = gMessageStringTable.getString("TransactionType"); - _PREHASH_AvatarPropertiesUpdate = gMessageStringTable.getString("AvatarPropertiesUpdate"); - _PREHASH_ParcelPropertiesUpdate = gMessageStringTable.getString("ParcelPropertiesUpdate"); - _PREHASH_FetchItems = gMessageStringTable.getString("FetchItems"); - _PREHASH_AbortXfer = gMessageStringTable.getString("AbortXfer"); - _PREHASH_DeRezAck = gMessageStringTable.getString("DeRezAck"); - _PREHASH_TakeControls = gMessageStringTable.getString("TakeControls"); - _PREHASH_DirLandReply = gMessageStringTable.getString("DirLandReply"); - _PREHASH_MuteType = gMessageStringTable.getString("MuteType"); - _PREHASH_IMViaEMail = gMessageStringTable.getString("IMViaEMail"); - _PREHASH_RentPrice = gMessageStringTable.getString("RentPrice"); - _PREHASH_GenericMessage = gMessageStringTable.getString("GenericMessage"); - _PREHASH_ChildAgentAlive = gMessageStringTable.getString("ChildAgentAlive"); - _PREHASH_AssetType = gMessageStringTable.getString("AssetType"); - _PREHASH_SpawnPointBlock = gMessageStringTable.getString("SpawnPointBlock"); - _PREHASH_AttachmentBlock = gMessageStringTable.getString("AttachmentBlock"); - _PREHASH_ObjectMaterial = gMessageStringTable.getString("ObjectMaterial"); - _PREHASH_OwnerName = gMessageStringTable.getString("OwnerName"); - _PREHASH_AvatarNotesReply = gMessageStringTable.getString("AvatarNotesReply"); - _PREHASH_CacheID = gMessageStringTable.getString("CacheID"); - _PREHASH_OwnerMask = gMessageStringTable.getString("OwnerMask"); - _PREHASH_TransferInventoryAck = gMessageStringTable.getString("TransferInventoryAck"); - _PREHASH_RegionDenyAgeUnverified = gMessageStringTable.getString("RegionDenyAgeUnverified"); - _PREHASH_AgeVerificationBlock = gMessageStringTable.getString("AgeVerificationBlock"); -} +char* _PREHASH_X = LLMessageStringTable::getInstance()->getString("X"); +char* _PREHASH_Y = LLMessageStringTable::getInstance()->getString("Y"); +char* _PREHASH_Z = LLMessageStringTable::getInstance()->getString("Z"); +char* _PREHASH_AddFlags = LLMessageStringTable::getInstance()->getString("AddFlags"); +char* _PREHASH_FailureInfo = LLMessageStringTable::getInstance()->getString("FailureInfo"); +char* _PREHASH_MapData = LLMessageStringTable::getInstance()->getString("MapData"); +char* _PREHASH_AddItem = LLMessageStringTable::getInstance()->getString("AddItem"); +char* _PREHASH_MeanCollision = LLMessageStringTable::getInstance()->getString("MeanCollision"); +char* _PREHASH_RezScript = LLMessageStringTable::getInstance()->getString("RezScript"); +char* _PREHASH_AvatarSitResponse = LLMessageStringTable::getInstance()->getString("AvatarSitResponse"); +char* _PREHASH_InventoryAssetResponse = LLMessageStringTable::getInstance()->getString("InventoryAssetResponse"); +char* _PREHASH_KillObject = LLMessageStringTable::getInstance()->getString("KillObject"); +char* _PREHASH_ProposalID = LLMessageStringTable::getInstance()->getString("ProposalID"); +char* _PREHASH_SerialNum = LLMessageStringTable::getInstance()->getString("SerialNum"); +char* _PREHASH_Duration = LLMessageStringTable::getInstance()->getString("Duration"); +char* _PREHASH_ScriptQuestion = LLMessageStringTable::getInstance()->getString("ScriptQuestion"); +char* _PREHASH_AddCircuitCode = LLMessageStringTable::getInstance()->getString("AddCircuitCode"); +char* _PREHASH_UseCircuitCode = LLMessageStringTable::getInstance()->getString("UseCircuitCode"); +char* _PREHASH_ViewerCircuitCode = LLMessageStringTable::getInstance()->getString("ViewerCircuitCode"); +char* _PREHASH_ScriptAnswerYes = LLMessageStringTable::getInstance()->getString("ScriptAnswerYes"); +char* _PREHASH_PartnerID = LLMessageStringTable::getInstance()->getString("PartnerID"); +char* _PREHASH_DirLandQuery = LLMessageStringTable::getInstance()->getString("DirLandQuery"); +char* _PREHASH_TeleportStart = LLMessageStringTable::getInstance()->getString("TeleportStart"); +char* _PREHASH_AboutText = LLMessageStringTable::getInstance()->getString("AboutText"); +char* _PREHASH_VisualParam = LLMessageStringTable::getInstance()->getString("VisualParam"); +char* _PREHASH_GroupPrims = LLMessageStringTable::getInstance()->getString("GroupPrims"); +char* _PREHASH_SelectedPrims = LLMessageStringTable::getInstance()->getString("SelectedPrims"); +char* _PREHASH_ID = LLMessageStringTable::getInstance()->getString("ID"); +char* _PREHASH_UUIDNameRequest = LLMessageStringTable::getInstance()->getString("UUIDNameRequest"); +char* _PREHASH_UUIDGroupNameRequest = LLMessageStringTable::getInstance()->getString("UUIDGroupNameRequest"); +char* _PREHASH_GroupAccountTransactionsRequest = LLMessageStringTable::getInstance()->getString("GroupAccountTransactionsRequest"); +char* _PREHASH_MapNameRequest = LLMessageStringTable::getInstance()->getString("MapNameRequest"); +char* _PREHASH_UpdateSimulator = LLMessageStringTable::getInstance()->getString("UpdateSimulator"); +char* _PREHASH_BillableFactor = LLMessageStringTable::getInstance()->getString("BillableFactor"); +char* _PREHASH_ObjectBonusFactor = LLMessageStringTable::getInstance()->getString("ObjectBonusFactor"); +char* _PREHASH_EnableSimulator = LLMessageStringTable::getInstance()->getString("EnableSimulator"); +char* _PREHASH_DisableSimulator = LLMessageStringTable::getInstance()->getString("DisableSimulator"); +char* _PREHASH_ConfirmEnableSimulator = LLMessageStringTable::getInstance()->getString("ConfirmEnableSimulator"); +char* _PREHASH_LayerType = LLMessageStringTable::getInstance()->getString("LayerType"); +char* _PREHASH_OwnerRole = LLMessageStringTable::getInstance()->getString("OwnerRole"); +char* _PREHASH_ParcelOverlay = LLMessageStringTable::getInstance()->getString("ParcelOverlay"); +char* _PREHASH_GroupOwned = LLMessageStringTable::getInstance()->getString("GroupOwned"); +char* _PREHASH_IP = LLMessageStringTable::getInstance()->getString("IP"); +char* _PREHASH_ChatFromViewer = LLMessageStringTable::getInstance()->getString("ChatFromViewer"); +char* _PREHASH_AvgAgentsInView = LLMessageStringTable::getInstance()->getString("AvgAgentsInView"); +char* _PREHASH_AgentsInView = LLMessageStringTable::getInstance()->getString("AgentsInView"); +char* _PREHASH_GroupTitle = LLMessageStringTable::getInstance()->getString("GroupTitle"); +char* _PREHASH_MapLayerReply = LLMessageStringTable::getInstance()->getString("MapLayerReply"); +char* _PREHASH_CompoundMsgID = LLMessageStringTable::getInstance()->getString("CompoundMsgID"); +char* _PREHASH_CameraConstraint = LLMessageStringTable::getInstance()->getString("CameraConstraint"); +char* _PREHASH_DownloadTotals = LLMessageStringTable::getInstance()->getString("DownloadTotals"); +char* _PREHASH_GenCounter = LLMessageStringTable::getInstance()->getString("GenCounter"); +char* _PREHASH_FrozenData = LLMessageStringTable::getInstance()->getString("FrozenData"); +char* _PREHASH_ChildAgentDying = LLMessageStringTable::getInstance()->getString("ChildAgentDying"); +char* _PREHASH_To = LLMessageStringTable::getInstance()->getString("To"); +char* _PREHASH_CopyInventoryFromNotecard = LLMessageStringTable::getInstance()->getString("CopyInventoryFromNotecard"); +char* _PREHASH_RezObjectFromNotecard = LLMessageStringTable::getInstance()->getString("RezObjectFromNotecard"); +char* _PREHASH_ParcelDirFeeCurrent = LLMessageStringTable::getInstance()->getString("ParcelDirFeeCurrent"); +char* _PREHASH_SeedCapability = LLMessageStringTable::getInstance()->getString("SeedCapability"); +char* _PREHASH_ObjectDuplicate = LLMessageStringTable::getInstance()->getString("ObjectDuplicate"); +char* _PREHASH_InventoryData = LLMessageStringTable::getInstance()->getString("InventoryData"); +char* _PREHASH_ReplyData = LLMessageStringTable::getInstance()->getString("ReplyData"); +char* _PREHASH_ResetList = LLMessageStringTable::getInstance()->getString("ResetList"); +char* _PREHASH_MediaID = LLMessageStringTable::getInstance()->getString("MediaID"); +char* _PREHASH_RelatedRights = LLMessageStringTable::getInstance()->getString("RelatedRights"); +char* _PREHASH_RedirectGridX = LLMessageStringTable::getInstance()->getString("RedirectGridX"); +char* _PREHASH_RedirectGridY = LLMessageStringTable::getInstance()->getString("RedirectGridY"); +char* _PREHASH_TransferID = LLMessageStringTable::getInstance()->getString("TransferID"); +char* _PREHASH_TexturesChanged = LLMessageStringTable::getInstance()->getString("TexturesChanged"); +char* _PREHASH_UserLookAt = LLMessageStringTable::getInstance()->getString("UserLookAt"); +char* _PREHASH_TestBlock1 = LLMessageStringTable::getInstance()->getString("TestBlock1"); +char* _PREHASH_SensedData = LLMessageStringTable::getInstance()->getString("SensedData"); +char* _PREHASH_UpdateBlock = LLMessageStringTable::getInstance()->getString("UpdateBlock"); +char* _PREHASH_ClassifiedGodDelete = LLMessageStringTable::getInstance()->getString("ClassifiedGodDelete"); +char* _PREHASH_ObjectGrabUpdate = LLMessageStringTable::getInstance()->getString("ObjectGrabUpdate"); +char* _PREHASH_LocationPos = LLMessageStringTable::getInstance()->getString("LocationPos"); +char* _PREHASH_TaxDate = LLMessageStringTable::getInstance()->getString("TaxDate"); +char* _PREHASH_StartDateTime = LLMessageStringTable::getInstance()->getString("StartDateTime"); +char* _PREHASH_ObjectUpdateCached = LLMessageStringTable::getInstance()->getString("ObjectUpdateCached"); +char* _PREHASH_Packets = LLMessageStringTable::getInstance()->getString("Packets"); +char* _PREHASH_FailureType = LLMessageStringTable::getInstance()->getString("FailureType"); +char* _PREHASH_UpdateGroupInfo = LLMessageStringTable::getInstance()->getString("UpdateGroupInfo"); +char* _PREHASH_ObjectPermissions = LLMessageStringTable::getInstance()->getString("ObjectPermissions"); +char* _PREHASH_RevokePermissions = LLMessageStringTable::getInstance()->getString("RevokePermissions"); +char* _PREHASH_UpdateFlags = LLMessageStringTable::getInstance()->getString("UpdateFlags"); +char* _PREHASH_ObjectExportSelected = LLMessageStringTable::getInstance()->getString("ObjectExportSelected"); +char* _PREHASH_RezSelected = LLMessageStringTable::getInstance()->getString("RezSelected"); +char* _PREHASH_AutoPilot = LLMessageStringTable::getInstance()->getString("AutoPilot"); +char* _PREHASH_UpdateMuteListEntry = LLMessageStringTable::getInstance()->getString("UpdateMuteListEntry"); +char* _PREHASH_RemoveMuteListEntry = LLMessageStringTable::getInstance()->getString("RemoveMuteListEntry"); +char* _PREHASH_SetSimStatusInDatabase = LLMessageStringTable::getInstance()->getString("SetSimStatusInDatabase"); +char* _PREHASH_SetSimPresenceInDatabase = LLMessageStringTable::getInstance()->getString("SetSimPresenceInDatabase"); +char* _PREHASH_CameraProperty = LLMessageStringTable::getInstance()->getString("CameraProperty"); +char* _PREHASH_BrushSize = LLMessageStringTable::getInstance()->getString("BrushSize"); +char* _PREHASH_SimulatorSetMap = LLMessageStringTable::getInstance()->getString("SimulatorSetMap"); +char* _PREHASH_RegionPresenceRequestByRegionID = LLMessageStringTable::getInstance()->getString("RegionPresenceRequestByRegionID"); +char* _PREHASH_ParcelObjectOwnersReply = LLMessageStringTable::getInstance()->getString("ParcelObjectOwnersReply"); +char* _PREHASH_GroupMembersReply = LLMessageStringTable::getInstance()->getString("GroupMembersReply"); +char* _PREHASH_GroupRoleMembersReply = LLMessageStringTable::getInstance()->getString("GroupRoleMembersReply"); +char* _PREHASH_RequestRegionInfo = LLMessageStringTable::getInstance()->getString("RequestRegionInfo"); +char* _PREHASH_AABBMax = LLMessageStringTable::getInstance()->getString("AABBMax"); +char* _PREHASH_RequestPayPrice = LLMessageStringTable::getInstance()->getString("RequestPayPrice"); +char* _PREHASH_SimulatorPresentAtLocation = LLMessageStringTable::getInstance()->getString("SimulatorPresentAtLocation"); +char* _PREHASH_AgentRequestSit = LLMessageStringTable::getInstance()->getString("AgentRequestSit"); +char* _PREHASH_AABBMin = LLMessageStringTable::getInstance()->getString("AABBMin"); +char* _PREHASH_ClassifiedFlags = LLMessageStringTable::getInstance()->getString("ClassifiedFlags"); +char* _PREHASH_ControlFlags = LLMessageStringTable::getInstance()->getString("ControlFlags"); +char* _PREHASH_TeleportRequest = LLMessageStringTable::getInstance()->getString("TeleportRequest"); +char* _PREHASH_ScriptTeleportRequest = LLMessageStringTable::getInstance()->getString("ScriptTeleportRequest"); +char* _PREHASH_EstateCovenantRequest = LLMessageStringTable::getInstance()->getString("EstateCovenantRequest"); +char* _PREHASH_DateUTC = LLMessageStringTable::getInstance()->getString("DateUTC"); +char* _PREHASH_TaskIDs = LLMessageStringTable::getInstance()->getString("TaskIDs"); +char* _PREHASH_RequestResult = LLMessageStringTable::getInstance()->getString("RequestResult"); +char* _PREHASH_CanAcceptAgents = LLMessageStringTable::getInstance()->getString("CanAcceptAgents"); +char* _PREHASH_ObjectSaleInfo = LLMessageStringTable::getInstance()->getString("ObjectSaleInfo"); +char* _PREHASH_KillChildAgents = LLMessageStringTable::getInstance()->getString("KillChildAgents"); +char* _PREHASH_Balance = LLMessageStringTable::getInstance()->getString("Balance"); +char* _PREHASH_DerezContainer = LLMessageStringTable::getInstance()->getString("DerezContainer"); +char* _PREHASH_ObjectData = LLMessageStringTable::getInstance()->getString("ObjectData"); +char* _PREHASH_CameraAtAxis = LLMessageStringTable::getInstance()->getString("CameraAtAxis"); +char* _PREHASH_InfoBlock = LLMessageStringTable::getInstance()->getString("InfoBlock"); +char* _PREHASH_OwnershipCost = LLMessageStringTable::getInstance()->getString("OwnershipCost"); +char* _PREHASH_AvatarNotesUpdate = LLMessageStringTable::getInstance()->getString("AvatarNotesUpdate"); +char* _PREHASH_PID = LLMessageStringTable::getInstance()->getString("PID"); +char* _PREHASH_DirPopularReply = LLMessageStringTable::getInstance()->getString("DirPopularReply"); +char* _PREHASH_TerrainHeightRange00 = LLMessageStringTable::getInstance()->getString("TerrainHeightRange00"); +char* _PREHASH_SimData = LLMessageStringTable::getInstance()->getString("SimData"); +char* _PREHASH_TerrainHeightRange01 = LLMessageStringTable::getInstance()->getString("TerrainHeightRange01"); +char* _PREHASH_TerrainHeightRange10 = LLMessageStringTable::getInstance()->getString("TerrainHeightRange10"); +char* _PREHASH_TerrainHeightRange11 = LLMessageStringTable::getInstance()->getString("TerrainHeightRange11"); +char* _PREHASH_UpdateInventoryItem = LLMessageStringTable::getInstance()->getString("UpdateInventoryItem"); +char* _PREHASH_UpdateCreateInventoryItem = LLMessageStringTable::getInstance()->getString("UpdateCreateInventoryItem"); +char* _PREHASH_MoveInventoryItem = LLMessageStringTable::getInstance()->getString("MoveInventoryItem"); +char* _PREHASH_CopyInventoryItem = LLMessageStringTable::getInstance()->getString("CopyInventoryItem"); +char* _PREHASH_RemoveInventoryItem = LLMessageStringTable::getInstance()->getString("RemoveInventoryItem"); +char* _PREHASH_CreateInventoryItem = LLMessageStringTable::getInstance()->getString("CreateInventoryItem"); +char* _PREHASH_PathTwistBegin = LLMessageStringTable::getInstance()->getString("PathTwistBegin"); +char* _PREHASH_CRC = LLMessageStringTable::getInstance()->getString("CRC"); +char* _PREHASH_AttachmentPoint = LLMessageStringTable::getInstance()->getString("AttachmentPoint"); +char* _PREHASH_TelehubBlock = LLMessageStringTable::getInstance()->getString("TelehubBlock"); +char* _PREHASH_FOVBlock = LLMessageStringTable::getInstance()->getString("FOVBlock"); +char* _PREHASH_StartLocationData = LLMessageStringTable::getInstance()->getString("StartLocationData"); +char* _PREHASH_PositionData = LLMessageStringTable::getInstance()->getString("PositionData"); +char* _PREHASH_TimeSinceLast = LLMessageStringTable::getInstance()->getString("TimeSinceLast"); +char* _PREHASH_MapImage = LLMessageStringTable::getInstance()->getString("MapImage"); +char* _PREHASH_Objects = LLMessageStringTable::getInstance()->getString("Objects"); +char* _PREHASH_URL = LLMessageStringTable::getInstance()->getString("URL"); +char* _PREHASH_CreationDate = LLMessageStringTable::getInstance()->getString("CreationDate"); +char* _PREHASH_JointPivot = LLMessageStringTable::getInstance()->getString("JointPivot"); +char* _PREHASH_FPS = LLMessageStringTable::getInstance()->getString("FPS"); +char* _PREHASH_HasTelehub = LLMessageStringTable::getInstance()->getString("HasTelehub"); +char* _PREHASH_PathEnd = LLMessageStringTable::getInstance()->getString("PathEnd"); +char* _PREHASH_ScriptDataReply = LLMessageStringTable::getInstance()->getString("ScriptDataReply"); +char* _PREHASH_MapBlockReply = LLMessageStringTable::getInstance()->getString("MapBlockReply"); +char* _PREHASH_PropertiesData = LLMessageStringTable::getInstance()->getString("PropertiesData"); +char* _PREHASH_ViewerEffect = LLMessageStringTable::getInstance()->getString("ViewerEffect"); +char* _PREHASH_FreezeUser = LLMessageStringTable::getInstance()->getString("FreezeUser"); +char* _PREHASH_OwnerPrims = LLMessageStringTable::getInstance()->getString("OwnerPrims"); +char* _PREHASH_ObjectGrab = LLMessageStringTable::getInstance()->getString("ObjectGrab"); +char* _PREHASH_ToAgentID = LLMessageStringTable::getInstance()->getString("ToAgentID"); +char* _PREHASH_SimulatorMapUpdate = LLMessageStringTable::getInstance()->getString("SimulatorMapUpdate"); +char* _PREHASH_TransferPacket = LLMessageStringTable::getInstance()->getString("TransferPacket"); +char* _PREHASH_ObjectName = LLMessageStringTable::getInstance()->getString("ObjectName"); +char* _PREHASH_GroupPowers = LLMessageStringTable::getInstance()->getString("GroupPowers"); +char* _PREHASH_OriginalName = LLMessageStringTable::getInstance()->getString("OriginalName"); +char* _PREHASH_CompletePingCheck = LLMessageStringTable::getInstance()->getString("CompletePingCheck"); +char* _PREHASH_OnlineStatus = LLMessageStringTable::getInstance()->getString("OnlineStatus"); +char* _PREHASH_ObjectDrop = LLMessageStringTable::getInstance()->getString("ObjectDrop"); +char* _PREHASH_UseBigPackets = LLMessageStringTable::getInstance()->getString("UseBigPackets"); +char* _PREHASH_GroupNoticesListReply = LLMessageStringTable::getInstance()->getString("GroupNoticesListReply"); +char* _PREHASH_ParcelAccessListReply = LLMessageStringTable::getInstance()->getString("ParcelAccessListReply"); +char* _PREHASH_RpcChannelReply = LLMessageStringTable::getInstance()->getString("RpcChannelReply"); +char* _PREHASH_RegionPresenceResponse = LLMessageStringTable::getInstance()->getString("RegionPresenceResponse"); +char* _PREHASH_CharterMember = LLMessageStringTable::getInstance()->getString("CharterMember"); +char* _PREHASH_EdgeData = LLMessageStringTable::getInstance()->getString("EdgeData"); +char* _PREHASH_NameData = LLMessageStringTable::getInstance()->getString("NameData"); +char* _PREHASH_RegionPushOverride = LLMessageStringTable::getInstance()->getString("RegionPushOverride"); +char* _PREHASH_SimName = LLMessageStringTable::getInstance()->getString("SimName"); +char* _PREHASH_UserReport = LLMessageStringTable::getInstance()->getString("UserReport"); +char* _PREHASH_DownloadPriority = LLMessageStringTable::getInstance()->getString("DownloadPriority"); +char* _PREHASH_ToAgentId = LLMessageStringTable::getInstance()->getString("ToAgentId"); +char* _PREHASH_DirPopularQuery = LLMessageStringTable::getInstance()->getString("DirPopularQuery"); +char* _PREHASH_Mag = LLMessageStringTable::getInstance()->getString("Mag"); +char* _PREHASH_ParcelPropertiesRequestByID = LLMessageStringTable::getInstance()->getString("ParcelPropertiesRequestByID"); +char* _PREHASH_ObjectLink = LLMessageStringTable::getInstance()->getString("ObjectLink"); +char* _PREHASH_RpcScriptReplyInbound = LLMessageStringTable::getInstance()->getString("RpcScriptReplyInbound"); +char* _PREHASH_RezData = LLMessageStringTable::getInstance()->getString("RezData"); +char* _PREHASH_RemoveInventoryObjects = LLMessageStringTable::getInstance()->getString("RemoveInventoryObjects"); +char* _PREHASH_GroupProposalBallot = LLMessageStringTable::getInstance()->getString("GroupProposalBallot"); +char* _PREHASH_RPCServerIP = LLMessageStringTable::getInstance()->getString("RPCServerIP"); +char* _PREHASH_Far = LLMessageStringTable::getInstance()->getString("Far"); +char* _PREHASH_GodSessionID = LLMessageStringTable::getInstance()->getString("GodSessionID"); +char* _PREHASH_FLAboutText = LLMessageStringTable::getInstance()->getString("FLAboutText"); +char* _PREHASH_RegionHandshakeReply = LLMessageStringTable::getInstance()->getString("RegionHandshakeReply"); +char* _PREHASH_GroupActiveProposalItemReply = LLMessageStringTable::getInstance()->getString("GroupActiveProposalItemReply"); +char* _PREHASH_MapItemReply = LLMessageStringTable::getInstance()->getString("MapItemReply"); +char* _PREHASH_Seconds = LLMessageStringTable::getInstance()->getString("Seconds"); +char* _PREHASH_UpdateUserInfo = LLMessageStringTable::getInstance()->getString("UpdateUserInfo"); +char* _PREHASH_AggregatePermTexturesOwner = LLMessageStringTable::getInstance()->getString("AggregatePermTexturesOwner"); +char* _PREHASH_Set = LLMessageStringTable::getInstance()->getString("Set"); +char* _PREHASH_NewName = LLMessageStringTable::getInstance()->getString("NewName"); +char* _PREHASH_Key = LLMessageStringTable::getInstance()->getString("Key"); +char* _PREHASH_AgentID = LLMessageStringTable::getInstance()->getString("AgentID"); +char* _PREHASH_EventNotificationRemoveRequest = LLMessageStringTable::getInstance()->getString("EventNotificationRemoveRequest"); +char* _PREHASH_NewFolderID = LLMessageStringTable::getInstance()->getString("NewFolderID"); +char* _PREHASH_Arc = LLMessageStringTable::getInstance()->getString("Arc"); +char* _PREHASH_RegionX = LLMessageStringTable::getInstance()->getString("RegionX"); +char* _PREHASH_RegionY = LLMessageStringTable::getInstance()->getString("RegionY"); +char* _PREHASH_RequestData = LLMessageStringTable::getInstance()->getString("RequestData"); +char* _PREHASH_Msg = LLMessageStringTable::getInstance()->getString("Msg"); +char* _PREHASH_Top = LLMessageStringTable::getInstance()->getString("Top"); +char* _PREHASH_MiscStats = LLMessageStringTable::getInstance()->getString("MiscStats"); +char* _PREHASH_ImageID = LLMessageStringTable::getInstance()->getString("ImageID"); +char* _PREHASH_DataPacket = LLMessageStringTable::getInstance()->getString("DataPacket"); +char* _PREHASH_You = LLMessageStringTable::getInstance()->getString("You"); +char* _PREHASH_ScriptControlChange = LLMessageStringTable::getInstance()->getString("ScriptControlChange"); +char* _PREHASH_LoadURL = LLMessageStringTable::getInstance()->getString("LoadURL"); +char* _PREHASH_SetCPURatio = LLMessageStringTable::getInstance()->getString("SetCPURatio"); +char* _PREHASH_NameValueData = LLMessageStringTable::getInstance()->getString("NameValueData"); +char* _PREHASH_AtomicPassObject = LLMessageStringTable::getInstance()->getString("AtomicPassObject"); +char* _PREHASH_ErrorMessage = LLMessageStringTable::getInstance()->getString("ErrorMessage"); +char* _PREHASH_ViewerFrozenMessage = LLMessageStringTable::getInstance()->getString("ViewerFrozenMessage"); +char* _PREHASH_HealthMessage = LLMessageStringTable::getInstance()->getString("HealthMessage"); +char* _PREHASH_LogTextMessage = LLMessageStringTable::getInstance()->getString("LogTextMessage"); +char* _PREHASH_TimeDilation = LLMessageStringTable::getInstance()->getString("TimeDilation"); +char* _PREHASH_RemoveContribution = LLMessageStringTable::getInstance()->getString("RemoveContribution"); +char* _PREHASH_Contribution = LLMessageStringTable::getInstance()->getString("Contribution"); +char* _PREHASH_SetGroupContribution = LLMessageStringTable::getInstance()->getString("SetGroupContribution"); +char* _PREHASH_Offline = LLMessageStringTable::getInstance()->getString("Offline"); +char* _PREHASH_AgentIsNowWearing = LLMessageStringTable::getInstance()->getString("AgentIsNowWearing"); +char* _PREHASH_Members = LLMessageStringTable::getInstance()->getString("Members"); +char* _PREHASH_FailedResends = LLMessageStringTable::getInstance()->getString("FailedResends"); +char* _PREHASH_SecPerDay = LLMessageStringTable::getInstance()->getString("SecPerDay"); +char* _PREHASH_CameraCenter = LLMessageStringTable::getInstance()->getString("CameraCenter"); +char* _PREHASH_CameraLeftAxis = LLMessageStringTable::getInstance()->getString("CameraLeftAxis"); +char* _PREHASH_ExBlock = LLMessageStringTable::getInstance()->getString("ExBlock"); +char* _PREHASH_Channel = LLMessageStringTable::getInstance()->getString("Channel"); +char* _PREHASH_NetTest = LLMessageStringTable::getInstance()->getString("NetTest"); +char* _PREHASH_DiscardLevel = LLMessageStringTable::getInstance()->getString("DiscardLevel"); +char* _PREHASH_LayerID = LLMessageStringTable::getInstance()->getString("LayerID"); +char* _PREHASH_GrabOffset = LLMessageStringTable::getInstance()->getString("GrabOffset"); +char* _PREHASH_SimPort = LLMessageStringTable::getInstance()->getString("SimPort"); +char* _PREHASH_PricePerMeter = LLMessageStringTable::getInstance()->getString("PricePerMeter"); +char* _PREHASH_RegionFlags = LLMessageStringTable::getInstance()->getString("RegionFlags"); +char* _PREHASH_VoteResult = LLMessageStringTable::getInstance()->getString("VoteResult"); +char* _PREHASH_ParcelDirFeeEstimate = LLMessageStringTable::getInstance()->getString("ParcelDirFeeEstimate"); +char* _PREHASH_ModifyBlock = LLMessageStringTable::getInstance()->getString("ModifyBlock"); +char* _PREHASH_InventoryBlock = LLMessageStringTable::getInstance()->getString("InventoryBlock"); +char* _PREHASH_ReplyBlock = LLMessageStringTable::getInstance()->getString("ReplyBlock"); +char* _PREHASH_ValidUntil = LLMessageStringTable::getInstance()->getString("ValidUntil"); +char* _PREHASH_VelocityInterpolateOn = LLMessageStringTable::getInstance()->getString("VelocityInterpolateOn"); +char* _PREHASH_ClassifiedDelete = LLMessageStringTable::getInstance()->getString("ClassifiedDelete"); +char* _PREHASH_RegionDenyAnonymous = LLMessageStringTable::getInstance()->getString("RegionDenyAnonymous"); +char* _PREHASH_FLImageID = LLMessageStringTable::getInstance()->getString("FLImageID"); +char* _PREHASH_AllowPublish = LLMessageStringTable::getInstance()->getString("AllowPublish"); +char* _PREHASH_SitName = LLMessageStringTable::getInstance()->getString("SitName"); +char* _PREHASH_RegionsVisited = LLMessageStringTable::getInstance()->getString("RegionsVisited"); +char* _PREHASH_DirClassifiedReply = LLMessageStringTable::getInstance()->getString("DirClassifiedReply"); +char* _PREHASH_AvatarClassifiedReply = LLMessageStringTable::getInstance()->getString("AvatarClassifiedReply"); +char* _PREHASH_MediaURL = LLMessageStringTable::getInstance()->getString("MediaURL"); +char* _PREHASH_CompleteAgentMovement = LLMessageStringTable::getInstance()->getString("CompleteAgentMovement"); +char* _PREHASH_ClassifiedID = LLMessageStringTable::getInstance()->getString("ClassifiedID"); +char* _PREHASH_LocalID = LLMessageStringTable::getInstance()->getString("LocalID"); +char* _PREHASH_SpaceIP = LLMessageStringTable::getInstance()->getString("SpaceIP"); +char* _PREHASH_RemoveItem = LLMessageStringTable::getInstance()->getString("RemoveItem"); +char* _PREHASH_LogFailedMoneyTransaction = LLMessageStringTable::getInstance()->getString("LogFailedMoneyTransaction"); +char* _PREHASH_ViewerStartAuction = LLMessageStringTable::getInstance()->getString("ViewerStartAuction"); +char* _PREHASH_StartAuction = LLMessageStringTable::getInstance()->getString("StartAuction"); +char* _PREHASH_DuplicateFlags = LLMessageStringTable::getInstance()->getString("DuplicateFlags"); +char* _PREHASH_RegionInfo2 = LLMessageStringTable::getInstance()->getString("RegionInfo2"); +char* _PREHASH_TextColor = LLMessageStringTable::getInstance()->getString("TextColor"); +char* _PREHASH_SlaveID = LLMessageStringTable::getInstance()->getString("SlaveID"); +char* _PREHASH_Charter = LLMessageStringTable::getInstance()->getString("Charter"); +char* _PREHASH_AlertData = LLMessageStringTable::getInstance()->getString("AlertData"); +char* _PREHASH_TargetBlock = LLMessageStringTable::getInstance()->getString("TargetBlock"); +char* _PREHASH_CheckParcelAuctions = LLMessageStringTable::getInstance()->getString("CheckParcelAuctions"); +char* _PREHASH_ParcelAuctions = LLMessageStringTable::getInstance()->getString("ParcelAuctions"); +char* _PREHASH_OwnerIsGroup = LLMessageStringTable::getInstance()->getString("OwnerIsGroup"); +char* _PREHASH_NameValuePair = LLMessageStringTable::getInstance()->getString("NameValuePair"); +char* _PREHASH_RemoveNameValuePair = LLMessageStringTable::getInstance()->getString("RemoveNameValuePair"); +char* _PREHASH_BulkUpdateInventory = LLMessageStringTable::getInstance()->getString("BulkUpdateInventory"); +char* _PREHASH_UpdateTaskInventory = LLMessageStringTable::getInstance()->getString("UpdateTaskInventory"); +char* _PREHASH_RemoveTaskInventory = LLMessageStringTable::getInstance()->getString("RemoveTaskInventory"); +char* _PREHASH_MoveTaskInventory = LLMessageStringTable::getInstance()->getString("MoveTaskInventory"); +char* _PREHASH_RequestTaskInventory = LLMessageStringTable::getInstance()->getString("RequestTaskInventory"); +char* _PREHASH_ReplyTaskInventory = LLMessageStringTable::getInstance()->getString("ReplyTaskInventory"); +char* _PREHASH_AggregatePermInventory = LLMessageStringTable::getInstance()->getString("AggregatePermInventory"); +char* _PREHASH_GroupAccountTransactionsReply = LLMessageStringTable::getInstance()->getString("GroupAccountTransactionsReply"); +char* _PREHASH_SimulatorInfo = LLMessageStringTable::getInstance()->getString("SimulatorInfo"); +char* _PREHASH_WearableData = LLMessageStringTable::getInstance()->getString("WearableData"); +char* _PREHASH_Enabled = LLMessageStringTable::getInstance()->getString("Enabled"); +char* _PREHASH_Savings = LLMessageStringTable::getInstance()->getString("Savings"); +char* _PREHASH_SimulatorLoad = LLMessageStringTable::getInstance()->getString("SimulatorLoad"); +char* _PREHASH_InternalRegionIP = LLMessageStringTable::getInstance()->getString("InternalRegionIP"); +char* _PREHASH_ExternalRegionIP = LLMessageStringTable::getInstance()->getString("ExternalRegionIP"); +char* _PREHASH_TotalPairs = LLMessageStringTable::getInstance()->getString("TotalPairs"); +char* _PREHASH_CreateGroupRequest = LLMessageStringTable::getInstance()->getString("CreateGroupRequest"); +char* _PREHASH_JoinGroupRequest = LLMessageStringTable::getInstance()->getString("JoinGroupRequest"); +char* _PREHASH_LeaveGroupRequest = LLMessageStringTable::getInstance()->getString("LeaveGroupRequest"); +char* _PREHASH_InviteGroupRequest = LLMessageStringTable::getInstance()->getString("InviteGroupRequest"); +char* _PREHASH_LiveHelpGroupRequest = LLMessageStringTable::getInstance()->getString("LiveHelpGroupRequest"); +char* _PREHASH_PriceParcelClaimFactor = LLMessageStringTable::getInstance()->getString("PriceParcelClaimFactor"); +char* _PREHASH_BillableArea = LLMessageStringTable::getInstance()->getString("BillableArea"); +char* _PREHASH_ObjectID = LLMessageStringTable::getInstance()->getString("ObjectID"); +char* _PREHASH_ObjectFlagUpdate = LLMessageStringTable::getInstance()->getString("ObjectFlagUpdate"); +char* _PREHASH_GroupRoleUpdate = LLMessageStringTable::getInstance()->getString("GroupRoleUpdate"); +char* _PREHASH_RequestInventoryAsset = LLMessageStringTable::getInstance()->getString("RequestInventoryAsset"); +char* _PREHASH_ChangedGrid = LLMessageStringTable::getInstance()->getString("ChangedGrid"); +char* _PREHASH_AgentDropGroup = LLMessageStringTable::getInstance()->getString("AgentDropGroup"); +char* _PREHASH_Details = LLMessageStringTable::getInstance()->getString("Details"); +char* _PREHASH_LocationX = LLMessageStringTable::getInstance()->getString("LocationX"); +char* _PREHASH_SaleType = LLMessageStringTable::getInstance()->getString("SaleType"); +char* _PREHASH_LocationY = LLMessageStringTable::getInstance()->getString("LocationY"); +char* _PREHASH_LocationZ = LLMessageStringTable::getInstance()->getString("LocationZ"); +char* _PREHASH_EconomyData = LLMessageStringTable::getInstance()->getString("EconomyData"); +char* _PREHASH_HeadRotation = LLMessageStringTable::getInstance()->getString("HeadRotation"); +char* _PREHASH_DeleteOnCompletion = LLMessageStringTable::getInstance()->getString("DeleteOnCompletion"); +char* _PREHASH_PublicPort = LLMessageStringTable::getInstance()->getString("PublicPort"); +char* _PREHASH_DirClassifiedQuery = LLMessageStringTable::getInstance()->getString("DirClassifiedQuery"); +char* _PREHASH_CallbackID = LLMessageStringTable::getInstance()->getString("CallbackID"); +char* _PREHASH_RequestParcelTransfer = LLMessageStringTable::getInstance()->getString("RequestParcelTransfer"); +char* _PREHASH_RoleCount = LLMessageStringTable::getInstance()->getString("RoleCount"); +char* _PREHASH_ObjectCapacity = LLMessageStringTable::getInstance()->getString("ObjectCapacity"); +char* _PREHASH_RequestID = LLMessageStringTable::getInstance()->getString("RequestID"); +char* _PREHASH_RequestXfer = LLMessageStringTable::getInstance()->getString("RequestXfer"); +char* _PREHASH_ObjectTaxCurrent = LLMessageStringTable::getInstance()->getString("ObjectTaxCurrent"); +char* _PREHASH_LightTaxCurrent = LLMessageStringTable::getInstance()->getString("LightTaxCurrent"); +char* _PREHASH_LandTaxCurrent = LLMessageStringTable::getInstance()->getString("LandTaxCurrent"); +char* _PREHASH_GroupTaxCurrent = LLMessageStringTable::getInstance()->getString("GroupTaxCurrent"); +char* _PREHASH_FetchInventoryDescendents = LLMessageStringTable::getInstance()->getString("FetchInventoryDescendents"); +char* _PREHASH_InventoryDescendents = LLMessageStringTable::getInstance()->getString("InventoryDescendents"); +char* _PREHASH_Descendents = LLMessageStringTable::getInstance()->getString("Descendents"); +char* _PREHASH_PurgeInventoryDescendents = LLMessageStringTable::getInstance()->getString("PurgeInventoryDescendents"); +char* _PREHASH_ShowDir = LLMessageStringTable::getInstance()->getString("ShowDir"); +char* _PREHASH_IsOwner = LLMessageStringTable::getInstance()->getString("IsOwner"); +char* _PREHASH_Timestamp = LLMessageStringTable::getInstance()->getString("Timestamp"); +char* _PREHASH_GlobalPos = LLMessageStringTable::getInstance()->getString("GlobalPos"); +char* _PREHASH_GrabOffsetInitial = LLMessageStringTable::getInstance()->getString("GrabOffsetInitial"); +char* _PREHASH_IsTrial = LLMessageStringTable::getInstance()->getString("IsTrial"); +char* _PREHASH_ObjectDuplicateOnRay = LLMessageStringTable::getInstance()->getString("ObjectDuplicateOnRay"); +char* _PREHASH_GroupMembershipCount = LLMessageStringTable::getInstance()->getString("GroupMembershipCount"); +char* _PREHASH_MethodData = LLMessageStringTable::getInstance()->getString("MethodData"); +char* _PREHASH_ActivateGestures = LLMessageStringTable::getInstance()->getString("ActivateGestures"); +char* _PREHASH_DeactivateGestures = LLMessageStringTable::getInstance()->getString("DeactivateGestures"); +char* _PREHASH_ProposalData = LLMessageStringTable::getInstance()->getString("ProposalData"); +char* _PREHASH_PosGlobal = LLMessageStringTable::getInstance()->getString("PosGlobal"); +char* _PREHASH_SearchID = LLMessageStringTable::getInstance()->getString("SearchID"); +char* _PREHASH_RezMultipleAttachmentsFromInv = LLMessageStringTable::getInstance()->getString("RezMultipleAttachmentsFromInv"); +char* _PREHASH_SearchName = LLMessageStringTable::getInstance()->getString("SearchName"); +char* _PREHASH_VersionString = LLMessageStringTable::getInstance()->getString("VersionString"); +char* _PREHASH_CreateGroupReply = LLMessageStringTable::getInstance()->getString("CreateGroupReply"); +char* _PREHASH_LeaveGroupReply = LLMessageStringTable::getInstance()->getString("LeaveGroupReply"); +char* _PREHASH_ActualArea = LLMessageStringTable::getInstance()->getString("ActualArea"); +char* _PREHASH_Message = LLMessageStringTable::getInstance()->getString("Message"); +char* _PREHASH_ClickAction = LLMessageStringTable::getInstance()->getString("ClickAction"); +char* _PREHASH_AssetUploadComplete = LLMessageStringTable::getInstance()->getString("AssetUploadComplete"); +char* _PREHASH_RequestType = LLMessageStringTable::getInstance()->getString("RequestType"); +char* _PREHASH_UUID = LLMessageStringTable::getInstance()->getString("UUID"); +char* _PREHASH_BaseMask = LLMessageStringTable::getInstance()->getString("BaseMask"); +char* _PREHASH_NetBlock = LLMessageStringTable::getInstance()->getString("NetBlock"); +char* _PREHASH_GlobalX = LLMessageStringTable::getInstance()->getString("GlobalX"); +char* _PREHASH_GlobalY = LLMessageStringTable::getInstance()->getString("GlobalY"); +char* _PREHASH_CopyRotates = LLMessageStringTable::getInstance()->getString("CopyRotates"); +char* _PREHASH_KickUserAck = LLMessageStringTable::getInstance()->getString("KickUserAck"); +char* _PREHASH_TopPick = LLMessageStringTable::getInstance()->getString("TopPick"); +char* _PREHASH_SessionID = LLMessageStringTable::getInstance()->getString("SessionID"); +char* _PREHASH_GlobalZ = LLMessageStringTable::getInstance()->getString("GlobalZ"); +char* _PREHASH_DeclineFriendship = LLMessageStringTable::getInstance()->getString("DeclineFriendship"); +char* _PREHASH_FormFriendship = LLMessageStringTable::getInstance()->getString("FormFriendship"); +char* _PREHASH_TerminateFriendship = LLMessageStringTable::getInstance()->getString("TerminateFriendship"); +char* _PREHASH_TaskData = LLMessageStringTable::getInstance()->getString("TaskData"); +char* _PREHASH_SimWideMaxPrims = LLMessageStringTable::getInstance()->getString("SimWideMaxPrims"); +char* _PREHASH_TotalPrims = LLMessageStringTable::getInstance()->getString("TotalPrims"); +char* _PREHASH_ProfileBegin = LLMessageStringTable::getInstance()->getString("ProfileBegin"); +char* _PREHASH_Request = LLMessageStringTable::getInstance()->getString("Request"); +char* _PREHASH_GroupAccountDetailsRequest = LLMessageStringTable::getInstance()->getString("GroupAccountDetailsRequest"); +char* _PREHASH_GroupActiveProposalsRequest = LLMessageStringTable::getInstance()->getString("GroupActiveProposalsRequest"); +char* _PREHASH_StringValue = LLMessageStringTable::getInstance()->getString("StringValue"); +char* _PREHASH_Version = LLMessageStringTable::getInstance()->getString("Version"); +char* _PREHASH_OtherCount = LLMessageStringTable::getInstance()->getString("OtherCount"); +char* _PREHASH_MemberCount = LLMessageStringTable::getInstance()->getString("MemberCount"); +char* _PREHASH_ChatData = LLMessageStringTable::getInstance()->getString("ChatData"); +char* _PREHASH_IsGroupOwned = LLMessageStringTable::getInstance()->getString("IsGroupOwned"); +char* _PREHASH_EnergyEfficiency = LLMessageStringTable::getInstance()->getString("EnergyEfficiency"); +char* _PREHASH_PickInfoUpdate = LLMessageStringTable::getInstance()->getString("PickInfoUpdate"); +char* _PREHASH_PickDelete = LLMessageStringTable::getInstance()->getString("PickDelete"); +char* _PREHASH_ScriptReset = LLMessageStringTable::getInstance()->getString("ScriptReset"); +char* _PREHASH_Requester = LLMessageStringTable::getInstance()->getString("Requester"); +char* _PREHASH_ForSale = LLMessageStringTable::getInstance()->getString("ForSale"); +char* _PREHASH_NearestLandingRegionReply = LLMessageStringTable::getInstance()->getString("NearestLandingRegionReply"); +char* _PREHASH_ParcelID = LLMessageStringTable::getInstance()->getString("ParcelID"); +char* _PREHASH_Godlike = LLMessageStringTable::getInstance()->getString("Godlike"); +char* _PREHASH_TotalDebits = LLMessageStringTable::getInstance()->getString("TotalDebits"); +char* _PREHASH_Direction = LLMessageStringTable::getInstance()->getString("Direction"); +char* _PREHASH_HealthData = LLMessageStringTable::getInstance()->getString("HealthData"); +char* _PREHASH_LeftAxis = LLMessageStringTable::getInstance()->getString("LeftAxis"); +char* _PREHASH_LocationBlock = LLMessageStringTable::getInstance()->getString("LocationBlock"); +char* _PREHASH_ObjectImage = LLMessageStringTable::getInstance()->getString("ObjectImage"); +char* _PREHASH_TerrainStartHeight00 = LLMessageStringTable::getInstance()->getString("TerrainStartHeight00"); +char* _PREHASH_TerrainStartHeight01 = LLMessageStringTable::getInstance()->getString("TerrainStartHeight01"); +char* _PREHASH_TerrainStartHeight10 = LLMessageStringTable::getInstance()->getString("TerrainStartHeight10"); +char* _PREHASH_TerrainStartHeight11 = LLMessageStringTable::getInstance()->getString("TerrainStartHeight11"); +char* _PREHASH_WaterHeight = LLMessageStringTable::getInstance()->getString("WaterHeight"); +char* _PREHASH_FetchInventoryReply = LLMessageStringTable::getInstance()->getString("FetchInventoryReply"); +char* _PREHASH_GroupAccountSummaryReply = LLMessageStringTable::getInstance()->getString("GroupAccountSummaryReply"); +char* _PREHASH_AttachedSound = LLMessageStringTable::getInstance()->getString("AttachedSound"); +char* _PREHASH_ParamInUse = LLMessageStringTable::getInstance()->getString("ParamInUse"); +char* _PREHASH_GodKickUser = LLMessageStringTable::getInstance()->getString("GodKickUser"); +char* _PREHASH_PickName = LLMessageStringTable::getInstance()->getString("PickName"); +char* _PREHASH_TaskName = LLMessageStringTable::getInstance()->getString("TaskName"); +char* _PREHASH_ObjectCount = LLMessageStringTable::getInstance()->getString("ObjectCount"); +char* _PREHASH_RegionPresenceRequestByHandle = LLMessageStringTable::getInstance()->getString("RegionPresenceRequestByHandle"); +char* _PREHASH_RezSingleAttachmentFromInv = LLMessageStringTable::getInstance()->getString("RezSingleAttachmentFromInv"); +char* _PREHASH_ChildAgentUpdate = LLMessageStringTable::getInstance()->getString("ChildAgentUpdate"); +char* _PREHASH_IsOwnerGroup = LLMessageStringTable::getInstance()->getString("IsOwnerGroup"); +char* _PREHASH_AgentHeightWidth = LLMessageStringTable::getInstance()->getString("AgentHeightWidth"); +char* _PREHASH_VerticalAngle = LLMessageStringTable::getInstance()->getString("VerticalAngle"); +char* _PREHASH_WearableType = LLMessageStringTable::getInstance()->getString("WearableType"); +char* _PREHASH_AggregatePermNextOwner = LLMessageStringTable::getInstance()->getString("AggregatePermNextOwner"); +char* _PREHASH_ShowInList = LLMessageStringTable::getInstance()->getString("ShowInList"); +char* _PREHASH_UpdateParcel = LLMessageStringTable::getInstance()->getString("UpdateParcel"); +char* _PREHASH_SetAlwaysRun = LLMessageStringTable::getInstance()->getString("SetAlwaysRun"); +char* _PREHASH_NVPair = LLMessageStringTable::getInstance()->getString("NVPair"); +char* _PREHASH_SearchType = LLMessageStringTable::getInstance()->getString("SearchType"); +char* _PREHASH_ObjectSpinStart = LLMessageStringTable::getInstance()->getString("ObjectSpinStart"); +char* _PREHASH_UseEstateSun = LLMessageStringTable::getInstance()->getString("UseEstateSun"); +char* _PREHASH_RegionID = LLMessageStringTable::getInstance()->getString("RegionID"); +char* _PREHASH_AbuseRegionID = LLMessageStringTable::getInstance()->getString("AbuseRegionID"); +char* _PREHASH_Creator = LLMessageStringTable::getInstance()->getString("Creator"); +char* _PREHASH_ProposalText = LLMessageStringTable::getInstance()->getString("ProposalText"); +char* _PREHASH_DirEventsReply = LLMessageStringTable::getInstance()->getString("DirEventsReply"); +char* _PREHASH_EventInfoReply = LLMessageStringTable::getInstance()->getString("EventInfoReply"); +char* _PREHASH_UserInfoReply = LLMessageStringTable::getInstance()->getString("UserInfoReply"); +char* _PREHASH_PathRadiusOffset = LLMessageStringTable::getInstance()->getString("PathRadiusOffset"); +char* _PREHASH_TextureData = LLMessageStringTable::getInstance()->getString("TextureData"); +char* _PREHASH_ChatPass = LLMessageStringTable::getInstance()->getString("ChatPass"); +char* _PREHASH_TargetID = LLMessageStringTable::getInstance()->getString("TargetID"); +char* _PREHASH_DefaultPayPrice = LLMessageStringTable::getInstance()->getString("DefaultPayPrice"); +char* _PREHASH_UserLocation = LLMessageStringTable::getInstance()->getString("UserLocation"); +char* _PREHASH_MaxPrims = LLMessageStringTable::getInstance()->getString("MaxPrims"); +char* _PREHASH_LandmarkID = LLMessageStringTable::getInstance()->getString("LandmarkID"); +char* _PREHASH_InitiateDownload = LLMessageStringTable::getInstance()->getString("InitiateDownload"); +char* _PREHASH_Name = LLMessageStringTable::getInstance()->getString("Name"); +char* _PREHASH_OtherCleanTime = LLMessageStringTable::getInstance()->getString("OtherCleanTime"); +char* _PREHASH_ParcelSetOtherCleanTime = LLMessageStringTable::getInstance()->getString("ParcelSetOtherCleanTime"); +char* _PREHASH_TeleportPriceExponent = LLMessageStringTable::getInstance()->getString("TeleportPriceExponent"); +char* _PREHASH_Gain = LLMessageStringTable::getInstance()->getString("Gain"); +char* _PREHASH_PacketAck = LLMessageStringTable::getInstance()->getString("PacketAck"); +char* _PREHASH_PathSkew = LLMessageStringTable::getInstance()->getString("PathSkew"); +char* _PREHASH_SimulatorShutdownRequest = LLMessageStringTable::getInstance()->getString("SimulatorShutdownRequest"); +char* _PREHASH_NearestLandingRegionRequest = LLMessageStringTable::getInstance()->getString("NearestLandingRegionRequest"); +char* _PREHASH_OtherID = LLMessageStringTable::getInstance()->getString("OtherID"); +char* _PREHASH_MemberID = LLMessageStringTable::getInstance()->getString("MemberID"); +char* _PREHASH_MapLayerRequest = LLMessageStringTable::getInstance()->getString("MapLayerRequest"); +char* _PREHASH_ObjectScale = LLMessageStringTable::getInstance()->getString("ObjectScale"); +char* _PREHASH_TargetIP = LLMessageStringTable::getInstance()->getString("TargetIP"); +char* _PREHASH_Redo = LLMessageStringTable::getInstance()->getString("Redo"); +char* _PREHASH_MoneyBalance = LLMessageStringTable::getInstance()->getString("MoneyBalance"); +char* _PREHASH_TrackAgent = LLMessageStringTable::getInstance()->getString("TrackAgent"); +char* _PREHASH_MaxX = LLMessageStringTable::getInstance()->getString("MaxX"); +char* _PREHASH_Data = LLMessageStringTable::getInstance()->getString("Data"); +char* _PREHASH_MaxY = LLMessageStringTable::getInstance()->getString("MaxY"); +char* _PREHASH_TextureAnim = LLMessageStringTable::getInstance()->getString("TextureAnim"); +char* _PREHASH_ReturnIDs = LLMessageStringTable::getInstance()->getString("ReturnIDs"); +char* _PREHASH_Date = LLMessageStringTable::getInstance()->getString("Date"); +char* _PREHASH_AgentWearablesUpdate = LLMessageStringTable::getInstance()->getString("AgentWearablesUpdate"); +char* _PREHASH_AgentDataUpdate = LLMessageStringTable::getInstance()->getString("AgentDataUpdate"); +char* _PREHASH_GroupDataUpdate = LLMessageStringTable::getInstance()->getString("GroupDataUpdate"); +char* _PREHASH_Hash = LLMessageStringTable::getInstance()->getString("Hash"); +char* _PREHASH_AgentGroupDataUpdate = LLMessageStringTable::getInstance()->getString("AgentGroupDataUpdate"); +char* _PREHASH_Left = LLMessageStringTable::getInstance()->getString("Left"); +char* _PREHASH_Mask = LLMessageStringTable::getInstance()->getString("Mask"); +char* _PREHASH_ForceMouselook = LLMessageStringTable::getInstance()->getString("ForceMouselook"); +char* _PREHASH_Success = LLMessageStringTable::getInstance()->getString("Success"); +char* _PREHASH_ObjectGroup = LLMessageStringTable::getInstance()->getString("ObjectGroup"); +char* _PREHASH_SunHour = LLMessageStringTable::getInstance()->getString("SunHour"); +char* _PREHASH_MinX = LLMessageStringTable::getInstance()->getString("MinX"); +char* _PREHASH_ScriptSensorReply = LLMessageStringTable::getInstance()->getString("ScriptSensorReply"); +char* _PREHASH_MinY = LLMessageStringTable::getInstance()->getString("MinY"); +char* _PREHASH_Command = LLMessageStringTable::getInstance()->getString("Command"); +char* _PREHASH_Desc = LLMessageStringTable::getInstance()->getString("Desc"); +char* _PREHASH_AttachmentNeedsSave = LLMessageStringTable::getInstance()->getString("AttachmentNeedsSave"); +char* _PREHASH_HistoryItemData = LLMessageStringTable::getInstance()->getString("HistoryItemData"); +char* _PREHASH_AgentCachedTexture = LLMessageStringTable::getInstance()->getString("AgentCachedTexture"); +char* _PREHASH_Subject = LLMessageStringTable::getInstance()->getString("Subject"); +char* _PREHASH_East = LLMessageStringTable::getInstance()->getString("East"); +char* _PREHASH_QueryReplies = LLMessageStringTable::getInstance()->getString("QueryReplies"); +char* _PREHASH_ObjectCategory = LLMessageStringTable::getInstance()->getString("ObjectCategory"); +char* _PREHASH_Time = LLMessageStringTable::getInstance()->getString("Time"); +char* _PREHASH_CreateLandmarkForEvent = LLMessageStringTable::getInstance()->getString("CreateLandmarkForEvent"); +char* _PREHASH_ParentID = LLMessageStringTable::getInstance()->getString("ParentID"); +char* _PREHASH_Ping = LLMessageStringTable::getInstance()->getString("Ping"); +char* _PREHASH_Perp = LLMessageStringTable::getInstance()->getString("Perp"); +char* _PREHASH_Code = LLMessageStringTable::getInstance()->getString("Code"); +char* _PREHASH_InvType = LLMessageStringTable::getInstance()->getString("InvType"); +char* _PREHASH_AgentFOV = LLMessageStringTable::getInstance()->getString("AgentFOV"); +char* _PREHASH_Audible = LLMessageStringTable::getInstance()->getString("Audible"); +char* _PREHASH_AuctionData = LLMessageStringTable::getInstance()->getString("AuctionData"); +char* _PREHASH_IDBlock = LLMessageStringTable::getInstance()->getString("IDBlock"); +char* _PREHASH_West = LLMessageStringTable::getInstance()->getString("West"); +char* _PREHASH_Undo = LLMessageStringTable::getInstance()->getString("Undo"); +char* _PREHASH_TotalNumItems = LLMessageStringTable::getInstance()->getString("TotalNumItems"); +char* _PREHASH_Info = LLMessageStringTable::getInstance()->getString("Info"); +char* _PREHASH_Area = LLMessageStringTable::getInstance()->getString("Area"); +char* _PREHASH_SimCrashed = LLMessageStringTable::getInstance()->getString("SimCrashed"); +char* _PREHASH_Text = LLMessageStringTable::getInstance()->getString("Text"); +char* _PREHASH_PriceGroupCreate = LLMessageStringTable::getInstance()->getString("PriceGroupCreate"); +char* _PREHASH_ObjectShape = LLMessageStringTable::getInstance()->getString("ObjectShape"); +char* _PREHASH_GroupRoleDataReply = LLMessageStringTable::getInstance()->getString("GroupRoleDataReply"); +char* _PREHASH_MuteCRC = LLMessageStringTable::getInstance()->getString("MuteCRC"); +char* _PREHASH_Size = LLMessageStringTable::getInstance()->getString("Size"); +char* _PREHASH_FromAddress = LLMessageStringTable::getInstance()->getString("FromAddress"); +char* _PREHASH_Body = LLMessageStringTable::getInstance()->getString("Body"); +char* _PREHASH_FileData = LLMessageStringTable::getInstance()->getString("FileData"); +char* _PREHASH_List = LLMessageStringTable::getInstance()->getString("List"); +char* _PREHASH_KickUser = LLMessageStringTable::getInstance()->getString("KickUser"); +char* _PREHASH_OtherPrims = LLMessageStringTable::getInstance()->getString("OtherPrims"); +char* _PREHASH_RunTime = LLMessageStringTable::getInstance()->getString("RunTime"); +char* _PREHASH_GrantUserRights = LLMessageStringTable::getInstance()->getString("GrantUserRights"); +char* _PREHASH_RpcScriptRequestInboundForward = LLMessageStringTable::getInstance()->getString("RpcScriptRequestInboundForward"); +char* _PREHASH_More = LLMessageStringTable::getInstance()->getString("More"); +char* _PREHASH_Majority = LLMessageStringTable::getInstance()->getString("Majority"); +char* _PREHASH_MetersTraveled = LLMessageStringTable::getInstance()->getString("MetersTraveled"); +char* _PREHASH_Stat = LLMessageStringTable::getInstance()->getString("Stat"); +char* _PREHASH_SoundID = LLMessageStringTable::getInstance()->getString("SoundID"); +char* _PREHASH_Item = LLMessageStringTable::getInstance()->getString("Item"); +char* _PREHASH_User = LLMessageStringTable::getInstance()->getString("User"); +char* _PREHASH_Prey = LLMessageStringTable::getInstance()->getString("Prey"); +char* _PREHASH_RayStart = LLMessageStringTable::getInstance()->getString("RayStart"); +char* _PREHASH_UsecSinceStart = LLMessageStringTable::getInstance()->getString("UsecSinceStart"); +char* _PREHASH_ParcelData = LLMessageStringTable::getInstance()->getString("ParcelData"); +char* _PREHASH_CameraUpAxis = LLMessageStringTable::getInstance()->getString("CameraUpAxis"); +char* _PREHASH_ScriptDialog = LLMessageStringTable::getInstance()->getString("ScriptDialog"); +char* _PREHASH_MasterParcelData = LLMessageStringTable::getInstance()->getString("MasterParcelData"); +char* _PREHASH_Invalid = LLMessageStringTable::getInstance()->getString("Invalid"); +char* _PREHASH_ProfileCurve = LLMessageStringTable::getInstance()->getString("ProfileCurve"); +char* _PREHASH_ParcelAccessListUpdate = LLMessageStringTable::getInstance()->getString("ParcelAccessListUpdate"); +char* _PREHASH_MuteListUpdate = LLMessageStringTable::getInstance()->getString("MuteListUpdate"); +char* _PREHASH_SendPacket = LLMessageStringTable::getInstance()->getString("SendPacket"); +char* _PREHASH_SendXferPacket = LLMessageStringTable::getInstance()->getString("SendXferPacket"); +char* _PREHASH_RegionDenyIdentified = LLMessageStringTable::getInstance()->getString("RegionDenyIdentified"); +char* _PREHASH_NotecardItemID = LLMessageStringTable::getInstance()->getString("NotecardItemID"); +char* _PREHASH_LastName = LLMessageStringTable::getInstance()->getString("LastName"); +char* _PREHASH_From = LLMessageStringTable::getInstance()->getString("From"); +char* _PREHASH_RoleChange = LLMessageStringTable::getInstance()->getString("RoleChange"); +char* _PREHASH_Port = LLMessageStringTable::getInstance()->getString("Port"); +char* _PREHASH_MemberTitle = LLMessageStringTable::getInstance()->getString("MemberTitle"); +char* _PREHASH_LogParcelChanges = LLMessageStringTable::getInstance()->getString("LogParcelChanges"); +char* _PREHASH_AgentCachedTextureResponse = LLMessageStringTable::getInstance()->getString("AgentCachedTextureResponse"); +char* _PREHASH_DeRezObject = LLMessageStringTable::getInstance()->getString("DeRezObject"); +char* _PREHASH_IsTemporary = LLMessageStringTable::getInstance()->getString("IsTemporary"); +char* _PREHASH_InsigniaID = LLMessageStringTable::getInstance()->getString("InsigniaID"); +char* _PREHASH_CheckFlags = LLMessageStringTable::getInstance()->getString("CheckFlags"); +char* _PREHASH_EventID = LLMessageStringTable::getInstance()->getString("EventID"); +char* _PREHASH_Selected = LLMessageStringTable::getInstance()->getString("Selected"); +char* _PREHASH_FromAgentId = LLMessageStringTable::getInstance()->getString("FromAgentId"); +char* _PREHASH_Type = LLMessageStringTable::getInstance()->getString("Type"); +char* _PREHASH_ChatType = LLMessageStringTable::getInstance()->getString("ChatType"); +char* _PREHASH_ReportData = LLMessageStringTable::getInstance()->getString("ReportData"); +char* _PREHASH_RequestBlock = LLMessageStringTable::getInstance()->getString("RequestBlock"); +char* _PREHASH_GrantData = LLMessageStringTable::getInstance()->getString("GrantData"); +char* _PREHASH_DetachAttachmentIntoInv = LLMessageStringTable::getInstance()->getString("DetachAttachmentIntoInv"); +char* _PREHASH_ParcelDisableObjects = LLMessageStringTable::getInstance()->getString("ParcelDisableObjects"); +char* _PREHASH_Sections = LLMessageStringTable::getInstance()->getString("Sections"); +char* _PREHASH_GodLevel = LLMessageStringTable::getInstance()->getString("GodLevel"); +char* _PREHASH_PayPriceReply = LLMessageStringTable::getInstance()->getString("PayPriceReply"); +char* _PREHASH_QueryID = LLMessageStringTable::getInstance()->getString("QueryID"); +char* _PREHASH_CameraEyeOffset = LLMessageStringTable::getInstance()->getString("CameraEyeOffset"); +char* _PREHASH_AgentPosition = LLMessageStringTable::getInstance()->getString("AgentPosition"); +char* _PREHASH_GrabPosition = LLMessageStringTable::getInstance()->getString("GrabPosition"); +char* _PREHASH_OnlineNotification = LLMessageStringTable::getInstance()->getString("OnlineNotification"); +char* _PREHASH_OfflineNotification = LLMessageStringTable::getInstance()->getString("OfflineNotification"); +char* _PREHASH_SendPostcard = LLMessageStringTable::getInstance()->getString("SendPostcard"); +char* _PREHASH_RequestFlags = LLMessageStringTable::getInstance()->getString("RequestFlags"); +char* _PREHASH_GroupAccountSummaryRequest = LLMessageStringTable::getInstance()->getString("GroupAccountSummaryRequest"); +char* _PREHASH_GroupVoteHistoryRequest = LLMessageStringTable::getInstance()->getString("GroupVoteHistoryRequest"); +char* _PREHASH_ParamValue = LLMessageStringTable::getInstance()->getString("ParamValue"); +char* _PREHASH_MaxAgents = LLMessageStringTable::getInstance()->getString("MaxAgents"); +char* _PREHASH_CreateNewOutfitAttachments = LLMessageStringTable::getInstance()->getString("CreateNewOutfitAttachments"); +char* _PREHASH_RegionHandle = LLMessageStringTable::getInstance()->getString("RegionHandle"); +char* _PREHASH_TeleportProgress = LLMessageStringTable::getInstance()->getString("TeleportProgress"); +char* _PREHASH_AgentQuitCopy = LLMessageStringTable::getInstance()->getString("AgentQuitCopy"); +char* _PREHASH_AvatarInterestsUpdate = LLMessageStringTable::getInstance()->getString("AvatarInterestsUpdate"); +char* _PREHASH_GroupNoticeID = LLMessageStringTable::getInstance()->getString("GroupNoticeID"); +char* _PREHASH_ParcelName = LLMessageStringTable::getInstance()->getString("ParcelName"); +char* _PREHASH_PriceObjectRent = LLMessageStringTable::getInstance()->getString("PriceObjectRent"); +char* _PREHASH_OfferCallingCard = LLMessageStringTable::getInstance()->getString("OfferCallingCard"); +char* _PREHASH_AcceptCallingCard = LLMessageStringTable::getInstance()->getString("AcceptCallingCard"); +char* _PREHASH_DeclineCallingCard = LLMessageStringTable::getInstance()->getString("DeclineCallingCard"); +char* _PREHASH_AgentAccess = LLMessageStringTable::getInstance()->getString("AgentAccess"); +char* _PREHASH_DataHomeLocationReply = LLMessageStringTable::getInstance()->getString("DataHomeLocationReply"); +char* _PREHASH_EventLocationReply = LLMessageStringTable::getInstance()->getString("EventLocationReply"); +char* _PREHASH_TerseDateID = LLMessageStringTable::getInstance()->getString("TerseDateID"); +char* _PREHASH_ObjectOwner = LLMessageStringTable::getInstance()->getString("ObjectOwner"); +char* _PREHASH_AssetID = LLMessageStringTable::getInstance()->getString("AssetID"); +char* _PREHASH_AlertMessage = LLMessageStringTable::getInstance()->getString("AlertMessage"); +char* _PREHASH_AgentAlertMessage = LLMessageStringTable::getInstance()->getString("AgentAlertMessage"); +char* _PREHASH_EstateOwnerMessage = LLMessageStringTable::getInstance()->getString("EstateOwnerMessage"); +char* _PREHASH_ParcelMediaCommandMessage = LLMessageStringTable::getInstance()->getString("ParcelMediaCommandMessage"); +char* _PREHASH_Auction = LLMessageStringTable::getInstance()->getString("Auction"); +char* _PREHASH_Category = LLMessageStringTable::getInstance()->getString("Category"); +char* _PREHASH_FilePath = LLMessageStringTable::getInstance()->getString("FilePath"); +char* _PREHASH_ItemFlags = LLMessageStringTable::getInstance()->getString("ItemFlags"); +char* _PREHASH_Invoice = LLMessageStringTable::getInstance()->getString("Invoice"); +char* _PREHASH_IntervalDays = LLMessageStringTable::getInstance()->getString("IntervalDays"); +char* _PREHASH_PathScaleX = LLMessageStringTable::getInstance()->getString("PathScaleX"); +char* _PREHASH_FromTaskID = LLMessageStringTable::getInstance()->getString("FromTaskID"); +char* _PREHASH_PathScaleY = LLMessageStringTable::getInstance()->getString("PathScaleY"); +char* _PREHASH_TimeInfo = LLMessageStringTable::getInstance()->getString("TimeInfo"); +char* _PREHASH_PublicCount = LLMessageStringTable::getInstance()->getString("PublicCount"); +char* _PREHASH_ParcelJoin = LLMessageStringTable::getInstance()->getString("ParcelJoin"); +char* _PREHASH_GroupRolesCount = LLMessageStringTable::getInstance()->getString("GroupRolesCount"); +char* _PREHASH_SimulatorBlock = LLMessageStringTable::getInstance()->getString("SimulatorBlock"); +char* _PREHASH_GroupID = LLMessageStringTable::getInstance()->getString("GroupID"); +char* _PREHASH_AgentVel = LLMessageStringTable::getInstance()->getString("AgentVel"); +char* _PREHASH_RequestImage = LLMessageStringTable::getInstance()->getString("RequestImage"); +char* _PREHASH_NetStats = LLMessageStringTable::getInstance()->getString("NetStats"); +char* _PREHASH_AgentPos = LLMessageStringTable::getInstance()->getString("AgentPos"); +char* _PREHASH_AgentSit = LLMessageStringTable::getInstance()->getString("AgentSit"); +char* _PREHASH_Material = LLMessageStringTable::getInstance()->getString("Material"); +char* _PREHASH_ObjectDeGrab = LLMessageStringTable::getInstance()->getString("ObjectDeGrab"); +char* _PREHASH_VelocityInterpolateOff = LLMessageStringTable::getInstance()->getString("VelocityInterpolateOff"); +char* _PREHASH_AuthorizedBuyerID = LLMessageStringTable::getInstance()->getString("AuthorizedBuyerID"); +char* _PREHASH_AvatarPropertiesReply = LLMessageStringTable::getInstance()->getString("AvatarPropertiesReply"); +char* _PREHASH_GroupProfileReply = LLMessageStringTable::getInstance()->getString("GroupProfileReply"); +char* _PREHASH_SimOwner = LLMessageStringTable::getInstance()->getString("SimOwner"); +char* _PREHASH_SalePrice = LLMessageStringTable::getInstance()->getString("SalePrice"); +char* _PREHASH_Animation = LLMessageStringTable::getInstance()->getString("Animation"); +char* _PREHASH_OwnerID = LLMessageStringTable::getInstance()->getString("OwnerID"); +char* _PREHASH_NearestLandingRegionUpdated = LLMessageStringTable::getInstance()->getString("NearestLandingRegionUpdated"); +char* _PREHASH_PassToAgent = LLMessageStringTable::getInstance()->getString("PassToAgent"); +char* _PREHASH_PreyAgent = LLMessageStringTable::getInstance()->getString("PreyAgent"); +char* _PREHASH_SimStats = LLMessageStringTable::getInstance()->getString("SimStats"); +char* _PREHASH_LogoutReply = LLMessageStringTable::getInstance()->getString("LogoutReply"); +char* _PREHASH_FeatureDisabled = LLMessageStringTable::getInstance()->getString("FeatureDisabled"); +char* _PREHASH_PhysicalAvatarEventList = LLMessageStringTable::getInstance()->getString("PhysicalAvatarEventList"); +char* _PREHASH_ObjectLocalID = LLMessageStringTable::getInstance()->getString("ObjectLocalID"); +char* _PREHASH_Dropped = LLMessageStringTable::getInstance()->getString("Dropped"); +char* _PREHASH_WebProfilesDisabled = LLMessageStringTable::getInstance()->getString("WebProfilesDisabled"); +char* _PREHASH_Destination = LLMessageStringTable::getInstance()->getString("Destination"); +char* _PREHASH_MasterID = LLMessageStringTable::getInstance()->getString("MasterID"); +char* _PREHASH_TransferData = LLMessageStringTable::getInstance()->getString("TransferData"); +char* _PREHASH_WantToMask = LLMessageStringTable::getInstance()->getString("WantToMask"); +char* _PREHASH_ParcelSelectObjects = LLMessageStringTable::getInstance()->getString("ParcelSelectObjects"); +char* _PREHASH_ExtraParams = LLMessageStringTable::getInstance()->getString("ExtraParams"); +char* _PREHASH_CreatorID = LLMessageStringTable::getInstance()->getString("CreatorID"); +char* _PREHASH_Summary = LLMessageStringTable::getInstance()->getString("Summary"); +char* _PREHASH_BuyObjectInventory = LLMessageStringTable::getInstance()->getString("BuyObjectInventory"); +char* _PREHASH_FetchInventory = LLMessageStringTable::getInstance()->getString("FetchInventory"); +char* _PREHASH_InventoryID = LLMessageStringTable::getInstance()->getString("InventoryID"); +char* _PREHASH_PacketNumber = LLMessageStringTable::getInstance()->getString("PacketNumber"); +char* _PREHASH_SetFollowCamProperties = LLMessageStringTable::getInstance()->getString("SetFollowCamProperties"); +char* _PREHASH_ClearFollowCamProperties = LLMessageStringTable::getInstance()->getString("ClearFollowCamProperties"); +char* _PREHASH_SequenceID = LLMessageStringTable::getInstance()->getString("SequenceID"); +char* _PREHASH_DataServerLogout = LLMessageStringTable::getInstance()->getString("DataServerLogout"); +char* _PREHASH_NameValue = LLMessageStringTable::getInstance()->getString("NameValue"); +char* _PREHASH_PathShearX = LLMessageStringTable::getInstance()->getString("PathShearX"); +char* _PREHASH_PathShearY = LLMessageStringTable::getInstance()->getString("PathShearY"); +char* _PREHASH_Velocity = LLMessageStringTable::getInstance()->getString("Velocity"); +char* _PREHASH_SecPerYear = LLMessageStringTable::getInstance()->getString("SecPerYear"); +char* _PREHASH_FirstName = LLMessageStringTable::getInstance()->getString("FirstName"); +char* _PREHASH_AttachedSoundGainChange = LLMessageStringTable::getInstance()->getString("AttachedSoundGainChange"); +char* _PREHASH_LocationID = LLMessageStringTable::getInstance()->getString("LocationID"); +char* _PREHASH_Running = LLMessageStringTable::getInstance()->getString("Running"); +char* _PREHASH_AgentThrottle = LLMessageStringTable::getInstance()->getString("AgentThrottle"); +char* _PREHASH_NeighborList = LLMessageStringTable::getInstance()->getString("NeighborList"); +char* _PREHASH_PathTaperX = LLMessageStringTable::getInstance()->getString("PathTaperX"); +char* _PREHASH_PathTaperY = LLMessageStringTable::getInstance()->getString("PathTaperY"); +char* _PREHASH_AgentRelated = LLMessageStringTable::getInstance()->getString("AgentRelated"); +char* _PREHASH_GranterBlock = LLMessageStringTable::getInstance()->getString("GranterBlock"); +char* _PREHASH_UseCachedMuteList = LLMessageStringTable::getInstance()->getString("UseCachedMuteList"); +char* _PREHASH_FailStats = LLMessageStringTable::getInstance()->getString("FailStats"); +char* _PREHASH_Tempfile = LLMessageStringTable::getInstance()->getString("Tempfile"); +char* _PREHASH_BuyerID = LLMessageStringTable::getInstance()->getString("BuyerID"); +char* _PREHASH_DirPeopleReply = LLMessageStringTable::getInstance()->getString("DirPeopleReply"); +char* _PREHASH_TransferInfo = LLMessageStringTable::getInstance()->getString("TransferInfo"); +char* _PREHASH_AvatarPickerRequestBackend = LLMessageStringTable::getInstance()->getString("AvatarPickerRequestBackend"); +char* _PREHASH_AvatarPropertiesRequestBackend = LLMessageStringTable::getInstance()->getString("AvatarPropertiesRequestBackend"); +char* _PREHASH_UpdateData = LLMessageStringTable::getInstance()->getString("UpdateData"); +char* _PREHASH_SimFPS = LLMessageStringTable::getInstance()->getString("SimFPS"); +char* _PREHASH_ReporterID = LLMessageStringTable::getInstance()->getString("ReporterID"); +char* _PREHASH_ButtonLabel = LLMessageStringTable::getInstance()->getString("ButtonLabel"); +char* _PREHASH_GranterID = LLMessageStringTable::getInstance()->getString("GranterID"); +char* _PREHASH_WantToText = LLMessageStringTable::getInstance()->getString("WantToText"); +char* _PREHASH_ReportType = LLMessageStringTable::getInstance()->getString("ReportType"); +char* _PREHASH_SimulatorReady = LLMessageStringTable::getInstance()->getString("SimulatorReady"); +char* _PREHASH_DataBlock = LLMessageStringTable::getInstance()->getString("DataBlock"); +char* _PREHASH_AnimationSourceList = LLMessageStringTable::getInstance()->getString("AnimationSourceList"); +char* _PREHASH_SubscribeLoad = LLMessageStringTable::getInstance()->getString("SubscribeLoad"); +char* _PREHASH_UnsubscribeLoad = LLMessageStringTable::getInstance()->getString("UnsubscribeLoad"); +char* _PREHASH_Packet = LLMessageStringTable::getInstance()->getString("Packet"); +char* _PREHASH_UndoLand = LLMessageStringTable::getInstance()->getString("UndoLand"); +char* _PREHASH_SimAccess = LLMessageStringTable::getInstance()->getString("SimAccess"); +char* _PREHASH_AbuserID = LLMessageStringTable::getInstance()->getString("AbuserID"); +char* _PREHASH_MembershipFee = LLMessageStringTable::getInstance()->getString("MembershipFee"); +char* _PREHASH_InviteGroupResponse = LLMessageStringTable::getInstance()->getString("InviteGroupResponse"); +char* _PREHASH_CreateInventoryFolder = LLMessageStringTable::getInstance()->getString("CreateInventoryFolder"); +char* _PREHASH_UpdateInventoryFolder = LLMessageStringTable::getInstance()->getString("UpdateInventoryFolder"); +char* _PREHASH_MoveInventoryFolder = LLMessageStringTable::getInstance()->getString("MoveInventoryFolder"); +char* _PREHASH_RemoveInventoryFolder = LLMessageStringTable::getInstance()->getString("RemoveInventoryFolder"); +char* _PREHASH_MoneyData = LLMessageStringTable::getInstance()->getString("MoneyData"); +char* _PREHASH_ObjectDeselect = LLMessageStringTable::getInstance()->getString("ObjectDeselect"); +char* _PREHASH_NewAssetID = LLMessageStringTable::getInstance()->getString("NewAssetID"); +char* _PREHASH_ObjectAdd = LLMessageStringTable::getInstance()->getString("ObjectAdd"); +char* _PREHASH_RayEndIsIntersection = LLMessageStringTable::getInstance()->getString("RayEndIsIntersection"); +char* _PREHASH_CompleteAuction = LLMessageStringTable::getInstance()->getString("CompleteAuction"); +char* _PREHASH_CircuitCode = LLMessageStringTable::getInstance()->getString("CircuitCode"); +char* _PREHASH_AgentMovementComplete = LLMessageStringTable::getInstance()->getString("AgentMovementComplete"); +char* _PREHASH_ViewerIP = LLMessageStringTable::getInstance()->getString("ViewerIP"); +char* _PREHASH_Header = LLMessageStringTable::getInstance()->getString("Header"); +char* _PREHASH_GestureFlags = LLMessageStringTable::getInstance()->getString("GestureFlags"); +char* _PREHASH_XferID = LLMessageStringTable::getInstance()->getString("XferID"); +char* _PREHASH_StatValue = LLMessageStringTable::getInstance()->getString("StatValue"); +char* _PREHASH_TaskID = LLMessageStringTable::getInstance()->getString("TaskID"); +char* _PREHASH_PickID = LLMessageStringTable::getInstance()->getString("PickID"); +char* _PREHASH_RayEnd = LLMessageStringTable::getInstance()->getString("RayEnd"); +char* _PREHASH_Throttles = LLMessageStringTable::getInstance()->getString("Throttles"); +char* _PREHASH_RebakeAvatarTextures = LLMessageStringTable::getInstance()->getString("RebakeAvatarTextures"); +char* _PREHASH_UpAxis = LLMessageStringTable::getInstance()->getString("UpAxis"); +char* _PREHASH_AgentTextures = LLMessageStringTable::getInstance()->getString("AgentTextures"); +char* _PREHASH_NotecardData = LLMessageStringTable::getInstance()->getString("NotecardData"); +char* _PREHASH_Radius = LLMessageStringTable::getInstance()->getString("Radius"); +char* _PREHASH_OffCircuit = LLMessageStringTable::getInstance()->getString("OffCircuit"); +char* _PREHASH_Access = LLMessageStringTable::getInstance()->getString("Access"); +char* _PREHASH_TitleRoleID = LLMessageStringTable::getInstance()->getString("TitleRoleID"); +char* _PREHASH_SquareMetersCredit = LLMessageStringTable::getInstance()->getString("SquareMetersCredit"); +char* _PREHASH_Filename = LLMessageStringTable::getInstance()->getString("Filename"); +char* _PREHASH_ClassifiedInfoRequest = LLMessageStringTable::getInstance()->getString("ClassifiedInfoRequest"); +char* _PREHASH_ParcelInfoRequest = LLMessageStringTable::getInstance()->getString("ParcelInfoRequest"); +char* _PREHASH_ParcelObjectOwnersRequest = LLMessageStringTable::getInstance()->getString("ParcelObjectOwnersRequest"); +char* _PREHASH_TeleportLandmarkRequest = LLMessageStringTable::getInstance()->getString("TeleportLandmarkRequest"); +char* _PREHASH_EventInfoRequest = LLMessageStringTable::getInstance()->getString("EventInfoRequest"); +char* _PREHASH_MoneyBalanceRequest = LLMessageStringTable::getInstance()->getString("MoneyBalanceRequest"); +char* _PREHASH_GroupMembersRequest = LLMessageStringTable::getInstance()->getString("GroupMembersRequest"); +char* _PREHASH_GroupRoleMembersRequest = LLMessageStringTable::getInstance()->getString("GroupRoleMembersRequest"); +char* _PREHASH_ChatFromSimulator = LLMessageStringTable::getInstance()->getString("ChatFromSimulator"); +char* _PREHASH_OldFolderID = LLMessageStringTable::getInstance()->getString("OldFolderID"); +char* _PREHASH_UserInfoRequest = LLMessageStringTable::getInstance()->getString("UserInfoRequest"); +char* _PREHASH_TextureID = LLMessageStringTable::getInstance()->getString("TextureID"); +char* _PREHASH_ProfileURL = LLMessageStringTable::getInstance()->getString("ProfileURL"); +char* _PREHASH_Handle = LLMessageStringTable::getInstance()->getString("Handle"); +char* _PREHASH_ButtonIndex = LLMessageStringTable::getInstance()->getString("ButtonIndex"); +char* _PREHASH_GetScriptRunning = LLMessageStringTable::getInstance()->getString("GetScriptRunning"); +char* _PREHASH_SetScriptRunning = LLMessageStringTable::getInstance()->getString("SetScriptRunning"); +char* _PREHASH_Health = LLMessageStringTable::getInstance()->getString("Health"); +char* _PREHASH_CircuitInfo = LLMessageStringTable::getInstance()->getString("CircuitInfo"); +char* _PREHASH_ObjectBuy = LLMessageStringTable::getInstance()->getString("ObjectBuy"); +char* _PREHASH_ProfileEnd = LLMessageStringTable::getInstance()->getString("ProfileEnd"); +char* _PREHASH_Effect = LLMessageStringTable::getInstance()->getString("Effect"); +char* _PREHASH_TestMessage = LLMessageStringTable::getInstance()->getString("TestMessage"); +char* _PREHASH_ScriptMailRegistration = LLMessageStringTable::getInstance()->getString("ScriptMailRegistration"); +char* _PREHASH_AgentSetAppearance = LLMessageStringTable::getInstance()->getString("AgentSetAppearance"); +char* _PREHASH_AvatarAppearance = LLMessageStringTable::getInstance()->getString("AvatarAppearance"); +char* _PREHASH_RegionData = LLMessageStringTable::getInstance()->getString("RegionData"); +char* _PREHASH_RequestingRegionData = LLMessageStringTable::getInstance()->getString("RequestingRegionData"); +char* _PREHASH_LandingRegionData = LLMessageStringTable::getInstance()->getString("LandingRegionData"); +char* _PREHASH_SitTransform = LLMessageStringTable::getInstance()->getString("SitTransform"); +char* _PREHASH_TerrainBase0 = LLMessageStringTable::getInstance()->getString("TerrainBase0"); +char* _PREHASH_SkillsMask = LLMessageStringTable::getInstance()->getString("SkillsMask"); +char* _PREHASH_AtAxis = LLMessageStringTable::getInstance()->getString("AtAxis"); +char* _PREHASH_TerrainBase1 = LLMessageStringTable::getInstance()->getString("TerrainBase1"); +char* _PREHASH_Reason = LLMessageStringTable::getInstance()->getString("Reason"); +char* _PREHASH_TerrainBase2 = LLMessageStringTable::getInstance()->getString("TerrainBase2"); +char* _PREHASH_TerrainBase3 = LLMessageStringTable::getInstance()->getString("TerrainBase3"); +char* _PREHASH_Params = LLMessageStringTable::getInstance()->getString("Params"); +char* _PREHASH_PingID = LLMessageStringTable::getInstance()->getString("PingID"); +char* _PREHASH_Change = LLMessageStringTable::getInstance()->getString("Change"); +char* _PREHASH_Height = LLMessageStringTable::getInstance()->getString("Height"); +char* _PREHASH_Region = LLMessageStringTable::getInstance()->getString("Region"); +char* _PREHASH_TelehubInfo = LLMessageStringTable::getInstance()->getString("TelehubInfo"); +char* _PREHASH_StateSave = LLMessageStringTable::getInstance()->getString("StateSave"); +char* _PREHASH_RoleData = LLMessageStringTable::getInstance()->getString("RoleData"); +char* _PREHASH_AgentAnimation = LLMessageStringTable::getInstance()->getString("AgentAnimation"); +char* _PREHASH_AvatarAnimation = LLMessageStringTable::getInstance()->getString("AvatarAnimation"); +char* _PREHASH_LogDwellTime = LLMessageStringTable::getInstance()->getString("LogDwellTime"); +char* _PREHASH_ParcelGodMarkAsContent = LLMessageStringTable::getInstance()->getString("ParcelGodMarkAsContent"); +char* _PREHASH_UsePhysics = LLMessageStringTable::getInstance()->getString("UsePhysics"); +char* _PREHASH_RegionDenyTransacted = LLMessageStringTable::getInstance()->getString("RegionDenyTransacted"); +char* _PREHASH_JointType = LLMessageStringTable::getInstance()->getString("JointType"); +char* _PREHASH_ObjectTaxEstimate = LLMessageStringTable::getInstance()->getString("ObjectTaxEstimate"); +char* _PREHASH_LightTaxEstimate = LLMessageStringTable::getInstance()->getString("LightTaxEstimate"); +char* _PREHASH_LandTaxEstimate = LLMessageStringTable::getInstance()->getString("LandTaxEstimate"); +char* _PREHASH_TeleportLandingStatusChanged = LLMessageStringTable::getInstance()->getString("TeleportLandingStatusChanged"); +char* _PREHASH_GroupTaxEstimate = LLMessageStringTable::getInstance()->getString("GroupTaxEstimate"); +char* _PREHASH_AvgViewerFPS = LLMessageStringTable::getInstance()->getString("AvgViewerFPS"); +char* _PREHASH_Buttons = LLMessageStringTable::getInstance()->getString("Buttons"); +char* _PREHASH_Sender = LLMessageStringTable::getInstance()->getString("Sender"); +char* _PREHASH_Dialog = LLMessageStringTable::getInstance()->getString("Dialog"); +char* _PREHASH_TargetData = LLMessageStringTable::getInstance()->getString("TargetData"); +char* _PREHASH_DestID = LLMessageStringTable::getInstance()->getString("DestID"); +char* _PREHASH_PricePublicObjectDelete = LLMessageStringTable::getInstance()->getString("PricePublicObjectDelete"); +char* _PREHASH_ObjectDelete = LLMessageStringTable::getInstance()->getString("ObjectDelete"); +char* _PREHASH_Delete = LLMessageStringTable::getInstance()->getString("Delete"); +char* _PREHASH_EventGodDelete = LLMessageStringTable::getInstance()->getString("EventGodDelete"); +char* _PREHASH_LastTaxDate = LLMessageStringTable::getInstance()->getString("LastTaxDate"); +char* _PREHASH_MapImageID = LLMessageStringTable::getInstance()->getString("MapImageID"); +char* _PREHASH_EndDateTime = LLMessageStringTable::getInstance()->getString("EndDateTime"); +char* _PREHASH_TerrainDetail0 = LLMessageStringTable::getInstance()->getString("TerrainDetail0"); +char* _PREHASH_TerrainDetail1 = LLMessageStringTable::getInstance()->getString("TerrainDetail1"); +char* _PREHASH_TerrainDetail2 = LLMessageStringTable::getInstance()->getString("TerrainDetail2"); +char* _PREHASH_TerrainDetail3 = LLMessageStringTable::getInstance()->getString("TerrainDetail3"); +char* _PREHASH_Offset = LLMessageStringTable::getInstance()->getString("Offset"); +char* _PREHASH_ObjectDelink = LLMessageStringTable::getInstance()->getString("ObjectDelink"); +char* _PREHASH_TargetObject = LLMessageStringTable::getInstance()->getString("TargetObject"); +char* _PREHASH_IsEstateManager = LLMessageStringTable::getInstance()->getString("IsEstateManager"); +char* _PREHASH_CancelAuction = LLMessageStringTable::getInstance()->getString("CancelAuction"); +char* _PREHASH_ObjectDetach = LLMessageStringTable::getInstance()->getString("ObjectDetach"); +char* _PREHASH_Compressed = LLMessageStringTable::getInstance()->getString("Compressed"); +char* _PREHASH_PathBegin = LLMessageStringTable::getInstance()->getString("PathBegin"); +char* _PREHASH_BypassRaycast = LLMessageStringTable::getInstance()->getString("BypassRaycast"); +char* _PREHASH_WinnerID = LLMessageStringTable::getInstance()->getString("WinnerID"); +char* _PREHASH_ChannelType = LLMessageStringTable::getInstance()->getString("ChannelType"); +char* _PREHASH_NonExemptMembers = LLMessageStringTable::getInstance()->getString("NonExemptMembers"); +char* _PREHASH_Agents = LLMessageStringTable::getInstance()->getString("Agents"); +char* _PREHASH_MemberData = LLMessageStringTable::getInstance()->getString("MemberData"); +char* _PREHASH_ToGroupID = LLMessageStringTable::getInstance()->getString("ToGroupID"); +char* _PREHASH_ImageNotInDatabase = LLMessageStringTable::getInstance()->getString("ImageNotInDatabase"); +char* _PREHASH_StartDate = LLMessageStringTable::getInstance()->getString("StartDate"); +char* _PREHASH_AnimID = LLMessageStringTable::getInstance()->getString("AnimID"); +char* _PREHASH_Serial = LLMessageStringTable::getInstance()->getString("Serial"); +char* _PREHASH_AbuseRegionName = LLMessageStringTable::getInstance()->getString("AbuseRegionName"); +char* _PREHASH_ModifyLand = LLMessageStringTable::getInstance()->getString("ModifyLand"); +char* _PREHASH_Digest = LLMessageStringTable::getInstance()->getString("Digest"); +char* _PREHASH_Victim = LLMessageStringTable::getInstance()->getString("Victim"); +char* _PREHASH_Script = LLMessageStringTable::getInstance()->getString("Script"); +char* _PREHASH_PickInfoReply = LLMessageStringTable::getInstance()->getString("PickInfoReply"); +char* _PREHASH_MoneyBalanceReply = LLMessageStringTable::getInstance()->getString("MoneyBalanceReply"); +char* _PREHASH_RoutedMoneyBalanceReply = LLMessageStringTable::getInstance()->getString("RoutedMoneyBalanceReply"); +char* _PREHASH_RoleID = LLMessageStringTable::getInstance()->getString("RoleID"); +char* _PREHASH_RegionInfo = LLMessageStringTable::getInstance()->getString("RegionInfo"); +char* _PREHASH_GodUpdateRegionInfo = LLMessageStringTable::getInstance()->getString("GodUpdateRegionInfo"); +char* _PREHASH_StartAnim = LLMessageStringTable::getInstance()->getString("StartAnim"); +char* _PREHASH_Action = LLMessageStringTable::getInstance()->getString("Action"); +char* _PREHASH_Location = LLMessageStringTable::getInstance()->getString("Location"); +char* _PREHASH_Rights = LLMessageStringTable::getInstance()->getString("Rights"); +char* _PREHASH_SearchDir = LLMessageStringTable::getInstance()->getString("SearchDir"); +char* _PREHASH_TransferRequest = LLMessageStringTable::getInstance()->getString("TransferRequest"); +char* _PREHASH_ScriptSensorRequest = LLMessageStringTable::getInstance()->getString("ScriptSensorRequest"); +char* _PREHASH_MoneyTransferRequest = LLMessageStringTable::getInstance()->getString("MoneyTransferRequest"); +char* _PREHASH_EjectGroupMemberRequest = LLMessageStringTable::getInstance()->getString("EjectGroupMemberRequest"); +char* _PREHASH_SkillsText = LLMessageStringTable::getInstance()->getString("SkillsText"); +char* _PREHASH_Resent = LLMessageStringTable::getInstance()->getString("Resent"); +char* _PREHASH_Center = LLMessageStringTable::getInstance()->getString("Center"); +char* _PREHASH_SharedData = LLMessageStringTable::getInstance()->getString("SharedData"); +char* _PREHASH_PSBlock = LLMessageStringTable::getInstance()->getString("PSBlock"); +char* _PREHASH_UUIDNameBlock = LLMessageStringTable::getInstance()->getString("UUIDNameBlock"); +char* _PREHASH_GroupTitleUpdate = LLMessageStringTable::getInstance()->getString("GroupTitleUpdate"); +char* _PREHASH_Method = LLMessageStringTable::getInstance()->getString("Method"); +char* _PREHASH_TouchName = LLMessageStringTable::getInstance()->getString("TouchName"); +char* _PREHASH_UpdateType = LLMessageStringTable::getInstance()->getString("UpdateType"); +char* _PREHASH_KickedFromEstateID = LLMessageStringTable::getInstance()->getString("KickedFromEstateID"); +char* _PREHASH_CandidateID = LLMessageStringTable::getInstance()->getString("CandidateID"); +char* _PREHASH_ParamData = LLMessageStringTable::getInstance()->getString("ParamData"); +char* _PREHASH_GodlikeMessage = LLMessageStringTable::getInstance()->getString("GodlikeMessage"); +char* _PREHASH_SystemMessage = LLMessageStringTable::getInstance()->getString("SystemMessage"); +char* _PREHASH_BodyRotation = LLMessageStringTable::getInstance()->getString("BodyRotation"); +char* _PREHASH_SearchRegions = LLMessageStringTable::getInstance()->getString("SearchRegions"); +char* _PREHASH_AnimationData = LLMessageStringTable::getInstance()->getString("AnimationData"); +char* _PREHASH_StatID = LLMessageStringTable::getInstance()->getString("StatID"); +char* _PREHASH_ItemID = LLMessageStringTable::getInstance()->getString("ItemID"); +char* _PREHASH_ScriptDialogReply = LLMessageStringTable::getInstance()->getString("ScriptDialogReply"); +char* _PREHASH_RegionIDAndHandleReply = LLMessageStringTable::getInstance()->getString("RegionIDAndHandleReply"); +char* _PREHASH_CameraAtOffset = LLMessageStringTable::getInstance()->getString("CameraAtOffset"); +char* _PREHASH_VoteID = LLMessageStringTable::getInstance()->getString("VoteID"); +char* _PREHASH_ParcelGodForceOwner = LLMessageStringTable::getInstance()->getString("ParcelGodForceOwner"); +char* _PREHASH_Filter = LLMessageStringTable::getInstance()->getString("Filter"); +char* _PREHASH_InviteData = LLMessageStringTable::getInstance()->getString("InviteData"); +char* _PREHASH_PCode = LLMessageStringTable::getInstance()->getString("PCode"); +char* _PREHASH_SearchPos = LLMessageStringTable::getInstance()->getString("SearchPos"); +char* _PREHASH_PreyID = LLMessageStringTable::getInstance()->getString("PreyID"); +char* _PREHASH_TerrainLowerLimit = LLMessageStringTable::getInstance()->getString("TerrainLowerLimit"); +char* _PREHASH_EventFlags = LLMessageStringTable::getInstance()->getString("EventFlags"); +char* _PREHASH_TallyVotes = LLMessageStringTable::getInstance()->getString("TallyVotes"); +char* _PREHASH_Result = LLMessageStringTable::getInstance()->getString("Result"); +char* _PREHASH_LookAt = LLMessageStringTable::getInstance()->getString("LookAt"); +char* _PREHASH_SearchOrder = LLMessageStringTable::getInstance()->getString("SearchOrder"); +char* _PREHASH_PayButton = LLMessageStringTable::getInstance()->getString("PayButton"); +char* _PREHASH_SelfCount = LLMessageStringTable::getInstance()->getString("SelfCount"); +char* _PREHASH_PacketCount = LLMessageStringTable::getInstance()->getString("PacketCount"); +char* _PREHASH_ParcelBuyPass = LLMessageStringTable::getInstance()->getString("ParcelBuyPass"); +char* _PREHASH_OldItemID = LLMessageStringTable::getInstance()->getString("OldItemID"); +char* _PREHASH_RegionPort = LLMessageStringTable::getInstance()->getString("RegionPort"); +char* _PREHASH_PriceEnergyUnit = LLMessageStringTable::getInstance()->getString("PriceEnergyUnit"); +char* _PREHASH_Bitmap = LLMessageStringTable::getInstance()->getString("Bitmap"); +char* _PREHASH_CacheMissType = LLMessageStringTable::getInstance()->getString("CacheMissType"); +char* _PREHASH_VFileID = LLMessageStringTable::getInstance()->getString("VFileID"); +char* _PREHASH_GroupInsigniaID = LLMessageStringTable::getInstance()->getString("GroupInsigniaID"); +char* _PREHASH_Online = LLMessageStringTable::getInstance()->getString("Online"); +char* _PREHASH_KickFlags = LLMessageStringTable::getInstance()->getString("KickFlags"); +char* _PREHASH_CovenantID = LLMessageStringTable::getInstance()->getString("CovenantID"); +char* _PREHASH_SysCPU = LLMessageStringTable::getInstance()->getString("SysCPU"); +char* _PREHASH_EMail = LLMessageStringTable::getInstance()->getString("EMail"); +char* _PREHASH_AggregatePermTextures = LLMessageStringTable::getInstance()->getString("AggregatePermTextures"); +char* _PREHASH_ChatChannel = LLMessageStringTable::getInstance()->getString("ChatChannel"); +char* _PREHASH_ReturnID = LLMessageStringTable::getInstance()->getString("ReturnID"); +char* _PREHASH_ObjectAttach = LLMessageStringTable::getInstance()->getString("ObjectAttach"); +char* _PREHASH_TargetPort = LLMessageStringTable::getInstance()->getString("TargetPort"); +char* _PREHASH_ObjectSpinStop = LLMessageStringTable::getInstance()->getString("ObjectSpinStop"); +char* _PREHASH_FullID = LLMessageStringTable::getInstance()->getString("FullID"); +char* _PREHASH_ActivateGroup = LLMessageStringTable::getInstance()->getString("ActivateGroup"); +char* _PREHASH_SysGPU = LLMessageStringTable::getInstance()->getString("SysGPU"); +char* _PREHASH_AvatarInterestsReply = LLMessageStringTable::getInstance()->getString("AvatarInterestsReply"); +char* _PREHASH_StartLure = LLMessageStringTable::getInstance()->getString("StartLure"); +char* _PREHASH_SysRAM = LLMessageStringTable::getInstance()->getString("SysRAM"); +char* _PREHASH_ObjectPosition = LLMessageStringTable::getInstance()->getString("ObjectPosition"); +char* _PREHASH_SitPosition = LLMessageStringTable::getInstance()->getString("SitPosition"); +char* _PREHASH_StartTime = LLMessageStringTable::getInstance()->getString("StartTime"); +char* _PREHASH_BornOn = LLMessageStringTable::getInstance()->getString("BornOn"); +char* _PREHASH_CameraCollidePlane = LLMessageStringTable::getInstance()->getString("CameraCollidePlane"); +char* _PREHASH_EconomyDataRequest = LLMessageStringTable::getInstance()->getString("EconomyDataRequest"); +char* _PREHASH_TeleportLureRequest = LLMessageStringTable::getInstance()->getString("TeleportLureRequest"); +char* _PREHASH_FolderID = LLMessageStringTable::getInstance()->getString("FolderID"); +char* _PREHASH_RegionHandleRequest = LLMessageStringTable::getInstance()->getString("RegionHandleRequest"); +char* _PREHASH_ScriptDataRequest = LLMessageStringTable::getInstance()->getString("ScriptDataRequest"); +char* _PREHASH_GroupRoleDataRequest = LLMessageStringTable::getInstance()->getString("GroupRoleDataRequest"); +char* _PREHASH_GroupTitlesRequest = LLMessageStringTable::getInstance()->getString("GroupTitlesRequest"); +char* _PREHASH_AgentWearablesRequest = LLMessageStringTable::getInstance()->getString("AgentWearablesRequest"); +char* _PREHASH_MapBlockRequest = LLMessageStringTable::getInstance()->getString("MapBlockRequest"); +char* _PREHASH_LureID = LLMessageStringTable::getInstance()->getString("LureID"); +char* _PREHASH_CopyCenters = LLMessageStringTable::getInstance()->getString("CopyCenters"); +char* _PREHASH_ParamList = LLMessageStringTable::getInstance()->getString("ParamList"); +char* _PREHASH_InventorySerial = LLMessageStringTable::getInstance()->getString("InventorySerial"); +char* _PREHASH_EdgeDataPacket = LLMessageStringTable::getInstance()->getString("EdgeDataPacket"); +char* _PREHASH_AvatarPickerReply = LLMessageStringTable::getInstance()->getString("AvatarPickerReply"); +char* _PREHASH_ParcelDwellReply = LLMessageStringTable::getInstance()->getString("ParcelDwellReply"); +char* _PREHASH_IsForSale = LLMessageStringTable::getInstance()->getString("IsForSale"); +char* _PREHASH_MuteID = LLMessageStringTable::getInstance()->getString("MuteID"); +char* _PREHASH_MeanCollisionAlert = LLMessageStringTable::getInstance()->getString("MeanCollisionAlert"); +char* _PREHASH_CanAcceptTasks = LLMessageStringTable::getInstance()->getString("CanAcceptTasks"); +char* _PREHASH_ItemData = LLMessageStringTable::getInstance()->getString("ItemData"); +char* _PREHASH_AnimationList = LLMessageStringTable::getInstance()->getString("AnimationList"); +char* _PREHASH_Reputation = LLMessageStringTable::getInstance()->getString("Reputation"); +char* _PREHASH_IntValue = LLMessageStringTable::getInstance()->getString("IntValue"); +char* _PREHASH_TargetType = LLMessageStringTable::getInstance()->getString("TargetType"); +char* _PREHASH_Amount = LLMessageStringTable::getInstance()->getString("Amount"); +char* _PREHASH_HasAttachment = LLMessageStringTable::getInstance()->getString("HasAttachment"); +char* _PREHASH_UpdateAttachment = LLMessageStringTable::getInstance()->getString("UpdateAttachment"); +char* _PREHASH_RemoveAttachment = LLMessageStringTable::getInstance()->getString("RemoveAttachment"); +char* _PREHASH_HeightWidthBlock = LLMessageStringTable::getInstance()->getString("HeightWidthBlock"); +char* _PREHASH_RequestObjectPropertiesFamily = LLMessageStringTable::getInstance()->getString("RequestObjectPropertiesFamily"); +char* _PREHASH_ObjectPropertiesFamily = LLMessageStringTable::getInstance()->getString("ObjectPropertiesFamily"); +char* _PREHASH_UserData = LLMessageStringTable::getInstance()->getString("UserData"); +char* _PREHASH_IsReadable = LLMessageStringTable::getInstance()->getString("IsReadable"); +char* _PREHASH_PathCurve = LLMessageStringTable::getInstance()->getString("PathCurve"); +char* _PREHASH_Status = LLMessageStringTable::getInstance()->getString("Status"); +char* _PREHASH_FromGroup = LLMessageStringTable::getInstance()->getString("FromGroup"); +char* _PREHASH_AlreadyVoted = LLMessageStringTable::getInstance()->getString("AlreadyVoted"); +char* _PREHASH_PlacesReply = LLMessageStringTable::getInstance()->getString("PlacesReply"); +char* _PREHASH_DirPlacesReply = LLMessageStringTable::getInstance()->getString("DirPlacesReply"); +char* _PREHASH_ParcelBuy = LLMessageStringTable::getInstance()->getString("ParcelBuy"); +char* _PREHASH_DirFindQueryBackend = LLMessageStringTable::getInstance()->getString("DirFindQueryBackend"); +char* _PREHASH_DirPlacesQueryBackend = LLMessageStringTable::getInstance()->getString("DirPlacesQueryBackend"); +char* _PREHASH_DirClassifiedQueryBackend = LLMessageStringTable::getInstance()->getString("DirClassifiedQueryBackend"); +char* _PREHASH_DirLandQueryBackend = LLMessageStringTable::getInstance()->getString("DirLandQueryBackend"); +char* _PREHASH_DirPopularQueryBackend = LLMessageStringTable::getInstance()->getString("DirPopularQueryBackend"); +char* _PREHASH_HistoryData = LLMessageStringTable::getInstance()->getString("HistoryData"); +char* _PREHASH_SnapshotID = LLMessageStringTable::getInstance()->getString("SnapshotID"); +char* _PREHASH_Aspect = LLMessageStringTable::getInstance()->getString("Aspect"); +char* _PREHASH_ParamSize = LLMessageStringTable::getInstance()->getString("ParamSize"); +char* _PREHASH_VoteCast = LLMessageStringTable::getInstance()->getString("VoteCast"); +char* _PREHASH_CastsShadows = LLMessageStringTable::getInstance()->getString("CastsShadows"); +char* _PREHASH_EveryoneMask = LLMessageStringTable::getInstance()->getString("EveryoneMask"); +char* _PREHASH_ObjectSpinUpdate = LLMessageStringTable::getInstance()->getString("ObjectSpinUpdate"); +char* _PREHASH_MaturePublish = LLMessageStringTable::getInstance()->getString("MaturePublish"); +char* _PREHASH_UseExistingAsset = LLMessageStringTable::getInstance()->getString("UseExistingAsset"); +char* _PREHASH_Powers = LLMessageStringTable::getInstance()->getString("Powers"); +char* _PREHASH_ParcelLocalID = LLMessageStringTable::getInstance()->getString("ParcelLocalID"); +char* _PREHASH_TeleportCancel = LLMessageStringTable::getInstance()->getString("TeleportCancel"); +char* _PREHASH_UnixTime = LLMessageStringTable::getInstance()->getString("UnixTime"); +char* _PREHASH_QueryFlags = LLMessageStringTable::getInstance()->getString("QueryFlags"); +char* _PREHASH_AlwaysRun = LLMessageStringTable::getInstance()->getString("AlwaysRun"); +char* _PREHASH_Bottom = LLMessageStringTable::getInstance()->getString("Bottom"); +char* _PREHASH_ButtonData = LLMessageStringTable::getInstance()->getString("ButtonData"); +char* _PREHASH_SoundData = LLMessageStringTable::getInstance()->getString("SoundData"); +char* _PREHASH_ViewerStats = LLMessageStringTable::getInstance()->getString("ViewerStats"); +char* _PREHASH_RegionHandshake = LLMessageStringTable::getInstance()->getString("RegionHandshake"); +char* _PREHASH_ObjectDescription = LLMessageStringTable::getInstance()->getString("ObjectDescription"); +char* _PREHASH_Description = LLMessageStringTable::getInstance()->getString("Description"); +char* _PREHASH_ParamType = LLMessageStringTable::getInstance()->getString("ParamType"); +char* _PREHASH_UUIDNameReply = LLMessageStringTable::getInstance()->getString("UUIDNameReply"); +char* _PREHASH_UUIDGroupNameReply = LLMessageStringTable::getInstance()->getString("UUIDGroupNameReply"); +char* _PREHASH_SaveAssetIntoInventory = LLMessageStringTable::getInstance()->getString("SaveAssetIntoInventory"); +char* _PREHASH_UserInfo = LLMessageStringTable::getInstance()->getString("UserInfo"); +char* _PREHASH_AnimSequenceID = LLMessageStringTable::getInstance()->getString("AnimSequenceID"); +char* _PREHASH_NVPairs = LLMessageStringTable::getInstance()->getString("NVPairs"); +char* _PREHASH_GroupNoticesListRequest = LLMessageStringTable::getInstance()->getString("GroupNoticesListRequest"); +char* _PREHASH_ParcelAccessListRequest = LLMessageStringTable::getInstance()->getString("ParcelAccessListRequest"); +char* _PREHASH_MuteListRequest = LLMessageStringTable::getInstance()->getString("MuteListRequest"); +char* _PREHASH_RpcChannelRequest = LLMessageStringTable::getInstance()->getString("RpcChannelRequest"); +char* _PREHASH_LandStatRequest = LLMessageStringTable::getInstance()->getString("LandStatRequest"); +char* _PREHASH_PlacesQuery = LLMessageStringTable::getInstance()->getString("PlacesQuery"); +char* _PREHASH_DirPlacesQuery = LLMessageStringTable::getInstance()->getString("DirPlacesQuery"); +char* _PREHASH_SortOrder = LLMessageStringTable::getInstance()->getString("SortOrder"); +char* _PREHASH_Hunter = LLMessageStringTable::getInstance()->getString("Hunter"); +char* _PREHASH_SunAngVelocity = LLMessageStringTable::getInstance()->getString("SunAngVelocity"); +char* _PREHASH_BinaryBucket = LLMessageStringTable::getInstance()->getString("BinaryBucket"); +char* _PREHASH_ImagePacket = LLMessageStringTable::getInstance()->getString("ImagePacket"); +char* _PREHASH_StartGroupProposal = LLMessageStringTable::getInstance()->getString("StartGroupProposal"); +char* _PREHASH_EnergyLevel = LLMessageStringTable::getInstance()->getString("EnergyLevel"); +char* _PREHASH_PriceForListing = LLMessageStringTable::getInstance()->getString("PriceForListing"); +char* _PREHASH_Scale = LLMessageStringTable::getInstance()->getString("Scale"); +char* _PREHASH_EstateCovenantReply = LLMessageStringTable::getInstance()->getString("EstateCovenantReply"); +char* _PREHASH_ParentEstateID = LLMessageStringTable::getInstance()->getString("ParentEstateID"); +char* _PREHASH_Extra2 = LLMessageStringTable::getInstance()->getString("Extra2"); +char* _PREHASH_Throttle = LLMessageStringTable::getInstance()->getString("Throttle"); +char* _PREHASH_SimIP = LLMessageStringTable::getInstance()->getString("SimIP"); +char* _PREHASH_GodID = LLMessageStringTable::getInstance()->getString("GodID"); +char* _PREHASH_TeleportMinPrice = LLMessageStringTable::getInstance()->getString("TeleportMinPrice"); +char* _PREHASH_VoteItem = LLMessageStringTable::getInstance()->getString("VoteItem"); +char* _PREHASH_ObjectRotation = LLMessageStringTable::getInstance()->getString("ObjectRotation"); +char* _PREHASH_SitRotation = LLMessageStringTable::getInstance()->getString("SitRotation"); +char* _PREHASH_SnapSelection = LLMessageStringTable::getInstance()->getString("SnapSelection"); +char* _PREHASH_SoundTrigger = LLMessageStringTable::getInstance()->getString("SoundTrigger"); +char* _PREHASH_TerrainRaiseLimit = LLMessageStringTable::getInstance()->getString("TerrainRaiseLimit"); +char* _PREHASH_Quorum = LLMessageStringTable::getInstance()->getString("Quorum"); +char* _PREHASH_AgentBlock = LLMessageStringTable::getInstance()->getString("AgentBlock"); +char* _PREHASH_CommandBlock = LLMessageStringTable::getInstance()->getString("CommandBlock"); +char* _PREHASH_PricePublicObjectDecay = LLMessageStringTable::getInstance()->getString("PricePublicObjectDecay"); +char* _PREHASH_SpawnPointPos = LLMessageStringTable::getInstance()->getString("SpawnPointPos"); +char* _PREHASH_VolumeDetail = LLMessageStringTable::getInstance()->getString("VolumeDetail"); +char* _PREHASH_FromAgentName = LLMessageStringTable::getInstance()->getString("FromAgentName"); +char* _PREHASH_Range = LLMessageStringTable::getInstance()->getString("Range"); +char* _PREHASH_DirectoryVisibility = LLMessageStringTable::getInstance()->getString("DirectoryVisibility"); +char* _PREHASH_PublicIP = LLMessageStringTable::getInstance()->getString("PublicIP"); +char* _PREHASH_TeleportFailed = LLMessageStringTable::getInstance()->getString("TeleportFailed"); +char* _PREHASH_PreloadSound = LLMessageStringTable::getInstance()->getString("PreloadSound"); +char* _PREHASH_ScreenshotID = LLMessageStringTable::getInstance()->getString("ScreenshotID"); +char* _PREHASH_CovenantTimestamp = LLMessageStringTable::getInstance()->getString("CovenantTimestamp"); +char* _PREHASH_OldestUnacked = LLMessageStringTable::getInstance()->getString("OldestUnacked"); +char* _PREHASH_SimulatorIP = LLMessageStringTable::getInstance()->getString("SimulatorIP"); +char* _PREHASH_Value = LLMessageStringTable::getInstance()->getString("Value"); +char* _PREHASH_JointAxisOrAnchor = LLMessageStringTable::getInstance()->getString("JointAxisOrAnchor"); +char* _PREHASH_Test0 = LLMessageStringTable::getInstance()->getString("Test0"); +char* _PREHASH_Test1 = LLMessageStringTable::getInstance()->getString("Test1"); +char* _PREHASH_Test2 = LLMessageStringTable::getInstance()->getString("Test2"); +char* _PREHASH_SunPhase = LLMessageStringTable::getInstance()->getString("SunPhase"); +char* _PREHASH_ParcelDivide = LLMessageStringTable::getInstance()->getString("ParcelDivide"); +char* _PREHASH_PriceObjectClaim = LLMessageStringTable::getInstance()->getString("PriceObjectClaim"); +char* _PREHASH_Field = LLMessageStringTable::getInstance()->getString("Field"); +char* _PREHASH_Ratio = LLMessageStringTable::getInstance()->getString("Ratio"); +char* _PREHASH_JoinGroupReply = LLMessageStringTable::getInstance()->getString("JoinGroupReply"); +char* _PREHASH_LiveHelpGroupReply = LLMessageStringTable::getInstance()->getString("LiveHelpGroupReply"); +char* _PREHASH_Score = LLMessageStringTable::getInstance()->getString("Score"); +char* _PREHASH_Image = LLMessageStringTable::getInstance()->getString("Image"); +char* _PREHASH_ObjectClickAction = LLMessageStringTable::getInstance()->getString("ObjectClickAction"); +char* _PREHASH_Parameter = LLMessageStringTable::getInstance()->getString("Parameter"); +char* _PREHASH_Flags = LLMessageStringTable::getInstance()->getString("Flags"); +char* _PREHASH_Plane = LLMessageStringTable::getInstance()->getString("Plane"); +char* _PREHASH_Width = LLMessageStringTable::getInstance()->getString("Width"); +char* _PREHASH_Right = LLMessageStringTable::getInstance()->getString("Right"); +char* _PREHASH_DirFindQuery = LLMessageStringTable::getInstance()->getString("DirFindQuery"); +char* _PREHASH_Textures = LLMessageStringTable::getInstance()->getString("Textures"); +char* _PREHASH_EventData = LLMessageStringTable::getInstance()->getString("EventData"); +char* _PREHASH_Final = LLMessageStringTable::getInstance()->getString("Final"); +char* _PREHASH_System = LLMessageStringTable::getInstance()->getString("System"); +char* _PREHASH_TelehubPos = LLMessageStringTable::getInstance()->getString("TelehubPos"); +char* _PREHASH_ReportAutosaveCrash = LLMessageStringTable::getInstance()->getString("ReportAutosaveCrash"); +char* _PREHASH_CreateTrustedCircuit = LLMessageStringTable::getInstance()->getString("CreateTrustedCircuit"); +char* _PREHASH_DenyTrustedCircuit = LLMessageStringTable::getInstance()->getString("DenyTrustedCircuit"); +char* _PREHASH_RequestTrustedCircuit = LLMessageStringTable::getInstance()->getString("RequestTrustedCircuit"); +char* _PREHASH_Codec = LLMessageStringTable::getInstance()->getString("Codec"); +char* _PREHASH_Modal = LLMessageStringTable::getInstance()->getString("Modal"); +char* _PREHASH_ChildAgentUnknown = LLMessageStringTable::getInstance()->getString("ChildAgentUnknown"); +char* _PREHASH_LandingType = LLMessageStringTable::getInstance()->getString("LandingType"); +char* _PREHASH_ScriptRunningReply = LLMessageStringTable::getInstance()->getString("ScriptRunningReply"); +char* _PREHASH_Reply = LLMessageStringTable::getInstance()->getString("Reply"); +char* _PREHASH_GroupAccountDetailsReply = LLMessageStringTable::getInstance()->getString("GroupAccountDetailsReply"); +char* _PREHASH_TelehubRot = LLMessageStringTable::getInstance()->getString("TelehubRot"); +char* _PREHASH_AcceptFriendship = LLMessageStringTable::getInstance()->getString("AcceptFriendship"); +char* _PREHASH_ItemType = LLMessageStringTable::getInstance()->getString("ItemType"); +char* _PREHASH_DwellInfo = LLMessageStringTable::getInstance()->getString("DwellInfo"); +char* _PREHASH_AgentResume = LLMessageStringTable::getInstance()->getString("AgentResume"); +char* _PREHASH_MailFilter = LLMessageStringTable::getInstance()->getString("MailFilter"); +char* _PREHASH_Disconnect = LLMessageStringTable::getInstance()->getString("Disconnect"); +char* _PREHASH_SimPosition = LLMessageStringTable::getInstance()->getString("SimPosition"); +char* _PREHASH_SimWideTotalPrims = LLMessageStringTable::getInstance()->getString("SimWideTotalPrims"); +char* _PREHASH_Index = LLMessageStringTable::getInstance()->getString("Index"); +char* _PREHASH_SimFilename = LLMessageStringTable::getInstance()->getString("SimFilename"); +char* _PREHASH_LastOwnerID = LLMessageStringTable::getInstance()->getString("LastOwnerID"); +char* _PREHASH_GroupNoticeRequest = LLMessageStringTable::getInstance()->getString("GroupNoticeRequest"); +char* _PREHASH_EmailMessageRequest = LLMessageStringTable::getInstance()->getString("EmailMessageRequest"); +char* _PREHASH_MapItemRequest = LLMessageStringTable::getInstance()->getString("MapItemRequest"); +char* _PREHASH_AgentCount = LLMessageStringTable::getInstance()->getString("AgentCount"); +char* _PREHASH_MessageBlock = LLMessageStringTable::getInstance()->getString("MessageBlock"); +char* _PREHASH_FuseBlock = LLMessageStringTable::getInstance()->getString("FuseBlock"); +char* _PREHASH_AgentGroupData = LLMessageStringTable::getInstance()->getString("AgentGroupData"); +char* _PREHASH_ClassifiedInfoUpdate = LLMessageStringTable::getInstance()->getString("ClassifiedInfoUpdate"); +char* _PREHASH_RegionPos = LLMessageStringTable::getInstance()->getString("RegionPos"); +char* _PREHASH_ParcelMediaUpdate = LLMessageStringTable::getInstance()->getString("ParcelMediaUpdate"); +char* _PREHASH_NoticeID = LLMessageStringTable::getInstance()->getString("NoticeID"); +char* _PREHASH_GridX = LLMessageStringTable::getInstance()->getString("GridX"); +char* _PREHASH_GridY = LLMessageStringTable::getInstance()->getString("GridY"); +char* _PREHASH_Title = LLMessageStringTable::getInstance()->getString("Title"); +char* _PREHASH_AuctionID = LLMessageStringTable::getInstance()->getString("AuctionID"); +char* _PREHASH_VoteType = LLMessageStringTable::getInstance()->getString("VoteType"); +char* _PREHASH_CategoryID = LLMessageStringTable::getInstance()->getString("CategoryID"); +char* _PREHASH_Token = LLMessageStringTable::getInstance()->getString("Token"); +char* _PREHASH_AggregatePerms = LLMessageStringTable::getInstance()->getString("AggregatePerms"); +char* _PREHASH_ObjectSelect = LLMessageStringTable::getInstance()->getString("ObjectSelect"); +char* _PREHASH_ForceObjectSelect = LLMessageStringTable::getInstance()->getString("ForceObjectSelect"); +char* _PREHASH_Price = LLMessageStringTable::getInstance()->getString("Price"); +char* _PREHASH_SunDirection = LLMessageStringTable::getInstance()->getString("SunDirection"); +char* _PREHASH_FromName = LLMessageStringTable::getInstance()->getString("FromName"); +char* _PREHASH_ChangeInventoryItemFlags = LLMessageStringTable::getInstance()->getString("ChangeInventoryItemFlags"); +char* _PREHASH_Force = LLMessageStringTable::getInstance()->getString("Force"); +char* _PREHASH_TransactionBlock = LLMessageStringTable::getInstance()->getString("TransactionBlock"); +char* _PREHASH_PowersMask = LLMessageStringTable::getInstance()->getString("PowersMask"); +char* _PREHASH_Stamp = LLMessageStringTable::getInstance()->getString("Stamp"); +char* _PREHASH_TotalCredits = LLMessageStringTable::getInstance()->getString("TotalCredits"); +char* _PREHASH_State = LLMessageStringTable::getInstance()->getString("State"); +char* _PREHASH_TextureIndex = LLMessageStringTable::getInstance()->getString("TextureIndex"); +char* _PREHASH_InviteeID = LLMessageStringTable::getInstance()->getString("InviteeID"); +char* _PREHASH_ParcelReclaim = LLMessageStringTable::getInstance()->getString("ParcelReclaim"); +char* _PREHASH_Money = LLMessageStringTable::getInstance()->getString("Money"); +char* _PREHASH_PathTwist = LLMessageStringTable::getInstance()->getString("PathTwist"); +char* _PREHASH_AuthBuyerID = LLMessageStringTable::getInstance()->getString("AuthBuyerID"); +char* _PREHASH_Color = LLMessageStringTable::getInstance()->getString("Color"); +char* _PREHASH_SourceType = LLMessageStringTable::getInstance()->getString("SourceType"); +char* _PREHASH_World = LLMessageStringTable::getInstance()->getString("World"); +char* _PREHASH_QueryData = LLMessageStringTable::getInstance()->getString("QueryData"); +char* _PREHASH_Users = LLMessageStringTable::getInstance()->getString("Users"); +char* _PREHASH_SysOS = LLMessageStringTable::getInstance()->getString("SysOS"); +char* _PREHASH_Notes = LLMessageStringTable::getInstance()->getString("Notes"); +char* _PREHASH_AvatarID = LLMessageStringTable::getInstance()->getString("AvatarID"); +char* _PREHASH_FounderID = LLMessageStringTable::getInstance()->getString("FounderID"); +char* _PREHASH_EndPointID = LLMessageStringTable::getInstance()->getString("EndPointID"); +char* _PREHASH_LocationLookAt = LLMessageStringTable::getInstance()->getString("LocationLookAt"); +char* _PREHASH_Sound = LLMessageStringTable::getInstance()->getString("Sound"); +char* _PREHASH_Cover = LLMessageStringTable::getInstance()->getString("Cover"); +char* _PREHASH_TotalObjectCount = LLMessageStringTable::getInstance()->getString("TotalObjectCount"); +char* _PREHASH_TextureEntry = LLMessageStringTable::getInstance()->getString("TextureEntry"); +char* _PREHASH_SquareMetersCommitted = LLMessageStringTable::getInstance()->getString("SquareMetersCommitted"); +char* _PREHASH_ChannelID = LLMessageStringTable::getInstance()->getString("ChannelID"); +char* _PREHASH_Dwell = LLMessageStringTable::getInstance()->getString("Dwell"); +char* _PREHASH_North = LLMessageStringTable::getInstance()->getString("North"); +char* _PREHASH_AgentUpdate = LLMessageStringTable::getInstance()->getString("AgentUpdate"); +char* _PREHASH_PickGodDelete = LLMessageStringTable::getInstance()->getString("PickGodDelete"); +char* _PREHASH_HostName = LLMessageStringTable::getInstance()->getString("HostName"); +char* _PREHASH_PriceParcelClaim = LLMessageStringTable::getInstance()->getString("PriceParcelClaim"); +char* _PREHASH_ParcelClaim = LLMessageStringTable::getInstance()->getString("ParcelClaim"); +char* _PREHASH_AgentPowers = LLMessageStringTable::getInstance()->getString("AgentPowers"); +char* _PREHASH_ProfileHollow = LLMessageStringTable::getInstance()->getString("ProfileHollow"); +char* _PREHASH_GroupRoleChanges = LLMessageStringTable::getInstance()->getString("GroupRoleChanges"); +char* _PREHASH_Count = LLMessageStringTable::getInstance()->getString("Count"); +char* _PREHASH_South = LLMessageStringTable::getInstance()->getString("South"); +char* _PREHASH_ObjectUpdateCompressed = LLMessageStringTable::getInstance()->getString("ObjectUpdateCompressed"); +char* _PREHASH_MuteFlags = LLMessageStringTable::getInstance()->getString("MuteFlags"); +char* _PREHASH_Group = LLMessageStringTable::getInstance()->getString("Group"); +char* _PREHASH_AgentPause = LLMessageStringTable::getInstance()->getString("AgentPause"); +char* _PREHASH_LanguagesText = LLMessageStringTable::getInstance()->getString("LanguagesText"); +char* _PREHASH_Error = LLMessageStringTable::getInstance()->getString("Error"); +char* _PREHASH_InternalScriptMail = LLMessageStringTable::getInstance()->getString("InternalScriptMail"); +char* _PREHASH_FindAgent = LLMessageStringTable::getInstance()->getString("FindAgent"); +char* _PREHASH_AgentData = LLMessageStringTable::getInstance()->getString("AgentData"); +char* _PREHASH_FolderData = LLMessageStringTable::getInstance()->getString("FolderData"); +char* _PREHASH_AssetBlock = LLMessageStringTable::getInstance()->getString("AssetBlock"); +char* _PREHASH_AcceptNotices = LLMessageStringTable::getInstance()->getString("AcceptNotices"); +char* _PREHASH_SetGroupAcceptNotices = LLMessageStringTable::getInstance()->getString("SetGroupAcceptNotices"); +char* _PREHASH_CloseCircuit = LLMessageStringTable::getInstance()->getString("CloseCircuit"); +char* _PREHASH_TeleportFinish = LLMessageStringTable::getInstance()->getString("TeleportFinish"); +char* _PREHASH_PathRevolutions = LLMessageStringTable::getInstance()->getString("PathRevolutions"); +char* _PREHASH_ClassifiedInfoReply = LLMessageStringTable::getInstance()->getString("ClassifiedInfoReply"); +char* _PREHASH_ParcelInfoReply = LLMessageStringTable::getInstance()->getString("ParcelInfoReply"); +char* _PREHASH_AutosaveData = LLMessageStringTable::getInstance()->getString("AutosaveData"); +char* _PREHASH_SetStartLocation = LLMessageStringTable::getInstance()->getString("SetStartLocation"); +char* _PREHASH_PassHours = LLMessageStringTable::getInstance()->getString("PassHours"); +char* _PREHASH_AttachmentPt = LLMessageStringTable::getInstance()->getString("AttachmentPt"); +char* _PREHASH_ParcelFlags = LLMessageStringTable::getInstance()->getString("ParcelFlags"); +char* _PREHASH_NumVotes = LLMessageStringTable::getInstance()->getString("NumVotes"); +char* _PREHASH_AvatarPickerRequest = LLMessageStringTable::getInstance()->getString("AvatarPickerRequest"); +char* _PREHASH_TeleportLocationRequest = LLMessageStringTable::getInstance()->getString("TeleportLocationRequest"); +char* _PREHASH_DataHomeLocationRequest = LLMessageStringTable::getInstance()->getString("DataHomeLocationRequest"); +char* _PREHASH_EventNotificationAddRequest = LLMessageStringTable::getInstance()->getString("EventNotificationAddRequest"); +char* _PREHASH_ParcelDwellRequest = LLMessageStringTable::getInstance()->getString("ParcelDwellRequest"); +char* _PREHASH_EventLocationRequest = LLMessageStringTable::getInstance()->getString("EventLocationRequest"); +char* _PREHASH_SetStartLocationRequest = LLMessageStringTable::getInstance()->getString("SetStartLocationRequest"); +char* _PREHASH_QueryStart = LLMessageStringTable::getInstance()->getString("QueryStart"); +char* _PREHASH_EjectData = LLMessageStringTable::getInstance()->getString("EjectData"); +char* _PREHASH_AvatarTextureUpdate = LLMessageStringTable::getInstance()->getString("AvatarTextureUpdate"); +char* _PREHASH_RPCServerPort = LLMessageStringTable::getInstance()->getString("RPCServerPort"); +char* _PREHASH_Bytes = LLMessageStringTable::getInstance()->getString("Bytes"); +char* _PREHASH_Extra = LLMessageStringTable::getInstance()->getString("Extra"); +char* _PREHASH_ForceScriptControlRelease = LLMessageStringTable::getInstance()->getString("ForceScriptControlRelease"); +char* _PREHASH_ParcelRelease = LLMessageStringTable::getInstance()->getString("ParcelRelease"); +char* _PREHASH_VFileType = LLMessageStringTable::getInstance()->getString("VFileType"); +char* _PREHASH_EjectGroupMemberReply = LLMessageStringTable::getInstance()->getString("EjectGroupMemberReply"); +char* _PREHASH_ImageData = LLMessageStringTable::getInstance()->getString("ImageData"); +char* _PREHASH_SimulatorViewerTimeMessage = LLMessageStringTable::getInstance()->getString("SimulatorViewerTimeMessage"); +char* _PREHASH_Rotation = LLMessageStringTable::getInstance()->getString("Rotation"); +char* _PREHASH_Selection = LLMessageStringTable::getInstance()->getString("Selection"); +char* _PREHASH_TransactionData = LLMessageStringTable::getInstance()->getString("TransactionData"); +char* _PREHASH_OperationData = LLMessageStringTable::getInstance()->getString("OperationData"); +char* _PREHASH_ExpirationDate = LLMessageStringTable::getInstance()->getString("ExpirationDate"); +char* _PREHASH_ParcelDeedToGroup = LLMessageStringTable::getInstance()->getString("ParcelDeedToGroup"); +char* _PREHASH_AvatarPicksReply = LLMessageStringTable::getInstance()->getString("AvatarPicksReply"); +char* _PREHASH_GroupTitlesReply = LLMessageStringTable::getInstance()->getString("GroupTitlesReply"); +char* _PREHASH_AgentInfo = LLMessageStringTable::getInstance()->getString("AgentInfo"); +char* _PREHASH_MoneyTransferBackend = LLMessageStringTable::getInstance()->getString("MoneyTransferBackend"); +char* _PREHASH_NextOwnerMask = LLMessageStringTable::getInstance()->getString("NextOwnerMask"); +char* _PREHASH_MuteData = LLMessageStringTable::getInstance()->getString("MuteData"); +char* _PREHASH_PassPrice = LLMessageStringTable::getInstance()->getString("PassPrice"); +char* _PREHASH_SourceID = LLMessageStringTable::getInstance()->getString("SourceID"); +char* _PREHASH_ChangeUserRights = LLMessageStringTable::getInstance()->getString("ChangeUserRights"); +char* _PREHASH_TeleportFlags = LLMessageStringTable::getInstance()->getString("TeleportFlags"); +char* _PREHASH_SlaveParcelData = LLMessageStringTable::getInstance()->getString("SlaveParcelData"); +char* _PREHASH_AssetData = LLMessageStringTable::getInstance()->getString("AssetData"); +char* _PREHASH_MultipleObjectUpdate = LLMessageStringTable::getInstance()->getString("MultipleObjectUpdate"); +char* _PREHASH_ObjectUpdate = LLMessageStringTable::getInstance()->getString("ObjectUpdate"); +char* _PREHASH_ImprovedTerseObjectUpdate = LLMessageStringTable::getInstance()->getString("ImprovedTerseObjectUpdate"); +char* _PREHASH_ConfirmXferPacket = LLMessageStringTable::getInstance()->getString("ConfirmXferPacket"); +char* _PREHASH_StartPingCheck = LLMessageStringTable::getInstance()->getString("StartPingCheck"); +char* _PREHASH_SimWideDeletes = LLMessageStringTable::getInstance()->getString("SimWideDeletes"); +char* _PREHASH_LandStatReply = LLMessageStringTable::getInstance()->getString("LandStatReply"); +char* _PREHASH_IsPhantom = LLMessageStringTable::getInstance()->getString("IsPhantom"); +char* _PREHASH_AgentList = LLMessageStringTable::getInstance()->getString("AgentList"); +char* _PREHASH_SimApproved = LLMessageStringTable::getInstance()->getString("SimApproved"); +char* _PREHASH_RezObject = LLMessageStringTable::getInstance()->getString("RezObject"); +char* _PREHASH_TaskLocalID = LLMessageStringTable::getInstance()->getString("TaskLocalID"); +char* _PREHASH_ClaimDate = LLMessageStringTable::getInstance()->getString("ClaimDate"); +char* _PREHASH_MergeParcel = LLMessageStringTable::getInstance()->getString("MergeParcel"); +char* _PREHASH_Priority = LLMessageStringTable::getInstance()->getString("Priority"); +char* _PREHASH_QueryText = LLMessageStringTable::getInstance()->getString("QueryText"); +char* _PREHASH_GroupNoticeAdd = LLMessageStringTable::getInstance()->getString("GroupNoticeAdd"); +char* _PREHASH_ReturnType = LLMessageStringTable::getInstance()->getString("ReturnType"); +char* _PREHASH_FetchFolders = LLMessageStringTable::getInstance()->getString("FetchFolders"); +char* _PREHASH_SimulatorPublicHostBlock = LLMessageStringTable::getInstance()->getString("SimulatorPublicHostBlock"); +char* _PREHASH_HeaderData = LLMessageStringTable::getInstance()->getString("HeaderData"); +char* _PREHASH_RequestMultipleObjects = LLMessageStringTable::getInstance()->getString("RequestMultipleObjects"); +char* _PREHASH_RetrieveInstantMessages = LLMessageStringTable::getInstance()->getString("RetrieveInstantMessages"); +char* _PREHASH_OpenCircuit = LLMessageStringTable::getInstance()->getString("OpenCircuit"); +char* _PREHASH_CrossedRegion = LLMessageStringTable::getInstance()->getString("CrossedRegion"); +char* _PREHASH_DirGroupsReply = LLMessageStringTable::getInstance()->getString("DirGroupsReply"); +char* _PREHASH_AvatarGroupsReply = LLMessageStringTable::getInstance()->getString("AvatarGroupsReply"); +char* _PREHASH_EmailMessageReply = LLMessageStringTable::getInstance()->getString("EmailMessageReply"); +char* _PREHASH_GroupVoteHistoryItemReply = LLMessageStringTable::getInstance()->getString("GroupVoteHistoryItemReply"); +char* _PREHASH_ViewerPosition = LLMessageStringTable::getInstance()->getString("ViewerPosition"); +char* _PREHASH_Position = LLMessageStringTable::getInstance()->getString("Position"); +char* _PREHASH_ParentEstate = LLMessageStringTable::getInstance()->getString("ParentEstate"); +char* _PREHASH_EstateName = LLMessageStringTable::getInstance()->getString("EstateName"); +char* _PREHASH_MuteName = LLMessageStringTable::getInstance()->getString("MuteName"); +char* _PREHASH_ParcelRename = LLMessageStringTable::getInstance()->getString("ParcelRename"); +char* _PREHASH_ViewerFilename = LLMessageStringTable::getInstance()->getString("ViewerFilename"); +char* _PREHASH_UserReportInternal = LLMessageStringTable::getInstance()->getString("UserReportInternal"); +char* _PREHASH_AvatarPropertiesRequest = LLMessageStringTable::getInstance()->getString("AvatarPropertiesRequest"); +char* _PREHASH_ParcelPropertiesRequest = LLMessageStringTable::getInstance()->getString("ParcelPropertiesRequest"); +char* _PREHASH_GroupProfileRequest = LLMessageStringTable::getInstance()->getString("GroupProfileRequest"); +char* _PREHASH_AgentDataUpdateRequest = LLMessageStringTable::getInstance()->getString("AgentDataUpdateRequest"); +char* _PREHASH_PriceObjectScaleFactor = LLMessageStringTable::getInstance()->getString("PriceObjectScaleFactor"); +char* _PREHASH_OpenEnrollment = LLMessageStringTable::getInstance()->getString("OpenEnrollment"); +char* _PREHASH_GroupData = LLMessageStringTable::getInstance()->getString("GroupData"); +char* _PREHASH_RequestGodlikePowers = LLMessageStringTable::getInstance()->getString("RequestGodlikePowers"); +char* _PREHASH_GrantGodlikePowers = LLMessageStringTable::getInstance()->getString("GrantGodlikePowers"); +char* _PREHASH_TransactionID = LLMessageStringTable::getInstance()->getString("TransactionID"); +char* _PREHASH_DestinationID = LLMessageStringTable::getInstance()->getString("DestinationID"); +char* _PREHASH_Controls = LLMessageStringTable::getInstance()->getString("Controls"); +char* _PREHASH_FirstDetachAll = LLMessageStringTable::getInstance()->getString("FirstDetachAll"); +char* _PREHASH_EstateID = LLMessageStringTable::getInstance()->getString("EstateID"); +char* _PREHASH_ImprovedInstantMessage = LLMessageStringTable::getInstance()->getString("ImprovedInstantMessage"); +char* _PREHASH_CheckParcelSales = LLMessageStringTable::getInstance()->getString("CheckParcelSales"); +char* _PREHASH_ParcelSales = LLMessageStringTable::getInstance()->getString("ParcelSales"); +char* _PREHASH_CurrentInterval = LLMessageStringTable::getInstance()->getString("CurrentInterval"); +char* _PREHASH_PriceRentLight = LLMessageStringTable::getInstance()->getString("PriceRentLight"); +char* _PREHASH_MediaAutoScale = LLMessageStringTable::getInstance()->getString("MediaAutoScale"); +char* _PREHASH_NeighborBlock = LLMessageStringTable::getInstance()->getString("NeighborBlock"); +char* _PREHASH_LayerData = LLMessageStringTable::getInstance()->getString("LayerData"); +char* _PREHASH_NVPairData = LLMessageStringTable::getInstance()->getString("NVPairData"); +char* _PREHASH_TeleportLocal = LLMessageStringTable::getInstance()->getString("TeleportLocal"); +char* _PREHASH_EjecteeID = LLMessageStringTable::getInstance()->getString("EjecteeID"); +char* _PREHASH_VoteInitiator = LLMessageStringTable::getInstance()->getString("VoteInitiator"); +char* _PREHASH_TypeData = LLMessageStringTable::getInstance()->getString("TypeData"); +char* _PREHASH_OwnerIDs = LLMessageStringTable::getInstance()->getString("OwnerIDs"); +char* _PREHASH_SystemKickUser = LLMessageStringTable::getInstance()->getString("SystemKickUser"); +char* _PREHASH_TransactionTime = LLMessageStringTable::getInstance()->getString("TransactionTime"); +char* _PREHASH_TimeToLive = LLMessageStringTable::getInstance()->getString("TimeToLive"); +char* _PREHASH_OldAgentID = LLMessageStringTable::getInstance()->getString("OldAgentID"); +char* _PREHASH_MusicURL = LLMessageStringTable::getInstance()->getString("MusicURL"); +char* _PREHASH_ParcelPrimBonus = LLMessageStringTable::getInstance()->getString("ParcelPrimBonus"); +char* _PREHASH_EjectUser = LLMessageStringTable::getInstance()->getString("EjectUser"); +char* _PREHASH_CoarseLocationUpdate = LLMessageStringTable::getInstance()->getString("CoarseLocationUpdate"); +char* _PREHASH_ChildAgentPositionUpdate = LLMessageStringTable::getInstance()->getString("ChildAgentPositionUpdate"); +char* _PREHASH_StoreLocal = LLMessageStringTable::getInstance()->getString("StoreLocal"); +char* _PREHASH_GroupName = LLMessageStringTable::getInstance()->getString("GroupName"); +char* _PREHASH_PriceParcelRent = LLMessageStringTable::getInstance()->getString("PriceParcelRent"); +char* _PREHASH_SimStatus = LLMessageStringTable::getInstance()->getString("SimStatus"); +char* _PREHASH_TransactionSuccess = LLMessageStringTable::getInstance()->getString("TransactionSuccess"); +char* _PREHASH_LureType = LLMessageStringTable::getInstance()->getString("LureType"); +char* _PREHASH_GroupMask = LLMessageStringTable::getInstance()->getString("GroupMask"); +char* _PREHASH_SitObject = LLMessageStringTable::getInstance()->getString("SitObject"); +char* _PREHASH_Override = LLMessageStringTable::getInstance()->getString("Override"); +char* _PREHASH_LocomotionState = LLMessageStringTable::getInstance()->getString("LocomotionState"); +char* _PREHASH_PriceUpload = LLMessageStringTable::getInstance()->getString("PriceUpload"); +char* _PREHASH_RemoveParcel = LLMessageStringTable::getInstance()->getString("RemoveParcel"); +char* _PREHASH_ConfirmAuctionStart = LLMessageStringTable::getInstance()->getString("ConfirmAuctionStart"); +char* _PREHASH_RpcScriptRequestInbound = LLMessageStringTable::getInstance()->getString("RpcScriptRequestInbound"); +char* _PREHASH_ActiveGroupID = LLMessageStringTable::getInstance()->getString("ActiveGroupID"); +char* _PREHASH_ParcelReturnObjects = LLMessageStringTable::getInstance()->getString("ParcelReturnObjects"); +char* _PREHASH_TotalObjects = LLMessageStringTable::getInstance()->getString("TotalObjects"); +char* _PREHASH_ObjectExtraParams = LLMessageStringTable::getInstance()->getString("ObjectExtraParams"); +char* _PREHASH_Questions = LLMessageStringTable::getInstance()->getString("Questions"); +char* _PREHASH_TransferAbort = LLMessageStringTable::getInstance()->getString("TransferAbort"); +char* _PREHASH_TransferInventory = LLMessageStringTable::getInstance()->getString("TransferInventory"); +char* _PREHASH_RayTargetID = LLMessageStringTable::getInstance()->getString("RayTargetID"); +char* _PREHASH_ClaimPrice = LLMessageStringTable::getInstance()->getString("ClaimPrice"); +char* _PREHASH_ObjectProperties = LLMessageStringTable::getInstance()->getString("ObjectProperties"); +char* _PREHASH_ParcelProperties = LLMessageStringTable::getInstance()->getString("ParcelProperties"); +char* _PREHASH_EstateOwnerID = LLMessageStringTable::getInstance()->getString("EstateOwnerID"); +char* _PREHASH_LogoutRequest = LLMessageStringTable::getInstance()->getString("LogoutRequest"); +char* _PREHASH_AssetUploadRequest = LLMessageStringTable::getInstance()->getString("AssetUploadRequest"); +char* _PREHASH_TransactionType = LLMessageStringTable::getInstance()->getString("TransactionType"); +char* _PREHASH_AvatarPropertiesUpdate = LLMessageStringTable::getInstance()->getString("AvatarPropertiesUpdate"); +char* _PREHASH_ParcelPropertiesUpdate = LLMessageStringTable::getInstance()->getString("ParcelPropertiesUpdate"); +char* _PREHASH_FetchItems = LLMessageStringTable::getInstance()->getString("FetchItems"); +char* _PREHASH_AbortXfer = LLMessageStringTable::getInstance()->getString("AbortXfer"); +char* _PREHASH_DeRezAck = LLMessageStringTable::getInstance()->getString("DeRezAck"); +char* _PREHASH_TakeControls = LLMessageStringTable::getInstance()->getString("TakeControls"); +char* _PREHASH_DirLandReply = LLMessageStringTable::getInstance()->getString("DirLandReply"); +char* _PREHASH_MuteType = LLMessageStringTable::getInstance()->getString("MuteType"); +char* _PREHASH_IMViaEMail = LLMessageStringTable::getInstance()->getString("IMViaEMail"); +char* _PREHASH_RentPrice = LLMessageStringTable::getInstance()->getString("RentPrice"); +char* _PREHASH_GenericMessage = LLMessageStringTable::getInstance()->getString("GenericMessage"); +char* _PREHASH_ChildAgentAlive = LLMessageStringTable::getInstance()->getString("ChildAgentAlive"); +char* _PREHASH_AssetType = LLMessageStringTable::getInstance()->getString("AssetType"); +char* _PREHASH_SpawnPointBlock = LLMessageStringTable::getInstance()->getString("SpawnPointBlock"); +char* _PREHASH_AttachmentBlock = LLMessageStringTable::getInstance()->getString("AttachmentBlock"); +char* _PREHASH_ObjectMaterial = LLMessageStringTable::getInstance()->getString("ObjectMaterial"); +char* _PREHASH_OwnerName = LLMessageStringTable::getInstance()->getString("OwnerName"); +char* _PREHASH_AvatarNotesReply = LLMessageStringTable::getInstance()->getString("AvatarNotesReply"); +char* _PREHASH_CacheID = LLMessageStringTable::getInstance()->getString("CacheID"); +char* _PREHASH_OwnerMask = LLMessageStringTable::getInstance()->getString("OwnerMask"); +char* _PREHASH_TransferInventoryAck = LLMessageStringTable::getInstance()->getString("TransferInventoryAck"); +char* _PREHASH_RegionDenyAgeUnverified = LLMessageStringTable::getInstance()->getString("RegionDenyAgeUnverified"); +char* _PREHASH_AgeVerificationBlock = LLMessageStringTable::getInstance()->getString("AgeVerificationBlock"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 4210665a84..287296d1eb 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1373,10 +1373,4 @@ extern char * _PREHASH_RegionDenyAgeUnverified; extern char * _PREHASH_AgeVerificationBlock; -void init_prehash_data(); - - - - - #endif diff --git a/indra/llmessage/message_string_table.cpp b/indra/llmessage/message_string_table.cpp index bc442395d3..45fcf5e80a 100644 --- a/indra/llmessage/message_string_table.cpp +++ b/indra/llmessage/message_string_table.cpp @@ -46,8 +46,6 @@ inline U32 message_hash_my_string(const char *str) } -LLMessageStringTable gMessageStringTable; - LLMessageStringTable::LLMessageStringTable() : mUsed(0) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8ae6dd2ea5..e0ac3cebd7 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -50,6 +50,8 @@ #include "llwindow.h" #include "llglimmediate.h" +static LLRegisterWidget<LLButton> r("button"); + // globals loaded from settings.xml S32 LLBUTTON_ORIG_H_PAD = 6; // Pre-zoomable UI S32 LLBUTTON_H_PAD = 0; @@ -222,18 +224,6 @@ LLButton::~LLButton() } } -// virtual -EWidgetType LLButton::getWidgetType() const -{ - return WIDGET_TYPE_BUTTON; -} - -// virtual -LLString LLButton::getWidgetTag() const -{ - return LL_BUTTON_TAG; -} - // HACK: Committing a button is the same as instantly clicking it. // virtual void LLButton::onCommit() @@ -277,10 +267,11 @@ void LLButton::onCommit() -BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent && ' ' == uni_char && !gKeyboard->getKeyRepeated(' ')) + if(' ' == uni_char + && !gKeyboard->getKeyRepeated(' ')) { if (mIsToggle) { @@ -296,24 +287,21 @@ BOOL LLButton::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) return handled; } -BOOL LLButton::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLButton::handleKeyHere(KEY key, MASK mask ) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent ) + if( mCommitOnReturn && KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key)) { - if( mCommitOnReturn && KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key)) + if (mIsToggle) { - if (mIsToggle) - { - toggleState(); - } + toggleState(); + } - handled = TRUE; + handled = TRUE; - if (mClickedCallback) - { - (*mClickedCallback)( mCallbackUserData ); - } + if (mClickedCallback) + { + (*mClickedCallback)( mCallbackUserData ); } } return handled; @@ -391,8 +379,6 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; - LLMouseHandler* other_captor = gFocusMgr.getMouseCapture(); mNeedsHighlight = other_captor == NULL || other_captor == this || @@ -409,358 +395,333 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) } // We only handle the click if the click both started and ended within us - if( hasMouseCapture() ) - { - handled = TRUE; - } - else if( getVisible() ) - { - // Opaque - handled = TRUE; - } + getWindow()->setCursor(UI_CURSOR_ARROW); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; - if( handled ) - { - getWindow()->setCursor(UI_CURSOR_ARROW); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << llendl; - } - - return handled; + return TRUE; } // virtual void LLButton::draw() { - if( getVisible() ) + BOOL flash = FALSE; + if( mFlashing ) { - BOOL flash = FALSE; - if( mFlashing ) - { - F32 elapsed = mFlashingTimer.getElapsedTimeF32(); - S32 flash_count = S32(elapsed * LLUI::sConfigGroup->getF32("ButtonFlashRate") * 2.f); - // flash on or off? - flash = (flash_count % 2 == 0) || flash_count > (F32)LLUI::sConfigGroup->getS32("ButtonFlashCount"); - } + F32 elapsed = mFlashingTimer.getElapsedTimeF32(); + S32 flash_count = S32(elapsed * LLUI::sConfigGroup->getF32("ButtonFlashRate") * 2.f); + // flash on or off? + flash = (flash_count % 2 == 0) || flash_count > S32((F32)LLUI::sConfigGroup->getS32("ButtonFlashCount") * 2.f); + } - BOOL pressed_by_keyboard = FALSE; - if (hasFocus()) - { - pressed_by_keyboard = gKeyboard->getKeyDown(' ') || (mCommitOnReturn && gKeyboard->getKeyDown(KEY_RETURN)); - } + BOOL pressed_by_keyboard = FALSE; + if (hasFocus()) + { + pressed_by_keyboard = gKeyboard->getKeyDown(' ') || (mCommitOnReturn && gKeyboard->getKeyDown(KEY_RETURN)); + } - // Unselected image assignments - S32 local_mouse_x; - S32 local_mouse_y; - LLCoordWindow cursor_pos_window; - getWindow()->getCursorPosition(&cursor_pos_window); - LLCoordGL cursor_pos_gl; - getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); - cursor_pos_gl.mX = llround((F32)cursor_pos_gl.mX / LLUI::sGLScaleFactor.mV[VX]); - cursor_pos_gl.mY = llround((F32)cursor_pos_gl.mY / LLUI::sGLScaleFactor.mV[VY]); - screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y); - - BOOL pressed = pressed_by_keyboard - || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) - || mToggleState; - - BOOL use_glow_effect = FALSE; - if ( mNeedsHighlight || flash ) + // Unselected image assignments + S32 local_mouse_x; + S32 local_mouse_y; + LLCoordWindow cursor_pos_window; + getWindow()->getCursorPosition(&cursor_pos_window); + LLCoordGL cursor_pos_gl; + getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); + cursor_pos_gl.mX = llround((F32)cursor_pos_gl.mX / LLUI::sGLScaleFactor.mV[VX]); + cursor_pos_gl.mY = llround((F32)cursor_pos_gl.mY / LLUI::sGLScaleFactor.mV[VY]); + screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y); + + BOOL pressed = pressed_by_keyboard + || (hasMouseCapture() && pointInView(local_mouse_x, local_mouse_y)) + || mToggleState; + + BOOL use_glow_effect = FALSE; + if ( mNeedsHighlight || flash ) + { + if (pressed) { - if (pressed) + if (mImageHoverSelected) { - if (mImageHoverSelected) - { - mImagep = mImageHoverSelected; - } - else - { - mImagep = mImageSelected; - use_glow_effect = TRUE; - } + mImagep = mImageHoverSelected; } else { - if (mImageHoverUnselected) - { - mImagep = mImageHoverUnselected; - } - else - { - mImagep = mImageUnselected; - use_glow_effect = TRUE; - } + mImagep = mImageSelected; + use_glow_effect = TRUE; } } - else if ( pressed ) - { - mImagep = mImageSelected; - } else { - mImagep = mImageUnselected; + if (mImageHoverUnselected) + { + mImagep = mImageHoverUnselected; + } + else + { + mImagep = mImageUnselected; + use_glow_effect = TRUE; + } } + } + else if ( pressed ) + { + mImagep = mImageSelected; + } + else + { + mImagep = mImageUnselected; + } - // Override if more data is available - // HACK: Use gray checked state to mean either: - // enabled and tentative - // or - // disabled but checked - if (!mImageDisabledSelected.isNull() && ( (getEnabled() && getTentative()) || (!getEnabled() && pressed ) ) ) - { - mImagep = mImageDisabledSelected; - } - else if (!mImageDisabled.isNull() && !getEnabled() && !pressed) - { - mImagep = mImageDisabled; - } + // Override if more data is available + // HACK: Use gray checked state to mean either: + // enabled and tentative + // or + // disabled but checked + if (!mImageDisabledSelected.isNull() + && + ( (getEnabled() && getTentative()) + || (!getEnabled() && pressed ) ) ) + { + mImagep = mImageDisabledSelected; + } + else if (!mImageDisabled.isNull() + && !getEnabled() + && !pressed) + { + mImagep = mImageDisabled; + } - if (mNeedsHighlight && !mImagep) - { - use_glow_effect = TRUE; - } + if (mNeedsHighlight && !mImagep) + { + use_glow_effect = TRUE; + } - // Figure out appropriate color for the text - LLColor4 label_color; + // Figure out appropriate color for the text + LLColor4 label_color; - // label changes when button state changes, not when pressed - if ( getEnabled() ) + // label changes when button state changes, not when pressed + if ( getEnabled() ) + { + if ( mToggleState ) { - if ( mToggleState ) - { - label_color = mSelectedLabelColor; - } - else - { - label_color = mUnselectedLabelColor; - } + label_color = mSelectedLabelColor; } else { - if ( mToggleState ) - { - label_color = mDisabledSelectedLabelColor; - } - else - { - label_color = mDisabledLabelColor; - } + label_color = mUnselectedLabelColor; } - - // Unselected label assignments - LLWString label; - - if( mToggleState ) + } + else + { + if ( mToggleState ) { - if( getEnabled() || mDisabledSelectedLabel.empty() ) - { - label = mSelectedLabel; - } - else - { - label = mDisabledSelectedLabel; - } + label_color = mDisabledSelectedLabelColor; } else { - if( getEnabled() || mDisabledLabel.empty() ) - { - label = mUnselectedLabel; - } - else - { - label = mDisabledLabel; - } + label_color = mDisabledLabelColor; } - - // draw default button border - if (getEnabled() && mBorderEnabled && gFocusMgr.getAppHasFocus()) // because we're the default button in a panel + } + + // Unselected label assignments + LLWString label; + + if( mToggleState ) + { + if( getEnabled() || mDisabledSelectedLabel.empty() ) { - drawBorder(LLUI::sColorsGroup->getColor( "ButtonBorderColor" ), BORDER_SIZE); + label = mSelectedLabel; } - - // overlay with keyboard focus border - if (hasFocus()) + else { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - drawBorder(gFocusMgr.getFocusColor(), llround(lerp(1.f, 3.f, lerp_amt))); + label = mDisabledSelectedLabel; } - - if (use_glow_effect) + } + else + { + if( getEnabled() || mDisabledLabel.empty() ) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + label = mUnselectedLabel; } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + label = mDisabledLabel; } + } - // Draw button image, if available. - // Otherwise draw basic rectangular button. - if( mImagep.notNull() && !mScaleImage) + // overlay with keyboard focus border + if (hasFocus()) + { + F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); + drawBorder(gFocusMgr.getFocusColor(), llround(lerp(1.f, 3.f, lerp_amt))); + } + + if (use_glow_effect) + { + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + } + else + { + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + } + + // Draw button image, if available. + // Otherwise draw basic rectangular button. + if (mImagep.notNull()) + { + if ( mScaleImage) { - mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); + mImagep->draw(getLocalRect(), getEnabled() ? mImageColor : mDisabledImageColor ); if (mCurGlowStrength > 0.01f) { - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE); - mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } else - if ( mImagep.notNull() && mScaleImage) { - mImagep->draw(0, 0, getRect().getWidth(), getRect().getHeight(), getEnabled() ? mImageColor : mDisabledImageColor ); + mImagep->draw(0, 0, getEnabled() ? mImageColor : mDisabledImageColor ); if (mCurGlowStrength > 0.01f) { - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE); - mImagep->drawSolid(0, 0, getRect().getWidth(), getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + mImagep->drawSolid(0, 0, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } } - else - { - // no image - llwarns << "No image for button " << getName() << llendl; - // draw it in pink so we can find it - gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1, FALSE); - } - - // let overlay image and text play well together - S32 text_left = mLeftHPad; - S32 text_right = getRect().getWidth() - mRightHPad; - S32 text_width = getRect().getWidth() - mLeftHPad - mRightHPad; - - // draw overlay image - if (mImageOverlay.notNull()) - { - // get max width and height (discard level 0) - S32 overlay_width = mImageOverlay->getWidth(); - S32 overlay_height = mImageOverlay->getHeight(); + } + else + { + // no image + llwarns << "No image for button " << getName() << llendl; + // draw it in pink so we can find it + gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4::pink1, FALSE); + } - F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); - overlay_width = llround((F32)overlay_width * scale_factor); - overlay_height = llround((F32)overlay_height * scale_factor); + // let overlay image and text play well together + S32 text_left = mLeftHPad; + S32 text_right = getRect().getWidth() - mRightHPad; + S32 text_width = getRect().getWidth() - mLeftHPad - mRightHPad; - S32 center_x = getLocalRect().getCenterX(); - S32 center_y = getLocalRect().getCenterY(); + // draw overlay image + if (mImageOverlay.notNull()) + { + // get max width and height (discard level 0) + S32 overlay_width = mImageOverlay->getWidth(); + S32 overlay_height = mImageOverlay->getHeight(); - //FUGLY HACK FOR "DEPRESSED" BUTTONS - if (pressed) - { - center_y--; - center_x++; - } + F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f); + overlay_width = llround((F32)overlay_width * scale_factor); + overlay_height = llround((F32)overlay_height * scale_factor); - // fade out overlay images on disabled buttons - LLColor4 overlay_color = mImageOverlayColor; - if (!getEnabled()) - { - overlay_color.mV[VALPHA] = 0.5f; - } + S32 center_x = getLocalRect().getCenterX(); + S32 center_y = getLocalRect().getCenterY(); - switch(mImageOverlayAlignment) - { - case LLFontGL::LEFT: - text_left += overlay_width + 1; - text_width -= overlay_width + 1; - mImageOverlay->draw( - mLeftHPad, - center_y - (overlay_height / 2), - overlay_width, - overlay_height, - overlay_color); - break; - case LLFontGL::HCENTER: - mImageOverlay->draw( - center_x - (overlay_width / 2), - center_y - (overlay_height / 2), - overlay_width, - overlay_height, - overlay_color); - break; - case LLFontGL::RIGHT: - text_right -= overlay_width + 1; - text_width -= overlay_width + 1; - mImageOverlay->draw( - getRect().getWidth() - mRightHPad - overlay_width, - center_y - (overlay_height / 2), - overlay_width, - overlay_height, - overlay_color); - break; - default: - // draw nothing - break; - } + //FUGLY HACK FOR "DEPRESSED" BUTTONS + if (pressed) + { + center_y--; + center_x++; } - // Draw label - if( !label.empty() ) + // fade out overlay images on disabled buttons + LLColor4 overlay_color = mImageOverlayColor; + if (!getEnabled()) { - LLWString::trim(label); + overlay_color.mV[VALPHA] = 0.5f; + } - S32 x; - switch( mHAlign ) - { - case LLFontGL::RIGHT: - x = text_right; - break; - case LLFontGL::HCENTER: - x = getRect().getWidth() / 2; - break; - case LLFontGL::LEFT: - default: - x = text_left; - break; - } + switch(mImageOverlayAlignment) + { + case LLFontGL::LEFT: + text_left += overlay_width + 1; + text_width -= overlay_width + 1; + mImageOverlay->draw( + mLeftHPad, + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + overlay_color); + break; + case LLFontGL::HCENTER: + mImageOverlay->draw( + center_x - (overlay_width / 2), + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + overlay_color); + break; + case LLFontGL::RIGHT: + text_right -= overlay_width + 1; + text_width -= overlay_width + 1; + mImageOverlay->draw( + getRect().getWidth() - mRightHPad - overlay_width, + center_y - (overlay_height / 2), + overlay_width, + overlay_height, + overlay_color); + break; + default: + // draw nothing + break; + } + } - S32 y_offset = 2 + (getRect().getHeight() - 20)/2; - - if (pressed) - { - y_offset--; - x++; - } + // Draw label + if( !label.empty() ) + { + LLWString::trim(label); - mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset), - label_color, - mHAlign, LLFontGL::BOTTOM, - mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NORMAL, - U32_MAX, text_width, - NULL, FALSE, FALSE); + S32 x; + switch( mHAlign ) + { + case LLFontGL::RIGHT: + x = text_right; + break; + case LLFontGL::HCENTER: + x = getRect().getWidth() / 2; + break; + case LLFontGL::LEFT: + default: + x = text_left; + break; } - if (sDebugRects - || (LLView::sEditingUI && this == LLView::sEditingUIView)) + S32 y_offset = 2 + (getRect().getHeight() - 20)/2; + + if (pressed) { - drawDebugRect(); + y_offset--; + x++; } + + mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset), + label_color, + mHAlign, LLFontGL::BOTTOM, + mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NORMAL, + U32_MAX, text_width, + NULL, FALSE, FALSE); } + + if (sDebugRects + || (LLView::sEditingUI && this == LLView::sEditingUIView)) + { + drawDebugRect(); + } + // reset hover status for next frame mNeedsHighlight = FALSE; } void LLButton::drawBorder(const LLColor4& color, S32 size) { - S32 left = -size; - S32 top = getRect().getHeight() + size; - S32 right = getRect().getWidth() + size; - S32 bottom = -size; - - if (mImagep.isNull()) - { - gl_rect_2d(left, top, right, bottom, color, FALSE); - return; - } - if (mScaleImage) { - mImagep->drawSolid(left, bottom, right-left, top-bottom, color); + mImagep->drawBorder(getLocalRect(), color, size); } else { - mImagep->drawSolid(left, bottom, mImagep->getWidth() + size * 2, mImagep->getHeight() + size * 2, color); + mImagep->drawBorder(0, 0, color, size); } } @@ -923,7 +884,7 @@ void LLButton::setImageOverlay(const LLString &image_name, LLFontGL::HAlign alig } else { - mImageOverlay = LLUI::getUIImageByName(image_name); + mImageOverlay = LLUI::getUIImage(image_name); mImageOverlayAlignment = alignment; mImageOverlayColor = color; } @@ -956,37 +917,37 @@ S32 round_up(S32 grid, S32 value) void LLButton::setImageUnselected(const LLString &image_name) { - setImageUnselected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageUnselected(LLUI::getUIImage(image_name)); mImageUnselectedName = image_name; } void LLButton::setImageSelected(const LLString &image_name) { - setImageSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageSelected(LLUI::getUIImage(image_name)); mImageSelectedName = image_name; } void LLButton::setImageHoverSelected(const LLString &image_name) { - setImageHoverSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageHoverSelected(LLUI::getUIImage(image_name)); mImageHoverSelectedName = image_name; } void LLButton::setImageHoverUnselected(const LLString &image_name) { - setImageHoverUnselected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageHoverUnselected(LLUI::getUIImage(image_name)); mImageHoverUnselectedName = image_name; } void LLButton::setImageDisabled(const LLString &image_name) { - setImageDisabled(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageDisabled(LLUI::getUIImage(image_name)); mImageDisabledName = image_name; } void LLButton::setImageDisabledSelected(const LLString &image_name) { - setImageDisabledSelected(image_name.empty() ? NULL : LLUI::getUIImageByName(image_name)); + setImageDisabledSelected(LLUI::getUIImage(image_name)); mImageDisabledSelectedName = image_name; } diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index a181fbbf56..6357e27bb7 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -87,16 +87,15 @@ public: virtual ~LLButton(); void init(void (*click_callback)(void*), void *callback_data, const LLFontGL* font, const LLString& control_name); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; + void addImageAttributeToXML(LLXMLNodePtr node, const LLString& imageName, const LLUUID& imageID,const LLString& xmlTagName) const; virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); @@ -104,7 +103,6 @@ public: virtual void onMouseCaptureLost(); - // HACK: "committing" a button is the same as clicking on it. virtual void onCommit(); void setUnselectedLabelColor( const LLColor4& c ) { mUnselectedLabelColor = c; } diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp index 0b3156fa1e..4d65047c36 100644 --- a/indra/llui/llcheckboxctrl.cpp +++ b/indra/llui/llcheckboxctrl.cpp @@ -45,10 +45,11 @@ #include "llfontgl.h" #include "lltextbox.h" #include "llkeyboard.h" -#include "llviewborder.h" const U32 MAX_STRING_LENGTH = 10; +static LLRegisterWidget<LLCheckBoxCtrl> r("check_box"); + LLCheckBoxCtrl::LLCheckBoxCtrl(const LLString& name, const LLRect& rect, const LLString& label, diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 513b2930e1..2921e837c4 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -75,8 +75,7 @@ public: virtual ~LLCheckBoxCtrl(); // LLView interface - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_CHECKBOX; } - virtual LLString getWidgetTag() const { return LL_CHECK_BOX_CTRL_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index ca02305f32..62f2a6d319 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -57,6 +57,8 @@ S32 LLCOMBOBOX_HEIGHT = 0; S32 LLCOMBOBOX_WIDTH = 0; S32 MAX_COMBO_WIDTH = 500; +static LLRegisterWidget<LLComboBox> r1("combo_box"); + LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString& label, void (*commit_callback)(LLUICtrl*,void*), void *callback_userdata @@ -74,9 +76,10 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString { // Always use text box // Text label button - mButton = new LLButton("comboxbox button", - LLRect(), label, NULL, LLString::null, - NULL, this); + mButton = new LLButton(label, + LLRect(), + LLString::null, + NULL, this); mButton->setImageUnselected("square_btn_32x128.tga"); mButton->setImageSelected("square_btn_selected_32x128.tga"); mButton->setImageDisabled("square_btn_32x128.tga"); @@ -99,13 +102,7 @@ LLComboBox::LLComboBox( const LLString& name, const LLRect &rect, const LLString mList->setCommitOnKeyboardMovement(FALSE); addChild(mList); - LLRect border_rect(0, getRect().getHeight(), getRect().getWidth(), 0); - mBorder = new LLViewBorder( "combo border", border_rect ); - addChild( mBorder ); - mBorder->setFollowsAll(); - - LLUUID arrow_image_id( LLUI::sAssetsGroup->getString("combobox_arrow.tga") ); - mArrowImage = LLUI::sImageProvider->getImageByID(arrow_image_id); + mArrowImage = LLUI::sImageProvider->getUIImage("combobox_arrow.tga"); mButton->setImageOverlay("combobox_arrow.tga", LLFontGL::RIGHT); updateLayout(); @@ -447,7 +444,7 @@ void LLComboBox::setButtonVisible(BOOL visible) LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); if (visible) { - text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth(0)) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); + text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); } //mTextEntry->setRect(text_entry_rect); mTextEntry->reshape(text_entry_rect.getWidth(), text_entry_rect.getHeight(), TRUE); @@ -456,15 +453,10 @@ void LLComboBox::setButtonVisible(BOOL visible) void LLComboBox::draw() { - if( getVisible() ) - { - mBorder->setKeyboardFocusHighlight(hasFocus()); - - mButton->setEnabled(getEnabled() /*&& !mList->isEmpty()*/); + mButton->setEnabled(getEnabled() /*&& !mList->isEmpty()*/); - // Draw children normally - LLUICtrl::draw(); - } + // Draw children normally + LLUICtrl::draw(); } BOOL LLComboBox::setCurrentByIndex( S32 index ) @@ -494,14 +486,14 @@ void LLComboBox::updateLayout() if (mAllowTextEntry) { S32 shadow_size = LLUI::sConfigGroup->getS32("DropShadowButton"); - mButton->setRect(LLRect( getRect().getWidth() - llmax(8,mArrowImage->getWidth(0)) - 2 * shadow_size, + mButton->setRect(LLRect( getRect().getWidth() - llmax(8,mArrowImage->getWidth()) - 2 * shadow_size, rect.mTop, rect.mRight, rect.mBottom)); mButton->setTabStop(FALSE); if (!mTextEntry) { LLRect text_entry_rect(0, getRect().getHeight(), getRect().getWidth(), 0); - text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth(0)) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); + text_entry_rect.mRight -= llmax(8,mArrowImage->getWidth()) + 2 * LLUI::sConfigGroup->getS32("DropShadowButton"); // clear label on button LLString cur_label = mButton->getLabelSelected(); mTextEntry = new LLLineEditor("combo_text_entry", @@ -512,11 +504,7 @@ void LLComboBox::updateLayout() onTextCommit, onTextEntry, NULL, - this, - NULL, // prevalidate func - LLViewBorder::BEVEL_NONE, - LLViewBorder::STYLE_LINE, - 0); // no border + this); mTextEntry->setSelectAllonFocusReceived(TRUE); mTextEntry->setHandleEditKeysDirectly(TRUE); mTextEntry->setCommitOnFocusLost(FALSE); @@ -780,10 +768,10 @@ BOOL LLComboBox::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_ return TRUE; } -BOOL LLComboBox::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) { BOOL result = FALSE; - if (gFocusMgr.childHasKeyboardFocus(this)) + if (hasFocus()) { //give list a chance to pop up and handle key LLScrollListItem* last_selected_item = mList->getLastSelectedItem(); @@ -792,7 +780,7 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) // highlight the original selection before potentially selecting a new item mList->highlightNthItem(mList->getItemIndex(last_selected_item)); } - result = mList->handleKeyHere(key, mask, FALSE); + result = mList->handleKeyHere(key, mask); // if selection has changed, pop open list if (mList->getLastSelectedItem() != last_selected_item) { @@ -802,7 +790,7 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) return result; } -BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char) { BOOL result = FALSE; if (gFocusMgr.childHasKeyboardFocus(this)) @@ -816,7 +804,7 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent // highlight the original selection before potentially selecting a new item mList->highlightNthItem(mList->getItemIndex(last_selected_item)); } - result = mList->handleUnicodeCharHere(uni_char, called_from_parent); + result = mList->handleUnicodeCharHere(uni_char); if (mList->getLastSelectedItem() != last_selected_item) { showList(); @@ -1095,6 +1083,8 @@ BOOL LLComboBox::selectItemRange( S32 first, S32 last ) // LLFlyoutButton // +static LLRegisterWidget<LLFlyoutButton> r2("flyout_button"); + const S32 FLYOUT_BUTTON_ARROW_WIDTH = 24; LLFlyoutButton::LLFlyoutButton( @@ -1109,9 +1099,8 @@ LLFlyoutButton::LLFlyoutButton( { // Always use text box // Text label button - mActionButton = new LLButton("flyout_button_main", - LLRect(), label, NULL, LLString::null, - NULL, this); + mActionButton = new LLButton(label, + LLRect(), LLString::null, NULL, this); mActionButton->setScaleImage(TRUE); mActionButton->setClickedCallback(onActionButtonClick); @@ -1120,10 +1109,10 @@ LLFlyoutButton::LLFlyoutButton( mActionButton->setLabel(label); addChild(mActionButton); - mActionButtonImage = LLUI::getUIImageByName("flyout_btn_left.tga"); - mExpanderButtonImage = LLUI::getUIImageByName("flyout_btn_right.tga"); - mActionButtonImageSelected = LLUI::getUIImageByName("flyout_btn_left_selected.tga"); - mExpanderButtonImageSelected = LLUI::getUIImageByName("flyout_btn_right_selected.tga"); + mActionButtonImage = LLUI::getUIImage("flyout_btn_left.tga"); + mExpanderButtonImage = LLUI::getUIImage("flyout_btn_right.tga"); + mActionButtonImageSelected = LLUI::getUIImage("flyout_btn_left_selected.tga"); + mExpanderButtonImageSelected = LLUI::getUIImage("flyout_btn_right_selected.tga"); mActionButton->setImageSelected(mActionButtonImageSelected); mActionButton->setImageUnselected(mActionButtonImage); @@ -1136,8 +1125,6 @@ LLFlyoutButton::LLFlyoutButton( mButton->setImageDisabledSelected(LLPointer<LLUIImage>(NULL)); mButton->setRightHPad(6); - mBorder->setVisible(FALSE); - updateLayout(); } diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 0d6c3aef2e..c4db52cc97 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -73,8 +73,7 @@ public: virtual ~LLComboBox(); // LLView interface - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_COMBO_BOX; } - virtual LLString getWidgetTag() const { return LL_COMBO_BOX_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -85,8 +84,8 @@ public: virtual void setEnabled(BOOL enabled); virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); // LLUICtrl interface virtual void clear(); // select nothing @@ -187,9 +186,8 @@ public: protected: LLButton* mButton; LLScrollListCtrl* mList; - LLViewBorder* mBorder; EPreferredPosition mListPosition; - LLPointer<LLImageGL> mArrowImage; + LLPointer<LLUIImage> mArrowImage; private: S32 mButtonPadding; @@ -211,9 +209,6 @@ public: void (*commit_callback)(LLUICtrl*, void*) = NULL, void *callback_userdata = NULL); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_FLYOUT_BUTTON; } - virtual LLString getWidgetTag() const { return LL_FLYOUT_BUTTON_TAG; } - virtual void updateLayout(); virtual void draw(); virtual void setEnabled(BOOL enabled); diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index a4e92e11d0..75e4ad5c08 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -101,16 +101,6 @@ LLDragHandleTop::LLDragHandleTop(const LLString& name, const LLRect &rect, const setTitle( title ); } -EWidgetType LLDragHandleTop::getWidgetType() const -{ - return WIDGET_TYPE_DRAG_HANDLE_TOP; -} - -LLString LLDragHandleTop::getWidgetTag() const -{ - return LL_DRAG_HANDLE_TOP_TAG; -} - LLDragHandleLeft::LLDragHandleLeft(const LLString& name, const LLRect &rect, const LLString& title) : LLDragHandle(name, rect, title) { @@ -118,22 +108,12 @@ LLDragHandleLeft::LLDragHandleLeft(const LLString& name, const LLRect &rect, con setTitle( title ); } -EWidgetType LLDragHandleLeft::getWidgetType() const -{ - return WIDGET_TYPE_DRAG_HANDLE_LEFT; -} - -LLString LLDragHandleLeft::getWidgetTag() const -{ - return LL_DRAG_HANDLE_LEFT_TAG; -} - void LLDragHandleTop::setTitle(const LLString& title) { LLString trimmed_title = title; LLString::trim(trimmed_title); - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); LLTextBox* titlebox = new LLTextBox( "Drag Handle Title", getRect(), trimmed_title, font ); titlebox->setFollows(FOLLOWS_TOP | FOLLOWS_LEFT | FOLLOWS_RIGHT); titlebox->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); @@ -262,7 +242,7 @@ void LLDragHandleTop::reshapeTitleBox() { return; } - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); S32 title_width = font->getWidth( getTitleBox()->getText() ) + TITLE_PAD; if (getMaxTitleWidth() > 0) title_width = llmin(title_width, getMaxTitleWidth()); @@ -372,7 +352,7 @@ BOOL LLDragHandle::handleHover(S32 x, S32 y, MASK mask) lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" <<llendl; handled = TRUE; } - else if( getVisible() ) + else { getWindow()->setCursor(UI_CURSOR_ARROW); lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h index 940eb21e66..6215142e6f 100644 --- a/indra/llui/lldraghandle.h +++ b/indra/llui/lldraghandle.h @@ -91,9 +91,6 @@ class LLDragHandleTop public: LLDragHandleTop(const LLString& name, const LLRect& rect, const LLString& title ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual void setTitle( const LLString& title ); virtual const LLString& getTitle() const; virtual void draw(); @@ -111,9 +108,6 @@ class LLDragHandleLeft public: LLDragHandleLeft(const LLString& name, const LLRect& rect, const LLString& title ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual void setTitle( const LLString& title ); virtual const LLString& getTitle() const; virtual void draw(); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index fed39b7917..f8882c5ebf 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -50,7 +50,6 @@ #include "lltextbox.h" #include "llresmgr.h" #include "llui.h" -#include "llviewborder.h" #include "llwindow.h" #include "llstl.h" #include "llcontrol.h" @@ -799,24 +798,10 @@ void LLFloater::setMinimized(BOOL minimize) mButtonsEnabled[BUTTON_RESTORE] = TRUE; } - mMinimizedHiddenChildren.clear(); - // hide all children - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - if (!viewp->getVisible()) - { - mMinimizedHiddenChildren.push_back(viewp->getHandle()); - } - viewp->setVisible(FALSE); - } - - // except the special controls if (mDragHandle) { mDragHandle->setVisible(TRUE); } - setBorderVisible(TRUE); for(handle_set_iter_t dependent_it = mDependents.begin(); @@ -840,6 +825,12 @@ void LLFloater::setMinimized(BOOL minimize) // Lose keyboard focus when minimized releaseFocus(); + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i]->setEnabled(FALSE); + mResizeHandle[i]->setEnabled(FALSE); + } + mMinimized = TRUE; } else @@ -862,24 +853,6 @@ void LLFloater::setMinimized(BOOL minimize) mButtonsEnabled[BUTTON_RESTORE] = FALSE; } - // show all children - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - viewp->setVisible(TRUE); - } - - std::vector<LLHandle<LLView> >::iterator itor = mMinimizedHiddenChildren.begin(); - for ( ; itor != mMinimizedHiddenChildren.end(); ++itor) - { - LLView* viewp = itor->get(); - if(viewp) - { - viewp->setVisible(FALSE); - } - } - mMinimizedHiddenChildren.clear(); - // show dependent floater for(handle_set_iter_t dependent_it = mDependents.begin(); dependent_it != mDependents.end(); @@ -893,6 +866,12 @@ void LLFloater::setMinimized(BOOL minimize) } } + for (S32 i = 0; i < 4; i++) + { + mResizeBar[i]->setEnabled(isResizable()); + mResizeHandle[i]->setEnabled(isResizable()); + } + mMinimized = FALSE; } make_ui_sound("UISndWindowClose"); @@ -1302,49 +1281,72 @@ void LLFloater::onClickClose( void* userdata ) // virtual void LLFloater::draw() { - if( getVisible() ) + // draw background + if( isBackgroundVisible() ) { - // draw background - if( isBackgroundVisible() ) - { - S32 left = LLPANEL_BORDER_WIDTH; - S32 top = getRect().getHeight() - LLPANEL_BORDER_WIDTH; - S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH; - S32 bottom = LLPANEL_BORDER_WIDTH; + S32 left = LLPANEL_BORDER_WIDTH; + S32 top = getRect().getHeight() - LLPANEL_BORDER_WIDTH; + S32 right = getRect().getWidth() - LLPANEL_BORDER_WIDTH; + S32 bottom = LLPANEL_BORDER_WIDTH; - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater"); - if (!isBackgroundOpaque()) - { - shadow_offset *= 0.2f; - shadow_color.mV[VALPHA] *= 0.5f; - } - gl_drop_shadow(left, top, right, bottom, - shadow_color, - llround(shadow_offset)); + LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); + F32 shadow_offset = (F32)LLUI::sConfigGroup->getS32("DropShadowFloater"); + if (!isBackgroundOpaque()) + { + shadow_offset *= 0.2f; + shadow_color.mV[VALPHA] *= 0.5f; + } + gl_drop_shadow(left, top, right, bottom, + shadow_color, + llround(shadow_offset)); - // No transparent windows in simple UI - if (isBackgroundOpaque()) - { - gl_rect_2d( left, top, right, bottom, getBackgroundColor() ); - } - else - { - gl_rect_2d( left, top, right, bottom, getTransparentColor() ); - } + // No transparent windows in simple UI + if (isBackgroundOpaque()) + { + gl_rect_2d( left, top, right, bottom, getBackgroundColor() ); + } + else + { + gl_rect_2d( left, top, right, bottom, getTransparentColor() ); + } - if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getTitle().empty()) - { - // draw highlight on title bar to indicate focus. RDW - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); - LLRect r = getRect(); - gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, - LLUI::sColorsGroup->getColor("TitleBarFocusColor"), 0, TRUE); - } + if(gFocusMgr.childHasKeyboardFocus(this) && !getIsChrome() && !getTitle().empty()) + { + // draw highlight on title bar to indicate focus. RDW + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + LLRect r = getRect(); + gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, + LLUI::sColorsGroup->getColor("TitleBarFocusColor"), 0, TRUE); } + } - LLPanel::updateDefaultBtn(); + LLPanel::updateDefaultBtn(); + if( getDefaultButton() ) + { + if (hasFocus() && getDefaultButton()->getEnabled()) + { + LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); + // is this button a direct descendent and not a nested widget (e.g. checkbox)? + BOOL focus_is_child_button = dynamic_cast<LLButton*>(focus_ctrl) != NULL && focus_ctrl->getParent() == this; + // only enable default button when current focus is not a button + getDefaultButton()->setBorderEnabled(!focus_is_child_button); + } + else + { + getDefaultButton()->setBorderEnabled(FALSE); + } + } + if (isMinimized()) + { + for (S32 i = 0; i < BUTTON_COUNT; i++) + { + drawChild(mButtons[i]); + } + drawChild(mDragHandle); + } + else + { // draw children LLView* focused_child = gFocusMgr.getKeyboardFocus(); BOOL focused_child_visible = FALSE; @@ -1357,36 +1359,35 @@ void LLFloater::draw() // don't call LLPanel::draw() since we've implemented custom background rendering LLView::draw(); - if( isBackgroundVisible() ) - { - // add in a border to improve spacialized visual aclarity ;) - // use lines instead of gl_rect_2d so we can round the edges as per james' recommendation - LLUI::setLineWidth(1.5f); - LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? LLUI::sColorsGroup->getColor("FloaterFocusBorderColor") : LLUI::sColorsGroup->getColor("FloaterUnfocusBorderColor"); - gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor, -LLPANEL_BORDER_WIDTH, FALSE); - LLUI::setLineWidth(1.f); - } - if (focused_child_visible) { focused_child->setVisible(TRUE); } drawChild(focused_child); + } + + if( isBackgroundVisible() ) + { + // add in a border to improve spacialized visual aclarity ;) + // use lines instead of gl_rect_2d so we can round the edges as per james' recommendation + LLUI::setLineWidth(1.5f); + LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? LLUI::sColorsGroup->getColor("FloaterFocusBorderColor") : LLUI::sColorsGroup->getColor("FloaterUnfocusBorderColor"); + gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor, -LLPANEL_BORDER_WIDTH, FALSE); + LLUI::setLineWidth(1.f); + } - // update tearoff button for torn off floaters - // when last host goes away - if (mCanTearOff && !getHost()) + // update tearoff button for torn off floaters + // when last host goes away + if (mCanTearOff && !getHost()) + { + LLFloater* old_host = mLastHostHandle.get(); + if (!old_host) { - LLFloater* old_host = mLastHostHandle.get(); - if (!old_host) - { - setCanTearOff(FALSE); - } + setCanTearOff(FALSE); } } } - void LLFloater::setCanMinimize(BOOL can_minimize) { // removing minimize/restore button programmatically, @@ -1532,7 +1533,13 @@ void LLFloater::updateButtons() S32 button_count = 0; for (S32 i = 0; i < BUTTON_COUNT; i++) { - if (mButtonsEnabled[i]) + mButtons[i]->setEnabled(mButtonsEnabled[i]); + + if (mButtonsEnabled[i] + //*HACK: always render close button for hosted floaters + // so that users don't accidentally hit the button when closing multiple windows + // in the chatterbox + || (i == BUTTON_CLOSE && mButtonScale != 1.f)) { button_count++; @@ -1556,14 +1563,12 @@ void LLFloater::updateButtons() mButtons[i]->setRect(btn_rect); mButtons[i]->setVisible(TRUE); - mButtons[i]->setEnabled(TRUE); // the restore button should have a tab stop so that it takes action when you Ctrl-Tab to a minimized floater mButtons[i]->setTabStop(i == BUTTON_RESTORE); } else if (mButtons[i]) { mButtons[i]->setVisible(FALSE); - mButtons[i]->setEnabled(FALSE); } } @@ -2068,7 +2073,7 @@ void LLFloaterView::closeAllChildren(bool app_quitting) // Attempt to close floater. This will cause the "do you want to save" // dialogs to appear. - if (floaterp->canClose()) + if (floaterp->canClose() && !floaterp->isDead()) { floaterp->close(app_quitting); } @@ -2085,7 +2090,7 @@ BOOL LLFloaterView::allChildrenClosed() LLView* viewp = *it; LLFloater* floaterp = (LLFloater*)viewp; - if (floaterp->getVisible() && floaterp->canClose()) + if (floaterp->getVisible() && !floaterp->isDead() && floaterp->canClose()) { return false; } @@ -2670,24 +2675,20 @@ void LLMultiFloater::setVisible(BOOL visible) } } -BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLMultiFloater::handleKeyHere(KEY key, MASK mask) { - if (getEnabled() - && mask == MASK_CONTROL) + if (key == 'W' && mask == MASK_CONTROL) { - if (key == 'W') + LLFloater* floater = getActiveFloater(); + // is user closeable and is system closeable + if (floater && floater->canClose() && floater->isCloseable()) { - LLFloater* floater = getActiveFloater(); - // is user closeable and is system closeable - if (floater && floater->canClose() && floater->isCloseable()) - { - floater->close(); - } - return TRUE; + floater->close(); } + return TRUE; } - return LLFloater::handleKeyHere(key, mask, called_from_parent); + return LLFloater::handleKeyHere(key, mask); } LLFloater* LLMultiFloater::getActiveFloater() @@ -2760,10 +2761,10 @@ BOOL LLMultiFloater::postBuild() return TRUE; } - requires("Preview Tabs", WIDGET_TYPE_TAB_CONTAINER); + requires<LLTabContainer>("Preview Tabs"); if (checkRequirements()) { - mTabContainer = LLUICtrlFactory::getTabContainerByName(this, "Preview Tabs"); + mTabContainer = getChild<LLTabContainer>("Preview Tabs"); return TRUE; } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 6597ef46da..360d8093e5 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -50,7 +50,7 @@ class LLMultiFloater; const S32 LLFLOATER_VPAD = 6; const S32 LLFLOATER_HPAD = 6; const S32 LLFLOATER_CLOSE_BOX_SIZE = 16; -const S32 LLFLOATER_HEADER_SIZE = 16; +const S32 LLFLOATER_HEADER_SIZE = 18; const BOOL RESIZE_YES = TRUE; const BOOL RESIZE_NO = FALSE; @@ -122,8 +122,6 @@ public: virtual void init(const LLString& title, BOOL resizable, S32 min_width, S32 min_height, BOOL drag_on_left, BOOL minimizable, BOOL close_btn); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_FLOATER; } - virtual LLString getWidgetTag() const { return LL_FLOATER_TAG; }; virtual void open(); /* Flawfinder: ignore */ @@ -302,9 +300,6 @@ class LLFloaterView : public LLUICtrl public: LLFloaterView( const LLString& name, const LLRect& rect ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_FLOATER_VIEW; } - virtual LLString getWidgetTag() const { return LL_FLOATER_VIEW_TAG; } - /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); void reshape(S32 width, S32 height, BOOL called_from_parent, BOOL adjust_vertical); @@ -373,9 +368,7 @@ public: /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); /*virtual*/ void setVisible(BOOL visible); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); - /*virtual*/ EWidgetType getWidgetType() const { return WIDGET_TYPE_MULTI_FLOATER; } - /*virtual*/ LLString getWidgetTag() const { return LL_MULTI_FLOATER_TAG; }; + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); virtual void setCanResize(BOOL can_resize); virtual void growToFit(S32 content_width, S32 content_height); diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp index 29c6aa3c30..621b01ad82 100644 --- a/indra/llui/llfocusmgr.cpp +++ b/indra/llui/llfocusmgr.cpp @@ -46,6 +46,7 @@ LLFocusMgr::LLFocusMgr() mKeyboardFocus( NULL ), mLastKeyboardFocus( NULL ), mDefaultKeyboardFocus( NULL ), + mKeystrokesOnly(FALSE), mTopCtrl( NULL ), mFocusWeight(0.f), mAppHasFocus(TRUE) // Macs don't seem to notify us that we've gotten focus, so default to true @@ -85,7 +86,7 @@ void LLFocusMgr::releaseFocusIfNeeded( const LLView* view ) } -void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock) +void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock, BOOL keystrokes_only) { if (mLockedView && (new_focus == NULL || @@ -98,6 +99,8 @@ void LLFocusMgr::setKeyboardFocus(LLUICtrl* new_focus, BOOL lock) //llinfos << "Keyboard focus handled by " << (new_focus ? new_focus->getName() : "nothing") << llendl; + mKeystrokesOnly = keystrokes_only; + if( new_focus != mKeyboardFocus ) { mLastKeyboardFocus = mKeyboardFocus; diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h index a3ca8bee26..34651160f1 100644 --- a/indra/llui/llfocusmgr.h +++ b/indra/llui/llfocusmgr.h @@ -54,13 +54,17 @@ public: BOOL childHasMouseCapture( const LLView* parent ) const; // Keyboard Focus - void setKeyboardFocus(LLUICtrl* new_focus, BOOL lock = FALSE); // new_focus = NULL to release the focus. + void setKeyboardFocus(LLUICtrl* new_focus, BOOL lock = FALSE, BOOL keystrokes_only = FALSE); // new_focus = NULL to release the focus. LLUICtrl* getKeyboardFocus() const { return mKeyboardFocus; } LLUICtrl* getLastKeyboardFocus() const { return mLastKeyboardFocus; } BOOL childHasKeyboardFocus( const LLView* parent ) const; void removeKeyboardFocusWithoutCallback( const LLView* focus ); + BOOL getKeystrokesOnly() { return mKeystrokesOnly; } + void setKeystrokesOnly(BOOL keystrokes_only) { mKeystrokesOnly = keystrokes_only; } + F32 getFocusTime() const { return mFocusTimer.getElapsedTimeF32(); } F32 getFocusFlashAmt() const; + S32 getFocusFlashWidth() const { return llround(lerp(1.f, 3.f, getFocusFlashAmt())); } LLColor4 getFocusColor() const; void triggerFocusFlash(); BOOL getAppHasFocus() const { return mAppHasFocus; } @@ -96,6 +100,7 @@ private: LLUICtrl* mKeyboardFocus; // Keyboard events are preemptively routed to this object LLUICtrl* mLastKeyboardFocus; // who last had focus LLUICtrl* mDefaultKeyboardFocus; + BOOL mKeystrokesOnly; // Top View LLUICtrl* mTopCtrl; diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index f47f166c45..df37532d60 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -42,14 +42,15 @@ const F32 RESOLUTION_BUMP = 1.f; +static LLRegisterWidget<LLIconCtrl> r("icon"); + LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id) : LLUICtrl(name, rect, FALSE, // mouse opaque NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP), - mColor( LLColor4::white ), - mImageName("") + mColor( LLColor4::white ) { setImage( image_id ); setTabStop(FALSE); @@ -64,9 +65,7 @@ LLIconCtrl::LLIconCtrl(const LLString& name, const LLRect &rect, const LLString mColor( LLColor4::white ), mImageName(image_name) { - LLUUID image_id; - image_id.set(LLUI::sAssetsGroup->getString( image_name )); - setImage( image_id ); + setImage( image_name ); setTabStop(FALSE); } @@ -77,32 +76,52 @@ LLIconCtrl::~LLIconCtrl() } -void LLIconCtrl::setImage(const LLUUID &image_id) +void LLIconCtrl::setImage(const LLString& image_name) { - mImageID = image_id; + //RN: support UUIDs masquerading as strings + if (LLUUID::validate(image_name)) + { + mImageID = LLUUID(image_name); + + setImage(mImageID); + } + else + { + mImageName = image_name; + mImagep = LLUI::sImageProvider->getUIImage(image_name); + mImageID.setNull(); + } +} + +void LLIconCtrl::setImage(const LLUUID& image_id) +{ + mImageName.clear(); mImagep = LLUI::sImageProvider->getUIImageByID(image_id); + mImageID = image_id; } void LLIconCtrl::draw() { - if( getVisible() ) + if( mImagep.notNull() ) { - if( mImagep.notNull() ) - { - mImagep->draw(0, 0, - getRect().getWidth(), getRect().getHeight(), - mColor ); - } - - LLUICtrl::draw(); + mImagep->draw(getLocalRect(), mColor ); } + + LLUICtrl::draw(); } // virtual void LLIconCtrl::setValue(const LLSD& value ) { - setImage(value.asUUID()); + if (value.isUUID()) + { + setImage(value.asUUID()); + } + else + { + setImage(value.asString()); + } } // virtual @@ -135,18 +154,16 @@ LLView* LLIconCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory * LLRect rect; createRect(node, rect, parent, LLRect()); - LLUUID image_id; + LLString image_name; if (node->hasAttribute("image_name")) { - LLString image_name; node->getAttributeString("image_name", image_name); - image_id.set(LLUI::sAssetsGroup->getString( image_name )); } LLColor4 color(LLColor4::white); LLUICtrlFactory::getAttributeColor(node,"color", color); - LLIconCtrl* icon = new LLIconCtrl(name, rect, image_id); + LLIconCtrl* icon = new LLIconCtrl(name, rect, image_name); icon->setColor(color); diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 6535c0bb0b..33429c580e 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -51,14 +51,14 @@ public: LLIconCtrl(const LLString& name, const LLRect &rect, const LLUUID &image_id); LLIconCtrl(const LLString& name, const LLRect &rect, const LLString &image_name); virtual ~LLIconCtrl(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_ICON; } - virtual LLString getWidgetTag() const { return LL_ICON_CTRL_TAG; } // llview overrides virtual void draw(); - void setImage(const LLUUID &image_id); + void setImage(const LLString& image_name); + void setImage(const LLUUID& image_name); const LLUUID &getImage() const { return mImageID; } + LLString getImageName() const { return mImageName; } // Takes a UUID, wraps get/setImage virtual void setValue(const LLSD& value ); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 6d5e589b04..b54470d44a 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -70,7 +70,6 @@ const F32 CURSOR_FLASH_DELAY = 1.0f; // in seconds const S32 SCROLL_INCREMENT_ADD = 0; // make space for typing const S32 SCROLL_INCREMENT_DEL = 4; // make space for baskspacing const F32 AUTO_SCROLL_TIME = 0.05f; -const F32 LABEL_HPAD = 5.f; const F32 PREEDIT_MARKER_BRIGHTNESS = 0.4f; const S32 PREEDIT_MARKER_GAP = 1; @@ -81,6 +80,10 @@ const S32 PREEDIT_STANDOUT_GAP = 1; const S32 PREEDIT_STANDOUT_POSITION = 2; const S32 PREEDIT_STANDOUT_THICKNESS = 2; +static LLRegisterWidget<LLLineEditor> r1("line_editor"); + +/* static */ LLPointer<LLUIImage> LLLineEditor::sImage; + // // Member functions // @@ -101,8 +104,8 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, mMaxLengthBytes(max_length_bytes), mCursorPos( 0 ), mScrollHPos( 0 ), - mBorderLeft(0), - mBorderRight(0), + mTextPadLeft(0), + mTextPadRight(0), mCommitOnFocusLost( TRUE ), mRevertOnEsc( TRUE ), mKeystrokeCallback( keystroke_callback ), @@ -128,7 +131,8 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, mHandleEditKeysDirectly( FALSE ), mSelectAllonFocusReceived( FALSE ), mPassDelete(FALSE), - mReadOnly(FALSE) + mReadOnly(FALSE), + mImage( sImage ) { llassert( max_length_bytes > 0 ); @@ -151,8 +155,7 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, setFocusLostCallback(focus_lost_callback); - mMinHPixels = mBorderThickness + UI_LINEEDITOR_H_PAD + mBorderLeft; - mMaxHPixels = getRect().getWidth() - mMinHPixels - mBorderThickness - mBorderRight; + setTextPadding(0, 0); mScrollTimer.reset(); @@ -166,6 +169,12 @@ LLLineEditor::LLLineEditor(const LLString& name, const LLRect& rect, mBorder = new LLViewBorder( "line ed border", border_rect, border_bevel, border_style, mBorderThickness ); addChild( mBorder ); mBorder->setFollows(FOLLOWS_LEFT|FOLLOWS_RIGHT|FOLLOWS_TOP|FOLLOWS_BOTTOM); + + if( ! sImage) + { + sImage = LLUI::getUIImage("sm_rounded_corners_simple.tga"); + } + mImage = sImage; } @@ -243,9 +252,9 @@ void LLLineEditor::updateHistory() void LLLineEditor::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLUICtrl::reshape(width, height, called_from_parent ); - - mMaxHPixels = getRect().getWidth() - 2 * (mBorderThickness + UI_LINEEDITOR_H_PAD) + 1 - mBorderRight; + LLUICtrl::reshape(width, height, called_from_parent); + setTextPadding(mTextPadLeft, mTextPadRight); // For clamping side-effect. + setCursor(mCursorPos); // For clamping side-effect. } void LLLineEditor::setEnabled(BOOL enabled) @@ -262,12 +271,12 @@ void LLLineEditor::setMaxTextLength(S32 max_text_length) mMaxLengthBytes = max_len; } -void LLLineEditor::setBorderWidth(S32 left, S32 right) +void LLLineEditor::setTextPadding(S32 left, S32 right) { - mBorderLeft = llclamp(left, 0, getRect().getWidth()); - mBorderRight = llclamp(right, 0, getRect().getWidth()); - mMinHPixels = mBorderThickness + UI_LINEEDITOR_H_PAD + mBorderLeft; - mMaxHPixels = getRect().getWidth() - mMinHPixels - mBorderThickness - mBorderRight; + mTextPadLeft = llclamp(left, 0, getRect().getWidth()); + mTextPadRight = llclamp(right, 0, getRect().getWidth()); + mMinHPixels = UI_LINEEDITOR_H_PAD + mTextPadLeft; + mMaxHPixels = getRect().getWidth() - mMinHPixels - mTextPadRight; } @@ -483,9 +492,10 @@ BOOL LLLineEditor::handleDoubleClick(S32 x, S32 y, MASK mask) BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) { - if (x < mBorderLeft || x > (getRect().getWidth() - mBorderRight)) + // Check first whether the "clear search" button wants to deal with this. + if(childrenHandleMouseDown(x, y, mask) != NULL) { - return LLUICtrl::handleMouseDown(x, y, mask); + return TRUE; } if (mSelectAllonFocusReceived && gFocusMgr.getKeyboardFocus() != this) @@ -563,61 +573,62 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; - if (!hasMouseCapture() && (x < mBorderLeft || x > (getRect().getWidth() - mBorderRight))) + // Check first whether the "clear search" button wants to deal with this. + if(!hasMouseCapture()) { - return LLUICtrl::handleHover(x, y, mask); + if(childrenHandleHover(x, y, mask) != NULL) + { + return TRUE; + } } - if( getVisible() ) + if( (hasMouseCapture()) && mIsSelecting ) { - if( (hasMouseCapture()) && mIsSelecting ) + if (x != mLastSelectionX || y != mLastSelectionY) { - if (x != mLastSelectionX || y != mLastSelectionY) + mLastSelectionX = x; + mLastSelectionY = y; + } + // Scroll if mouse cursor outside of bounds + if (mScrollTimer.hasExpired()) + { + S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); + mScrollTimer.reset(); + mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME); + if( (x < mMinHPixels) && (mScrollHPos > 0 ) ) { - mLastSelectionX = x; - mLastSelectionY = y; + // Scroll to the left + mScrollHPos = llclamp(mScrollHPos - increment, 0, mText.length()); } - // Scroll if mouse cursor outside of bounds - if (mScrollTimer.hasExpired()) + else + if( (x > mMaxHPixels) && (mCursorPos < (S32)mText.length()) ) { - S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME); - mScrollTimer.reset(); - mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME); - if( (x < mMinHPixels) && (mScrollHPos > 0 ) ) - { - // Scroll to the left - mScrollHPos = llclamp(mScrollHPos - increment, 0, mText.length()); - } - else - if( (x > mMaxHPixels) && (mCursorPos < (S32)mText.length()) ) + // If scrolling one pixel would make a difference... + S32 pixels_after_scrolling_one_char = findPixelNearestPos(1); + if( pixels_after_scrolling_one_char >= mMaxHPixels ) { - // If scrolling one pixel would make a difference... - S32 pixels_after_scrolling_one_char = findPixelNearestPos(1); - if( pixels_after_scrolling_one_char >= mMaxHPixels ) - { - // ...scroll to the right - mScrollHPos = llclamp(mScrollHPos + increment, 0, mText.length()); - } + // ...scroll to the right + mScrollHPos = llclamp(mScrollHPos + increment, 0, mText.length()); } } + } - setCursorAtLocalPos( x ); - mSelectionEnd = getCursor(); + setCursorAtLocalPos( x ); + mSelectionEnd = getCursor(); - // delay cursor flashing - mKeystrokeTimer.reset(); + // delay cursor flashing + mKeystrokeTimer.reset(); - getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; - handled = TRUE; - } + getWindow()->setCursor(UI_CURSOR_IBEAM); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + handled = TRUE; + } - if( !handled ) - { - getWindow()->setCursor(UI_CURSOR_IBEAM); - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; - handled = TRUE; - } + if( !handled ) + { + getWindow()->setCursor(UI_CURSOR_IBEAM); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + handled = TRUE; } return handled; @@ -634,9 +645,10 @@ BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask) handled = TRUE; } - if (!handled && (x < mBorderLeft || x > (getRect().getWidth() - mBorderRight))) + // Check first whether the "clear search" button wants to deal with this. + if(!handled && childrenHandleMouseUp(x, y, mask) != NULL) { - return LLUICtrl::handleMouseUp(x, y, mask); + return TRUE; } if( mIsSelecting ) @@ -1223,12 +1235,12 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) } -BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask ) { BOOL handled = FALSE; BOOL selection_modified = FALSE; - if ( (gFocusMgr.getKeyboardFocus() == this) && getVisible()) + if ( gFocusMgr.getKeyboardFocus() == this ) { LLLineEditorRollback rollback( this ); @@ -1291,7 +1303,7 @@ BOOL LLLineEditor::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) } -BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL { @@ -1381,11 +1393,6 @@ void LLLineEditor::doDelete() void LLLineEditor::draw() { - if( !getVisible() ) - { - return; - } - S32 text_len = mText.length(); LLString saved_text; @@ -1406,6 +1413,13 @@ void LLLineEditor::draw() LLColor4 bg_color = mReadOnlyBgColor; +#if 0 // for when we're ready for image art. + if( hasFocus()) + { + mImage->drawBorder(0, 0, getRect().getWidth(), getRect().getHeight(), gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); + } + mImage->draw(getLocalRect(), mReadOnly ? mReadOnlyBgColor : mWriteableBgColor ); +#else // the old programmer art. // drawing solids requires texturing be disabled { LLGLSNoTexture no_texture; @@ -1423,6 +1437,7 @@ void LLLineEditor::draw() } gl_rect_2d(background, bg_color); } +#endif // draw text @@ -1560,10 +1575,14 @@ void LLLineEditor::draw() mMaxHPixels - llround(rendered_pixels_right), &rendered_pixels_right); } +#if 0 // for when we're ready for image art. + mBorder->setVisible(FALSE); // no more programmatic art. +#endif // If we're editing... if( gFocusMgr.getKeyboardFocus() == this) { + //mBorder->setVisible(TRUE); // ok, programmer art just this once. // (Flash the cursor every half second) if (gShowTextEditCursor && !mReadOnly) { @@ -1616,7 +1635,7 @@ void LLLineEditor::draw() if (0 == mText.length()) { mGLFont->render(mLabel.getWString(), 0, - LABEL_HPAD, (F32)text_bottom, + mMinHPixels, (F32)text_bottom, label_color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, @@ -1757,7 +1776,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str) if( 0 < len ) { // May be a comma or period, depending on the locale - llwchar decimal_point = (llwchar)gResMgr->getDecimalPoint(); + llwchar decimal_point = (llwchar)LLResMgr::getInstance()->getDecimalPoint(); S32 i = 0; @@ -1806,7 +1825,7 @@ BOOL LLLineEditor::postvalidateFloat(const LLString &str) } // May be a comma or period, depending on the locale - llwchar decimal_point = (llwchar)gResMgr->getDecimalPoint(); + llwchar decimal_point = (llwchar)LLResMgr::getInstance()->getDecimalPoint(); for( ; i < len; i++ ) { @@ -2244,8 +2263,27 @@ LLView* LLLineEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory return line_editor; } +//static +void LLLineEditor::cleanupClass() +{ + sImage = NULL; +} + +/* static */ +LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def) +{ + LLString xml_name; + if (from->hasAttribute(name)) from->getAttributeString(name, xml_name); + if (xml_name == LLString::null) return def; + LLPointer<LLUIImage> image = LLUI::getUIImage(xml_name); + return image.isNull() ? def : image; +} + void LLLineEditor::setColorParameters(LLXMLNodePtr node) { + // overrides default image if supplied. + mImage = parseImage("image", node, mImage); + LLColor4 color; if (LLUICtrlFactory::getAttributeColor(node,"cursor_color", color)) { @@ -2510,6 +2548,9 @@ S32 LLLineEditor::getPreeditFontSize() const } +static LLRegisterWidget<LLSearchEditor> r2("search_editor"); + + LLSearchEditor::LLSearchEditor(const LLString& name, const LLRect& rect, S32 max_length_bytes, @@ -2539,7 +2580,7 @@ LLSearchEditor::LLSearchEditor(const LLString& name, LLRect clear_btn_rect(rect.getWidth() - btn_width, rect.getHeight(), rect.getWidth(), 0); mClearSearchButton = new LLButton("clear search", clear_btn_rect, - "closebox.tga", + "icn_clear_lineeditor.tga", "UIImgBtnCloseInactiveUUID", LLString::null, onClearSearch, @@ -2552,9 +2593,42 @@ LLSearchEditor::LLSearchEditor(const LLString& name, mClearSearchButton->setTabStop(FALSE); mSearchEdit->addChild(mClearSearchButton); - mSearchEdit->setBorderWidth(0, btn_width); + mSearchEdit->setTextPadding(0, btn_width); +} + + +//virtual +void LLSearchEditor::setValue(const LLSD& value ) +{ + mSearchEdit->setValue(value); +} + +//virtual +LLSD LLSearchEditor::getValue() const +{ + return mSearchEdit->getValue(); } +//virtual +BOOL LLSearchEditor::setTextArg( const LLString& key, const LLStringExplicit& text ) +{ + return mSearchEdit->setTextArg(key, text); +} + +//virtual +BOOL LLSearchEditor::setLabelArg( const LLString& key, const LLStringExplicit& text ) +{ + return mSearchEdit->setLabelArg(key, text); +} + +//virtual +void LLSearchEditor::clear() +{ + if (mSearchEdit) + { + mSearchEdit->clear(); + } +} void LLSearchEditor::draw() { diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 6210c37ef3..687e98e377 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -78,19 +78,19 @@ public: S32 border_thickness = 1); virtual ~LLLineEditor(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_LINE_EDITOR; } - virtual LLString getWidgetTag() const { return LL_LINE_EDITOR_TAG; }; + virtual LLXMLNodePtr getXML(bool save_children = true) const; void setColorParameters(LLXMLNodePtr node); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + static void cleanupClass(); // mousehandler overrides /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleDoubleClick(S32 x,S32 y,MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); /*virtual*/ void onMouseCaptureLost(); // LLEditMenuHandler overrides @@ -189,8 +189,8 @@ public: void setKeystrokeCallback(void (*keystroke_callback)(LLLineEditor* caller, void* user_data)); - void setMaxTextLength(S32 max_text_length); - void setBorderWidth(S32 left, S32 right); + void setMaxTextLength(S32 max_text_length); + void setTextPadding(S32 left, S32 right); // Used to specify room for children before or after text. static BOOL isPartOfWord(llwchar c); // Prevalidation controls which keystrokes can affect the editor @@ -212,7 +212,7 @@ public: void updateHistory(); // stores current line in history private: - // private helper classes + // private helper methods void removeChar(); void addChar(const llwchar c); void setCursorAtLocalPos(S32 local_mouse_x); @@ -254,10 +254,10 @@ protected: S32 mCursorPos; // I-beam is just after the mCursorPos-th character. S32 mScrollHPos; // Horizontal offset from the start of mText. Used for scrolling. LLFrameTimer mScrollTimer; + S32 mTextPadLeft; // Used to reserve space before the beginning of the text for children. + S32 mTextPadRight; // Used to reserve space after the end of the text for children. S32 mMinHPixels; S32 mMaxHPixels; - S32 mBorderLeft; - S32 mBorderRight; BOOL mCommitOnFocusLost; BOOL mRevertOnEsc; @@ -302,6 +302,15 @@ protected: std::vector<S32> mPreeditPositions; LLPreeditor::standouts_t mPreeditStandouts; +private: + // Utility on top of LLUI::getUIImage, looks up a named image in a given XML node and returns it if possible + // or returns a given default image if anything in the process fails. + static LLPointer<LLUIImage> LLLineEditor::parseImage(LLString name, LLXMLNodePtr from, LLPointer<LLUIImage> def); + // Global instance used as default for member instance below. + static LLPointer<LLUIImage> sImage; + // Instances that by default point to the statics but can be overidden in XML. + LLPointer<LLUIImage> mImage; + // private helper class class LLLineEditorRollback { @@ -359,8 +368,6 @@ public: /*virtual*/ void draw(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SEARCH_EDITOR; } - virtual LLString getWidgetTag() const { return LL_SEARCH_EDITOR_TAG; } static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } @@ -368,12 +375,11 @@ public: void setSearchCallback(void (*search_callback)(const LLString& search_string, void* user_data), void* data) { mSearchCallback = search_callback; mCallbackUserData = data; } // LLUICtrl interface - virtual void setValue(const LLSD& value ) { mSearchEdit->setValue(value); } - virtual LLSD getValue() const { return mSearchEdit->getValue(); } - virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ) { return mSearchEdit->setTextArg( key, text); } - virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ) { return mSearchEdit->setLabelArg(key, text); } - virtual void clear() { if (mSearchEdit) mSearchEdit->clear(); } - + virtual void setValue(const LLSD& value ); + virtual LLSD getValue() const; + virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); + virtual BOOL setLabelArg( const LLString& key, const LLStringExplicit& text ); + virtual void clear(); private: static void onSearchEdit(LLLineEditor* caller, void* user_data ); diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 8c62a10f2b..b52de24bb5 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -188,31 +188,6 @@ LLXMLNodePtr LLMenuItemGL::getXML(bool save_children) const return node; } -BOOL LLMenuItemGL::handleKey(KEY key, MASK mask, BOOL called_from_parent) -{ - // modified from LLView::handleKey - // ignore visibility, as keyboard accelerators should still trigger menu items - // even when they are not visible - // also, ignore enabled flag for self, as that can change based on menu callbacks - BOOL handled = FALSE; - - if( called_from_parent ) - { - // Downward traversal - if (getEnabled()) - { - handled = childrenHandleKey( key, mask ) != NULL; - } - } - - if( !handled ) - { - handled = handleKeyHere( key, mask, called_from_parent ); - } - - return handled; -} - BOOL LLMenuItemGL::handleAcceleratorKey(KEY key, MASK mask) { if( getEnabled() && (!gKeyboard->getKeyRepeated(key) || mAllowKeyRepeat) && (key == mAcceleratorKey) && (mask == (mAcceleratorMask & MASK_NORMALKEYS)) ) @@ -400,7 +375,7 @@ void LLMenuItemGL::doIt( void ) } -BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask ) { if (getHighlight() && getMenu()->isOpen()) @@ -436,29 +411,21 @@ BOOL LLMenuItemGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) BOOL LLMenuItemGL::handleMouseUp( S32 x, S32 y, MASK ) { - if (getEnabled()) - { - // switch to mouse navigation mode - LLMenuGL::setKeyboardMode(FALSE); + // switch to mouse navigation mode + LLMenuGL::setKeyboardMode(FALSE); - doIt(); - make_ui_sound("UISndClickRelease"); - return TRUE; - } - return FALSE; + doIt(); + make_ui_sound("UISndClickRelease"); + return TRUE; } BOOL LLMenuItemGL::handleMouseDown( S32 x, S32 y, MASK ) { - if (getEnabled()) - { - // switch to mouse navigation mode - LLMenuGL::setKeyboardMode(FALSE); + // switch to mouse navigation mode + LLMenuGL::setKeyboardMode(FALSE); - setHighlight(TRUE); - return TRUE; - } - return FALSE; + setHighlight(TRUE); + return TRUE; } @@ -560,9 +527,6 @@ public: virtual LLString getType() const { return "separator"; } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_SEPARATOR; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_SEPARATOR_GL_TAG; } - // doIt() - do the primary funcationality of the menu item. virtual void doIt( void ) {} @@ -641,9 +605,6 @@ class LLMenuItemVerticalSeparatorGL public: LLMenuItemVerticalSeparatorGL( void ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_SEPARATOR_VERTICAL; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_VERTICAL_SEPARATOR_GL_TAG; } - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; } }; @@ -739,8 +700,6 @@ public: { setEnabled(FALSE); } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_BLANK; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_BLANK_GL_TAG; } virtual void doIt( void ) {} virtual void draw( void ) {} }; @@ -1086,29 +1045,31 @@ LLMenuItemBranchGL::LLMenuItemBranchGL( const LLString& name, const LLString& la } // virtual -LLView* LLMenuItemBranchGL::getChildByName(const LLString& name, BOOL recurse) const +LLView* LLMenuItemBranchGL::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const { + // richard: this is redundant with parent, remove if (mBranch->getName() == name) { return mBranch; } // Always recurse on branches - return mBranch->getChild<LLView>(name, recurse); + LLView* child = mBranch->getChildView(name, recurse, FALSE); + if (!child) + { + child = LLView::getChildView(name, recurse, create_if_missing); + } + return child; } // virtual BOOL LLMenuItemBranchGL::handleMouseUp(S32 x, S32 y, MASK mask) { - if (getEnabled()) - { - // switch to mouse navigation mode - LLMenuGL::setKeyboardMode(FALSE); + // switch to mouse navigation mode + LLMenuGL::setKeyboardMode(FALSE); - doIt(); - make_ui_sound("UISndClickRelease"); - return TRUE; - } - return FALSE; + doIt(); + make_ui_sound("UISndClickRelease"); + return TRUE; } BOOL LLMenuItemBranchGL::handleAcceleratorKey(KEY key, MASK mask) @@ -1266,7 +1227,7 @@ void LLMenuItemBranchGL::onVisibilityChange( BOOL new_visibility ) LLMenuItemGL::onVisibilityChange(new_visibility); } -BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask ) { if (getMenu()->getVisible() && mBranch->getVisible() && key == KEY_LEFT) { @@ -1285,8 +1246,7 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_par return handled; } - if (getEnabled() && - getHighlight() && + if (getHighlight() && getMenu()->isOpen() && key == KEY_RIGHT && !mBranch->getHighlightedItem()) { @@ -1300,7 +1260,7 @@ BOOL LLMenuItemBranchGL::handleKeyHere( KEY key, MASK mask, BOOL called_from_par } } - return LLMenuItemGL::handleKeyHere(key, mask, called_from_parent); + return LLMenuItemGL::handleKeyHere(key, mask); } void LLMenuItemBranchGL::openMenu() @@ -1370,9 +1330,6 @@ public: LLMenuItemBranchDownGL( const LLString& name, const LLString& label, LLMenuGL* branch, KEY key = KEY_NONE, MASK mask = MASK_NONE ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_BRANCH_DOWN; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_BRANCH_DOWN_GL_TAG; } - virtual LLString getType() const { return "menu"; } // returns the normal width of this control in pixels - this is @@ -1396,7 +1353,7 @@ public: virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); virtual void draw( void ); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleAcceleratorKey(KEY key, MASK mask); }; @@ -1533,7 +1490,7 @@ BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask) return handled; } -BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask) { BOOL menu_open = getBranch()->getVisible(); // don't do keyboard navigation of top-level menus unless in keyboard mode, or menu expanded @@ -1572,7 +1529,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_ // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - if (getEnabled() && !isActive()) + if (!isActive()) { doIt(); } @@ -1584,7 +1541,7 @@ BOOL LLMenuItemBranchDownGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_ // switch to keyboard navigation mode LLMenuGL::setKeyboardMode(TRUE); - if (getEnabled() && !isActive()) + if (!isActive()) { doIt(); } @@ -1657,6 +1614,8 @@ void LLMenuItemBranchDownGL::draw( void ) /// Class LLMenuGL ///============================================================================ +static LLRegisterWidget<LLMenuGL> r1("menu"); + // Default constructor LLMenuGL::LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater_handle ) : LLUICtrl( name, LLRect(), FALSE, NULL, NULL ), @@ -2652,8 +2611,8 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa while(1) { - // skip separators and disabled items - if ((*next_item_iter)->getEnabled() && (*next_item_iter)->getType() != SEPARATOR_NAME) + // skip separators and disabled/invisible items + if ((*next_item_iter)->getEnabled() && (*next_item_iter)->getVisible() && (*next_item_iter)->getType() != SEPARATOR_NAME) { if (cur_item) { @@ -2718,8 +2677,8 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa while(1) { - // skip separators and disabled items - if ((*prev_item_iter)->getEnabled() && (*prev_item_iter)->getName() != SEPARATOR_NAME) + // skip separators and disabled/invisible items + if ((*prev_item_iter)->getEnabled() && (*prev_item_iter)->getVisible() && (*prev_item_iter)->getName() != SEPARATOR_NAME) { (*prev_item_iter)->setHighlight(TRUE); return (*prev_item_iter); @@ -2768,37 +2727,6 @@ void LLMenuGL::updateParent(LLView* parentp) } } -// LLView functionality -BOOL LLMenuGL::handleKey( KEY key, MASK mask, BOOL called_from_parent ) -{ - BOOL handled = FALSE; - - // Pass down even if not visible - if( getEnabled() && called_from_parent ) - { - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - if (viewp->handleKey(key, mask, TRUE)) - { - handled = TRUE; - break; - } - } - } - - if( !handled ) - { - handled = handleKeyHere( key, mask, called_from_parent ); - if (handled && LLView::sDebugKeys) - { - llinfos << "Key handled by " << getName() << llendl; - } - } - - return handled; -} - BOOL LLMenuGL::handleAcceleratorKey(KEY key, MASK mask) { // don't handle if not enabled @@ -2821,7 +2749,7 @@ BOOL LLMenuGL::handleAcceleratorKey(KEY key, MASK mask) return FALSE; } -BOOL LLMenuGL::handleUnicodeCharHere( llwchar uni_char, BOOL called_from_parent ) +BOOL LLMenuGL::handleUnicodeCharHere( llwchar uni_char ) { if (jumpKeysActive()) { @@ -2947,17 +2875,19 @@ void LLMenuGL::setVisible(BOOL visible) LLMenuGL* LLMenuGL::getChildMenuByName(const LLString& name, BOOL recurse) const { - LLView* view = getChildByName(name, recurse); + LLView* view = getChildView(name, recurse, FALSE); if (view) { - if (view->getWidgetType() == WIDGET_TYPE_MENU_ITEM_BRANCH) + LLMenuItemBranchGL* branch = dynamic_cast<LLMenuItemBranchGL*>(view); + if (branch) { - LLMenuItemBranchGL *branch = (LLMenuItemBranchGL *)view; return branch->getBranch(); } - if (view->getWidgetType() == WIDGET_TYPE_MENU || view->getWidgetType() == WIDGET_TYPE_PIE_MENU) + + LLMenuGL* menup = dynamic_cast<LLMenuGL*>(view); + if (menup) { - return (LLMenuGL*)view; + return menup; } } llwarns << "Child Menu " << name << " not found in menu " << getName() << llendl; @@ -3038,9 +2968,6 @@ public: LLPieMenuBranch(const LLString& name, const LLString& label, LLPieMenu* branch, enabled_callback ecb, void* user_data); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_PIE_MENU_BRANCH; } - virtual LLString getWidgetTag() const { return LL_PIE_MENU_BRANCH_TAG; } - // called to rebuild the draw label virtual void buildDrawLabel( void ); @@ -3825,6 +3752,8 @@ void LLPieMenu::hide(BOOL item_selected) /// Class LLMenuBarGL ///============================================================================ +static LLRegisterWidget<LLMenuBarGL> r2("menu_bar"); + // Default constructor LLMenuBarGL::LLMenuBarGL( const LLString& name ) : LLMenuGL ( name, name ) { @@ -3880,9 +3809,10 @@ LLView* LLMenuBarGL::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLMenuBarGL *menubar = new LLMenuBarGL(name); LLHandle<LLFloater> parent_handle; - if (parent->getWidgetType() == WIDGET_TYPE_FLOATER) + LLFloater* parent_floater = dynamic_cast<LLFloater*>(parent); + if (parent_floater) { - parent_handle = ((LLFloater*)parent)->getHandle(); + parent_handle = parent_floater->getHandle(); } // We need to have the rect early so that it's around when building @@ -3974,7 +3904,7 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) return result; } -BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask) { if(key == KEY_ALT && !gKeyboard->getKeyRepeated(key) && LLUI::sConfigGroup->getBOOL("UseAltKeyForMenus")) { @@ -3988,7 +3918,7 @@ BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) // before processing any other key, check to see if ALT key has triggered menu access checkMenuTrigger(); - return LLMenuGL::handleKeyHere(key, mask, called_from_parent); + return LLMenuGL::handleKeyHere(key, mask); } BOOL LLMenuBarGL::handleJumpKey(KEY key) @@ -4278,7 +4208,7 @@ BOOL LLMenuHolderGL::hasVisibleMenu() const for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - if (viewp->getVisible() && viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR) + if (viewp->getVisible() && dynamic_cast<LLMenuBarGL*>(viewp) == NULL) { return TRUE; } @@ -4302,7 +4232,7 @@ BOOL LLMenuHolderGL::hideMenus() { LLView* viewp = *child_it; // clicks off of menu do not hide menu bar - if (viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR && viewp->getVisible()) + if (dynamic_cast<LLMenuBarGL*>(viewp) == NULL && viewp->getVisible()) { viewp->setVisible(FALSE); } @@ -4412,7 +4342,7 @@ BOOL LLTearOffMenu::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) return mMenu->handleUnicodeChar(uni_char, TRUE); } -BOOL LLTearOffMenu::handleKey(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLTearOffMenu::handleKeyHere(KEY key, MASK mask) { if (!mMenu->getHighlightedItem()) { diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 33b226fd99..3166290307 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -91,14 +91,11 @@ public: LLMenuItemGL( const LLString& name, const LLString& label, KEY key = KEY_NONE, MASK = MASK_NONE ); virtual void setValue(const LLSD& value) { setLabel(value.asString()); } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_TAG; } virtual LLXMLNodePtr getXML(bool save_children = true) const; virtual LLString getType() const { return "item"; } - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -165,7 +162,7 @@ public: virtual void setEnabledSubMenus(BOOL enable){}; // LLView Functionality - virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ); + virtual BOOL handleKeyHere( KEY key, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); virtual void draw( void ); @@ -267,8 +264,6 @@ public: virtual LLString getType() const { return "call"; } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_CALL; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_CALL_GL_TAG; } void setEnabledControl(LLString enabled_control, LLView *context); void setVisibleControl(LLString enabled_control, LLView *context); @@ -341,8 +336,6 @@ public: void setCheckedControl(LLString checked_control, LLView *context); virtual void setValue(const LLSD& value); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_CHECK; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_CHECK_GL_TAG; } virtual LLString getType() const { return "check"; } @@ -405,6 +398,8 @@ class LLMenuGL // TODO: The menu and menu item classes share a great deal of functionality and perhaps should be united. // I think it may make the most sense to make LLMenuGL be a subclass of LLMenuItemGL. -MG { + // let branching menu items use my protected traversal methods + friend class LLMenuItemBranchGL; public: LLMenuGL( const LLString& name, const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>()); LLMenuGL( const LLString& label, LLHandle<LLFloater> parent_floater = LLHandle<LLFloater>() ); @@ -414,13 +409,9 @@ public: void parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory *factory); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU; } - virtual LLString getWidgetTag() const { return LL_MENU_GL_TAG; } // LLView Functionality - virtual BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); - //virtual BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ); - virtual BOOL handleUnicodeCharHere( llwchar uni_char, BOOL called_from_parent ); + virtual BOOL handleUnicodeCharHere( llwchar uni_char ); virtual BOOL handleHover( S32 x, S32 y, MASK mask ); virtual void draw( void ); virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color); @@ -578,9 +569,6 @@ public: virtual LLString getType() const { return "menu"; } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_ITEM_BRANCH; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_BRANCH_GL_TAG; } - virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleAcceleratorKey(KEY key, MASK mask); @@ -601,7 +589,7 @@ public: // active. This is used for behavior transfer. virtual void setHighlight( BOOL highlight ); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL isActive() const { return isOpen() && mBranch->getHighlightedItem(); } @@ -620,8 +608,7 @@ public: virtual void openMenu(); -protected: - virtual LLView* getChildByName(const LLString& name, BOOL recurse) const; + virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; private: LLMenuGL* mBranch; @@ -642,16 +629,12 @@ public: LLPieMenu(const LLString& name); virtual ~LLPieMenu() {} - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_PIE_MENU; } - virtual LLString getWidgetTag() const { return LL_PIE_MENU_TAG; } - void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); // LLView Functionality // can't set visibility directly, must call show or hide virtual void setVisible(BOOL visible); - //virtual BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); virtual BOOL handleHover( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); @@ -710,11 +693,8 @@ public: virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_BAR; } - virtual LLString getWidgetTag() const { return LL_MENU_BAR_GL_TAG; } - virtual BOOL handleAcceleratorKey(KEY key, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleJumpKey(KEY key); // rearrange the child rects so they fit the shape of the menu @@ -756,9 +736,6 @@ public: LLMenuHolderGL(const LLString& name, const LLRect& rect, BOOL mouse_opaque, U32 follows = FOLLOWS_NONE); virtual ~LLMenuHolderGL() {} - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MENU_HOLDER; } - virtual LLString getWidgetTag() const { return LL_MENU_HOLDER_GL_TAG; } - virtual BOOL hideMenus(); void reshape(S32 width, S32 height, BOOL called_from_parent); void setCanHide(BOOL can_hide) { mCanHide = can_hide; } @@ -796,7 +773,7 @@ public: virtual void onFocusReceived(); virtual void onFocusLost(); virtual BOOL handleUnicodeChar(llwchar uni_char, BOOL called_from_parent); - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void translate(S32 x, S32 y); private: @@ -818,9 +795,6 @@ class LLMenuItemTearOffGL : public LLMenuItemGL public: LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEAROFF_MENU; } - virtual LLString getWidgetTag() const { return LL_MENU_ITEM_TEAR_OFF_GL_TAG; } - virtual LLString getType() const { return "tearoff_menu"; } virtual void doIt(void); diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp index a150d295e5..878c57b8b3 100644 --- a/indra/llui/llmodaldialog.cpp +++ b/indra/llui/llmodaldialog.cpp @@ -211,11 +211,9 @@ BOOL LLModalDialog::handleRightMouseDown(S32 x, S32 y, MASK mask) } -BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLModalDialog::handleKeyHere(KEY key, MASK mask ) { - childrenHandleKey(key, mask); - - LLFloater::handleKeyHere(key, mask, called_from_parent ); + LLFloater::handleKeyHere(key, mask ); if (mModal) { @@ -246,33 +244,30 @@ void LLModalDialog::onClose(bool app_quitting) // virtual void LLModalDialog::draw() { - if (getVisible()) - { - LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); - S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); + LLColor4 shadow_color = LLUI::sColorsGroup->getColor("ColorDropShadow"); + S32 shadow_lines = LLUI::sConfigGroup->getS32("DropShadowFloater"); + + gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, + shadow_color, shadow_lines); - gl_drop_shadow( 0, getRect().getHeight(), getRect().getWidth(), 0, - shadow_color, shadow_lines); + LLFloater::draw(); + + if (mModal) + { + // If we've lost focus to a non-child, get it back ASAP. + if( gFocusMgr.getTopCtrl() != this ) + { + gFocusMgr.setTopCtrl( this ); + } - LLFloater::draw(); + if( !gFocusMgr.childHasKeyboardFocus( this ) ) + { + setFocus(TRUE); + } - if (mModal) + if( !gFocusMgr.childHasMouseCapture( this ) ) { - // If we've lost focus to a non-child, get it back ASAP. - if( gFocusMgr.getTopCtrl() != this ) - { - gFocusMgr.setTopCtrl( this ); - } - - if( !gFocusMgr.childHasKeyboardFocus( this ) ) - { - setFocus(TRUE); - } - - if( !gFocusMgr.childHasMouseCapture( this ) ) - { - gFocusMgr.setMouseCapture( this ); - } + gFocusMgr.setMouseCapture( this ); } } } diff --git a/indra/llui/llmodaldialog.h b/indra/llui/llmodaldialog.h index f13e5c37b7..a5e6e9a490 100644 --- a/indra/llui/llmodaldialog.h +++ b/indra/llui/llmodaldialog.h @@ -60,7 +60,7 @@ public: /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask ); /*virtual*/ void onClose(bool app_quitting); diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp index b4bf3a92d5..c5c0e1c8b1 100644 --- a/indra/llui/llmultislider.cpp +++ b/indra/llui/llmultislider.cpp @@ -43,6 +43,8 @@ #include <sstream> +static LLRegisterWidget<LLMultiSlider> r("multi_slider_bar"); + const S32 MULTI_THUMB_WIDTH = 8; const S32 MULTI_TRACK_HEIGHT = 6; const F32 FLOAT_THRESHOLD = 0.00001f; @@ -98,16 +100,6 @@ LLMultiSlider::LLMultiSlider( setValue(getValue()); } -EWidgetType LLMultiSlider::getWidgetType() const -{ - return WIDGET_TYPE_MULTI_SLIDER_BAR; -} - -LLString LLMultiSlider::getWidgetTag() const -{ - return LL_MULTI_SLIDER_TAG; -} - void LLMultiSlider::setSliderValue(const LLString& name, F32 value, BOOL from_event) { // exit if not there @@ -403,31 +395,28 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } -BOOL LLMultiSlider::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLMultiSlider::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent ) + switch(key) { - switch(key) - { - case KEY_UP: - case KEY_DOWN: - // eat up and down keys to be consistent - handled = TRUE; - break; - case KEY_LEFT: - setCurSliderValue(getCurSliderValue() - getIncrement()); - onCommit(); - handled = TRUE; - break; - case KEY_RIGHT: - setCurSliderValue(getCurSliderValue() + getIncrement()); - onCommit(); - handled = TRUE; - break; - default: - break; - } + case KEY_UP: + case KEY_DOWN: + // eat up and down keys to be consistent + handled = TRUE; + break; + case KEY_LEFT: + setCurSliderValue(getCurSliderValue() - getIncrement()); + onCommit(); + handled = TRUE; + break; + case KEY_RIGHT: + setCurSliderValue(getCurSliderValue() + getIncrement()); + onCommit(); + handled = TRUE; + break; + default: + break; } return handled; } @@ -438,177 +427,142 @@ void LLMultiSlider::draw() std::map<LLString, LLRect>::iterator mIt; std::map<LLString, LLRect>::iterator curSldrIt; - if( getVisible() ) - { - // Draw background and thumb. - // drawing solids requires texturing be disabled - LLGLSNoTexture no_texture; + // Draw background and thumb. - LLRect rect(mDragStartThumbRect); + // drawing solids requires texturing be disabled + LLGLSNoTexture no_texture; - F32 opacity = getEnabled() ? 1.f : 0.3f; + LLRect rect(mDragStartThumbRect); - // Track - LLUUID thumb_image_id; - thumb_image_id.set(LLUI::sAssetsGroup->getString("rounded_square.tga")); - LLPointer<LLImageGL> thumb_imagep(LLUI::sImageProvider->getUIImageByID(thumb_image_id)->getImage()); + F32 opacity = getEnabled() ? 1.f : 0.3f; - S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2; - LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset ); + // Track + LLUIImagePtr thumb_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga"); + S32 height_offset = (getRect().getHeight() - MULTI_TRACK_HEIGHT) / 2; + LLRect track_rect(0, getRect().getHeight() - height_offset, getRect().getWidth(), height_offset ); - if(mDrawTrack) - { - track_rect.stretch(-1); - gl_draw_scaled_image_with_border(track_rect.mLeft, track_rect.mBottom, 16, 16, track_rect.getWidth(), track_rect.getHeight(), - thumb_imagep, mTrackColor % opacity); - } - // if we're supposed to use a drawn triangle - // simple gl call for the triangle - if(mUseTriangle) { + if(mDrawTrack) + { + track_rect.stretch(-1); + thumb_imagep->draw(track_rect, mTrackColor % opacity); + } - for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { + // if we're supposed to use a drawn triangle + // simple gl call for the triangle + if(mUseTriangle) { - gl_triangle_2d( - mIt->second.mLeft - EXTRA_TRIANGLE_WIDTH, - mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, - mIt->second.mRight + EXTRA_TRIANGLE_WIDTH, - mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, - mIt->second.mLeft + mIt->second.getWidth() / 2, - mIt->second.mBottom - EXTRA_TRIANGLE_HEIGHT, - mTriangleColor, TRUE); - } + for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { + + gl_triangle_2d( + mIt->second.mLeft - EXTRA_TRIANGLE_WIDTH, + mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, + mIt->second.mRight + EXTRA_TRIANGLE_WIDTH, + mIt->second.mTop + EXTRA_TRIANGLE_HEIGHT, + mIt->second.mLeft + mIt->second.getWidth() / 2, + mIt->second.mBottom - EXTRA_TRIANGLE_HEIGHT, + mTriangleColor, TRUE); } - else if (!thumb_imagep) - { - // draw all the thumbs - curSldrIt = mThumbRects.end(); - for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { + } + else if (!thumb_imagep) + { + // draw all the thumbs + curSldrIt = mThumbRects.end(); + for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { + + // choose the color + curThumbColor = mThumbCenterColor; + if(mIt->first == mCurSlider) { - // choose the color - curThumbColor = mThumbCenterColor; - if(mIt->first == mCurSlider) { - - curSldrIt = mIt; - continue; - //curThumbColor = mThumbCenterSelectedColor; - } - - // the draw command - gl_rect_2d(mIt->second, curThumbColor, TRUE); + curSldrIt = mIt; + continue; + //curThumbColor = mThumbCenterSelectedColor; } - // now draw the current slider - if(curSldrIt != mThumbRects.end()) { - gl_rect_2d(curSldrIt->second, mThumbCenterSelectedColor, TRUE); - } + // the draw command + gl_rect_2d(mIt->second, curThumbColor, TRUE); + } - // and draw the drag start - if (gFocusMgr.getMouseCapture() == this) - { - gl_rect_2d(mDragStartThumbRect, mThumbCenterColor % opacity, FALSE); - } + // now draw the current slider + if(curSldrIt != mThumbRects.end()) { + gl_rect_2d(curSldrIt->second, mThumbCenterSelectedColor, TRUE); } - else if( gFocusMgr.getMouseCapture() == this ) + + // and draw the drag start + if (gFocusMgr.getMouseCapture() == this) { - // draw drag start - gl_draw_scaled_image_with_border(mDragStartThumbRect.mLeft, - mDragStartThumbRect.mBottom, 16, 16, - mDragStartThumbRect.getWidth(), - mDragStartThumbRect.getHeight(), - thumb_imagep, mThumbCenterColor % 0.3f, TRUE); - - // draw the highlight - if (hasFocus()) + gl_rect_2d(mDragStartThumbRect, mThumbCenterColor % opacity, FALSE); + } + } + else if( gFocusMgr.getMouseCapture() == this ) + { + // draw drag start + thumb_imagep->drawSolid(mDragStartThumbRect, mThumbCenterColor % 0.3f); + + // draw the highlight + if (hasFocus()) + { + thumb_imagep->drawBorder(mThumbRects[mCurSlider], gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); + } + + // draw the thumbs + curSldrIt = mThumbRects.end(); + for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) + { + // choose the color + curThumbColor = mThumbCenterColor; + if(mIt->first == mCurSlider) { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - LLRect highlight_rect = mThumbRects[mCurSlider]; - highlight_rect.stretch(llround(lerp(1.f, 3.f, lerp_amt))); - gl_draw_scaled_image_with_border(highlight_rect.mLeft, - highlight_rect.mBottom, 16, 16, highlight_rect.getWidth(), - highlight_rect.getHeight(), - thumb_imagep, gFocusMgr.getFocusColor()); + // don't draw now, draw last + curSldrIt = mIt; + continue; } + + // the draw command + thumb_imagep->drawSolid(mIt->second, curThumbColor); + } + + // draw cur slider last + if(curSldrIt != mThumbRects.end()) + { + thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor); + } + + } + else + { + // draw highlight + if (hasFocus()) + { + thumb_imagep->drawBorder(mThumbRects[mCurSlider], gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); + } - // draw the thumbs - curSldrIt = mThumbRects.end(); - for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { - - // choose the color - curThumbColor = mThumbCenterColor; - if(mIt->first == mCurSlider) { - // don't draw now, draw last - curSldrIt = mIt; - continue; - } - - // the draw command - gl_draw_scaled_image_with_border( - mIt->second.mLeft, - mIt->second.mBottom, 16, 16, - mIt->second.getWidth(), - mIt->second.getHeight(), thumb_imagep, - curThumbColor, TRUE); - } + // draw thumbs + curSldrIt = mThumbRects.end(); + for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) + { - // draw cur slider last - if(curSldrIt != mThumbRects.end()) { - gl_draw_scaled_image_with_border( - curSldrIt->second.mLeft, - curSldrIt->second.mBottom, 16, 16, - curSldrIt->second.getWidth(), - curSldrIt->second.getHeight(), thumb_imagep, - mThumbCenterSelectedColor, TRUE); - } + // choose the color + curThumbColor = mThumbCenterColor; + if(mIt->first == mCurSlider) + { + curSldrIt = mIt; + continue; + //curThumbColor = mThumbCenterSelectedColor; + } + thumb_imagep->drawSolid(mIt->second, curThumbColor % opacity); } - else - { - // draw highlight - if (hasFocus()) - { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - LLRect highlight_rect = mThumbRects[mCurSlider]; - highlight_rect.stretch(llround(lerp(1.f, 3.f, lerp_amt))); - gl_draw_scaled_image_with_border(highlight_rect.mLeft, highlight_rect.mBottom, 16, 16, highlight_rect.getWidth(), highlight_rect.getHeight(), - thumb_imagep, gFocusMgr.getFocusColor()); - } - // draw thumbs - curSldrIt = mThumbRects.end(); - for(mIt = mThumbRects.begin(); mIt != mThumbRects.end(); mIt++) { - - // choose the color - curThumbColor = mThumbCenterColor; - if(mIt->first == mCurSlider) { - curSldrIt = mIt; - continue; - //curThumbColor = mThumbCenterSelectedColor; - } - - // the draw command - gl_draw_scaled_image_with_border( - mIt->second.mLeft, - mIt->second.mBottom, 16, 16, - mIt->second.getWidth(), - mIt->second.getHeight(), thumb_imagep, - curThumbColor % opacity, TRUE); - } - - if(curSldrIt != mThumbRects.end()) { - gl_draw_scaled_image_with_border( - curSldrIt->second.mLeft, - curSldrIt->second.mBottom, 16, 16, - curSldrIt->second.getWidth(), - curSldrIt->second.getHeight(), thumb_imagep, - mThumbCenterSelectedColor % opacity, TRUE); - } + if(curSldrIt != mThumbRects.end()) + { + thumb_imagep->drawSolid(curSldrIt->second, mThumbCenterSelectedColor % opacity); } - - LLUICtrl::draw(); } + + LLUICtrl::draw(); } // virtual diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h index 67f627d21c..1eb7764c3c 100644 --- a/indra/llui/llmultislider.h +++ b/indra/llui/llmultislider.h @@ -55,8 +55,6 @@ public: BOOL use_triangle, const LLString& control_name = LLString::null ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -94,7 +92,7 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void draw(); protected: diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 6f921a4e5e..641b88de9a 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -50,6 +50,8 @@ #include "llfocusmgr.h" #include "llresmgr.h" +static LLRegisterWidget<LLMultiSliderCtrl> r("multi_slider"); + const U32 MAX_STRING_LENGTH = 10; diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h index 028f54ed5e..a3a602c2b2 100644 --- a/indra/llui/llmultisliderctrl.h +++ b/indra/llui/llmultisliderctrl.h @@ -71,8 +71,6 @@ public: const LLString& control_which = LLString::null ); virtual ~LLMultiSliderCtrl(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_MULTI_SLIDER; } - virtual LLString getWidgetTag() const { return LL_MULTI_SLIDER_CTRL_TAG; } virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index cb732a17c6..c3afa040f8 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -65,6 +65,8 @@ LLPanel::alert_queue_t LLPanel::sAlertQueue; const S32 RESIZE_BAR_OVERLAP = 1; const S32 RESIZE_BAR_HEIGHT = 3; +static LLRegisterWidget<LLPanel> r1("panel"); + void LLPanel::init() { // mRectControl @@ -126,18 +128,6 @@ LLPanel::~LLPanel() } // virtual -EWidgetType LLPanel::getWidgetType() const -{ - return WIDGET_TYPE_PANEL; -} - -// virtual -LLString LLPanel::getWidgetTag() const -{ - return LL_PANEL_TAG; -} - -// virtual BOOL LLPanel::isPanel() const { return TRUE; @@ -227,7 +217,8 @@ void LLPanel::updateDefaultBtn() if (gFocusMgr.childHasKeyboardFocus( this ) && mDefaultBtn->getEnabled()) { LLUICtrl* focus_ctrl = gFocusMgr.getKeyboardFocus(); - BOOL focus_is_child_button = focus_ctrl->getWidgetType() == WIDGET_TYPE_BUTTON && static_cast<LLButton *>(focus_ctrl)->getCommitOnReturn(); + LLButton* buttonp = dynamic_cast<LLButton*>(focus_ctrl); + BOOL focus_is_child_button = buttonp && buttonp->getCommitOnReturn(); // only enable default button when current focus is not a return-capturing button mDefaultBtn->setBorderEnabled(!focus_is_child_button); } @@ -259,7 +250,7 @@ void LLPanel::setDefaultBtn(LLButton* btn) void LLPanel::setDefaultBtn(const LLString& id) { - LLButton *button = LLUICtrlFactory::getButtonByName(this, id); + LLButton *button = getChild<LLButton>(id); if (button) { setDefaultBtn(button); @@ -270,77 +261,6 @@ void LLPanel::setDefaultBtn(const LLString& id) } } -BOOL LLPanel::handleKey(KEY key, MASK mask, BOOL called_from_parent) -{ - BOOL handled = FALSE; - if (getVisible() && getEnabled()) - { - if( (mask == MASK_SHIFT) && (KEY_TAB == key)) - { - //SHIFT-TAB - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus && gFocusMgr.childHasKeyboardFocus(this)) - { - LLUICtrl* focus_root = cur_focus; - while(cur_focus->getParentUICtrl()) - { - cur_focus = cur_focus->getParentUICtrl(); - if (cur_focus->isFocusRoot()) - { - // this is the root-most focus root found so far - focus_root = cur_focus; - } - } - handled = focus_root->focusPrevItem(FALSE); - } - else if (!cur_focus && isFocusRoot()) - { - handled = focusLastItem(); - if (!handled) - { - setFocus(TRUE); - handled = TRUE; - } - } - } - else - if( (mask == MASK_NONE ) && (KEY_TAB == key)) - { - //TAB - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - if (cur_focus && gFocusMgr.childHasKeyboardFocus(this)) - { - LLUICtrl* focus_root = cur_focus; - while(cur_focus->getParentUICtrl()) - { - cur_focus = cur_focus->getParentUICtrl(); - if (cur_focus->isFocusRoot()) - { - focus_root = cur_focus; - } - } - handled = focus_root->focusNextItem(FALSE); - } - else if (!cur_focus && isFocusRoot()) - { - handled = focusFirstItem(); - if (!handled) - { - setFocus(TRUE); - handled = TRUE; - } - } - } - } - - if (!handled) - { - handled = LLView::handleKey(key, mask, called_from_parent); - } - - return handled; -} - void LLPanel::addCtrl( LLUICtrl* ctrl, S32 tab_group) { mLastTabGroup = tab_group; @@ -355,83 +275,84 @@ void LLPanel::addCtrlAtEnd( LLUICtrl* ctrl, S32 tab_group) LLView::addCtrlAtEnd(ctrl, tab_group); } -BOOL LLPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLPanel::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && - gFocusMgr.childHasKeyboardFocus(this) && !called_from_parent ) + LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); + + // handle user hitting ESC to defocus + if (key == KEY_ESCAPE) { - // handle user hitting ESC to defocus - if (key == KEY_ESCAPE) + gFocusMgr.setKeyboardFocus(NULL); + return TRUE; + } + else if( (mask == MASK_SHIFT) && (KEY_TAB == key)) + { + //SHIFT-TAB + if (cur_focus) { - gFocusMgr.setKeyboardFocus(NULL); - return TRUE; + LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); + handled = focus_root->focusPrevItem(FALSE); } - - LLUICtrl* cur_focus = gFocusMgr.getKeyboardFocus(); - // If we have a default button, click it when - // return is pressed, unless current focus is a return-capturing button - // in which case *that* button will handle the return key - if (cur_focus && !(cur_focus->getWidgetType() == WIDGET_TYPE_BUTTON && static_cast<LLButton *>(cur_focus)->getCommitOnReturn())) + } + else if( (mask == MASK_NONE ) && (KEY_TAB == key)) + { + //TAB + if (cur_focus) { - // RETURN key means hit default button in this case - if (key == KEY_RETURN && mask == MASK_NONE - && mDefaultBtn != NULL - && mDefaultBtn->getVisible() - && mDefaultBtn->getEnabled()) - { - mDefaultBtn->onCommit(); - handled = TRUE; - } + LLUICtrl* focus_root = cur_focus->findRootMostFocusRoot(); + handled = focus_root->focusNextItem(FALSE); } + } - if (key == KEY_RETURN && mask == MASK_NONE) + // If we have a default button, click it when + // return is pressed, unless current focus is a return-capturing button + // in which case *that* button will handle the return key + LLButton* focused_button = dynamic_cast<LLButton*>(cur_focus); + if (cur_focus && !(focused_button && focused_button->getCommitOnReturn())) + { + // RETURN key means hit default button in this case + if (key == KEY_RETURN && mask == MASK_NONE + && mDefaultBtn != NULL + && mDefaultBtn->getVisible() + && mDefaultBtn->getEnabled()) { - // set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl - if (cur_focus && cur_focus->acceptsTextInput()) - { - cur_focus->onCommit(); - handled = TRUE; - } + mDefaultBtn->onCommit(); + handled = TRUE; } } - return handled; -} - -void LLPanel::requires(LLString name, EWidgetType type) -{ - mRequirements[name] = type; -} - -BOOL LLPanel::checkRequirements() const -{ - BOOL retval = TRUE; - LLString message; - - for (requirements_map_t::const_iterator i = mRequirements.begin(); i != mRequirements.end(); ++i) + if (key == KEY_RETURN && mask == MASK_NONE) { - if (!this->getCtrlByNameAndType(i->first, i->second)) + // set keyboard focus to self to trigger commitOnFocusLost behavior on current ctrl + if (cur_focus && cur_focus->acceptsTextInput()) { - retval = FALSE; - message += i->first + " " + LLUICtrlFactory::getWidgetType(i->second) + "\n"; + cur_focus->onCommit(); + handled = TRUE; } } - if (!retval) + return handled; +} + +BOOL LLPanel::checkRequirements() +{ + if (!mRequirementsError.empty()) { LLString::format_map_t args; - args["[COMPONENTS]"] = message; + args["[COMPONENTS]"] = mRequirementsError; args["[FLOATER]"] = getName(); llwarns << getName() << " failed requirements check on: \n" - << message << llendl; + << mRequirementsError << llendl; alertXml("FailedRequirementsCheck", args); + mRequirementsError.clear(); + return FALSE; } - return retval; + return TRUE; } //static @@ -494,30 +415,6 @@ void LLPanel::setBorderVisible(BOOL b) } } -LLUICtrl* LLPanel::getCtrlByNameAndType(const LLString& name, EWidgetType type) const -{ - LLView* view = getChildByName(name, TRUE); - if (view && view->isCtrl()) - { - if (type == WIDGET_TYPE_DONTCARE || view->getWidgetType() == type) - { - return (LLUICtrl*)view; - } - else - { - llwarns << "Widget " << name << " has improper type in panel " << getName() << "\n" - << "Is: \t\t" << view->getWidgetType() << "\n" - << "Should be: \t" << type - << llendl; - } - } - else - { - childNotFound(name); - } - return NULL; -} - // virtual LLXMLNodePtr LLPanel::getXML(bool save_children) const { @@ -963,7 +860,7 @@ BOOL LLPanel::childSetLabelArg(const LLString& id, const LLString& key, const LL BOOL LLPanel::childSetToolTipArg(const LLString& id, const LLString& key, const LLStringExplicit& text) { - LLView* child = getChildByName(id, true); + LLView* child = getChildView(id, true, FALSE); if (child) { return child->setToolTipArg(key, text); @@ -991,7 +888,7 @@ void LLPanel::childSetMaxValue(const LLString& id, LLSD max_value) void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool visible) { - LLTabContainer* child = LLUICtrlFactory::getTabContainerByName(this, id); + LLTabContainer* child = getChild<LLTabContainer>(id); if (child) { child->selectTabByName(tabname); @@ -1000,7 +897,7 @@ void LLPanel::childShowTab(const LLString& id, const LLString& tabname, bool vis LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const { - LLTabContainer* child = LLUICtrlFactory::getTabContainerByName(this, id); + LLTabContainer* child = getChild<LLTabContainer>(id); if (child) { return child->getCurrentPanel(); @@ -1010,7 +907,7 @@ LLPanel *LLPanel::childGetVisibleTab(const LLString& id) const void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabname, void (*on_tab_clicked)(void*, bool), void *userdata) { - LLTabContainer* child = LLUICtrlFactory::getTabContainerByName(this, id); + LLTabContainer* child = getChild<LLTabContainer>(id); if (child) { LLPanel *panel = child->getPanelByName(tabname); @@ -1024,7 +921,7 @@ void LLPanel::childSetTabChangeCallback(const LLString& id, const LLString& tabn void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) { - LLLineEditor* child = LLUICtrlFactory::getLineEditorByName(this, id); + LLLineEditor* child = getChild<LLLineEditor>(id); if (child) { child->setKeystrokeCallback(keystroke_callback); @@ -1037,7 +934,7 @@ void LLPanel::childSetKeystrokeCallback(const LLString& id, void (*keystroke_cal void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWString &) ) { - LLLineEditor* child = LLUICtrlFactory::getLineEditorByName(this, id); + LLLineEditor* child = getChild<LLLineEditor>(id); if (child) { child->setPrevalidate(func); @@ -1046,7 +943,7 @@ void LLPanel::childSetPrevalidate(const LLString& id, BOOL (*func)(const LLWStri void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool visible) { - LLTextBox* child = (LLTextBox*)getCtrlByNameAndType(id, WIDGET_TYPE_TEXT_BOX); + LLTextBox* child = getChild<LLTextBox>(id); if (child) { child->setVisible(visible); @@ -1056,7 +953,7 @@ void LLPanel::childSetWrappedText(const LLString& id, const LLString& text, bool void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* value) { - LLButton* button = (LLButton*)getCtrlByNameAndType(id, WIDGET_TYPE_BUTTON); + LLButton* button = getChild<LLButton>(id); if (button) { button->setClickedCallback(function, value); @@ -1065,7 +962,7 @@ void LLPanel::childSetAction(const LLString& id, void(*function)(void*), void* v void LLPanel::childSetActionTextbox(const LLString& id, void(*function)(void*)) { - LLTextBox* textbox = (LLTextBox*)getCtrlByNameAndType(id, WIDGET_TYPE_TEXT_BOX); + LLTextBox* textbox = getChild<LLTextBox>(id); if (textbox) { textbox->setClickedCallback(function); @@ -1082,13 +979,18 @@ void LLPanel::childSetControlName(const LLString& id, const LLString& control_na } //virtual -LLView* LLPanel::getChildByName(const LLString& name, BOOL recurse) const +LLView* LLPanel::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const { - LLView* view = LLUICtrl::getChildByName(name, recurse); + // just get child, don't try to create a dummy one + LLView* view = LLUICtrl::getChildView(name, recurse, FALSE); if (!view && !recurse) { childNotFound(name); } + if (!view && create_if_missing) + { + view = createDummyWidget<LLView>(name); + } return view; } @@ -1181,6 +1083,8 @@ struct LLLayoutStack::LLEmbeddedPanel F32 mVisibleAmt; }; +static LLRegisterWidget<LLLayoutStack> r2("layout_stack"); + LLLayoutStack::LLLayoutStack(eLayoutOrientation orientation) : mOrientation(orientation), mMinWidth(0), @@ -1194,19 +1098,6 @@ LLLayoutStack::~LLLayoutStack() std::for_each(mPanels.begin(), mPanels.end(), DeletePointer()); } -// virtual -EWidgetType LLLayoutStack::getWidgetType() const -{ - return WIDGET_TYPE_LAYOUT_STACK; -} - -// virtual -LLString LLLayoutStack::getWidgetTag() const -{ - return LL_LAYOUT_STACK_TAG; -} - - void LLLayoutStack::draw() { updateLayout(); @@ -1294,18 +1185,18 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor LLXMLNodePtr child; for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) { + S32 min_width = 0; + S32 min_height = 0; + BOOL auto_resize = TRUE; + + child->getAttributeS32("min_width", min_width); + child->getAttributeS32("min_height", min_height); + child->getAttributeBOOL("auto_resize", auto_resize); + if (child->hasName("layout_panel")) { - S32 min_width = 0; - S32 min_height = 0; - BOOL auto_resize = TRUE; BOOL user_resize = TRUE; - - child->getAttributeS32("min_width", min_width); - child->getAttributeS32("min_height", min_height); - child->getAttributeBOOL("auto_resize", auto_resize); child->getAttributeBOOL("user_resize", user_resize); - LLPanel* panelp = (LLPanel*)LLPanel::fromXML(child, layout_stackp, factory); if (panelp) { @@ -1313,6 +1204,26 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactor layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); } } + else + { + BOOL user_resize = FALSE; + child->getAttributeBOOL("user_resize", user_resize); + + LLPanel* panelp = new LLPanel("auto_panel"); + LLView* new_child = factory->createWidget(panelp, child); + if (new_child) + { + // put child in new embedded panel + layout_stackp->addPanel(panelp, min_width, min_height, auto_resize, user_resize); + // resize panel to contain widget and move widget to be contained in panel + panelp->setRect(new_child->getRect()); + new_child->setOrigin(0, 0); + } + else + { + panelp->die(); + } + } } layout_stackp->updateLayout(); @@ -1401,6 +1312,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize) if (mOrientation == HORIZONTAL) { + // enforce minimize size constraint by default + if (panelp->getRect().getWidth() < (*panel_it)->mMinWidth) + { + panelp->reshape((*panel_it)->mMinWidth, panelp->getRect().getHeight()); + } total_width += llround(panelp->getRect().getWidth() * (*panel_it)->mVisibleAmt); // want n-1 panel gaps for n panels if (panel_it != mPanels.begin()) @@ -1410,6 +1326,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize) } else //VERTICAL { + // enforce minimize size constraint by default + if (panelp->getRect().getHeight() < (*panel_it)->mMinHeight) + { + panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinHeight); + } total_height += llround(panelp->getRect().getHeight() * (*panel_it)->mVisibleAmt); if (panel_it != mPanels.begin()) { @@ -1428,6 +1349,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { continue; } + // if currently resizing a panel or the panel is flagged as not automatically resizing // only track total available headroom, but don't use it for automatic resize logic if ((*panel_it)->mResizeBar->hasMouseCapture() @@ -1459,6 +1381,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) } } + // calculate how many pixels need to be distributed among layout panels // positive means panels need to grow, negative means shrink S32 pixels_to_distribute; if (mOrientation == HORIZONTAL) @@ -1470,6 +1393,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) pixels_to_distribute = getRect().getHeight() - total_height; } + // now we distribute the pixels... S32 cur_x = 0; S32 cur_y = getRect().getHeight(); @@ -1495,13 +1419,17 @@ void LLLayoutStack::updateLayout(BOOL force_resize) if (pixels_to_distribute < 0) { // shrink proportionally to amount over minimum - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available) : 0; + // so we can do this in one pass + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinWidth) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_width - (*panel_it)->mMinWidth); } else { // grow all elements equally delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); + num_resizable_panels--; } + pixels_to_distribute -= delta_size; new_width = llmax((*panel_it)->mMinWidth, cur_width + delta_size); } else @@ -1514,12 +1442,16 @@ void LLLayoutStack::updateLayout(BOOL force_resize) if (pixels_to_distribute < 0) { // shrink proportionally to amount over minimum - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * (F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available) : 0; + // so we can do this in one pass + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinHeight) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_height - (*panel_it)->mMinHeight); } else { delta_size = llround((F32)pixels_to_distribute / (F32)num_resizable_panels); + num_resizable_panels--; } + pixels_to_distribute -= delta_size; new_height = llmax((*panel_it)->mMinHeight, cur_height + delta_size); } else diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 96417d358b..0485274055 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -82,13 +82,12 @@ public: /*virtual*/ ~LLPanel(); // LLView interface - /*virtual*/ EWidgetType getWidgetType() const; - /*virtual*/ LLString getWidgetTag() const; /*virtual*/ BOOL isPanel() const; /*virtual*/ void draw(); - /*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); - /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ); + /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; + // Override to set not found list: + virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; // From LLFocusableElement /*virtual*/ void setFocus( BOOL b ); @@ -106,8 +105,21 @@ public: BOOL hasBorder() const { return mBorder != NULL; } void setBorderVisible( BOOL b ); - void requires(LLString name, EWidgetType type = WIDGET_TYPE_DONTCARE); - BOOL checkRequirements() const; + template <class T> void requires(LLString name) + { + // check for widget with matching type and name + if (LLView::getChild<T>(name) == NULL) + { + mRequirementsError += name + "\n"; + } + } + + // requires LLView by default + void requires(LLString name) + { + requires<LLView>(name); + } + BOOL checkRequirements(); void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; } const LLColor4& getBackgroundColor() const { return mBgColorOpaque; } @@ -133,8 +145,6 @@ public: S32 getLastTabGroup() const { return mLastTabGroup; } - LLUICtrl* getCtrlByNameAndType(const LLString& name, EWidgetType type) const; - const LLCallbackMap::map_t& getFactoryMap() const { return mFactoryMap; } BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -226,9 +236,6 @@ protected: LLButton* getDefaultButton() { return mDefaultBtn; } LLCallbackMap::map_t mFactoryMap; - // Override to set not found list: - virtual LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const; - private: // common construction logic void init(); @@ -257,8 +264,7 @@ private: typedef std::map<LLString, LLUIString> ui_string_map_t; ui_string_map_t mUIStrings; - typedef std::map<LLString, EWidgetType> requirements_map_t; - requirements_map_t mRequirements; + LLString mRequirementsError; typedef std::queue<LLAlertInfo> alert_queue_t; static alert_queue_t sAlertQueue; @@ -281,9 +287,6 @@ public: /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; /*virtual*/ void removeCtrl(LLUICtrl* ctrl); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); S32 getMinWidth() const { return mMinWidth; } @@ -291,16 +294,17 @@ public: void addPanel(LLPanel* panel, S32 min_width, S32 min_height, BOOL auto_resize, BOOL user_resize, S32 index = S32_MAX); void removePanel(LLPanel* panel); - void updateLayout(BOOL force_resize = FALSE); private: + struct LLEmbeddedPanel; + + void updateLayout(BOOL force_resize = FALSE); void calcMinExtents(); S32 getDefaultHeight(S32 cur_height); S32 getDefaultWidth(S32 cur_width); const eLayoutOrientation mOrientation; - struct LLEmbeddedPanel; typedef std::vector<LLEmbeddedPanel*> e_panel_list_t; e_panel_list_t mPanels; LLEmbeddedPanel* findEmbeddedPanel(LLPanel* panelp) const; diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 8bda6780a2..6d496b391f 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -42,6 +42,7 @@ #include "llui.h" #include "llfocusmgr.h" +static LLRegisterWidget<LLRadioGroup> r("radio_group"); LLRadioGroup::LLRadioGroup(const LLString& name, const LLRect& rect, const LLString& control_name, @@ -161,11 +162,11 @@ BOOL LLRadioGroup::setSelectedIndex(S32 index, BOOL from_event) return TRUE; } -BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLRadioGroup::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; // do any of the tab buttons have keyboard focus? - if (getEnabled() && !called_from_parent && mask == MASK_NONE) + if (mask == MASK_NONE) { switch(key) { diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index 3e01e8223c..b9e2167446 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -82,10 +82,8 @@ public: BOOL border = TRUE); virtual ~LLRadioGroup(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_RADIO_GROUP; } - virtual LLString getWidgetTag() const { return LL_RADIO_GROUP_TAG; } - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void setEnabled(BOOL enabled); virtual LLXMLNodePtr getXML(bool save_children = true) const; diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 40346513cf..e82e93a7ba 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -85,16 +85,13 @@ LLResizeBar::LLResizeBar( const LLString& name, LLView* resizing_view, const LLR BOOL LLResizeBar::handleMouseDown(S32 x, S32 y, MASK mask) { - if( getEnabled() ) - { - // Route future Mouse messages here preemptively. (Release on mouse up.) - // No handler needed for focus lost since this clas has no state that depends on it. - gFocusMgr.setMouseCapture( this ); + // Route future Mouse messages here preemptively. (Release on mouse up.) + // No handler needed for focus lost since this clas has no state that depends on it. + gFocusMgr.setMouseCapture( this ); - localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY); - mLastMouseScreenX = mDragLastScreenX; - mLastMouseScreenY = mDragLastScreenY; - } + localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY); + mLastMouseScreenX = mDragLastScreenX; + mLastMouseScreenY = mDragLastScreenY; return TRUE; } diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h index a3fef1a28c..f45653cbad 100644 --- a/indra/llui/llresizebar.h +++ b/indra/llui/llresizebar.h @@ -42,9 +42,6 @@ public: LLResizeBar(const LLString& name, LLView* resizing_view, const LLRect& rect, S32 min_size, S32 max_size, Side side ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_RESIZE_BAR; } - virtual LLString getWidgetTag() const { return LL_RESIZE_BAR_TAG; } - // virtual void draw(); No appearance virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index 36028a4513..4da2d4fca1 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -59,8 +59,7 @@ LLResizeHandle::LLResizeHandle( const LLString& name, const LLRect& rect, S32 mi if( RIGHT_BOTTOM == mCorner) { - LLUUID image_id(LLUI::sConfigGroup->getString("UIImgResizeBottomRightUUID")); - mImage = LLUI::sImageProvider->getImageByID(image_id); + mImage = LLUI::sImageProvider->getUIImage("UIImgResizeBottomRightUUID"); } switch( mCorner ) @@ -78,19 +77,16 @@ LLResizeHandle::LLResizeHandle( const LLString& name, const LLRect& rect, S32 mi BOOL LLResizeHandle::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; - if( getVisible() && pointInHandle(x, y) ) + if( pointInHandle(x, y) ) { handled = TRUE; - if( getEnabled() ) - { - // Route future Mouse messages here preemptively. (Release on mouse up.) - // No handler needed for focus lost since this clas has no state that depends on it. - gFocusMgr.setMouseCapture( this ); + // Route future Mouse messages here preemptively. (Release on mouse up.) + // No handler needed for focus lost since this clas has no state that depends on it. + gFocusMgr.setMouseCapture( this ); - localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY); - mLastMouseScreenX = mDragLastScreenX; - mLastMouseScreenY = mDragLastScreenY; - } + localPointToScreen(x, y, &mDragLastScreenX, &mDragLastScreenY); + mLastMouseScreenX = mDragLastScreenX; + mLastMouseScreenY = mDragLastScreenY; } return handled; @@ -107,8 +103,7 @@ BOOL LLResizeHandle::handleMouseUp(S32 x, S32 y, MASK mask) gFocusMgr.setMouseCapture( NULL ); handled = TRUE; } - else - if( getVisible() && pointInHandle(x, y) ) + else if( pointInHandle(x, y) ) { handled = TRUE; } @@ -284,7 +279,7 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) } else // don't have mouse capture { - if( getVisible() && pointInHandle( x, y ) ) + if( pointInHandle( x, y ) ) { handled = TRUE; } @@ -314,7 +309,7 @@ void LLResizeHandle::draw() { if( mImage.notNull() && getVisible() && (RIGHT_BOTTOM == mCorner) ) { - gl_draw_image( 0, 0, mImage ); + mImage->draw(0, 0); } } diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h index 34be319786..15336948e2 100644 --- a/indra/llui/llresizehandle.h +++ b/indra/llui/llresizehandle.h @@ -46,9 +46,6 @@ public: LLResizeHandle(const LLString& name, const LLRect& rect, S32 min_width, S32 min_height, ECorner corner = RIGHT_BOTTOM ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_RESIZE_HANDLE; } - virtual LLString getWidgetTag() const { return LL_RESIZE_HANDLE_TAG; } - virtual void draw(); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); @@ -64,7 +61,7 @@ private: S32 mLastMouseScreenX; S32 mLastMouseScreenY; LLCoordGL mLastMouseDir; - LLPointer<LLImageGL> mImage; + LLPointer<LLUIImage> mImage; S32 mMinWidth; S32 mMinHeight; const ECorner mCorner; diff --git a/indra/llui/llresmgr.cpp b/indra/llui/llresmgr.cpp index 0e1b9bfbef..6cfc6a924b 100644 --- a/indra/llui/llresmgr.cpp +++ b/indra/llui/llresmgr.cpp @@ -39,8 +39,6 @@ #include "llerror.h" #include "llstring.h" -// Global singleton -LLResMgr* gResMgr = NULL; LLResMgr::LLResMgr() { diff --git a/indra/llui/llresmgr.h b/indra/llui/llresmgr.h index 1a452f7381..2e39387ae1 100644 --- a/indra/llui/llresmgr.h +++ b/indra/llui/llresmgr.h @@ -36,6 +36,7 @@ #include "locale.h" #include "stdtypes.h" #include "llstring.h" +#include "llmemory.h" enum LLLOCALE_ID { @@ -44,67 +45,6 @@ enum LLLOCALE_ID LLLOCALE_COUNT // Number of values in this enum. Keep at end. }; -/* -enum LLSTR_ID -{ - LLSTR_HELLO, - LLSTR_GOODBYE, - LLSTR_CHAT_LABEL, - LLSTR_STATUS_LABEL, - LLSTR_X, - LLSTR_Y, - LLSTR_Z, - LLSTR_POSITION, - LLSTR_SCALE, - LLSTR_ROTATION, - LLSTR_HAS_PHYSICS, - LLSTR_SCRIPT, - LLSTR_HELP, - LLSTR_REMOVE, - LLSTR_CLEAR, - LLSTR_APPLY, - LLSTR_CANCEL, - LLSTR_MATERIAL, - LLSTR_FACE, - LLSTR_TEXTURE, - LLSTR_TEXTURE_SIZE, - LLSTR_TEXTURE_OFFSET, - LLSTR_TEXTURE_ROTATION, - LLSTR_U, - LLSTR_V, - LLSTR_OWNERSHIP, - LLSTR_PUBLIC, - LLSTR_PRIVATE, - LLSTR_REVERT, - LLSTR_INSERT_SAMPLE, - LLSTR_SET_TEXTURE, - LLSTR_EDIT_SCRIPT, - LLSTR_MOUSELOOK_INSTRUCTIONS, - LLSTR_EDIT_FACE_INSTRUCTIONS, - LLSTR_CLOSE, - LLSTR_MOVE, - LLSTR_ROTATE, - LLSTR_RESIZE, - LLSTR_PLACE_BOX, - LLSTR_PLACE_PRISM, - LLSTR_PLACE_PYRAMID, - LLSTR_PLACE_TETRAHEDRON, - LLSTR_PLACE_CYLINDER, - LLSTR_PLACE_HALF_CYLINDER, - LLSTR_PLACE_CONE, - LLSTR_PLACE_HALF_CONE, - LLSTR_PLACE_SPHERE, - LLSTR_PLACE_HALF_SPHERE, - LLSTR_PLACE_BIRD, - LLSTR_PLACE_SNAKE, - LLSTR_PLACE_ROCK, - LLSTR_PLACE_TREE, - LLSTR_PLACE_GRASS, - LLSTR_MODIFY_LAND, - LLSTR_COUNT // Number of values in this enum. Keep at end. -}; -*/ - enum LLFONT_ID { LLFONT_OCRA, @@ -117,7 +57,7 @@ enum LLFONT_ID class LLFontGL; -class LLResMgr +class LLResMgr : public LLSingleton<LLResMgr> { public: LLResMgr(); @@ -162,6 +102,4 @@ private: LLString mPrevLocaleString; }; -extern LLResMgr* gResMgr; - #endif // LL_RESMGR_ diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index c3afb32570..90659cdc70 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -414,17 +414,8 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask) BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks) { - BOOL handled = FALSE; - if( getVisible() && getRect().localPointInRect( x, y ) ) - { - if( getEnabled() ) - { - changeLine( clicks * mStepSize, TRUE ); - } - handled = TRUE; - } - - return handled; + changeLine( clicks * mStepSize, TRUE ); + return TRUE; } BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, @@ -475,85 +466,68 @@ void LLScrollbar::reshape(S32 width, S32 height, BOOL called_from_parent) void LLScrollbar::draw() { - if( getVisible() ) + S32 local_mouse_x; + S32 local_mouse_y; + LLCoordWindow cursor_pos_window; + getWindow()->getCursorPosition(&cursor_pos_window); + LLCoordGL cursor_pos_gl; + getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); + + screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y); + BOOL other_captor = gFocusMgr.getMouseCapture() && gFocusMgr.getMouseCapture() != this; + BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); + if (hovered) { - S32 local_mouse_x; - S32 local_mouse_y; - LLCoordWindow cursor_pos_window; - getWindow()->getCursorPosition(&cursor_pos_window); - LLCoordGL cursor_pos_gl; - getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); - - screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &local_mouse_x, &local_mouse_y); - BOOL other_captor = gFocusMgr.getMouseCapture() && gFocusMgr.getMouseCapture() != this; - BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); - if (hovered) - { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); - } - else - { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); - } + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + } + else + { + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + } - // Draw background and thumb. - LLUUID rounded_rect_image_id; - rounded_rect_image_id.set(LLUI::sAssetsGroup->getString("rounded_square.tga")); - LLImageGL* rounded_rect_imagep = LLUI::sImageProvider->getImageByID(rounded_rect_image_id); + // Draw background and thumb. + LLUIImage* rounded_rect_imagep = LLUI::sImageProvider->getUIImage("rounded_square.tga"); - if (!rounded_rect_imagep) - { - gl_rect_2d(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0, - mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(), - mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(), - mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0, mTrackColor, TRUE); + if (!rounded_rect_imagep) + { + gl_rect_2d(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0, + mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(), + mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(), + mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0, mTrackColor, TRUE); - gl_rect_2d(mThumbRect, mThumbColor, TRUE); + gl_rect_2d(mThumbRect, mThumbColor, TRUE); - } - else - { - // Background - gl_draw_scaled_image_with_border(mOrientation == HORIZONTAL ? SCROLLBAR_SIZE : 0, - mOrientation == VERTICAL ? SCROLLBAR_SIZE : 0, - 16, - 16, - mOrientation == HORIZONTAL ? getRect().getWidth() - 2 * SCROLLBAR_SIZE : getRect().getWidth(), - mOrientation == VERTICAL ? getRect().getHeight() - 2 * SCROLLBAR_SIZE : getRect().getHeight(), - rounded_rect_imagep, - mTrackColor, - TRUE); - - // Thumb - LLRect outline_rect = mThumbRect; - outline_rect.stretch(2); - - if (gFocusMgr.getKeyboardFocus() == this) - { - gl_draw_scaled_image_with_border(outline_rect.mLeft, outline_rect.mBottom, 16, 16, outline_rect.getWidth(), outline_rect.getHeight(), - rounded_rect_imagep, gFocusMgr.getFocusColor() ); - } + } + else + { + // Thumb + LLRect outline_rect = mThumbRect; + outline_rect.stretch(2); - gl_draw_scaled_image_with_border(mThumbRect.mLeft, mThumbRect.mBottom, 16, 16, mThumbRect.getWidth(), mThumbRect.getHeight(), - rounded_rect_imagep, mThumbColor ); - if (mCurGlowStrength > 0.01f) - { - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE); - gl_draw_scaled_image_with_border(mThumbRect.mLeft, mThumbRect.mBottom, 16, 16, mThumbRect.getWidth(), mThumbRect.getHeight(), - rounded_rect_imagep, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength), TRUE); - gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } + if (gFocusMgr.getKeyboardFocus() == this) + { + rounded_rect_imagep->draw(outline_rect, gFocusMgr.getFocusColor()); } - BOOL was_scrolled_to_bottom = (getDocPos() == getDocPosMax()); - if (mOnScrollEndCallback && was_scrolled_to_bottom) + rounded_rect_imagep->draw(mThumbRect, mThumbColor); + if (mCurGlowStrength > 0.01f) { - mOnScrollEndCallback(mOnScrollEndData); + glBlendFunc(GL_SRC_ALPHA, GL_ONE); + rounded_rect_imagep->drawSolid(mThumbRect, LLColor4(1.f, 1.f, 1.f, mCurGlowStrength)); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - // Draw children - LLView::draw(); + } + + BOOL was_scrolled_to_bottom = (getDocPos() == getDocPosMax()); + if (mOnScrollEndCallback && was_scrolled_to_bottom) + { + mOnScrollEndCallback(mOnScrollEndData); + } + + // Draw children + LLView::draw(); } // end draw @@ -582,42 +556,39 @@ void LLScrollbar::setValue(const LLSD& value) } -BOOL LLScrollbar::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLScrollbar::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent ) + switch( key ) { - switch( key ) - { - case KEY_HOME: - changeLine( -mDocPos, TRUE ); - handled = TRUE; - break; - - case KEY_END: - changeLine( getDocPosMax() - mDocPos, TRUE ); - handled = TRUE; - break; - - case KEY_DOWN: - changeLine( mStepSize, TRUE ); - handled = TRUE; - break; - - case KEY_UP: - changeLine( - mStepSize, TRUE ); - handled = TRUE; - break; - - case KEY_PAGE_DOWN: - pageDown(1); - break; - - case KEY_PAGE_UP: - pageUp(1); - break; - } + case KEY_HOME: + changeLine( -mDocPos, TRUE ); + handled = TRUE; + break; + + case KEY_END: + changeLine( getDocPosMax() - mDocPos, TRUE ); + handled = TRUE; + break; + + case KEY_DOWN: + changeLine( mStepSize, TRUE ); + handled = TRUE; + break; + + case KEY_UP: + changeLine( - mStepSize, TRUE ); + handled = TRUE; + break; + + case KEY_PAGE_DOWN: + pageDown(1); + break; + + case KEY_PAGE_UP: + pageUp(1); + break; } return handled; diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index ac0bd37e3a..4d3b711b1a 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -62,11 +62,8 @@ public: virtual void setValue(const LLSD& value); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLLBAR; } - virtual LLString getWidgetTag() const { return LL_SCROLLBAR_TAG; } - // Overrides from LLView - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 991ba0ed04..d8df636abd 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -61,6 +61,8 @@ static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f; /// Class LLScrollableContainerView ///---------------------------------------------------------------------------- +static LLRegisterWidget<LLScrollableContainerView> r("scroll_container"); + // Default constructor LLScrollableContainerView::LLScrollableContainerView( const LLString& name, const LLRect& rect, @@ -210,63 +212,33 @@ void LLScrollableContainerView::reshape(S32 width, S32 height, } } -BOOL LLScrollableContainerView::handleKey( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLScrollableContainerView::handleKeyHere(KEY key, MASK mask) { - if( getVisible() && getEnabled() ) + for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) { - if( called_from_parent ) - { - // Downward traversal - - // Don't pass keys to scrollbars on downward. - - // Handle 'child' view. - if( mScrolledView && mScrolledView->handleKey(key, mask, TRUE) ) - { - return TRUE; - } - } - else + if( mScrollbar[i]->handleKeyHere(key, mask) ) { - // Upward traversal - - for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) - { - // Note: the scrollbar _is_ actually being called from it's parent. Here - // we're delgating LLScrollableContainerView's upward traversal to the scrollbars - if( mScrollbar[i]->handleKey(key, mask, TRUE) ) - { - return TRUE; - } - } - - if (getParent()) - { - return getParent()->handleKey( key, mask, FALSE ); - } + return TRUE; } - } + } return FALSE; } BOOL LLScrollableContainerView::handleScrollWheel( S32 x, S32 y, S32 clicks ) { - if( getEnabled() ) + for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) { - for( S32 i = 0; i < SCROLLBAR_COUNT; i++ ) - { - // Note: tries vertical and then horizontal + // Note: tries vertical and then horizontal - // Pretend the mouse is over the scrollbar - if( mScrollbar[i]->handleScrollWheel( 0, 0, clicks ) ) - { - return TRUE; - } + // Pretend the mouse is over the scrollbar + if( mScrollbar[i]->handleScrollWheel( 0, 0, clicks ) ) + { + return TRUE; } } - // Opaque + // Eat scroll wheel event (to avoid scrolling nested containers?) return TRUE; } @@ -446,80 +418,78 @@ void LLScrollableContainerView::draw() // clear this flag to be set on next call to handleDragAndDrop mAutoScrolling = FALSE; - if( getVisible() ) + // auto-focus when scrollbar active + // this allows us to capture user intent (i.e. stop automatically scrolling the view/etc) + if (!gFocusMgr.childHasKeyboardFocus(this) && + (mScrollbar[VERTICAL]->hasMouseCapture() || mScrollbar[HORIZONTAL]->hasMouseCapture())) { - // auto-focus when scrollbar active - // this allows us to capture user intent (i.e. stop automatically scrolling the view/etc) - if (!gFocusMgr.childHasKeyboardFocus(this) && - (mScrollbar[VERTICAL]->hasMouseCapture() || mScrollbar[HORIZONTAL]->hasMouseCapture())) - { - focusFirstItem(); - } + focusFirstItem(); + } - // Draw background - if( mIsOpaque ) + // Draw background + if( mIsOpaque ) + { + LLGLSNoTexture no_texture; + glColor4fv( mBackgroundColor.mV ); + gl_rect_2d( mInnerRect ); + } + + // Draw mScrolledViews and update scroll bars. + // get a scissor region ready, and draw the scrolling view. The + // scissor region ensures that we don't draw outside of the bounds + // of the rectangle. + if( mScrolledView ) + { + updateScroll(); + + // Draw the scrolled area. { - LLGLSNoTexture no_texture; - gGL.color4fv( mBackgroundColor.mV ); - gl_rect_2d( mInnerRect ); + S32 visible_width = 0; + S32 visible_height = 0; + BOOL show_v_scrollbar = FALSE; + BOOL show_h_scrollbar = FALSE; + calcVisibleSize( mScrolledView->getRect(), &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); + + LLLocalClipRect clip(LLRect(mInnerRect.mLeft, + mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) + visible_height, + visible_width, + mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) + )); + drawChild(mScrolledView); } - - // Draw mScrolledViews and update scroll bars. - // get a scissor region ready, and draw the scrolling view. The - // scissor region ensures that we don't draw outside of the bounds - // of the rectangle. - if( mScrolledView ) - { - updateScroll(); + } - // Draw the scrolled area. - { - S32 visible_width = 0; - S32 visible_height = 0; - BOOL show_v_scrollbar = FALSE; - BOOL show_h_scrollbar = FALSE; - calcVisibleSize( mScrolledView->getRect(), &visible_width, &visible_height, &show_h_scrollbar, &show_v_scrollbar ); - - LLLocalClipRect clip(LLRect(mInnerRect.mLeft, - mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) + visible_height, - visible_width, - mInnerRect.mBottom + (show_h_scrollbar ? SCROLLBAR_SIZE : 0) - )); - drawChild(mScrolledView); - } - } + // Highlight border if a child of this container has keyboard focus + if( mBorder->getVisible() ) + { + mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) ); + } - // Highlight border if a child of this container has keyboard focus - if( mBorder->getVisible() ) + // Draw all children except mScrolledView + // Note: scrollbars have been adjusted by above drawing code + for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin(); + child_iter != getChildList()->rend(); ++child_iter) + { + LLView *viewp = *child_iter; + if( sDebugRects ) { - mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus(this) ); + sDepth++; } - - // Draw all children except mScrolledView - // Note: scrollbars have been adjusted by above drawing code - for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin(); - child_iter != getChildList()->rend(); ++child_iter) + if( (viewp != mScrolledView) && viewp->getVisible() ) { - LLView *viewp = *child_iter; - if( sDebugRects ) - { - sDepth++; - } - if( (viewp != mScrolledView) && viewp->getVisible() ) - { - drawChild(viewp); - } - if( sDebugRects ) - { - sDepth--; - } + drawChild(viewp); } - - if (sDebugRects) + if( sDebugRects ) { - drawDebugRect(); + sDepth--; } } + + if (sDebugRects) + { + drawDebugRect(); + } + } // end draw void LLScrollableContainerView::updateScroll() diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 0bffd0438f..db6d7d6198 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -70,8 +70,6 @@ public: void setScrolledView(LLView* view) { mScrolledView = view; } virtual void setValue(const LLSD& value) { mInnerRect.setValue(value); } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLL_CONTAINER; } - virtual LLString getWidgetTag() const { return LL_SCROLLABLE_CONTAINER_VIEW_TAG; } void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; void calcVisibleSize( const LLRect& doc_rect, S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; @@ -90,7 +88,7 @@ public: // LLView functionality virtual void reshape(S32 width, S32 height, BOOL called_from_parent); - virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, diff --git a/indra/llui/llscrollingpanellist.cpp b/indra/llui/llscrollingpanellist.cpp index 70309ba6bc..28755ed30f 100644 --- a/indra/llui/llscrollingpanellist.cpp +++ b/indra/llui/llscrollingpanellist.cpp @@ -34,6 +34,9 @@ #include "llscrollingpanellist.h" +static LLRegisterWidget<LLScrollingPanelList> r("scrolling_panel_list"); + + ///////////////////////////////////////////////////////////////////// // LLScrollingPanelList @@ -129,10 +132,8 @@ void LLScrollingPanelList::updatePanelVisiblilty() void LLScrollingPanelList::draw() { - if( getVisible() ) - { - updatePanelVisiblilty(); - } + updatePanelVisiblilty(); + LLUICtrl::draw(); } diff --git a/indra/llui/llscrollingpanellist.h b/indra/llui/llscrollingpanellist.h index cb832f4bec..dc0dcbd460 100644 --- a/indra/llui/llscrollingpanellist.h +++ b/indra/llui/llscrollingpanellist.h @@ -56,8 +56,6 @@ public: : LLUICtrl(name, rect, TRUE, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_BOTTOM ) {} virtual void setValue(const LLSD& value) {}; - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLLING_PANEL_LIST; } - virtual LLString getWidgetTag() const { return LL_SCROLLING_PANEL_LIST_TAG; } virtual LLXMLNodePtr getXML(bool save_children) const { return LLUICtrl::getXML(); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 35e8f7300b..a4ea08bd5d 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -55,10 +55,11 @@ #include "llkeyboard.h" #include "llresizebar.h" -const S32 LIST_BORDER_PAD = 0; // white space inside the border and to the left of the scrollbar const S32 MIN_COLUMN_WIDTH = 20; const S32 LIST_SNAP_PADDING = 5; +static LLRegisterWidget<LLScrollListCtrl> r("scroll_list"); + // local structures & classes. struct SortScrollListItem { @@ -114,24 +115,49 @@ struct SortScrollListItem // // LLScrollListIcon // -LLScrollListIcon::LLScrollListIcon(const LLUUID& icon_id, S32 width) +LLScrollListIcon::LLScrollListIcon(LLUIImagePtr icon, S32 width) + : LLScrollListCell(width), + mIcon(icon), + mColor(LLColor4::white) +{ +} + +LLScrollListIcon::LLScrollListIcon(const LLSD& value, S32 width) : LLScrollListCell(width), - mColor(LLColor4::white), - mImageUUID(icon_id) + mColor(LLColor4::white) { - // don't use default image specified by LLUUID::null, use no image in that case - mIcon = icon_id.isNull() ? NULL : LLUI::sImageProvider->getImageByID(icon_id); + setValue(value); } + LLScrollListIcon::~LLScrollListIcon() { } void LLScrollListIcon::setValue(const LLSD& value) { - mImageUUID = value.asUUID(); - // don't use default image specified by LLUUID::null, use no image in that case - mIcon = mImageUUID.isNull() ? NULL : LLUI::sImageProvider->getImageByID(mImageUUID); + if (value.isUUID()) + { + // don't use default image specified by LLUUID::null, use no image in that case + LLUUID image_id = value.asUUID(); + mIcon = image_id.notNull() ? LLUI::sImageProvider->getUIImageByID(image_id) : LLUIImagePtr(NULL); + } + else + { + LLString value_string = value.asString(); + if (LLUUID::validate(value_string)) + { + setValue(LLUUID(value_string)); + } + else if (!value_string.empty()) + { + mIcon = LLUI::getUIImage(value.asString()); + } + else + { + mIcon = NULL; + } + } } @@ -143,7 +169,7 @@ void LLScrollListIcon::setColor(const LLColor4& color) S32 LLScrollListIcon::getWidth() const { // if no specified fix width, use width of icon - if (LLScrollListCell::getWidth() == 0) + if (LLScrollListCell::getWidth() == 0 && mIcon.notNull()) { return mIcon->getWidth(); } @@ -151,11 +177,11 @@ S32 LLScrollListIcon::getWidth() const } -void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const +void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const { if (mIcon) { - gl_draw_image(0, 0, mIcon, mColor); + mIcon->draw(0, 0, mColor); } } @@ -206,6 +232,13 @@ LLScrollListSeparator::LLScrollListSeparator(S32 width) : LLScrollListCell(width { } +//virtual +S32 LLScrollListSeparator::getHeight() const +{ + return 5; +} + + void LLScrollListSeparator::draw(const LLColor4& color, const LLColor4& highlight_color) const { //*FIXME: use dynamic item heights and make separators narrow, and inactive @@ -234,9 +267,34 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font, // initialize rounded rect image if (!mRoundedRectImage) { - mRoundedRectImage = LLUI::sImageProvider->getImageByID(LLUUID(LLUI::sAssetsGroup->getString("rounded_square.tga"))); + mRoundedRectImage = LLUI::sImageProvider->getUIImage("rounded_square.tga"); } } +//virtual +void LLScrollListText::highlightText(S32 offset, S32 num_chars) +{ + mHighlightOffset = offset; + mHighlightCount = num_chars; +} + +//virtual +BOOL LLScrollListText::isText() const +{ + return TRUE; +} + +//virtual +BOOL LLScrollListText::getVisible() const +{ + return mVisible; +} + +//virtual +S32 LLScrollListText::getHeight() const +{ + return llround(mFont->getLineHeight()); +} + LLScrollListText::~LLScrollListText() { @@ -266,6 +324,13 @@ void LLScrollListText::setValue(const LLSD& text) setText(text.asString()); } +//virtual +const LLSD LLScrollListText::getValue() const +{ + return LLSD(mText.getString()); +} + + void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const { LLColor4 display_color; @@ -280,8 +345,6 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col if (mHighlightCount > 0) { - mRoundedRectImage->bind(); - gGL.color4fv(highlight_color.mV); S32 left = 0; switch(mFontAlignment) { @@ -295,13 +358,11 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col left = (getWidth() - mFont->getWidth(mText.getString())) / 2; break; } - gl_segmented_rect_2d_tex(left - 2, + LLRect highlight_rect(left - 2, llround(mFont->getLineHeight()) + 1, left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1, - 1, - mRoundedRectImage->getWidth(), - mRoundedRectImage->getHeight(), - 16); + 1); + mRoundedRectImage->draw(highlight_rect, highlight_color); } // Try to draw the entire string @@ -389,8 +450,6 @@ void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const { // draw background rect LLRect bg_rect = rect; - // pad background rectangle to separate it from contents - bg_rect.stretch(LIST_BORDER_PAD, 0); { LLGLSNoTexture no_texture; gGL.color4fv(bg_color.mV); @@ -432,7 +491,7 @@ LLScrollListItemComment::LLScrollListItemComment(const LLString& comment_string, : LLScrollListItem(FALSE), mColor(color) { - addColumn( comment_string, gResMgr->getRes( LLFONT_SANSSERIF_SMALL ) ); + addColumn( comment_string, LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ) ); } void LLScrollListItemComment::draw(const LLRect& rect, const LLColor4& fg_color, const LLColor4& bg_color, const LLColor4& highlight_color, S32 column_padding) @@ -541,10 +600,10 @@ LLScrollListCtrl::LLScrollListCtrl(const LLString& name, const LLRect& rect, mDrewSelected(FALSE) { mItemListRect.setOriginAndSize( - mBorderThickness + LIST_BORDER_PAD, - mBorderThickness + LIST_BORDER_PAD, - getRect().getWidth() - 2*( mBorderThickness + LIST_BORDER_PAD ), - getRect().getHeight() - 2*( mBorderThickness + LIST_BORDER_PAD ) ); + mBorderThickness, + mBorderThickness, + getRect().getWidth() - 2 * mBorderThickness, + getRect().getHeight() - 2 * mBorderThickness ); updateLineHeight(); @@ -738,10 +797,10 @@ void LLScrollListCtrl::updateLayout() // reserve room for column headers, if needed S32 heading_size = (mDisplayColumnHeaders ? mHeadingHeight : 0); mItemListRect.setOriginAndSize( - mBorderThickness + LIST_BORDER_PAD, - mBorderThickness + LIST_BORDER_PAD, - getRect().getWidth() - 2*( mBorderThickness + LIST_BORDER_PAD ), - getRect().getHeight() - 2*( mBorderThickness + LIST_BORDER_PAD ) - heading_size ); + mBorderThickness, + mBorderThickness, + getRect().getWidth() - 2 * mBorderThickness, + getRect().getHeight() - (2 * mBorderThickness ) - heading_size ); // how many lines of content in a single "page" mPageLines = mLineHeight? mItemListRect.getHeight() / mLineHeight : 0; @@ -749,7 +808,7 @@ void LLScrollListCtrl::updateLayout() if (scrollbar_visible) { // provide space on the right for scrollbar - mItemListRect.mRight = getRect().getWidth() - ( mBorderThickness + LIST_BORDER_PAD ) - SCROLLBAR_SIZE; + mItemListRect.mRight = getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE; } mScrollbar->reshape(SCROLLBAR_SIZE, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0)); @@ -775,7 +834,7 @@ LLRect LLScrollListCtrl::getRequiredRect() { S32 heading_size = (mDisplayColumnHeaders ? mHeadingHeight : 0); S32 height = (mLineHeight * getItemCount()) - + (2 * ( mBorderThickness + LIST_BORDER_PAD )) + + (2 * mBorderThickness ) + heading_size; S32 width = getRect().getWidth(); @@ -1354,7 +1413,6 @@ LLScrollListItem* LLScrollListCtrl::addCommentText(const LLString& comment_text, LLScrollListItem* item = NULL; if (getItemCount() < mMaxItemCount) { - // simple items have their LLSD data set to their label // always draw comment text with "enabled" color item = new LLScrollListItemComment( comment_text, mFgUnselectedColor ); addItem( item, pos, FALSE ); @@ -1522,7 +1580,7 @@ LLScrollListItem* LLScrollListCtrl::addStringUUIDItem(const LLString& item_text, if (getItemCount() < mMaxItemCount) { item = new LLScrollListItem( enabled, NULL, id ); - item->addColumn(item_text, gResMgr->getRes(LLFONT_SANSSERIF_SMALL), column_width); + item->addColumn(item_text, LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF_SMALL), column_width); addItem( item, pos ); } return item; @@ -1661,7 +1719,6 @@ void LLScrollListCtrl::drawItems() fg_color = (item->getEnabled() ? mFgUnselectedColor : mFgDisabledColor); if( item->getSelected() && mCanSelect) { - // Draw background of selected item bg_color = mBgSelectedColor; fg_color = (item->getEnabled() ? mFgSelectedColor : mFgDisabledColor); } @@ -1694,43 +1751,40 @@ void LLScrollListCtrl::drawItems() void LLScrollListCtrl::draw() { - if( getVisible() ) + // if user specifies sort, make sure it is maintained + if (needsSorting() && !isSorted()) { - // if user specifies sort, make sure it is maintained - if (needsSorting() && !isSorted()) - { - sortItems(); - } - - if (mNeedsScroll) - { - scrollToShowSelected(); - mNeedsScroll = FALSE; - } - LLRect background(0, getRect().getHeight(), getRect().getWidth(), 0); - // Draw background - if (mBackgroundVisible) - { - LLGLSNoTexture no_texture; - gGL.color4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV ); - gl_rect_2d(background); - } + sortItems(); + } - if (mColumnsDirty) - { - updateColumns(); - mColumnsDirty = FALSE; - } + if (mNeedsScroll) + { + scrollToShowSelected(); + mNeedsScroll = FALSE; + } + LLRect background(0, getRect().getHeight(), getRect().getWidth(), 0); + // Draw background + if (mBackgroundVisible) + { + LLGLSNoTexture no_texture; + glColor4fv( getEnabled() ? mBgWriteableColor.mV : mBgReadOnlyColor.mV ); + gl_rect_2d(background); + } - drawItems(); + if (mColumnsDirty) + { + updateColumns(); + mColumnsDirty = FALSE; + } - if (mBorder) - { - mBorder->setKeyboardFocusHighlight(gFocusMgr.getKeyboardFocus() == this); - } + drawItems(); - LLUICtrl::draw(); + if (mBorder) + { + mBorder->setKeyboardFocusHighlight(gFocusMgr.getKeyboardFocus() == this); } + + LLUICtrl::draw(); } void LLScrollListCtrl::setEnabled(BOOL enabled) @@ -1947,23 +2001,21 @@ BOOL LLScrollListCtrl::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLScrollListCtrl::handleDoubleClick(S32 x, S32 y, MASK mask) { //BOOL handled = FALSE; - if(getVisible()) - { - BOOL handled = handleClick(x, y, mask); + BOOL handled = handleClick(x, y, mask); - if (!handled) + if (!handled) + { + // Offer the click to the children, even if we aren't enabled + // so the scroll bars will work. + if (NULL == LLView::childrenHandleDoubleClick(x, y, mask)) { - // Offer the click to the children, even if we aren't enabled - // so the scroll bars will work. - if (NULL == LLView::childrenHandleDoubleClick(x, y, mask)) + if( mCanSelect && mOnDoubleClickCallback ) { - if( mCanSelect && mOnDoubleClickCallback ) - { - mOnDoubleClickCallback( mCallbackUserData ); - } + mOnDoubleClickCallback( mCallbackUserData ); } } } + return TRUE; } @@ -2143,12 +2195,12 @@ BOOL LLScrollListCtrl::handleHover(S32 x,S32 y,MASK mask) } -BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask, BOOL called_from_parent ) +BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask ) { BOOL handled = FALSE; // not called from parent means we have keyboard focus or a child does - if (mCanSelect && !called_from_parent) + if (mCanSelect) { // Ignore capslock mask = mask; @@ -2231,7 +2283,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask, BOOL called_from_parent // JC - Special case: Only claim to have handled it // if we're the special non-commit-on-move // type. AND we are visible - if (!mCommitOnKeyboardMovement && mask == MASK_NONE && getVisible()) + if (!mCommitOnKeyboardMovement && mask == MASK_NONE) { onCommit(); mSearchString.clear(); @@ -2278,7 +2330,7 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask, BOOL called_from_parent return handled; } -BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLScrollListCtrl::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL { @@ -3204,17 +3256,16 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p LLColor4 color = ((*itor)["color"]); BOOL enabled = !(*itor).has("enabled") || (*itor)["enabled"].asBoolean() == true; - const LLFontGL *font = gResMgr->getRes(fontname); + const LLFontGL *font = LLResMgr::getInstance()->getRes(fontname); if (!font) { - font = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); } U8 font_style = LLFontGL::getStyleFromString(fontstyle); if (type == "icon") { - LLUUID image_id = value.asUUID(); - LLScrollListIcon* cell = new LLScrollListIcon(value.asUUID(), width); + LLScrollListIcon* cell = new LLScrollListIcon(value, width); if (has_color) { cell->setColor(color); @@ -3267,7 +3318,7 @@ LLScrollListItem* LLScrollListCtrl::addElement(const LLSD& value, EAddPosition p if (new_item->getColumn(column_idx) == NULL) { LLScrollListColumn* column_ptr = &column_it->second; - new_item->setColumn(column_idx, new LLScrollListText("", gResMgr->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); + new_item->setColumn(column_idx, new LLScrollListText("", LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ), column_ptr->mWidth, LLFontGL::NORMAL)); } } @@ -3287,7 +3338,7 @@ LLScrollListItem* LLScrollListCtrl::addSimpleElement(const LLString& value, EAdd LLScrollListItem *new_item = new LLScrollListItem(entry_id); - const LLFontGL *font = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL *font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); new_item->addColumn(value, font, getRect().getWidth()); @@ -3435,29 +3486,25 @@ LLColumnHeader::~LLColumnHeader() void LLColumnHeader::draw() { - if( getVisible() ) - { - BOOL draw_arrow = !mColumn->mLabel.empty() && mColumn->mParentCtrl->isSorted() && mColumn->mParentCtrl->getSortColumnName() == mColumn->mSortingColumn; + BOOL draw_arrow = !mColumn->mLabel.empty() && mColumn->mParentCtrl->isSorted() && mColumn->mParentCtrl->getSortColumnName() == mColumn->mSortingColumn; - BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); - mButton->setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, draw_arrow ? LLColor4::white : LLColor4::transparent); - mArrowImage = mButton->getImageOverlay()->getImage(); + BOOL is_ascending = mColumn->mParentCtrl->getSortAscending(); + mButton->setImageOverlay(is_ascending ? "up_arrow.tga" : "down_arrow.tga", LLFontGL::RIGHT, draw_arrow ? LLColor4::white : LLColor4::transparent); + mArrowImage = mButton->getImageOverlay(); - //BOOL clip = getRect().mRight > mColumn->mParentCtrl->getItemListRect().getWidth(); - //LLGLEnable scissor_test(clip ? GL_SCISSOR_TEST : GL_FALSE); + //BOOL clip = getRect().mRight > mColumn->mParentCtrl->getItemListRect().getWidth(); + //LLGLEnable scissor_test(clip ? GL_SCISSOR_TEST : GL_FALSE); - //LLRect column_header_local_rect(-getRect().mLeft, getRect().getHeight(), mColumn->mParentCtrl->getItemListRect().getWidth() - getRect().mLeft, 0); - //LLUI::setScissorRegionLocal(column_header_local_rect); + //LLRect column_header_local_rect(-getRect().mLeft, getRect().getHeight(), mColumn->mParentCtrl->getItemListRect().getWidth() - getRect().mLeft, 0); + //LLUI::setScissorRegionLocal(column_header_local_rect); - // Draw children - LLComboBox::draw(); - - if (mList->getVisible()) - { - // sync sort order with list selection every frame - mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, getCurrentIndex() == 0); - } + // Draw children + LLComboBox::draw(); + if (mList->getVisible()) + { + // sync sort order with list selection every frame + mColumn->mParentCtrl->sortByColumn(mColumn->mSortingColumn, getCurrentIndex() == 0); } } diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 6edb2939dd..47683d0ab4 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -90,7 +90,7 @@ public: LLScrollListSeparator(S32 width); virtual ~LLScrollListSeparator() {}; virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; // truncate to given width, if possible - virtual S32 getHeight() const { return 5; }; + virtual S32 getHeight() const; virtual BOOL isText() const { return FALSE; } }; @@ -105,14 +105,14 @@ public: virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; virtual S32 getContentWidth() const; - virtual S32 getHeight() const { return llround(mFont->getLineHeight()); } + virtual S32 getHeight() const; virtual void setValue(const LLSD& value); - virtual const LLSD getValue() const { return LLSD(mText.getString()); } - virtual BOOL getVisible() const { return mVisible; } - virtual void highlightText(S32 offset, S32 num_chars) {mHighlightOffset = offset; mHighlightCount = num_chars;} + virtual const LLSD getValue() const; + virtual BOOL getVisible() const; + virtual void highlightText(S32 offset, S32 num_chars); virtual void setColor(const LLColor4&); - virtual BOOL isText() const { return TRUE; } + virtual BOOL isText() const; void setText(const LLStringExplicit& text); void setFontStyle(const U8 font_style) { mFontStyle = font_style; } @@ -128,7 +128,7 @@ private: S32 mHighlightCount; S32 mHighlightOffset; - LLPointer<LLImageGL> mRoundedRectImage; + LLPointer<LLUIImage> mRoundedRectImage; static U32 sCount; }; @@ -139,20 +139,19 @@ private: class LLScrollListIcon : public LLScrollListCell { public: - LLScrollListIcon( const LLUUID& icon_id, S32 width = 0); + LLScrollListIcon( LLUIImagePtr icon, S32 width = 0); + LLScrollListIcon(const LLSD& value, S32 width = 0); /*virtual*/ ~LLScrollListIcon(); virtual void draw(const LLColor4& color, const LLColor4& highlight_color) const; virtual S32 getWidth() const; virtual S32 getHeight() const { return mIcon ? mIcon->getHeight() : 0; } - // used as sort criterion - virtual const LLSD getValue() const { return LLSD(mImageUUID); } + virtual const LLSD getValue() const { return mIcon.isNull() ? LLString::null : mIcon->getName(); } virtual void setColor(const LLColor4&); virtual BOOL isText()const { return FALSE; } virtual void setValue(const LLSD& value); private: - LLPointer<LLImageGL> mIcon; - LLUUID mImageUUID; + LLUIImagePtr mIcon; LLColor4 mColor; }; @@ -342,8 +341,8 @@ public: void addColumn( const LLString& text, const LLFontGL* font, S32 width = 0 , U8 font_style = LLFontGL::NORMAL, LLFontGL::HAlign font_alignment = LLFontGL::LEFT, BOOL visible = TRUE) { mColumns.push_back( new LLScrollListText(text, font, width, font_style, font_alignment, LLColor4::black, FALSE, visible) ); } - void addColumn( const LLUUID& icon_id, S32 width = 0 ) - { mColumns.push_back( new LLScrollListIcon(icon_id, width) ); } + void addColumn( LLUIImagePtr icon, S32 width = 0 ) + { mColumns.push_back( new LLScrollListIcon(icon, width) ); } void addColumn( LLCheckBoxCtrl* check, S32 width = 0 ) { mColumns.push_back( new LLScrollListCheck(check,width) ); } @@ -404,8 +403,7 @@ public: BOOL draw_border = TRUE); virtual ~LLScrollListCtrl(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SCROLL_LIST; } - virtual LLString getWidgetTag() const { return LL_SCROLL_LIST_CTRL_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; void setScrollListParameters(LLXMLNodePtr node); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -562,8 +560,8 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); /*virtual*/ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); /*virtual*/ void setEnabled(BOOL enabled); @@ -618,6 +616,7 @@ public: S32 selectMultiple( LLDynamicArray<LLUUID> ids ); void sortItems(); + // manually call this whenever editing list items in place to flag need for resorting void setSorted(BOOL sorted) { mSorted = sorted; } void dirtyColumns(); // some operation has potentially affected column layout or ordering diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp index 8b5bb1f3f6..d53e957c9c 100644 --- a/indra/llui/llslider.cpp +++ b/indra/llui/llslider.cpp @@ -41,6 +41,10 @@ #include "llcontrol.h" #include "llimagegl.h" +static LLRegisterWidget<LLSlider> r1("slider_bar"); +static LLRegisterWidget<LLSlider> r2("volume_slider"); + + LLSlider::LLSlider( const LLString& name, const LLRect& rect, @@ -68,9 +72,9 @@ LLSlider::LLSlider( mMouseDownCallback( NULL ), mMouseUpCallback( NULL ) { - mThumbImage = LLUI::sImageProvider->getImageByID(LLUUID(LLUI::sAssetsGroup->getString("icn_slide-thumb_dark.tga"))); - mTrackImage = LLUI::sImageProvider->getImageByID(LLUUID(LLUI::sAssetsGroup->getString("icn_slide-groove_dark.tga"))); - mTrackHighlightImage = LLUI::sImageProvider->getImageByID(LLUUID(LLUI::sAssetsGroup->getString("icn_slide-highlight.tga"))); + mThumbImage = LLUI::sImageProvider->getUIImage("icn_slide-thumb_dark.tga"); + mTrackImage = LLUI::sImageProvider->getUIImage("icn_slide-groove_dark.tga"); + mTrackHighlightImage = LLUI::sImageProvider->getUIImage("icn_slide-highlight.tga"); // properly handle setting the starting thumb rect // do it this way to handle both the operating-on-settings @@ -217,98 +221,68 @@ BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } -BOOL LLSlider::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLSlider::handleKeyHere(KEY key, MASK mask) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent ) + switch(key) { - switch(key) - { - case KEY_UP: - case KEY_DOWN: - // eat up and down keys to be consistent - handled = TRUE; - break; - case KEY_LEFT: - setValueAndCommit(getValueF32() - getIncrement()); - handled = TRUE; - break; - case KEY_RIGHT: - setValueAndCommit(getValueF32() + getIncrement()); - handled = TRUE; - break; - default: - break; - } + case KEY_UP: + case KEY_DOWN: + // eat up and down keys to be consistent + handled = TRUE; + break; + case KEY_LEFT: + setValueAndCommit(getValueF32() - getIncrement()); + handled = TRUE; + break; + case KEY_RIGHT: + setValueAndCommit(getValueF32() + getIncrement()); + handled = TRUE; + break; + default: + break; } return handled; } void LLSlider::draw() { - if( getVisible() ) - { - // since thumb image might still be decoding, need thumb to accomodate image size - updateThumbRect(); - - // Draw background and thumb. - - // drawing solids requires texturing be disabled - LLGLSNoTexture no_texture; - - LLRect rect(mDragStartThumbRect); - - F32 opacity = getEnabled() ? 1.f : 0.3f; - LLColor4 center_color = (mThumbCenterColor % opacity); - LLColor4 track_color = (mTrackColor % opacity); - - // Track - LLRect track_rect(mThumbImage->getWidth() / 2, - getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), - getRect().getWidth() - mThumbImage->getWidth() / 2, - getLocalRect().getCenterY() - (mTrackImage->getHeight() / 2) ); - - gl_draw_scaled_image_with_border(track_rect.mLeft, track_rect.mBottom, 3, 3, track_rect.getWidth(), track_rect.getHeight(), - mTrackImage, track_color); - gl_draw_scaled_image_with_border(track_rect.mLeft, track_rect.mBottom, 3, 3, mThumbRect.mLeft, track_rect.getHeight(), - mTrackHighlightImage, track_color); + // since thumb image might still be decoding, need thumb to accomodate image size + updateThumbRect(); + // Draw background and thumb. - // Thumb - if( hasMouseCapture() ) - { - gl_draw_scaled_image(mDragStartThumbRect.mLeft, mDragStartThumbRect.mBottom, mDragStartThumbRect.getWidth(), mDragStartThumbRect.getHeight(), - mThumbImage, mThumbCenterColor % 0.3f); + // drawing solids requires texturing be disabled + LLGLSNoTexture no_texture; - if (hasFocus()) - { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - LLRect highlight_rect = mThumbRect; - highlight_rect.stretch(llround(lerp(1.f, 3.f, lerp_amt))); - gl_draw_scaled_image_with_border(highlight_rect.mLeft, highlight_rect.mBottom, 0, 0, highlight_rect.getWidth(), highlight_rect.getHeight(), - mThumbImage, gFocusMgr.getFocusColor(), TRUE); - } + F32 opacity = getEnabled() ? 1.f : 0.3f; + LLColor4 center_color = (mThumbCenterColor % opacity); + LLColor4 track_color = (mTrackColor % opacity); - gl_draw_scaled_image(mThumbRect.mLeft, mThumbRect.mBottom, mThumbRect.getWidth(), mThumbRect.getHeight(), - mThumbImage, mThumbOutlineColor); + // Track + LLRect track_rect(mThumbImage->getWidth() / 2, + getLocalRect().getCenterY() + (mTrackImage->getHeight() / 2), + getRect().getWidth() - mThumbImage->getWidth() / 2, + getLocalRect().getCenterY() - (mTrackImage->getHeight() / 2) ); + LLRect highlight_rect(track_rect.mLeft, track_rect.mTop, mThumbRect.getCenterX(), track_rect.mBottom); + mTrackImage->draw(track_rect); + mTrackHighlightImage->draw(highlight_rect); - } - else - { - if (hasFocus()) - { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); - LLRect highlight_rect = mThumbRect; - highlight_rect.stretch(llround(lerp(1.f, 3.f, lerp_amt))); - gl_draw_scaled_image_with_border(highlight_rect.mLeft, highlight_rect.mBottom, 0, 0, highlight_rect.getWidth(), highlight_rect.getHeight(), - mThumbImage, gFocusMgr.getFocusColor(), TRUE); - } - - gl_draw_scaled_image(mThumbRect.mLeft, mThumbRect.mBottom, mThumbRect.getWidth(), mThumbRect.getHeight(), - mThumbImage, center_color); - } - LLUICtrl::draw(); + // Thumb + if( hasMouseCapture() ) + { + // Show ghost where thumb was before dragging began. + mThumbImage->draw(mDragStartThumbRect, mThumbCenterColor % 0.3f); } + if (hasFocus()) + { + // Draw focus highlighting. + mThumbImage->drawBorder(mThumbRect, gFocusMgr.getFocusColor(), gFocusMgr.getFocusFlashWidth()); + } + // Fill in the thumb. + mThumbImage->draw(mThumbRect, hasMouseCapture() ? mThumbOutlineColor : center_color); + + LLUICtrl::draw(); } // virtual diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h index 9ca51120fc..ba0fac1465 100644 --- a/indra/llui/llslider.h +++ b/indra/llui/llslider.h @@ -52,8 +52,6 @@ public: BOOL volume, //TODO: create a "volume" slider sub-class or just use image art, no? -MG const LLString& control_name = LLString::null ); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SLIDER_BAR; } - virtual LLString getWidgetTag() const { return LL_SLIDER_TAG; } virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); @@ -79,7 +77,7 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void draw(); private: @@ -96,9 +94,9 @@ private: S32 mMouseOffset; LLRect mDragStartThumbRect; - LLImageGL* mThumbImage; - LLImageGL* mTrackImage; - LLImageGL* mTrackHighlightImage; + LLUIImage* mThumbImage; + LLUIImage* mTrackImage; + LLUIImage* mTrackHighlightImage; LLRect mThumbRect; LLColor4 mTrackColor; diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 763be1d7e3..9cf1ca5929 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -52,6 +52,7 @@ const U32 MAX_STRING_LENGTH = 10; +static LLRegisterWidget<LLSliderCtrl> r("slider"); LLSliderCtrl::LLSliderCtrl(const LLString& name, const LLRect& rect, const LLString& label, diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h index 4f96b0915c..992fbafe38 100644 --- a/indra/llui/llsliderctrl.h +++ b/indra/llui/llsliderctrl.h @@ -63,8 +63,7 @@ public: const LLString& control_which = LLString::null ); virtual ~LLSliderCtrl() {} // Children all cleaned up by default view destructor. - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SLIDER; } - virtual LLString getWidgetTag() const { return LL_SLIDER_CTRL_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 36f801c2e6..a39b74a610 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -52,6 +52,7 @@ const U32 MAX_STRING_LENGTH = 32; +static LLRegisterWidget<LLSpinCtrl> r2("spinner"); LLSpinCtrl::LLSpinCtrl( const LLString& name, const LLRect& rect, const LLString& label, const LLFontGL* font, void (*commit_callback)(LLUICtrl*, void*), @@ -409,26 +410,23 @@ void LLSpinCtrl::draw() BOOL LLSpinCtrl::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if( getEnabled() ) + if( clicks > 0 ) { - if( clicks > 0 ) + while( clicks-- ) { - while( clicks-- ) - { - LLSpinCtrl::onDownBtn(this); - } - } - else - while( clicks++ ) - { - LLSpinCtrl::onUpBtn(this); + LLSpinCtrl::onDownBtn(this); } } + else + while( clicks++ ) + { + LLSpinCtrl::onUpBtn(this); + } return TRUE; } -BOOL LLSpinCtrl::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLSpinCtrl::handleKeyHere(KEY key, MASK mask) { if (mEditor->hasFocus()) { diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index 2e1c06d2c4..21d297fa16 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -62,8 +62,7 @@ public: S32 label_width = SPINCTRL_DEFAULT_LABEL_WIDTH ); virtual ~LLSpinCtrl() {} // Children all cleaned up by default view destructor. - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_SPINNER; } - virtual LLString getWidgetTag() const { return LL_SPIN_CTRL_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); @@ -101,7 +100,7 @@ public: void forceEditorCommit(); // for commit on external button virtual BOOL handleScrollWheel(S32 x,S32 y,S32 clicks); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void draw(); diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index 695dd2a16f..336fdfe2c3 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -138,12 +138,34 @@ void LLStyle::setFontName(const LLString& fontname) } -void LLStyle::setImage(const LLString& src) +void LLStyle::setLinkHREF(const LLString& href) { - if (src.size() >= UUID_STR_LENGTH - 1) - { - mImagep = LLUI::sImageProvider->getImageByID(LLUUID(src)); - } + mLink = href; +} + +BOOL LLStyle::isLink() const +{ + return mLink.size(); +} + +BOOL LLStyle::isVisible() const +{ + return mVisible; +} + +void LLStyle::setVisible(BOOL is_visible) +{ + mVisible = is_visible; +} + +LLUIImagePtr LLStyle::getImage() const +{ + return mImagep; +} + +void LLStyle::setImage(const LLUUID& src) +{ + mImagep = LLUI::sImageProvider->getUIImageByID(src); } diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index b425640a36..8b82a84b46 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -35,7 +35,7 @@ #include "v4color.h" #include "llresmgr.h" #include "llfont.h" -#include "llimagegl.h" +#include "llui.h" class LLStyle { @@ -53,19 +53,20 @@ public: virtual const LLColor4& getColor() const { return mColor; } virtual void setColor(const LLColor4 &color) { mColor = color; } - virtual BOOL isVisible() const { return mVisible; } - virtual void setVisible(BOOL is_visible) { mVisible = is_visible; } + virtual BOOL isVisible() const; + virtual void setVisible(BOOL is_visible); virtual const LLString& getFontString() const { return mFontName; } virtual void setFontName(const LLString& fontname); virtual LLFONT_ID getFontID() const { return mFontID; } virtual const LLString& getLinkHREF() const { return mLink; } - virtual void setLinkHREF(const LLString& href) { mLink = href; } - virtual BOOL isLink() const { return mLink.size(); } + virtual void setLinkHREF(const LLString& href); + virtual BOOL isLink() const; + + virtual LLUIImagePtr getImage() const; + virtual void setImage(const LLUUID& src); - virtual LLImageGL *getImage() const { return mImagep; } - virtual void setImage(const LLString& src); virtual BOOL isImage() const { return ((mImageWidth != 0) && (mImageHeight != 0)); } virtual void setImageSize(S32 width, S32 height); @@ -106,7 +107,7 @@ private: LLString mFontName; LLFONT_ID mFontID; LLString mLink; - LLPointer<LLImageGL> mImagep; + LLUIImagePtr mImagep; BOOL mIsEmbeddedItem; }; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 8d1bab6bd7..a1844d34f9 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -64,7 +64,7 @@ const S32 TABCNTRV_HEADER_HEIGHT = LLPANEL_BORDER_WIDTH + TABCNTRV_CLOSE_BTN_SIZ const S32 TABCNTRV_ARROW_BTN_SIZE = 16; const S32 TABCNTRV_PAD = 0; - +static LLRegisterWidget<LLTabContainer> r("tab_container"); LLTabContainer::LLTabContainer(const LLString& name, const LLRect& rect, TabPosition pos, BOOL bordered, BOOL is_vertical ) @@ -115,18 +115,6 @@ void LLTabContainer::setValue(const LLSD& value) } //virtual -EWidgetType LLTabContainer::getWidgetType() const -{ - return WIDGET_TYPE_TAB_CONTAINER; -} - -//virtual -LLString LLTabContainer::getWidgetTag() const -{ - return LL_TAB_CONTAINER_COMMON_TAG; -} - -//virtual void LLTabContainer::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPanel::reshape( width, height, called_from_parent ); @@ -134,7 +122,7 @@ void LLTabContainer::reshape(S32 width, S32 height, BOOL called_from_parent) } //virtual -LLView* LLTabContainer::getChildByName(const LLString& name, BOOL recurse) const +LLView* LLTabContainer::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const { tuple_list_t::const_iterator itor; for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) @@ -145,19 +133,20 @@ LLView* LLTabContainer::getChildByName(const LLString& name, BOOL recurse) const return panel; } } + if (recurse) { for (itor = mTabList.begin(); itor != mTabList.end(); ++itor) { LLPanel *panel = (*itor)->mTabPanel; - LLView *child = panel->getChild<LLView>(name, recurse); + LLView *child = panel->getChildView(name, recurse, FALSE); if (child) { return child; } } } - return LLView::getChildByName(name, recurse); + return LLView::getChildView(name, recurse, create_if_missing); } // virtual @@ -185,124 +174,122 @@ void LLTabContainer::draw() } setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); - if( getVisible() ) + + BOOL has_scroll_arrows = (mMaxScrollPos > 0) || (mScrollPosPixels > 0); + if (!mIsVertical) { - BOOL has_scroll_arrows = (mMaxScrollPos > 0) || (mScrollPosPixels > 0); - if (!mIsVertical) - { - mJumpPrevArrowBtn->setVisible( has_scroll_arrows ); - mJumpNextArrowBtn->setVisible( has_scroll_arrows ); - } - mPrevArrowBtn->setVisible( has_scroll_arrows ); - mNextArrowBtn->setVisible( has_scroll_arrows ); + mJumpPrevArrowBtn->setVisible( has_scroll_arrows ); + mJumpNextArrowBtn->setVisible( has_scroll_arrows ); + } + mPrevArrowBtn->setVisible( has_scroll_arrows ); + mNextArrowBtn->setVisible( has_scroll_arrows ); - S32 left = 0, top = 0; - if (mIsVertical) - { - top = getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1 - (has_scroll_arrows ? TABCNTRV_ARROW_BTN_SIZE : 0); - top += getScrollPosPixels(); - } - else - { - // Set the leftmost position of the tab buttons. - left = LLPANEL_BORDER_WIDTH + (has_scroll_arrows ? (TABCNTR_ARROW_BTN_SIZE * 2) : TABCNTR_TAB_H_PAD); - left -= getScrollPosPixels(); - } - - // Hide all the buttons + S32 left = 0, top = 0; + if (mIsVertical) + { + top = getRect().getHeight() - getTopBorderHeight() - LLPANEL_BORDER_WIDTH - 1 - (has_scroll_arrows ? TABCNTRV_ARROW_BTN_SIZE : 0); + top += getScrollPosPixels(); + } + else + { + // Set the leftmost position of the tab buttons. + left = LLPANEL_BORDER_WIDTH + (has_scroll_arrows ? (TABCNTR_ARROW_BTN_SIZE * 2) : TABCNTR_TAB_H_PAD); + left -= getScrollPosPixels(); + } + + // Hide all the buttons + for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) + { + LLTabTuple* tuple = *iter; + tuple->mButton->setVisible( FALSE ); + } + + LLPanel::draw(); + + // if tabs are hidden, don't draw them and leave them in the invisible state + if (!getTabsHidden()) + { + // Show all the buttons for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) { LLTabTuple* tuple = *iter; - tuple->mButton->setVisible( FALSE ); + tuple->mButton->setVisible( TRUE ); } - LLPanel::draw(); - - // if tabs are hidden, don't draw them and leave them in the invisible state - if (!getTabsHidden()) + // Draw some of the buttons... + LLRect clip_rect = getLocalRect(); + if (has_scroll_arrows) { - // Show all the buttons - for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) + // ...but clip them. + if (mIsVertical) { - LLTabTuple* tuple = *iter; - tuple->mButton->setVisible( TRUE ); + clip_rect.mBottom = mNextArrowBtn->getRect().mTop + 3*TABCNTRV_PAD; + clip_rect.mTop = mPrevArrowBtn->getRect().mBottom - 3*TABCNTRV_PAD; } - - // Draw some of the buttons... - LLRect clip_rect = getLocalRect(); - if (has_scroll_arrows) + else { - // ...but clip them. - if (mIsVertical) - { - clip_rect.mBottom = mNextArrowBtn->getRect().mTop + 3*TABCNTRV_PAD; - clip_rect.mTop = mPrevArrowBtn->getRect().mBottom - 3*TABCNTRV_PAD; - } - else - { - clip_rect.mLeft = mPrevArrowBtn->getRect().mRight; - clip_rect.mRight = mNextArrowBtn->getRect().mLeft; - } + clip_rect.mLeft = mPrevArrowBtn->getRect().mRight; + clip_rect.mRight = mNextArrowBtn->getRect().mLeft; } - LLLocalClipRect clip(clip_rect); + } + LLLocalClipRect clip(clip_rect); - S32 max_scroll_visible = getTabCount() - getMaxScrollPos() + getScrollPos(); - S32 idx = 0; - for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) - { - LLTabTuple* tuple = *iter; + S32 max_scroll_visible = getTabCount() - getMaxScrollPos() + getScrollPos(); + S32 idx = 0; + for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) + { + LLTabTuple* tuple = *iter; - tuple->mButton->translate( left ? left - tuple->mButton->getRect().mLeft : 0, - top ? top - tuple->mButton->getRect().mTop : 0 ); - if (top) top -= BTN_HEIGHT + TABCNTRV_PAD; - if (left) left += tuple->mButton->getRect().getWidth(); + tuple->mButton->translate( left ? left - tuple->mButton->getRect().mLeft : 0, + top ? top - tuple->mButton->getRect().mTop : 0 ); + if (top) top -= BTN_HEIGHT + TABCNTRV_PAD; + if (left) left += tuple->mButton->getRect().getWidth(); - if (!mIsVertical) + if (!mIsVertical) + { + if( idx < getScrollPos() ) { - if( idx < getScrollPos() ) - { - if( tuple->mButton->getFlashing() ) - { - mPrevArrowBtn->setFlashing( TRUE ); - } - } - else if( max_scroll_visible < idx ) + if( tuple->mButton->getFlashing() ) { - if( tuple->mButton->getFlashing() ) - { - mNextArrowBtn->setFlashing( TRUE ); - } + mPrevArrowBtn->setFlashing( TRUE ); } } - LLUI::pushMatrix(); + else if( max_scroll_visible < idx ) { - LLUI::translate((F32)tuple->mButton->getRect().mLeft, (F32)tuple->mButton->getRect().mBottom, 0.f); - tuple->mButton->draw(); + if( tuple->mButton->getFlashing() ) + { + mNextArrowBtn->setFlashing( TRUE ); + } } - LLUI::popMatrix(); - - idx++; } - - - if( mIsVertical && has_scroll_arrows ) + LLUI::pushMatrix(); { - // Redraw the arrows so that they appears on top. - gGL.pushMatrix(); - gGL.translatef((F32)mPrevArrowBtn->getRect().mLeft, (F32)mPrevArrowBtn->getRect().mBottom, 0.f); - mPrevArrowBtn->draw(); - gGL.popMatrix(); - - gGL.pushMatrix(); - gGL.translatef((F32)mNextArrowBtn->getRect().mLeft, (F32)mNextArrowBtn->getRect().mBottom, 0.f); - mNextArrowBtn->draw(); - gGL.popMatrix(); + LLUI::translate((F32)tuple->mButton->getRect().mLeft, (F32)tuple->mButton->getRect().mBottom, 0.f); + tuple->mButton->draw(); } + LLUI::popMatrix(); + + idx++; } - mPrevArrowBtn->setFlashing(FALSE); - mNextArrowBtn->setFlashing(FALSE); + + if( mIsVertical && has_scroll_arrows ) + { + // Redraw the arrows so that they appears on top. + gGL.pushMatrix(); + gGL.translatef((F32)mPrevArrowBtn->getRect().mLeft, (F32)mPrevArrowBtn->getRect().mBottom, 0.f); + mPrevArrowBtn->draw(); + gGL.popMatrix(); + + gGL.pushMatrix(); + gGL.translatef((F32)mNextArrowBtn->getRect().mLeft, (F32)mNextArrowBtn->getRect().mBottom, 0.f); + mNextArrowBtn->draw(); + gGL.popMatrix(); + } } + + mPrevArrowBtn->setFlashing(FALSE); + mNextArrowBtn->setFlashing(FALSE); } @@ -524,12 +511,8 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_ } // virtual -BOOL LLTabContainer::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLTabContainer::handleKeyHere(KEY key, MASK mask) { - if (!getEnabled()) return FALSE; - - if (!gFocusMgr.childHasKeyboardFocus(this)) return FALSE; - BOOL handled = FALSE; if (key == KEY_LEFT && mask == MASK_ALT) { @@ -687,7 +670,7 @@ void LLTabContainer::addTabPanel(LLPanel* child, // already a child of mine return; } - const LLFontGL* font = gResMgr->getRes( mIsVertical ? LLFONT_SANSSERIF : LLFONT_SANSSERIF_SMALL ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( mIsVertical ? LLFONT_SANSSERIF : LLFONT_SANSSERIF_SMALL ); // Store the original label for possible xml export. child->setLabel(label); @@ -1272,7 +1255,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L if (!mIsVertical) { - const LLFontGL* fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); // remove current width from total tab strip width mTotalTabWidth -= tuple->mButton->getRect().getWidth(); @@ -1353,7 +1336,7 @@ void LLTabContainer::setPanelTitle(S32 index, const LLString& title) { LLTabTuple* tuple = getTab(index); LLButton* tab_button = tuple->mButton; - const LLFontGL* fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); mTotalTabWidth -= tab_button->getRect().getWidth(); tab_button->reshape(llclamp(fontp->getWidth(title) + TAB_PADDING + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tab_button->getRect().getHeight()); mTotalTabWidth += tab_button->getRect().getWidth(); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 7c0463ee5b..20d04cbf86 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -62,19 +62,19 @@ public: // from LLView /*virtual*/ void setValue(const LLSD& value); - /*virtual*/ EWidgetType getWidgetType() const; - /*virtual*/ LLString getWidgetTag() const; + /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleHover( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleMouseUp( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect ); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType type, void* cargo_data, EAcceptance* accept, LLString& tooltip); /*virtual*/ LLXMLNodePtr getXML(bool save_children = true) const; + /*virtual*/ LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; void addTabPanel(LLPanel* child, const LLString& label, @@ -142,10 +142,6 @@ public: static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); -protected: - /*virtual*/ LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const; - - private: // Structure used to map tab buttons to and from tab panels struct LLTabTuple diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 0c5bc2da81..1c3c8329e6 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -34,6 +34,8 @@ #include "lluictrlfactory.h" #include "llfocusmgr.h" +static LLRegisterWidget<LLTextBox> r("text"); + LLTextBox::LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, const LLFontGL* font, BOOL mouse_opaque) : LLUICtrl(name, rect, mouse_opaque, NULL, NULL, FOLLOWS_LEFT | FOLLOWS_TOP ), @@ -212,7 +214,7 @@ void LLTextBox::setLineLengths() LLString::size_type cur = 0; LLString::size_type len = mText.getWString().size(); - while (cur < len) + while (cur < len) { LLString::size_type end = mText.getWString().find('\n', cur); LLString::size_type runLen; @@ -323,63 +325,60 @@ BOOL LLTextBox::setTextArg( const LLString& key, const LLStringExplicit& text ) void LLTextBox::draw() { - if( getVisible() ) + if (mBorderVisible) { - if (mBorderVisible) - { - gl_rect_2d_offset_local(getLocalRect(), 2, FALSE); - } + gl_rect_2d_offset_local(getLocalRect(), 2, FALSE); + } - if( mBorderDropShadowVisible ) - { - static LLColor4 color_drop_shadow = LLUI::sColorsGroup->getColor("ColorDropShadow"); - static S32 drop_shadow_tooltip = LLUI::sConfigGroup->getS32("DropShadowTooltip"); - gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, - color_drop_shadow, drop_shadow_tooltip); - } - - if (mBackgroundVisible) - { - LLRect r( 0, getRect().getHeight(), getRect().getWidth(), 0 ); - gl_rect_2d( r, mBackgroundColor ); - } + if( mBorderDropShadowVisible ) + { + static LLColor4 color_drop_shadow = LLUI::sColorsGroup->getColor("ColorDropShadow"); + static S32 drop_shadow_tooltip = LLUI::sConfigGroup->getS32("DropShadowTooltip"); + gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, + color_drop_shadow, drop_shadow_tooltip); + } - S32 text_x = 0; - switch( mHAlign ) - { - case LLFontGL::LEFT: - text_x = mHPad; - break; - case LLFontGL::HCENTER: - text_x = getRect().getWidth() / 2; - break; - case LLFontGL::RIGHT: - text_x = getRect().getWidth() - mHPad; - break; - } + if (mBackgroundVisible) + { + LLRect r( 0, getRect().getHeight(), getRect().getWidth(), 0 ); + gl_rect_2d( r, mBackgroundColor ); + } - S32 text_y = getRect().getHeight() - mVPad; + S32 text_x = 0; + switch( mHAlign ) + { + case LLFontGL::LEFT: + text_x = mHPad; + break; + case LLFontGL::HCENTER: + text_x = getRect().getWidth() / 2; + break; + case LLFontGL::RIGHT: + text_x = getRect().getWidth() - mHPad; + break; + } - if ( getEnabled() ) + S32 text_y = getRect().getHeight() - mVPad; + + if ( getEnabled() ) + { + if(mHasHover) { - if(mHasHover) - { - drawText( text_x, text_y, mHoverColor ); - } - else - { - drawText( text_x, text_y, mTextColor ); - } + drawText( text_x, text_y, mHoverColor ); } else { - drawText( text_x, text_y, mDisabledColor ); - } + drawText( text_x, text_y, mTextColor ); + } + } + else + { + drawText( text_x, text_y, mDisabledColor ); + } - if (sDebugRects) - { - drawDebugRect(); - } + if (sDebugRects) + { + drawDebugRect(); } mHasHover = FALSE; // This is reset every frame. diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index ce3a9bb12e..91d47795a5 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -57,8 +57,7 @@ public: LLTextBox(const LLString& name_and_label); virtual ~LLTextBox() {} - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXT_BOX; } - virtual LLString getWidgetTag() const { return LL_TEXT_BOX_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 0b6f5d75cc..7c8c0fe81c 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -64,6 +64,8 @@ // // Globals // +static LLRegisterWidget<LLTextEditor> r("simple_text_editor"); + BOOL gDebugTextEditorTips = FALSE; // @@ -304,10 +306,10 @@ LLTextEditor::LLTextEditor( // Init the scrollbar LLRect scroll_rect; scroll_rect.setOriginAndSize( - getRect().getWidth() - UI_TEXTEDITOR_BORDER - SCROLLBAR_SIZE, - UI_TEXTEDITOR_BORDER, + getRect().getWidth() - SCROLLBAR_SIZE, + 1, SCROLLBAR_SIZE, - getRect().getHeight() - 2 * UI_TEXTEDITOR_BORDER ); + getRect().getHeight() - 1); S32 lines_in_doc = getLineCount(); mScrollbar = new LLScrollbar( "Scrollbar", scroll_rect, LLScrollbar::VERTICAL, @@ -1102,14 +1104,7 @@ BOOL LLTextEditor::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rec BOOL LLTextEditor::handleScrollWheel(S32 x, S32 y, S32 clicks) { // Pretend the mouse is over the scrollbar - if (getVisible()) - { - return mScrollbar->handleScrollWheel( 0, 0, clicks ); - } - else - { - return FALSE; - } + return mScrollbar->handleScrollWheel( 0, 0, clicks ); } BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) @@ -1197,91 +1192,88 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) BOOL handled = FALSE; mHoverSegment = NULL; - if( getVisible() ) + if(hasMouseCapture() ) { - if(hasMouseCapture() ) + if( mIsSelecting ) { - if( mIsSelecting ) + if (x != mLastSelectionX || y != mLastSelectionY) { - if (x != mLastSelectionX || y != mLastSelectionY) - { - mLastSelectionX = x; - mLastSelectionY = y; - } + mLastSelectionX = x; + mLastSelectionY = y; + } - if( y > mTextRect.mTop ) + if( y > mTextRect.mTop ) + { + mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); + } + else + if( y < mTextRect.mBottom ) + { + mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); + } + + setCursorAtLocalPos( x, y, TRUE ); + mSelectionEnd = mCursorPos; + + updateScrollFromCursor(); + } + + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + getWindow()->setCursor(UI_CURSOR_IBEAM); + handled = TRUE; + } + + if( !handled ) + { + // Pass to children + handled = LLView::childrenHandleHover(x, y, mask) != NULL; + } + + if( handled ) + { + // Delay cursor flashing + resetKeystrokeTimer(); + } + + // Opaque + if( !handled && mTakesNonScrollClicks) + { + // Check to see if we're over an HTML-style link + if( !mSegments.empty() ) + { + const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); + if( cur_segment ) + { + if(cur_segment->getStyle().isLink()) { - mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; + getWindow()->setCursor(UI_CURSOR_HAND); + handled = TRUE; } else - if( y < mTextRect.mBottom ) + if(cur_segment->getStyle().getIsEmbeddedItem()) { - mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; + getWindow()->setCursor(UI_CURSOR_HAND); + //getWindow()->setCursor(UI_CURSOR_ARROW); + handled = TRUE; } - - setCursorAtLocalPos( x, y, TRUE ); - mSelectionEnd = mCursorPos; - - updateScrollFromCursor(); + mHoverSegment = cur_segment; } - - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; - getWindow()->setCursor(UI_CURSOR_IBEAM); - handled = TRUE; } if( !handled ) { - // Pass to children - handled = LLView::childrenHandleHover(x, y, mask) != NULL; - } - - if( handled ) - { - // Delay cursor flashing - resetKeystrokeTimer(); - } - - // Opaque - if( !handled && mTakesNonScrollClicks) - { - // Check to see if we're over an HTML-style link - if( !mSegments.empty() ) + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) { - const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); - if( cur_segment ) - { - if(cur_segment->getStyle().isLink()) - { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; - getWindow()->setCursor(UI_CURSOR_HAND); - handled = TRUE; - } - else - if(cur_segment->getStyle().getIsEmbeddedItem()) - { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; - getWindow()->setCursor(UI_CURSOR_HAND); - //getWindow()->setCursor(UI_CURSOR_ARROW); - handled = TRUE; - } - mHoverSegment = cur_segment; - } + getWindow()->setCursor(UI_CURSOR_IBEAM); } - - if( !handled ) + else { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; - if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) - { - getWindow()->setCursor(UI_CURSOR_IBEAM); - } - else - { - getWindow()->setCursor(UI_CURSOR_ARROW); - } - handled = TRUE; + getWindow()->setCursor(UI_CURSOR_ARROW); } + handled = TRUE; } } @@ -2154,14 +2146,14 @@ void LLTextEditor::unindentLineBeforeCloseBrace() } -BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask ) { BOOL handled = FALSE; BOOL selection_modified = FALSE; BOOL return_key_hit = FALSE; BOOL text_may_have_changed = TRUE; - if ( (gFocusMgr.getKeyboardFocus() == this) && getVisible()) + if ( gFocusMgr.getKeyboardFocus() == this ) { // Special case for TAB. If want to move to next field, report // not handled and let the parent take care of field movement. @@ -2245,7 +2237,7 @@ BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ) } -BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL { @@ -2254,7 +2246,7 @@ BOOL LLTextEditor::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_pare BOOL handled = FALSE; - if ( (gFocusMgr.getKeyboardFocus() == this) && getVisible()) + if ( gFocusMgr.getKeyboardFocus() == this ) { // Handle most keys only if the text editor is writeable. if( !mReadOnly ) @@ -2939,8 +2931,8 @@ void LLTextEditor::drawText() LLStyle style = cur_segment->getStyle(); if ( style.isImage() && (cur_segment->getStart() >= seg_start) && (cur_segment->getStart() <= clipped_end)) { - LLImageGL *image = style.getImage(); - gl_draw_scaled_image( llround(text_x), llround(text_y)+line_height-style.mImageHeight, style.mImageWidth, style.mImageHeight, image, LLColor4::white ); + LLUIImagePtr image = style.getImage(); + image->draw(llround(text_x), llround(text_y)+line_height-style.mImageHeight, style.mImageWidth, style.mImageHeight); } if (cur_segment == mHoverSegment && style.getIsEmbeddedItem()) @@ -2984,7 +2976,7 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 if ( style.getFontString()[0] ) { - font = gResMgr->getRes(style.getFontID()); + font = LLResMgr::getInstance()->getRes(style.getFontID()); } U8 font_flags = LLFontGL::NORMAL; @@ -3051,10 +3043,6 @@ void LLTextEditor::drawClippedSegment(const LLWString &text, S32 seg_start, S32 void LLTextEditor::draw() { - if( !getVisible() ) - { - return; - } { LLLocalClipRect clip(LLRect(0, getRect().getHeight(), getRect().getWidth() - (mScrollbar->getVisible() ? SCROLLBAR_SIZE : 0), 0)); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 7055e98a76..d48a162830 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -71,9 +71,6 @@ public: virtual ~LLTextEditor(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXT_EDITOR; } - virtual LLString getWidgetTag() const { return LL_TEXT_EDITOR_TAG; } - virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); void setTextEditorParameters(LLXMLNodePtr node); @@ -85,8 +82,8 @@ public: virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent ); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask ); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); virtual BOOL handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 1e9442805f..4866a4b309 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -55,6 +55,7 @@ //#include "llstartup.h" #include "llui.h" #include "llview.h" +#include "lllineeditor.h" #include "llwindow.h" #include "llglheaders.h" @@ -73,7 +74,6 @@ std::list<LLString> gUntranslated; LLControlGroup* LLUI::sConfigGroup = NULL; LLControlGroup* LLUI::sColorsGroup = NULL; -LLControlGroup* LLUI::sAssetsGroup = NULL; LLImageProviderInterface* LLUI::sImageProvider = NULL; LLUIAudioCallback LLUI::sAudioCallback = NULL; LLVector2 LLUI::sGLScaleFactor(1.f, 1.f); @@ -320,7 +320,7 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2 ) { // Work around bug in ATI driver: vertical lines are offset by (-1,-1) - if( gGLManager.mATIOffsetVerticalLines && (x1 == x2) ) + if( (x1 == x2) && gGLManager.mATIOffsetVerticalLines ) { x1++; x2++; @@ -339,7 +339,7 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2 ) void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) { // Work around bug in ATI driver: vertical lines are offset by (-1,-1) - if( gGLManager.mATIOffsetVerticalLines && (x1 == x2) ) + if( (x1 == x2) && gGLManager.mATIOffsetVerticalLines ) { x1++; x2++; @@ -457,24 +457,30 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma return; } - // scale screen size of borders down - LLRectf clipped_scale_rect = uv_rect; - clipped_scale_rect.intersectWith(scale_rect); + // shrink scaling region to be proportional to clipped image region + LLRectf scale_rect_uv( + uv_rect.mLeft + (scale_rect.mLeft * uv_rect.getWidth()), + uv_rect.mBottom + (scale_rect.mTop * uv_rect.getHeight()), + uv_rect.mLeft + (scale_rect.mRight * uv_rect.getWidth()), + uv_rect.mBottom + (scale_rect.mBottom * uv_rect.getHeight())); + + S32 image_natural_width = llround((F32)image->getWidth(0) * uv_rect.getWidth()); + S32 image_natural_height = llround((F32)image->getHeight(0) * uv_rect.getHeight()); LLRect draw_rect(0, height, width, 0); - LLRect draw_scale_rect(llround((F32)image->getWidth() * scale_rect.mLeft), - llround((F32)image->getHeight() * scale_rect.mTop), - llround((F32)image->getWidth() * scale_rect.mRight), - llround((F32)image->getHeight() * scale_rect.mBottom)); - // scale fixed region of image up with drawn region - draw_scale_rect.mRight += width - image->getWidth(); - draw_scale_rect.mTop += height - image->getHeight(); + LLRect draw_scale_rect(llround(scale_rect_uv.mLeft * (F32)image->getWidth(0)), + llround(scale_rect_uv.mTop * (F32)image->getHeight(0)), + llround(scale_rect_uv.mRight * (F32)image->getWidth(0)), + llround(scale_rect_uv.mBottom * (F32)image->getHeight(0))); + // scale fixed region of image to drawn region + draw_scale_rect.mRight += width - image_natural_width; + draw_scale_rect.mTop += height - image_natural_height; S32 border_shrink_width = llmax(0, draw_scale_rect.mLeft - draw_scale_rect.mRight); S32 border_shrink_height = llmax(0, draw_scale_rect.mBottom - draw_scale_rect.mTop); - F32 shrink_width_ratio = scale_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image->getWidth() * (1.f - scale_rect.getWidth())); - F32 shrink_height_ratio = scale_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image->getHeight() * (1.f - scale_rect.getHeight())); + F32 shrink_width_ratio = scale_rect.getWidth() == 1.f ? 0.f : border_shrink_width / ((F32)image_natural_width * (1.f - scale_rect.getWidth())); + F32 shrink_height_ratio = scale_rect.getHeight() == 1.f ? 0.f : border_shrink_height / ((F32)image_natural_height * (1.f - scale_rect.getHeight())); F32 shrink_scale = 1.f - llmax(shrink_width_ratio, shrink_height_ratio); draw_scale_rect.mLeft = llround((F32)draw_scale_rect.mLeft * shrink_scale); @@ -514,117 +520,117 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); gGL.vertex2i(0, 0); - gGL.texCoord2f(clipped_scale_rect.mLeft, uv_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, 0); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); - gGL.texCoord2f(uv_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(0, draw_scale_rect.mBottom); // draw bottom middle - gGL.texCoord2f(clipped_scale_rect.mLeft, uv_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, 0); - gGL.texCoord2f(clipped_scale_rect.mRight, uv_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mBottom); gGL.vertex2i(draw_scale_rect.mRight, 0); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); // draw bottom right - gGL.texCoord2f(clipped_scale_rect.mRight, uv_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mBottom); gGL.vertex2i(draw_scale_rect.mRight, 0); gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); gGL.vertex2i(width, 0); - gGL.texCoord2f(uv_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mBottom); gGL.vertex2i(width, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); // draw left - gGL.texCoord2f(uv_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(0, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); - gGL.texCoord2f(uv_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mTop); gGL.vertex2i(0, draw_scale_rect.mTop); // draw middle - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); // draw right - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mBottom); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mBottom); - gGL.texCoord2f(uv_rect.mRight, clipped_scale_rect.mBottom); + gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mBottom); gGL.vertex2i(width, draw_scale_rect.mBottom); - gGL.texCoord2f(uv_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mTop); gGL.vertex2i(width, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); // draw top left - gGL.texCoord2f(uv_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(uv_rect.mLeft, scale_rect_uv.mTop); gGL.vertex2i(0, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mLeft, uv_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mTop); gGL.vertex2i(draw_scale_rect.mLeft, height); gGL.texCoord2f(uv_rect.mLeft, uv_rect.mTop); gGL.vertex2i(0, height); // draw top middle - gGL.texCoord2f(clipped_scale_rect.mLeft, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mLeft, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); - gGL.texCoord2f(clipped_scale_rect.mRight, uv_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mTop); gGL.vertex2i(draw_scale_rect.mRight, height); - gGL.texCoord2f(clipped_scale_rect.mLeft, uv_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mLeft, uv_rect.mTop); gGL.vertex2i(draw_scale_rect.mLeft, height); // draw top right - gGL.texCoord2f(clipped_scale_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, scale_rect_uv.mTop); gGL.vertex2i(draw_scale_rect.mRight, draw_scale_rect.mTop); - gGL.texCoord2f(uv_rect.mRight, clipped_scale_rect.mTop); + gGL.texCoord2f(uv_rect.mRight, scale_rect_uv.mTop); gGL.vertex2i(width, draw_scale_rect.mTop); gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); gGL.vertex2i(width, height); - gGL.texCoord2f(clipped_scale_rect.mRight, uv_rect.mTop); + gGL.texCoord2f(scale_rect_uv.mRight, uv_rect.mTop); gGL.vertex2i(draw_scale_rect.mRight, height); } gGL.end(); @@ -1563,7 +1569,6 @@ bool handleShowXUINamesChanged(const LLSD& newvalue) void LLUI::initClass(LLControlGroup* config, LLControlGroup* colors, - LLControlGroup* assets, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback, const LLVector2* scale_factor, @@ -1571,7 +1576,6 @@ void LLUI::initClass(LLControlGroup* config, { sConfigGroup = config; sColorsGroup = colors; - sAssetsGroup = assets; sImageProvider = image_provider; sAudioCallback = audio_callback; sGLScaleFactor = (scale_factor == NULL) ? LLVector2(1.f, 1.f) : *scale_factor; @@ -1584,6 +1588,8 @@ void LLUI::initClass(LLControlGroup* config, void LLUI::cleanupClass() { + sImageProvider->cleanUp(); + LLLineEditor::cleanupClass(); } @@ -1726,28 +1732,15 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen) glPointToScreen(gl.mRight, gl.mBottom, &screen->mRight, &screen->mBottom); } -//static -LLUUID LLUI::findAssetUUIDByName(const LLString &asset_name) -{ - if(asset_name == LLString::null) return LLUUID::null; - LLString foundValue = LLUI::sConfigGroup->findString(asset_name); - if(foundValue==LLString::null) - { - foundValue = LLUI::sAssetsGroup->findString(asset_name); - } - if(foundValue == LLString::null){ - return LLUUID::null; - } - return LLUUID( foundValue ); -} - //static -LLUIImage* LLUI::getUIImageByName(const LLString& name) +LLUIImage* LLUI::getUIImage(const LLString& name) { - return sImageProvider->getUIImageByID(findAssetUUIDByName(name)); + if (!name.empty()) + return sImageProvider->getUIImage(name); + else + return NULL; } - // static void LLUI::setHtmlHelp(LLHtmlHelp* html_help) { @@ -1822,7 +1815,8 @@ LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled) // LLUIImage // -LLUIImage::LLUIImage(LLPointer<LLImageGL> image) : +LLUIImage::LLUIImage(const LLString& name, LLPointer<LLImageGL> image) : + mName(name), mImage(image), mScaleRegion(0.f, 1.f, 1.f, 0.f), mClipRegion(0.f, 1.f, 1.f, 0.f), @@ -1886,24 +1880,32 @@ void LLUIImage::drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& c mScaleRegion); } -void LLUIImage::drawSolid(S32 x, S32 y, const LLColor4& color) const +void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const { - gl_draw_scaled_image_with_border( - x, y, - getWidth(), getHeight(), - mImage, - color, - TRUE, - mClipRegion, - mScaleRegion); + LLRect border_rect; + border_rect.setOriginAndSize(x, y, width, height); + border_rect.stretch(border_width, border_width); + drawSolid(border_rect, color); } S32 LLUIImage::getWidth() const { - return mImage->getWidth(0); + // return clipped dimensions of actual image area + return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth()); } S32 LLUIImage::getHeight() const { - return mImage->getHeight(0); + // return clipped dimensions of actual image area + return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight()); +} + +S32 LLUIImage::getTextureWidth() const +{ + return mImage->getWidth(0); +} + +S32 LLUIImage::getTextureHeight() const +{ + return mImage->getHeight(0); } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index e7750087cf..b5a64e7533 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -161,7 +161,6 @@ public: // static void initClass(LLControlGroup* config, LLControlGroup* colors, - LLControlGroup* assets, LLImageProviderInterface* image_provider, LLUIAudioCallback audio_callback = NULL, const LLVector2 *scale_factor = NULL, @@ -179,8 +178,7 @@ public: static void setCursorPositionLocal(const LLView* viewp, S32 x, S32 y); static void setScaleFactor(const LLVector2& scale_factor); static void setLineWidth(F32 width); - static LLUUID findAssetUUIDByName(const LLString& name); - static LLUIImage* getUIImageByName(const LLString& name); + static LLUIImage* getUIImage(const LLString& name); static LLVector2 getWindowSize(); static void screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y); static void glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y); @@ -193,7 +191,6 @@ public: // static LLControlGroup* sConfigGroup; static LLControlGroup* sColorsGroup; - static LLControlGroup* sAssetsGroup; static LLImageProviderInterface* sImageProvider; static LLUIAudioCallback sAudioCallback; static LLVector2 sGLScaleFactor; @@ -203,101 +200,6 @@ public: }; -// UI widgets -// This MUST match UICtrlNames in lluictrlfactory.cpp -typedef enum e_widget_type -{ - WIDGET_TYPE_VIEW = 0, - WIDGET_TYPE_ROOT_VIEW, - WIDGET_TYPE_FLOATER_VIEW, - WIDGET_TYPE_BUTTON, - WIDGET_TYPE_JOYSTICK_TURN, - WIDGET_TYPE_JOYSTICK_SLIDE, - WIDGET_TYPE_CHECKBOX, - WIDGET_TYPE_COLOR_SWATCH, - WIDGET_TYPE_COMBO_BOX, - WIDGET_TYPE_LINE_EDITOR, - WIDGET_TYPE_SEARCH_EDITOR, - WIDGET_TYPE_SCROLL_LIST, - WIDGET_TYPE_NAME_LIST, - WIDGET_TYPE_WEBBROWSER, - WIDGET_TYPE_SLIDER, // actually LLSliderCtrl - WIDGET_TYPE_SLIDER_BAR, // actually LLSlider - WIDGET_TYPE_VOLUME_SLIDER,//actually LLVolumeSliderCtrl - WIDGET_TYPE_MULTI_SLIDER, // actually LLMultiSliderCtrl - WIDGET_TYPE_MULTI_SLIDER_BAR, // actually LLMultiSlider - WIDGET_TYPE_SPINNER, - WIDGET_TYPE_TEXT_EDITOR, - WIDGET_TYPE_TEXTURE_PICKER, - WIDGET_TYPE_TEXT_BOX, - WIDGET_TYPE_PAD, // used in XML for positioning, not a real widget - WIDGET_TYPE_RADIO_GROUP, - WIDGET_TYPE_ICON, - WIDGET_TYPE_LANDMARK_PICKER, - WIDGET_TYPE_LOCATE, // used in XML for positioning, not a real widget - WIDGET_TYPE_VIEW_BORDER, // decorative border - WIDGET_TYPE_PANEL, - WIDGET_TYPE_MENU, - WIDGET_TYPE_PIE_MENU, - WIDGET_TYPE_PIE_MENU_BRANCH, - WIDGET_TYPE_MENU_ITEM, - WIDGET_TYPE_MENU_ITEM_SEPARATOR, - WIDGET_TYPE_MENU_SEPARATOR_VERTICAL, - WIDGET_TYPE_MENU_ITEM_CALL, - WIDGET_TYPE_MENU_ITEM_CHECK, - WIDGET_TYPE_MENU_ITEM_BRANCH, - WIDGET_TYPE_MENU_ITEM_BRANCH_DOWN, - WIDGET_TYPE_MENU_ITEM_BLANK, - WIDGET_TYPE_TEAROFF_MENU, - WIDGET_TYPE_MENU_BAR, - WIDGET_TYPE_TAB_CONTAINER, - WIDGET_TYPE_SCROLL_CONTAINER, // LLScrollableContainerView - WIDGET_TYPE_SCROLLBAR, - WIDGET_TYPE_INVENTORY_PANEL, // LLInventoryPanel - WIDGET_TYPE_FLOATER, - WIDGET_TYPE_DRAG_HANDLE_TOP, - WIDGET_TYPE_DRAG_HANDLE_LEFT, - WIDGET_TYPE_RESIZE_HANDLE, - WIDGET_TYPE_RESIZE_BAR, - WIDGET_TYPE_NAME_EDITOR, - WIDGET_TYPE_MULTI_FLOATER, - WIDGET_TYPE_MEDIA_REMOTE, - WIDGET_TYPE_FOLDER_VIEW, - WIDGET_TYPE_FOLDER_ITEM, - WIDGET_TYPE_FOLDER, - WIDGET_TYPE_STAT_GRAPH, - WIDGET_TYPE_STAT_VIEW, - WIDGET_TYPE_STAT_BAR, - WIDGET_TYPE_DROP_TARGET, - WIDGET_TYPE_TEXTURE_BAR, - WIDGET_TYPE_TEX_MEM_BAR, - WIDGET_TYPE_SNAPSHOT_LIVE_PREVIEW, - WIDGET_TYPE_STATUS_BAR, - WIDGET_TYPE_PROGRESS_VIEW, - WIDGET_TYPE_TALK_VIEW, - WIDGET_TYPE_OVERLAY_BAR, - WIDGET_TYPE_HUD_VIEW, - WIDGET_TYPE_HOVER_VIEW, - WIDGET_TYPE_MORPH_VIEW, - WIDGET_TYPE_NET_MAP, - WIDGET_TYPE_PERMISSIONS_VIEW, - WIDGET_TYPE_MENU_HOLDER, - WIDGET_TYPE_DEBUG_VIEW, - WIDGET_TYPE_SCROLLING_PANEL_LIST, - WIDGET_TYPE_AUDIO_STATUS, - WIDGET_TYPE_CONTAINER_VIEW, - WIDGET_TYPE_CONSOLE, - WIDGET_TYPE_FAST_TIMER_VIEW, - WIDGET_TYPE_VELOCITY_BAR, - WIDGET_TYPE_TEXTURE_VIEW, - WIDGET_TYPE_MEMORY_VIEW, - WIDGET_TYPE_FRAME_STAT_VIEW, - WIDGET_TYPE_LAYOUT_STACK, - WIDGET_TYPE_FLYOUT_BUTTON, - WIDGET_TYPE_DONTCARE, - WIDGET_TYPE_COUNT -} EWidgetType; - // FactoryPolicy is a static class that controls the creation and lookup of UI elements, // such as floaters. // The key parameter is used to provide a unique identifier and/or associated construction @@ -503,7 +405,7 @@ public: class LLUIImage : public LLRefCount { public: - LLUIImage(LLPointer<LLImageGL> image); + LLUIImage(const LLString& name, LLPointer<LLImageGL> image); void setClipRegion(const LLRectf& region); void setScaleRegion(const LLRectf& region); @@ -511,15 +413,29 @@ public: LLPointer<LLImageGL> getImage() { return mImage; } const LLPointer<LLImageGL>& getImage() const { return mImage; } - void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const; void draw(S32 x, S32 y, S32 width, S32 height, const LLColor4& color = UI_VERTEX_COLOR) const; + void draw(S32 x, S32 y, const LLColor4& color = UI_VERTEX_COLOR) const; + void draw(const LLRect& rect, const LLColor4& color = UI_VERTEX_COLOR) const { draw(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } + void drawSolid(S32 x, S32 y, S32 width, S32 height, const LLColor4& color) const; - void drawSolid(S32 x, S32 y, const LLColor4& color) const; + void drawSolid(const LLRect& rect, const LLColor4& color) const { drawSolid(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color); } + void drawSolid(S32 x, S32 y, const LLColor4& color) const { drawSolid(x, y, mImage->getWidth(0), mImage->getHeight(0), color); } + + void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const; + void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); } + void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, mImage->getWidth(0), mImage->getHeight(0), color, border_width); } + + const LLString& getName() const { return mName; } S32 getWidth() const; S32 getHeight() const; + // returns dimensions of underlying textures, which might not be equal to ui image portion + S32 getTextureWidth() const; + S32 getTextureHeight() const; + protected: + LLString mName; LLRectf mScaleRegion; LLRectf mClipRegion; LLPointer<LLImageGL> mImage; @@ -527,6 +443,7 @@ protected: BOOL mNoClip; }; +typedef LLPointer<LLUIImage> LLUIImagePtr; template <typename T> class LLTombStone : public LLRefCount @@ -661,6 +578,7 @@ private: LLRootHandle<T> mHandle; }; + //RN: maybe this needs to moved elsewhere? class LLImageProviderInterface { @@ -668,8 +586,9 @@ public: LLImageProviderInterface() {}; virtual ~LLImageProviderInterface() {}; - virtual LLUIImage* getUIImageByID(const LLUUID& id, BOOL clamped = TRUE) = 0; - virtual LLImageGL* getImageByID(const LLUUID& id, BOOL clamped = TRUE) = 0; + virtual LLUIImagePtr getUIImage(const LLString& name) = 0; + virtual LLUIImagePtr getUIImageByID(const LLUUID& id) = 0; + virtual void cleanUp() = 0; }; #endif diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index ade301a32e..aa44663fd0 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -34,7 +34,9 @@ #include "linden_common.h" #include "lluictrl.h" #include "llfocusmgr.h" +#include "llpanel.h" +static LLRegisterWidget<LLUICtrl> r("ui_ctrl"); LLFocusableElement::LLFocusableElement() : mFocusLostCallback(NULL), @@ -473,7 +475,7 @@ BOOL LLUICtrl::focusPrevItem(BOOL text_fields_only) return focusPrev(result); } -const LLUICtrl* LLUICtrl::findRootMostFocusRoot() const +LLUICtrl* LLUICtrl::findRootMostFocusRoot() const { const LLUICtrl* focus_root = NULL; const LLUICtrl* next_view = this; @@ -485,7 +487,9 @@ const LLUICtrl* LLUICtrl::findRootMostFocusRoot() const } next_view = next_view->getParentUICtrl(); } - return focus_root; + // since focus_root could be this, need to cast away const to return + // a non-const result + return const_cast<LLUICtrl*>(focus_root); } @@ -538,14 +542,22 @@ LLXMLNodePtr LLUICtrl::getXML(bool save_children) const return node; } +//static +LLView* LLUICtrl::fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory) +{ + LLUICtrl* ctrl = new LLUICtrl(); + ctrl->initFromXML(node, parent); + return ctrl; +} + + // *NOTE: If other classes derive from LLPanel, they will need to be // added to this function. LLPanel* LLUICtrl::getParentPanel() const { LLView* parent = getParent(); - while (parent - && parent->getWidgetType() != WIDGET_TYPE_PANEL - && parent->getWidgetType() != WIDGET_TYPE_FLOATER) + LLPanel* parent_panel = dynamic_cast<LLPanel*>(parent); + while (!parent_panel) { parent = parent->getParent(); } diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 81b00d4ec3..6863940ddd 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -141,7 +141,9 @@ public: void setValidateBeforeCommit( BOOL(*cb)(LLUICtrl*, void*) ) { mValidateCallback = cb; } void setLostTopCallback( void (*cb)(LLUICtrl*, void*) ) { mLostTopCallback = cb; } - const LLUICtrl* findRootMostFocusRoot() const; + static LLView* fromXML(LLXMLNodePtr node, LLView* parent, class LLUICtrlFactory* factory); + + LLUICtrl* findRootMostFocusRoot() const; class LLTextInputFilter : public LLQueryFilter, public LLSingleton<LLTextInputFilter> { diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 4acfc69f3a..c75c6714f8 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -71,100 +71,6 @@ const char XML_HEADER[] = "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>\n"; -// *NOTE: If you add a new class derived from LLPanel, add a check for its -// widget type to LLUICtrl::getParentPanel(). -// *NOTE: This MUST match EWidgetType in llui.h -//static -const LLString LLUICtrlFactory::sUICtrlNames[WIDGET_TYPE_COUNT] = -{ - LLString("view"), //WIDGET_TYPE_VIEW - LLString("root_view"), //WIDGET_TYPE_ROOT_VIEW - LLString("floater_view"), //WIDGET_TYPE_FLOATER_VIEW - LLString("button"), //WIDGET_TYPE_BUTTON - LLString("joystick_turn"), //WIDGET_TYPE_JOYSTICK_TURN - LLString("joystick_slide"), //WIDGET_TYPE_JOYSTICK_SLIDE - LLString("check_box"), //WIDGET_TYPE_CHECKBOX - LLString("color_swatch"), //WIDGET_TYPE_COLOR_SWATCH - LLString("combo_box"), //WIDGET_TYPE_COMBO_BOX - LLString("line_editor"), //WIDGET_TYPE_LINE_EDITOR - LLString("search_editor"), //WIDGET_TYPE_SEARCH_EDITOR - LLString("scroll_list"), //WIDGET_TYPE_SCROLL_LIST - LLString("name_list"), //WIDGET_TYPE_NAME_LIST - LLString("web_browser"), //WIDGET_TYPE_WEBBROWSER - LLString("slider"), //WIDGET_TYPE_SLIDER, actually LLSliderCtrl - LLString("slider_bar"), //WIDGET_TYPE_SLIDER_BAR, actually LLSlider - LLString("volume_slider"), //WIDGET_TYPE_VOLUME_SLIDER, actually LLSlider + "volume" param - LLString("multi_slider"), //WIDGET_TYPE_MULTI_SLIDER, actually LLMultiSliderCtrl - LLString("multi_slider_bar"), //WIDGET_TYPE_MULTI_SLIDER_BAR, actually LLMultiSlider - LLString("spinner"), //WIDGET_TYPE_SPINNER, actually LLSpinCtrl - LLString("text_editor"), //WIDGET_TYPE_TEXT_EDITOR - LLString("texture_picker"),//WIDGET_TYPE_TEXTURE_PICKER - LLString("text"), //WIDGET_TYPE_TEXT_BOX - LLString("pad"), //WIDGET_TYPE_PAD - LLString("radio_group"), //WIDGET_TYPE_RADIO_GROUP - LLString("icon"), //WIDGET_TYPE_ICON - LLString("locate"), //WIDGET_TYPE_LOCATE - LLString("view_border"), //WIDGET_TYPE_VIEW_BORDER - LLString("panel"), //WIDGET_TYPE_PANEL - LLString("menu"), //WIDGET_TYPE_MENU - LLString("pie_menu"), //WIDGET_TYPE_PIE_MENU - LLString("pie_menu_branch"), //WIDGET_TYPE_PIE_MENU_BRANCH - LLString("menu_item"), //WIDGET_TYPE_MENU_ITEM - LLString("menu_item_separator"), //WIDGET_TYPE_MENU_ITEM_SEPARATOR - LLString("menu_separator_vertical"), // WIDGET_TYPE_MENU_SEPARATOR_VERTICAL - LLString("menu_item_call"), // WIDGET_TYPE_MENU_ITEM_CALL - LLString("menu_item_check"),// WIDGET_TYPE_MENU_ITEM_CHECK - LLString("menu_item_branch"), // WIDGET_TYPE_MENU_ITEM_BRANCH - LLString("menu_item_branch_down"), //WIDGET_TYPE_MENU_ITEM_BRANCH_DOWN, - LLString("menu_item_blank"), //WIDGET_TYPE_MENU_ITEM_BLANK, - LLString("tearoff_menu"), //WIDGET_TYPE_TEAROFF_MENU - LLString("menu_bar"), //WIDGET_TYPE_MENU_BAR - LLString("tab_container"),//WIDGET_TYPE_TAB_CONTAINER - LLString("scroll_container"),//WIDGET_TYPE_SCROLL_CONTAINER - LLString("scrollbar"), //WIDGET_TYPE_SCROLLBAR - LLString("inventory_panel"), //WIDGET_TYPE_INVENTORY_PANEL - LLString("floater"), //WIDGET_TYPE_FLOATER - LLString("drag_handle_top"), //WIDGET_TYPE_DRAG_HANDLE_TOP - LLString("drag_handle_left"), //WIDGET_TYPE_DRAG_HANDLE_LEFT - LLString("resize_handle"), //WIDGET_TYPE_RESIZE_HANDLE - LLString("resize_bar"), //WIDGET_TYPE_RESIZE_BAR - LLString("name_editor"), //WIDGET_TYPE_NAME_EDITOR - LLString("multi_floater"), //WIDGET_TYPE_MULTI_FLOATER - LLString("media_remote"), //WIDGET_TYPE_MEDIA_REMOTE - LLString("folder_view"), //WIDGET_TYPE_FOLDER_VIEW - LLString("folder_item"), //WIDGET_TYPE_FOLDER_ITEM - LLString("folder"), //WIDGET_TYPE_FOLDER - LLString("stat_graph"), //WIDGET_TYPE_STAT_GRAPH - LLString("stat_view"), //WIDGET_TYPE_STAT_VIEW - LLString("stat_bar"), //WIDGET_TYPE_STAT_BAR - LLString("drop_target"), //WIDGET_TYPE_DROP_TARGET - LLString("texture_bar"), //WIDGET_TYPE_TEXTURE_BAR - LLString("tex_mem_bar"), //WIDGET_TYPE_TEX_MEM_BAR - LLString("snapshot_live_preview"), //WIDGET_TYPE_SNAPSHOT_LIVE_PREVIEW - LLString("status_bar"), //WIDGET_TYPE_STATUS_BAR - LLString("progress_view"), //WIDGET_TYPE_PROGRESS_VIEW - LLString("talk_view"), //WIDGET_TYPE_TALK_VIEW - LLString("overlay_bar"), //WIDGET_TYPE_OVERLAY_BAR - LLString("hud_view"), //WIDGET_TYPE_HUD_VIEW - LLString("hover_view"), //WIDGET_TYPE_HOVER_VIEW - LLString("morph_view"), //WIDGET_TYPE_MORPH_VIEW - LLString("net_map"), //WIDGET_TYPE_NET_MAP - LLString("permissions_view"), //WIDGET_TYPE_PERMISSIONS_VIEW - LLString("menu_holder"), //WIDGET_TYPE_MENU_HOLDER - LLString("debug_view"), //WIDGET_TYPE_DEBUG_VIEW - LLString("scrolling_panel_list"), //WIDGET_TYPE_SCROLLING_PANEL_LIST - LLString("audio_status"), //WIDGET_TYPE_AUDIO_STATUS - LLString("container_view"), //WIDGET_TYPE_CONTAINER_VIEW - LLString("console"), //WIDGET_TYPE_CONSOLE - LLString("fast_timer_view"), //WIDGET_TYPE_FAST_TIMER_VIEW - LLString("velocity_bar"), //WIDGET_TYPE_VELOCITY_BAR - LLString("texture_view"), //WIDGET_TYPE_TEXTURE_VIEW - LLString("memory_view"), //WIDGET_TYPE_MEMORY_VIEW - LLString("frame_stat_view"), //WIDGET_TYPE_FRAME_STAT_VIEW - LLString("layout_stack"), //WIDGET_TYPE_LAYOUT_STACK - LLString("DONT_CARE"), //WIDGET_TYPE_DONTCARE -}; - const S32 HPAD = 4; const S32 VPAD = 4; const S32 FLOATER_H_MARGIN = 15; @@ -179,9 +85,6 @@ public: LLUICtrlLocate() : LLUICtrl("locate", LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } virtual void draw() { } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_LOCATE; } - virtual LLString getWidgetTag() const { return LL_UI_CTRL_LOCATE_TAG; } - static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { LLString name("pad"); @@ -194,39 +97,14 @@ public: } }; +static LLRegisterWidget<LLUICtrlLocate> r1("locate"); +static LLRegisterWidget<LLUICtrlLocate> r2("pad"); + //----------------------------------------------------------------------------- // LLUICtrlFactory() //----------------------------------------------------------------------------- LLUICtrlFactory::LLUICtrlFactory() { - // Register controls - LLUICtrlCreator<LLButton>::registerCreator(LL_BUTTON_TAG, this); - LLUICtrlCreator<LLCheckBoxCtrl>::registerCreator(LL_CHECK_BOX_CTRL_TAG, this); - LLUICtrlCreator<LLComboBox>::registerCreator(LL_COMBO_BOX_TAG, this); - LLUICtrlCreator<LLFlyoutButton>::registerCreator(LL_FLYOUT_BUTTON_TAG, this); - LLUICtrlCreator<LLLineEditor>::registerCreator(LL_LINE_EDITOR_TAG, this); - LLUICtrlCreator<LLSearchEditor>::registerCreator(LL_SEARCH_EDITOR_TAG, this); - LLUICtrlCreator<LLScrollListCtrl>::registerCreator(LL_SCROLL_LIST_CTRL_TAG, this); - LLUICtrlCreator<LLSliderCtrl>::registerCreator(LL_SLIDER_CTRL_TAG, this); - LLUICtrlCreator<LLSlider>::registerCreator(LL_SLIDER_TAG, this); - LLUICtrlCreator<LLSlider>::registerCreator(LL_VOLUME_SLIDER_CTRL_TAG, this); - LLUICtrlCreator<LLMultiSliderCtrl>::registerCreator(LL_MULTI_SLIDER_CTRL_TAG, this); - LLUICtrlCreator<LLMultiSlider>::registerCreator(LL_MULTI_SLIDER_TAG, this); - LLUICtrlCreator<LLSpinCtrl>::registerCreator(LL_SPIN_CTRL_TAG, this); - LLUICtrlCreator<LLTextBox>::registerCreator(LL_TEXT_BOX_TAG, this); - LLUICtrlCreator<LLRadioGroup>::registerCreator(LL_RADIO_GROUP_TAG, this); - LLUICtrlCreator<LLIconCtrl>::registerCreator(LL_ICON_CTRL_TAG, this); - LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_UI_CTRL_LOCATE_TAG, this); - LLUICtrlCreator<LLUICtrlLocate>::registerCreator(LL_PAD_TAG, this); - LLUICtrlCreator<LLViewBorder>::registerCreator(LL_VIEW_BORDER_TAG, this); - LLUICtrlCreator<LLTabContainer>::registerCreator(LL_TAB_CONTAINER_COMMON_TAG, this); - LLUICtrlCreator<LLScrollableContainerView>::registerCreator(LL_SCROLLABLE_CONTAINER_VIEW_TAG, this); - LLUICtrlCreator<LLPanel>::registerCreator(LL_PANEL_TAG, this); - LLUICtrlCreator<LLMenuGL>::registerCreator(LL_MENU_GL_TAG, this); - LLUICtrlCreator<LLMenuBarGL>::registerCreator(LL_MENU_BAR_GL_TAG, this); - LLUICtrlCreator<LLScrollingPanelList>::registerCreator(LL_SCROLLING_PANEL_LIST_TAG, this); - LLUICtrlCreator<LLLayoutStack>::registerCreator(LL_LAYOUT_STACK_TAG, this); - setupPaths(); } @@ -548,43 +426,33 @@ void LLUICtrlFactory::rebuild() //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -// static -EWidgetType LLUICtrlFactory::getWidgetType(const LLString& ctrl_type) -{ - U32 ctrl_id; - for (ctrl_id = 0; ctrl_id < WIDGET_TYPE_COUNT; ctrl_id++) - { - if (sUICtrlNames[ctrl_id] == ctrl_type) - { - break; - } - } - return (EWidgetType) ctrl_id; -} - -LLString LLUICtrlFactory::getWidgetType(EWidgetType ctrl_type) -{ - return sUICtrlNames[ctrl_type]; -} - LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) { + // panel for holding dummy widgets, so they have a parent for layout purposes, etc. + // does not manage lifetime of child widgets + static LLPanel dummy_panel; + LLString ctrl_type = node->getName()->mString; LLString::toLower(ctrl_type); - creator_list_t::const_iterator it = mCreatorFunctions.find(ctrl_type); - if (it == mCreatorFunctions.end()) + LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); + + if (func == NULL) { llwarns << "Unknown control type " << ctrl_type << llendl; return NULL; } - LLView *ctrl = (*it->second)(node, parent, this); + if (parent == NULL) + { + parent = &dummy_panel; + } + LLView *ctrl = func(node, parent, this); return ctrl; } -void LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) +LLView* LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) { LLView* view = createCtrlWidget(parent, node); @@ -595,6 +463,8 @@ void LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node) { parent->addChild(view, tab_group); } + + return view; } //----------------------------------------------------------------------------- @@ -648,138 +518,3 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, return res; } -//============================================================================ - -LLButton* LLUICtrlFactory::getButtonByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLButton>(name); -} - -LLCheckBoxCtrl* LLUICtrlFactory::getCheckBoxByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLCheckBoxCtrl>(name); -} - -LLComboBox* LLUICtrlFactory::getComboBoxByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLComboBox>(name); -} - -LLIconCtrl* LLUICtrlFactory::getIconByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLIconCtrl>(name); -} - -LLLineEditor* LLUICtrlFactory::getLineEditorByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLLineEditor>(name); -} - -LLRadioGroup* LLUICtrlFactory::getRadioGroupByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLRadioGroup>(name); -} - -LLScrollListCtrl* LLUICtrlFactory::getScrollListByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLScrollListCtrl>(name); -} - -LLSliderCtrl* LLUICtrlFactory::getSliderByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLSliderCtrl>(name); -} - -LLSlider* LLUICtrlFactory::getSliderBarByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLSlider>(name); -} - -LLSpinCtrl* LLUICtrlFactory::getSpinnerByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLSpinCtrl>(name); -} - -LLTextBox* LLUICtrlFactory::getTextBoxByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLTextBox>(name); -} - -LLTextEditor* LLUICtrlFactory::getTextEditorByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLTextEditor>(name); -} - -LLTabContainer* LLUICtrlFactory::getTabContainerByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLTabContainer>(name); -} - -LLScrollableContainerView* LLUICtrlFactory::getScrollableContainerByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLScrollableContainerView>(name); -} - -LLPanel* LLUICtrlFactory::getPanelByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLPanel>(name); -} - -LLMenuItemCallGL* LLUICtrlFactory::getMenuItemCallByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLMenuItemCallGL>(name); -} - -LLScrollingPanelList* LLUICtrlFactory::getScrollingPanelList(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLScrollingPanelList>(name); -} - -LLMultiSliderCtrl* LLUICtrlFactory::getMultiSliderByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLMultiSliderCtrl>(name); -} - -LLMultiSlider* LLUICtrlFactory::getMultiSliderBarByName(const LLPanel* panelp, const LLString& name) -{ - return panelp->getChild<LLMultiSlider>(name); -} - - -LLCtrlListInterface* LLUICtrlFactory::getListInterfaceByName(const LLPanel* panelp, const LLString& name) -{ - LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); - if (viewp && viewp->isCtrl()) - { - return ((LLUICtrl*)viewp)->getListInterface(); - } - return NULL; -} - -LLCtrlSelectionInterface* LLUICtrlFactory::getSelectionInterfaceByName(const LLPanel* panelp, const LLString& name) -{ - LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); - if (viewp && viewp->isCtrl()) - { - return ((LLUICtrl*)viewp)->getSelectionInterface(); - } - return NULL; -} - -LLCtrlScrollInterface* LLUICtrlFactory::getScrollInterfaceByName(const LLPanel* panelp, const LLString& name) -{ - LLView* viewp = panelp->getCtrlByNameAndType(name, WIDGET_TYPE_DONTCARE); - if (viewp && viewp->isCtrl()) - { - return ((LLUICtrl*)viewp)->getScrollInterface(); - } - return NULL; -} - -void LLUICtrlFactory::registerCreator(LLString ctrlname, creator_function_t function) -{ - LLString::toLower(ctrlname); - mCreatorFunctions[ctrlname] = function; -} - - diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index c2a6cfe510..651bfa7b88 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -41,7 +41,7 @@ class LLView; class LLPanel; -class LLUICtrlFactory +class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory> { public: LLUICtrlFactory(); @@ -49,7 +49,7 @@ public: virtual ~LLUICtrlFactory() {} void setupPaths(); - + void buildFloater(LLFloater* floaterp, const LLString &filename, const LLCallbackMap::map_t* factory_map = NULL, BOOL open = TRUE); BOOL buildPanel(LLPanel* panelp, const LLString &filename, @@ -65,84 +65,28 @@ public: // Returns 0 on success S32 saveToXML(LLView* viewp, const LLString& filename); - // Rebuilds all currently built panels. void rebuild(); - static EWidgetType getWidgetType(const LLString& ctrl_type); - static LLString getWidgetType(EWidgetType ctrl_type); static BOOL getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color); - // specific typed getters - static class LLButton* getButtonByName( const LLPanel* panelp, const LLString& name); - static class LLCheckBoxCtrl* getCheckBoxByName( const LLPanel* panelp, const LLString& name); - static class LLComboBox* getComboBoxByName( const LLPanel* panelp, const LLString& name); - static class LLIconCtrl* getIconByName( const LLPanel* panelp, const LLString& name); - static class LLLineEditor* getLineEditorByName( const LLPanel* panelp, const LLString& name); - static class LLRadioGroup* getRadioGroupByName( const LLPanel* panelp, const LLString& name); - static class LLScrollListCtrl* getScrollListByName( const LLPanel* panelp, const LLString& name); - static class LLSliderCtrl* getSliderByName( const LLPanel* panelp, const LLString& name); - static class LLSlider* getSliderBarByName( const LLPanel* panelp, const LLString& name); - static class LLSpinCtrl* getSpinnerByName( const LLPanel* panelp, const LLString& name); - static class LLTextBox* getTextBoxByName( const LLPanel* panelp, const LLString& name); - static class LLTextEditor* getTextEditorByName( const LLPanel* panelp, const LLString& name); - static class LLTabContainer* getTabContainerByName( const LLPanel* panelp, const LLString& name); - static class LLScrollableContainerView* getScrollableContainerByName(const LLPanel* panelp, const LLString& name); - static class LLPanel* getPanelByName( const LLPanel* panelp, const LLString& name); - static class LLMenuItemCallGL* getMenuItemCallByName( const LLPanel* panelp, const LLString& name); - static class LLScrollingPanelList* getScrollingPanelList( const LLPanel* panelp, const LLString& name); - static class LLMultiSliderCtrl* getMultiSliderByName( const LLPanel* panelp, const LLString& name); - static class LLMultiSlider* getMultiSliderBarByName(const LLPanel* panelp, const LLString& name); - - // interface getters - static LLCtrlListInterface* getListInterfaceByName( const LLPanel* panelp, const LLString& name); - static LLCtrlSelectionInterface* getSelectionInterfaceByName(const LLPanel* panelp, const LLString& name); - static LLCtrlScrollInterface* getScrollInterfaceByName(const LLPanel* panelp, const LLString& name); - LLPanel* createFactoryPanel(LLString name); virtual LLView* createCtrlWidget(LLPanel *parent, LLXMLNodePtr node); - virtual void createWidget(LLPanel *parent, LLXMLNodePtr node); - - template <class T> T* createDummyWidget(const LLString& name) - { - return NULL; - //static LLPanel dummy_panel; - //LLXMLNodePtr new_node_ptr = new LLXMLNode(T::getWidgetTag(), FALSE); - //return createWidget(&dummy_panel, new_node_ptr); - } - - // Creator library - typedef LLView* (*creator_function_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); - void registerCreator(LLString ctrlname, creator_function_t function); + virtual LLView* createWidget(LLPanel *parent, LLXMLNodePtr node); static bool getLayeredXMLNode(const LLString &filename, LLXMLNodePtr& root); -protected: - - template<class T> - class LLUICtrlCreator - { - public: - static void registerCreator(LLString name, LLUICtrlFactory *factory) - { - factory->registerCreator(name, T::fromXML); - } - }; - private: typedef std::map<LLHandle<LLPanel>, LLString> built_panel_t; built_panel_t mBuiltPanels; + typedef std::map<LLHandle<LLFloater>, LLString> built_floater_t; built_floater_t mBuiltFloaters; std::deque<const LLCallbackMap::map_t*> mFactoryStack; - static const LLString sUICtrlNames[]; - - typedef std::map<LLString, creator_function_t> creator_list_t; - creator_list_t mCreatorFunctions; static std::vector<LLString> mXUIPaths; }; diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 269796e5de..b49ee4338f 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -49,7 +49,16 @@ #include "lluictrl.h" #include "llwindow.h" #include "v3color.h" +#include "lluictrlfactory.h" +// for ui edit hack +#include "llbutton.h" +#include "lllineeditor.h" +#include "lltexteditor.h" +#include "lltextbox.h" + +//HACK: this allows you to instantiate LLView from xml with "<view/>" which we don't want +static LLRegisterWidget<LLView> r("view"); BOOL LLView::sDebugRects = FALSE; BOOL LLView::sDebugKeys = FALSE; @@ -153,6 +162,8 @@ LLView::~LLView() std::for_each(mFloaterControls.begin(), mFloaterControls.end(), DeletePairedPointer()); + std::for_each(mDummyWidgets.begin(), mDummyWidgets.end(), + DeletePairedPointer()); } // virtual @@ -716,7 +727,7 @@ BOOL LLView::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_scre tool_tip = getShowNamesToolTip(); } - BOOL showNamesTextBox = LLUI::sShowXUINames && (getWidgetType() == WIDGET_TYPE_TEXT_BOX); + BOOL showNamesTextBox = LLUI::sShowXUINames && dynamic_cast<LLTextBox*>(this) != NULL; if( !handled && (blockMouseEvent(x, y) || showNamesTextBox) && !tool_tip.empty()) { @@ -741,23 +752,21 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) { BOOL handled = FALSE; - if( called_from_parent ) + if (getVisible() && getEnabled()) { - // Downward traversal - if (getVisible() && getEnabled()) + if( called_from_parent ) { + // Downward traversal handled = childrenHandleKey( key, mask ) != NULL; } - } - // JC: Must pass to disabled views, since they could have - // keyboard focus, which requires the escape key to exit. - if (!handled && getVisible()) - { - handled = handleKeyHere( key, mask, called_from_parent ); - if (handled && LLView::sDebugKeys) + if (!handled) { - llinfos << "Key handled by " << getName() << llendl; + handled = handleKeyHere( key, mask ); + if (handled && LLView::sDebugKeys) + { + llinfos << "Key handled by " << getName() << llendl; + } } } @@ -771,7 +780,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent) // Called from handleKey() // Handles key in this object. Checking parents and children happens in handleKey() -BOOL LLView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLView::handleKeyHere(KEY key, MASK mask) { return FALSE; } @@ -780,25 +789,24 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) { BOOL handled = FALSE; - if( called_from_parent ) + if (getVisible() && getEnabled()) { - // Downward traversal - if (getVisible() && getEnabled()) + if( called_from_parent ) { + // Downward traversal handled = childrenHandleUnicodeChar( uni_char ) != NULL; } - } - if (!handled && getVisible()) - { - handled = handleUnicodeCharHere(uni_char, called_from_parent); - if (handled && LLView::sDebugKeys) + if (!handled) { - llinfos << "Unicode key handled by " << getName() << llendl; + handled = handleUnicodeCharHere(uni_char); + if (handled && LLView::sDebugKeys) + { + llinfos << "Unicode key handled by " << getName() << llendl; + } } } - if (!handled && !called_from_parent && mParentView) { // Upward traversal @@ -809,7 +817,7 @@ BOOL LLView::handleUnicodeChar(llwchar uni_char, BOOL called_from_parent) } -BOOL LLView::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent ) +BOOL LLView::handleUnicodeCharHere(llwchar uni_char ) { return FALSE; } @@ -903,11 +911,14 @@ BOOL LLView::handleMouseDown(S32 x, S32 y, MASK mask) if (sEditingUI && handled_view) { // need to find leaf views, big hack - EWidgetType type = handled_view->getWidgetType(); - if (type == WIDGET_TYPE_BUTTON - || type == WIDGET_TYPE_LINE_EDITOR - || type == WIDGET_TYPE_TEXT_EDITOR - || type == WIDGET_TYPE_TEXT_BOX) + LLButton* buttonp = dynamic_cast<LLButton*>(handled_view); + LLLineEditor* line_editorp = dynamic_cast<LLLineEditor*>(handled_view); + LLTextEditor* text_editorp = dynamic_cast<LLTextEditor*>(handled_view); + LLTextBox* text_boxp = dynamic_cast<LLTextBox*>(handled_view); + if (buttonp + || line_editorp + || text_editorp + || text_boxp) { sEditingUIView = handled_view; } @@ -971,8 +982,10 @@ LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) LLView* viewp = *child_it; S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; - if (viewp->pointInView(local_x, local_y) && - viewp->handleScrollWheel( local_x, local_y, clicks )) + if (viewp->pointInView(local_x, local_y) + && viewp->getVisible() + && viewp->getEnabled() + && viewp->handleScrollWheel( local_x, local_y, clicks )) { if (sDebugMouseHandling) { @@ -1528,7 +1541,7 @@ BOOL LLView::hasAncestor(const LLView* parentp) const BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const { - LLView *child = getChildByName(childname); + LLView *child = getChildView(childname, TRUE, FALSE); if (child) { return gFocusMgr.childHasKeyboardFocus(child); @@ -1543,16 +1556,17 @@ BOOL LLView::childHasKeyboardFocus( const LLString& childname ) const BOOL LLView::hasChild(const LLString& childname, BOOL recurse) const { - return getChildByName(childname, recurse) != NULL; + return getChildView(childname, recurse, FALSE) != NULL; } //----------------------------------------------------------------------------- -// getChildByName() +// getChildView() //----------------------------------------------------------------------------- -LLView* LLView::getChildByName(const LLString& name, BOOL recurse) const +LLView* LLView::getChildView(const LLString& name, BOOL recurse, BOOL create_if_missing) const { - if(name.empty()) - return NULL; + //richard: should we allow empty names? + //if(name.empty()) + // return NULL; child_list_const_iter_t child_it; // Look for direct children *first* for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) @@ -1569,13 +1583,18 @@ LLView* LLView::getChildByName(const LLString& name, BOOL recurse) const for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it) { LLView* childp = *child_it; - LLView* viewp = childp->getChildByName(name, recurse); + LLView* viewp = childp->getChildView(name, recurse, FALSE); if ( viewp ) { return viewp; } } } + + if (create_if_missing) + { + return createDummyWidget<LLView>(name); + } return NULL; } @@ -1692,7 +1711,6 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs if( getRect().mLeft + KEEP_ONSCREEN_PIXELS > constraint.mRight ) { delta_x = constraint.mRight - (getRect().mLeft + KEEP_ONSCREEN_PIXELS); - delta_x += llmax( 0, getRect().getWidth() - constraint.getWidth() ); } if( getRect().mTop > constraint.mTop ) @@ -1703,7 +1721,6 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs if( getRect().mTop - KEEP_ONSCREEN_PIXELS < constraint.mBottom ) { delta_y = constraint.mBottom - (getRect().mTop - KEEP_ONSCREEN_PIXELS); - delta_y -= llmax( 0, getRect().getHeight() - constraint.getHeight() ); } } else @@ -1716,6 +1733,7 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs if( getRect().mRight > constraint.mRight ) { delta_x = constraint.mRight - getRect().mRight; + // compensate for left edge possible going off screen delta_x += llmax( 0, getRect().getWidth() - constraint.getWidth() ); } @@ -1727,6 +1745,7 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs if( getRect().mBottom < constraint.mBottom ) { delta_y = constraint.mBottom - getRect().mBottom; + // compensate for top edge possible going off screen delta_y -= llmax( 0, getRect().getHeight() - constraint.getHeight() ); } } @@ -1832,9 +1851,8 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, LLView* o // virtual LLXMLNodePtr LLView::getXML(bool save_children) const { - const LLString& type_name = getWidgetTag(); - - LLXMLNodePtr node = new LLXMLNode(type_name, FALSE); + //FIXME: need to provide actual derived type tag, probably outside this method + LLXMLNodePtr node = new LLXMLNode("view", FALSE); node->createChild("name", TRUE)->setStringValue(getName()); node->createChild("width", TRUE)->setIntValue(getRect().getWidth()); @@ -1897,6 +1915,14 @@ LLXMLNodePtr LLView::getXML(bool save_children) const return node; } +//static +LLView* LLView::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +{ + LLView* viewp = new LLView(); + viewp->initFromXML(node, parent); + return viewp; +} + // static void LLView::addColorXML(LLXMLNodePtr node, const LLColor4& color, const LLString& xml_name, const LLString& control_name) @@ -2871,3 +2897,41 @@ LLSD LLView::getValue() const { return LLSD(); } + +LLView* LLView::createWidget(LLXMLNodePtr xml_node) const +{ + // forward requests to ui ctrl factory + return LLUICtrlFactory::getInstance()->createCtrlWidget(NULL, xml_node); +} + +// +// LLWidgetClassRegistry +// + +LLWidgetClassRegistry::LLWidgetClassRegistry() +{ +} + +void LLWidgetClassRegistry::registerCtrl(const LLString& tag, LLWidgetClassRegistry::factory_func_t function) +{ + LLString lower_case_tag = tag; + LLString::toLower(lower_case_tag); + + mCreatorFunctions[lower_case_tag] = function; +} + +BOOL LLWidgetClassRegistry::isTagRegistered(const LLString &tag) +{ + return mCreatorFunctions.find(tag) != mCreatorFunctions.end(); +} + +LLWidgetClassRegistry::factory_func_t LLWidgetClassRegistry::getCreatorFunc(const LLString& ctrl_type) +{ + factory_map_t::const_iterator found_it = mCreatorFunctions.find(ctrl_type); + if (found_it == mCreatorFunctions.end()) + { + return NULL; + } + return found_it->second; +} + diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 24a5eb4f89..6c5bcc5470 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -52,7 +52,6 @@ #include "stdenums.h" #include "lluistring.h" - const U32 FOLLOWS_NONE = 0x00; const U32 FOLLOWS_LEFT = 0x01; const U32 FOLLOWS_RIGHT = 0x02; @@ -119,9 +118,7 @@ virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,EDragAndDropTy * virtual void draw(); * -virtual EWidgetType getWidgetType() const = 0; - * -virtual LLString getWidgetTag() const = 0; + * virtual LLXMLNodePtr getXML(bool save_children = true) const; * @@ -131,7 +128,7 @@ virtual void onFocusLost() {} LLUICtrl, LLScrollListCtrl, LLMenuGL, LLLineEditor, LLComboBox virtual void onFocusReceived() {} LLUICtrl, LLTextEditor, LLScrollListVtrl, LLMenuGL, LLLineEditor -virtual LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const; +virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; LLTabContainer, LLPanel, LLMenuGL virtual void setControlName(const LLString& control, LLView *context); LLSliderCtrl, LLCheckBoxCtrl @@ -143,12 +140,71 @@ virtual void setValue(const LLSD& value); * protected: -virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); +virtual BOOL handleKeyHere(KEY key, MASK mask); * -virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); +virtual BOOL handleUnicodeCharHere(llwchar uni_char); * */ +class LLUICtrlFactory; + +// maps xml strings to widget classes +class LLWidgetClassRegistry : public LLSingleton<LLWidgetClassRegistry> +{ + friend class LLSingleton<LLWidgetClassRegistry>; +public: + typedef LLView* (*factory_func_t)(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + typedef std::map<LLString, factory_func_t> factory_map_t; + + void registerCtrl(const LLString& xml_tag, factory_func_t function); + BOOL isTagRegistered(const LLString& xml_tag); + factory_func_t getCreatorFunc(const LLString& xml_tag); + + // get (first) xml tag for a given class + template <class T> std::string getTag() + { + factory_map_t::iterator it; + for(it = mCreatorFunctions.begin(); it != mCreatorFunctions.end(); ++it) + { + if (it->second == T::fromXML) + { + return it->first; + } + } + + return ""; + } + +private: + LLWidgetClassRegistry(); + virtual ~LLWidgetClassRegistry() {}; + + typedef std::set<LLString> ctrl_name_set_t; + ctrl_name_set_t mUICtrlNames; + + // map of xml tags to widget creator functions + factory_map_t mCreatorFunctions; +}; + +template<class T> +class LLRegisterWidget +{ +public: + LLRegisterWidget(const std::string& tag) + { + LLWidgetClassRegistry* registry = LLWidgetClassRegistry::getInstance(); + if (registry->isTagRegistered(tag)) + { + //error! + llerrs << "Widget named " << tag << " already registered!" << llendl; + } + else + { + registry->registerCtrl(tag, T::fromXML); + } + } +}; + class LLView : public LLMouseHandler, public LLMortician { @@ -353,10 +409,9 @@ public: virtual void draw(); - virtual EWidgetType getWidgetType() const = 0; - virtual LLString getWidgetTag() const = 0; virtual LLXMLNodePtr getXML(bool save_children = true) const; - + //FIXME: make LLView non-instantiable from XML + static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); virtual void initFromXML(LLXMLNodePtr node, LLView* parent); void parseFollowsFlags(LLXMLNodePtr node); @@ -420,17 +475,74 @@ public: /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; - template <class T> T* getChild(const LLString& name, BOOL recurse = TRUE) const + template <class T> T* getChild(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const { - T* result = dynamic_cast<T*>(getChildByName(name, TRUE)); - //if (!result) - //{ - // // create dummy widget instance here - // result = gUICtrlFactory->createDummyWidget<T>(name); - //} + LLView* child = getChildView(name, recurse, FALSE); + T* result = dynamic_cast<T*>(child); + if (!result) + { + // did we find *something* with that name? + if (child) + { + llwarns << "Found child named " << name << " but of wrong type" << llendl; + } + if (create_if_missing) + { + // create dummy widget instance here + result = createDummyWidget<T>(name); + } + } return result; } + virtual LLView* getChildView(const LLString& name, BOOL recurse = TRUE, BOOL create_if_missing = TRUE) const; + + template <class T> T* createDummyWidget(const LLString& name) const + { + T* widget = getDummyWidget<T>(name); + if (!widget) + { + // get xml tag name corresponding to requested widget type (e.g. "button") + LLString xml_tag = LLWidgetClassRegistry::getInstance()->getTag<T>(); + if (xml_tag.empty()) + { + llwarns << "No xml tag registered for this class " << llendl; + return NULL; + } + // create dummy xml node (<button name="foo"/>) + LLXMLNodePtr new_node_ptr = new LLXMLNode(xml_tag, FALSE); + new_node_ptr->createChild("name", TRUE)->setStringValue(name); + + widget = dynamic_cast<T*>(createWidget(new_node_ptr)); + if (widget) + { + // need non-const to update private dummy widget cache + llwarns << "Making dummy " << xml_tag << " named " << name << " in " << getName() << llendl; + const_cast<LLView*>(this)->mDummyWidgets.insert(std::make_pair(name, widget)); + } + else + { + // dynamic cast will fail if T::fromXML only registered for base class + llwarns << "Failed to create dummy widget of requested type " << llendl; + return NULL; + } + } + return widget; + } + + template <class T> T* getDummyWidget(const LLString& name) const + { + dummy_widget_map_t::const_iterator found_it = mDummyWidgets.find(name); + if (found_it == mDummyWidgets.end()) + { + return NULL; + } + return dynamic_cast<T*>(found_it->second); + } + + LLView* createWidget(LLXMLNodePtr xml_node) const; + + // statics static U32 createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect = LLRect()); @@ -469,8 +581,8 @@ public: protected: - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); void drawDebugRect(); void drawChild(LLView* childp, S32 x_offset = 0, S32 y_offset = 0, BOOL force_draw = FALSE); @@ -497,7 +609,6 @@ protected: typedef std::map<LLString, LLControlVariable*> control_map_t; control_map_t mFloaterControls; - virtual LLView* getChildByName(const LLString& name, BOOL recurse = FALSE) const; private: LLView* mParentView; child_list_t mChildList; @@ -536,6 +647,10 @@ private: dispatch_list_t mDispatchList; LLString mControlName; + + typedef std::map<LLString, LLView*> dummy_widget_map_t; + dummy_widget_map_t mDummyWidgets; + boost::signals::connection mControlConnection; public: @@ -552,9 +667,6 @@ public: static BOOL sForceReshape; }; - - - class LLCompareByTabOrder { public: @@ -566,4 +678,5 @@ private: LLView::child_tab_order_t mTabOrder; }; + #endif //LL_LLVIEW_H diff --git a/indra/llui/llviewborder.cpp b/indra/llui/llviewborder.cpp index 301efa3872..605b7d84bc 100644 --- a/indra/llui/llviewborder.cpp +++ b/indra/llui/llviewborder.cpp @@ -33,6 +33,8 @@ #include "llglimmediate.h" #include "llfocusmgr.h" +static LLRegisterWidget<LLViewBorder> r("view_border"); + LLViewBorder::LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel, EStyle style, S32 width ) : LLView( name, rect, FALSE ), @@ -66,47 +68,45 @@ void LLViewBorder::setColorsExtended( const LLColor4& shadow_light, const LLColo void LLViewBorder::setTexture( const LLUUID &image_id ) { - mTexture = LLUI::sImageProvider->getImageByID(image_id); + mTexture = LLUI::sImageProvider->getUIImageByID(image_id); } void LLViewBorder::draw() { - if( getVisible() ) + if( STYLE_LINE == mStyle ) { - if( STYLE_LINE == mStyle ) + if( 0 == mBorderWidth ) + { + // no visible border + } + else + if( 1 == mBorderWidth ) + { + drawOnePixelLines(); + } + else + if( 2 == mBorderWidth ) { - if( 0 == mBorderWidth ) - { - // no visible border - } - else - if( 1 == mBorderWidth ) - { - drawOnePixelLines(); - } - else - if( 2 == mBorderWidth ) - { - drawTwoPixelLines(); - } - else - { - llassert( FALSE ); // not implemented - } + drawTwoPixelLines(); } else - if( STYLE_TEXTURE == mStyle ) { - if( mTexture ) - { - drawTextures(); - } + llassert( FALSE ); // not implemented } + } + else + if( STYLE_TEXTURE == mStyle ) + { + if( mTexture ) + { + drawTextures(); + } + } + + // draw the children + LLView::draw(); - // draw the children - LLView::draw(); - } } void LLViewBorder::drawOnePixelLines() @@ -134,11 +134,10 @@ void LLViewBorder::drawOnePixelLines() if( mHasKeyboardFocus ) { - F32 lerp_amt = gFocusMgr.getFocusFlashAmt(); top_color = gFocusMgr.getFocusColor(); bottom_color = top_color; - LLUI::setLineWidth(lerp(1.f, 3.f, lerp_amt)); + LLUI::setLineWidth(lerp(1.f, 3.f, gFocusMgr.getFocusFlashAmt())); } S32 left = 0; @@ -225,20 +224,20 @@ void LLViewBorder::drawTwoPixelLines() void LLViewBorder::drawTextures() { - LLGLSUIDefault gls_ui; + //LLGLSUIDefault gls_ui; - llassert( FALSE ); // TODO: finish implementing + //llassert( FALSE ); // TODO: finish implementing - gGL.color4fv(UI_VERTEX_COLOR.mV); + //gGL.color4fv(UI_VERTEX_COLOR.mV); - mTexture->bind(); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); + //mTexture->bind(); + //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); + //glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); - drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); - drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); - drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); - drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); + //drawTextureTrapezoid( 0.f, mBorderWidth, getRect().getWidth(), 0, 0 ); + //drawTextureTrapezoid( 90.f, mBorderWidth, getRect().getHeight(), (F32)getRect().getWidth(),0 ); + //drawTextureTrapezoid( 180.f, mBorderWidth, getRect().getWidth(), (F32)getRect().getWidth(),(F32)getRect().getHeight() ); + //drawTextureTrapezoid( 270.f, mBorderWidth, getRect().getHeight(), 0, (F32)getRect().getHeight() ); } diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h index d35663c857..3353103e96 100644 --- a/indra/llui/llviewborder.h +++ b/indra/llui/llviewborder.h @@ -44,8 +44,6 @@ public: LLViewBorder( const LLString& name, const LLRect& rect, EBevel bevel = BEVEL_OUT, EStyle style = STYLE_LINE, S32 width = 1 ); virtual void setValue(const LLSD& val) { setRect(LLRect(val)); } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_VIEW_BORDER; } - virtual LLString getWidgetTag() const { return LL_VIEW_BORDER_TAG; } virtual BOOL isCtrl() const { return FALSE; } @@ -85,7 +83,7 @@ private: LLColor4 mShadowDark; LLColor4 mBackgroundColor; S32 mBorderWidth; - LLPointer<LLImageGL> mTexture; + LLUIImagePtr mTexture; BOOL mHasKeyboardFocus; }; diff --git a/indra/llui/llviewquery.cpp b/indra/llui/llviewquery.cpp index dedc9a6ebb..1e33c2e34c 100644 --- a/indra/llui/llviewquery.cpp +++ b/indra/llui/llviewquery.cpp @@ -66,11 +66,6 @@ filterResult_t LLCtrlFilter::operator() (const LLView* const view, const viewLis return filterResult_t(view->isCtrl(),TRUE); } -filterResult_t LLWidgetTypeFilter::operator() (const LLView* const view, const viewList_t & children) const -{ - return filterResult_t(view->getWidgetType() == mType, TRUE); -} - // // LLViewQuery // diff --git a/indra/llui/llviewquery.h b/indra/llui/llviewquery.h index 59ef1c1896..d9127e310d 100644 --- a/indra/llui/llviewquery.h +++ b/indra/llui/llviewquery.h @@ -87,14 +87,14 @@ class LLCtrlFilter : public LLQueryFilter, public LLSingleton<LLCtrlFilter> /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; }; +template <class T> class LLWidgetTypeFilter : public LLQueryFilter { -public: - LLWidgetTypeFilter(EWidgetType type) : mType(type) {}; -private: - /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const; + /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const + { + return filterResult_t(dynamic_cast<const T*>(view) != NULL, TRUE); + } - EWidgetType mType; }; // Algorithm for flattening diff --git a/indra/llwindow/llpreeditor.h b/indra/llwindow/llpreeditor.h index 388e3dd2ca..466574088e 100644 --- a/indra/llwindow/llpreeditor.h +++ b/indra/llwindow/llpreeditor.h @@ -100,7 +100,7 @@ public: // This is a back door of the method of same name of LLWindowCallback. // called_from_parent should be set to FALSE if calling through LLPreeditor. - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) = 0; + virtual BOOL handleUnicodeCharHere(llwchar uni_char) = 0; }; #endif diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index aa4c2c86f7..ad8a284930 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -2053,7 +2053,7 @@ OSStatus LLWindowMacOSX::eventHandler (EventHandlerCallRef myHandler, EventRef e { for (LLWString::const_iterator i = fix_string.begin(); i != fix_string.end(); i++) { - mPreeditor->handleUnicodeCharHere(*i, FALSE); + mPreeditor->handleUnicodeCharHere(*i); } } diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index bcbd2d9cc3..5239da1712 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3547,7 +3547,7 @@ void LLWindowWin32::handleCompositionMessage(const U32 indexes) { for (LLWString::const_iterator i = result_string.begin(); i != result_string.end(); i++) { - mPreeditor->handleUnicodeCharHere(*i, FALSE); + mPreeditor->handleUnicodeCharHere(*i); } } diff --git a/indra/newview/app_settings/grass.xml b/indra/newview/app_settings/grass.xml index 7cc29fa771..4fc3b798af 100644 --- a/indra/newview/app_settings/grass.xml +++ b/indra/newview/app_settings/grass.xml @@ -3,35 +3,35 @@ <grass name="Grass 0" species_id="0" - texture_name="grass_texture_2.tga" + texture_id="6c4727b8-ac79-ba44-3b81-f9aa887b47eb" blade_size_x="1.35" blade_size_y="1.35" /> <grass name="Grass 1" species_id="1" - texture_name="grass_texture_1.tga" + texture_id="79504bf5-c3ec-0763-6563-d843de66d0a1" blade_size_x="1.0" blade_size_y="0.66" /> <grass name="Grass 2" species_id="2" - texture_name="grass_texture_2.tga" + texture_id="6c4727b8-ac79-ba44-3b81-f9aa887b47eb" blade_size_x="1.8" blade_size_y="1.8" /> <grass name="Grass 3" species_id="3" - texture_name="grass_texture_3.tga" + texture_id="99bd60a2-3250-efc9-2e39-2fbcadefbecc" blade_size_x="1.0" blade_size_y="1.0" /> <grass name="Grass 4" species_id="4" - texture_name="grass_texture_4.tga" + texture_id="7a2b3a4a-53c2-53ac-5716-aac7d743c020" blade_size_x="2.25" blade_size_y="2.25" /> @@ -44,4 +44,4 @@ /> -</grass_defs> +</grass_defs>
\ No newline at end of file diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 40e9b01b45..7e687a5e64 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -38,6 +38,22 @@ <real>1</real> </array> </map> + <key>IMChatColor</key> + <map> + <key>Comment</key> + <string>Color of instant messages from other residents</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Color4</string> + <key>Value</key> + <array> + <real>1</real> + <real>1</real> + <real>1</real> + <real>1</real> + </array> + </map> <key>AllowIdleAFK</key> <map> <key>Comment</key> @@ -8992,6 +9008,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>WarnFirstMedia</key> + <map> + <key>Comment</key> + <string>Enables FirstMedia warning dialog</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>WarnFirstAttach</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/std_bump.ini b/indra/newview/app_settings/std_bump.ini index 9509c357ff..f34e21ce32 100644 --- a/indra/newview/app_settings/std_bump.ini +++ b/indra/newview/app_settings/std_bump.ini @@ -1,18 +1,18 @@ LLStandardBumpmap version 1 -woodgrain bump_woodgrain.tga -bark bump_bark.tga -bricks bump_bricks.tga -checker bump_checker.tga -concrete bump_concrete.tga -crustytile bump_crustytile.tga -cutstone bump_cutstone.tga -discs bump_discs.tga -gravel bump_gravel.tga -petridish bump_petridish.tga -siding bump_siding.tga -stonetile bump_stonetile.tga -stucco bump_stucco.tga -suction bump_suction.tga -weave bump_weave.tga +woodgrain 058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c +bark 6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c +bricks b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c +checker 9deab416-9c63-78d6-d558-9a156f12044c.j2c +concrete db9d39ec-a896-c287-1ced-64566217021e.j2c +crustytile f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c +cutstone d9258671-868f-7511-c321-7baef9e948a4.j2c +discs d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c +gravel 4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c +petridish e569711a-27c2-aad4-9246-0c910239a179.j2c +siding 073c9723-540c-5449-cdd4-0e87fdc159e3.j2c +stonetile ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c +stucco 92e66e00-f56f-598a-7997-048aa64cde18.j2c +suction 83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c +weave 735198cf-6ea0-2550-e222-21d3c6a341ae.j2c diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 4dab653d19..a9d4e8a2f6 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -96,7 +96,6 @@ #include "llstatusbar.h" #include "llimview.h" #include "lltool.h" -#include "lltoolcomp.h" // for gToolGun #include "lltoolfocus.h" #include "lltoolgrab.h" #include "lltoolmgr.h" @@ -432,14 +431,14 @@ void LLAgent::init() { mDrawDistance = gSavedSettings.getF32("RenderFarClip"); - gCamera = new LLViewerCamera(); + // *Note: this is where LLViewerCamera::getInstance() used to be constructed. - gCamera->setView(DEFAULT_FIELD_OF_VIEW); + LLViewerCamera::getInstance()->setView(DEFAULT_FIELD_OF_VIEW); // Leave at 0.1 meters until we have real near clip management - gCamera->setNear(0.1f); - gCamera->setFar(mDrawDistance); // if you want to change camera settings, do so in camera.h - gCamera->setAspect( gViewerWindow->getDisplayAspectRatio() ); // default, overridden in LLViewerWindow::reshape - gCamera->setViewHeightInPixels(768); // default, overridden in LLViewerWindow::reshape + LLViewerCamera::getInstance()->setNear(0.1f); + LLViewerCamera::getInstance()->setFar(mDrawDistance); // if you want to change camera settings, do so in camera.h + LLViewerCamera::getInstance()->setAspect( gViewerWindow->getDisplayAspectRatio() ); // default, overridden in LLViewerWindow::reshape + LLViewerCamera::getInstance()->setViewHeightInPixels(768); // default, overridden in LLViewerWindow::reshape setFlying( gSavedSettings.getBOOL("FlyingAtExit") ); @@ -483,8 +482,7 @@ LLAgent::~LLAgent() delete [] mActiveCacheQueries; mActiveCacheQueries = NULL; - delete gCamera; - gCamera = NULL; + // *Note: this is where LLViewerCamera::getInstance() used to be deleted. } // Change camera back to third person, stop the autopilot, @@ -501,16 +499,16 @@ void LLAgent::resetView(BOOL reset_camera) if (!gNoRender) { - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); // By popular request, keep land selection while walking around. JC - // gParcelMgr->deselectLand(); + // LLViewerParcelMgr::getInstance()->deselectLand(); // force deselect when walking and attachment is selected // this is so people don't wig out when their avatar moves without animating - if (gSelectMgr->getSelection()->isAttachment()) + if (LLSelectMgr::getInstance()->getSelection()->isAttachment()) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } // Hide all popup menus @@ -547,7 +545,7 @@ void LLAgent::onAppFocusGained() if (CAMERA_MODE_MOUSELOOK == mCameraMode) { changeCameraToDefault(); - gToolMgr->clearSavedTool(); + LLToolMgr::getInstance()->clearSavedTool(); } } @@ -732,12 +730,10 @@ BOOL LLAgent::canFly() { if (isGodlike()) return TRUE; - if (!gParcelMgr) return FALSE; - LLViewerRegion* regionp = getRegion(); if (regionp && regionp->getBlockFly()) return FALSE; - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!parcel) return FALSE; // Allow owners to fly on their own land. @@ -772,20 +768,17 @@ void LLAgent::setFlying(BOOL fly) if (fly) { BOOL was_flying = getFlying(); - if (gParcelMgr) + if (!canFly() && !was_flying) { - if (!canFly() && !was_flying) - { - // parcel doesn't let you start fly - // gods can always fly - // and it's OK if you're already flying - make_ui_sound("UISndBadKeystroke"); - return; - } + // parcel doesn't let you start fly + // gods can always fly + // and it's OK if you're already flying + make_ui_sound("UISndBadKeystroke"); + return; } if( !was_flying ) { - gViewerStats->incStat(LLViewerStats::ST_FLY_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_FLY_COUNT); } setControlFlags(AGENT_CONTROL_FLY); gSavedSettings.setBOOL("FlyBtnState", TRUE); @@ -839,12 +832,12 @@ void LLAgent::setRegion(LLViewerRegion *regionp) delta.setVec(regionp->getOriginGlobal() - mRegionp->getOriginGlobal()); setPositionAgent(getPositionAgent() - delta); - LLVector3 camera_position_agent = gCamera->getOrigin(); - - gCamera->setOrigin(camera_position_agent - delta); + + LLVector3 camera_position_agent = LLViewerCamera::getInstance()->getOrigin(); + LLViewerCamera::getInstance()->setOrigin(camera_position_agent - delta); // Update all of the regions. - gWorldPointer->updateAgentOffset(agent_offset_global); + LLWorld::getInstance()->updateAgentOffset(agent_offset_global); // Hack to keep sky in the agent's region, otherwise it may get deleted - DJS 08/02/02 // *TODO: possibly refactor into gSky->setAgentRegion(regionp)? -Brad @@ -868,18 +861,18 @@ void LLAgent::setRegion(LLViewerRegion *regionp) delta.setVec(regionp->getOriginGlobal()); setPositionAgent(getPositionAgent() - delta); - LLVector3 camera_position_agent = gCamera->getOrigin(); - gCamera->setOrigin(camera_position_agent - delta); + LLVector3 camera_position_agent = LLViewerCamera::getInstance()->getOrigin(); + LLViewerCamera::getInstance()->setOrigin(camera_position_agent - delta); // Update all of the regions. - gWorldPointer->updateAgentOffset(mAgentOriginGlobal); + LLWorld::getInstance()->updateAgentOffset(mAgentOriginGlobal); } } mRegionp = regionp; // Must shift hole-covering water object locations because local // coordinate frame changed. - gWorldPointer->updateWaterObjects(); + LLWorld::getInstance()->updateWaterObjects(); // keep a list of regions we've been too // this is just an interesting stat, logged at the dataserver @@ -887,7 +880,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp) U64 handle = regionp->getHandle(); mRegionsVisited.insert(handle); - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); } @@ -1301,7 +1294,7 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) LLVector3 obj_pos = is_avatar ? ((LLVOAvatar*)object)->mPelvisp->getWorldPosition() : object->getRenderPosition(); LLQuaternion inv_obj_rot = ~obj_rot; - LLVector3 obj_dir_abs = obj_pos - gCamera->getOrigin(); + LLVector3 obj_dir_abs = obj_pos - LLViewerCamera::getInstance()->getOrigin(); obj_dir_abs.rotVec(inv_obj_rot); obj_dir_abs.normVec(); obj_dir_abs.abs(); @@ -1335,7 +1328,7 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) gViewerWindow->mousePointOnPlaneGlobal(focus_pt_global, x, y, gAgent.getPosGlobalFromAgent(obj_pos), normal); LLVector3 focus_pt = gAgent.getPosAgentFromGlobal(focus_pt_global); // find vector from camera to focus point in object coordinates - LLVector3 camera_focus_vec = focus_pt - gCamera->getOrigin(); + LLVector3 camera_focus_vec = focus_pt - LLViewerCamera::getInstance()->getOrigin(); // convert to object-local space camera_focus_vec.rotVec(inv_obj_rot); @@ -1395,7 +1388,6 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) if (!is_avatar) { //unproject relative clicked coordinate from window coordinate using GL - GLint viewport[4]; GLdouble modelview[16]; GLdouble projection[16]; @@ -1403,14 +1395,14 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) GLdouble posX, posY, posZ; // convert our matrices to something that has a multiply that works - glh::matrix4f newModel((F32*)gCamera->getModelview().mMatrix); + glh::matrix4f newModel((F32*)LLViewerCamera::getInstance()->getModelview().mMatrix); glh::matrix4f tmpObjMat((F32*)obj_matrix.mMatrix); newModel *= tmpObjMat; for(U32 i = 0; i < 16; ++i) { modelview[i] = newModel.m[i]; - projection[i] = gCamera->getProjection().mMatrix[i/4][i%4]; + projection[i] = LLViewerCamera::getInstance()->getProjection().mMatrix[i/4][i%4]; } glGetIntegerv( GL_VIEWPORT, viewport ); @@ -1429,8 +1421,8 @@ LLVector3d LLAgent::calcFocusOffset(LLViewerObject *object, S32 x, S32 y) //now that we have the object relative position, we should bias toward the center of the object //based on the distance of the camera to the focus point vs. the distance of the camera to the focus - F32 relDist = llabs(obj_rel * gCamera->getAtAxis()); - F32 viewDist = dist_vec(obj_center + obj_rel, gCamera->getOrigin()); + F32 relDist = llabs(obj_rel * LLViewerCamera::getInstance()->getAtAxis()); + F32 viewDist = dist_vec(obj_center + obj_rel, LLViewerCamera::getInstance()->getOrigin()); LLBBox obj_bbox = object->getBoundingBoxAgent(); @@ -1632,7 +1624,7 @@ BOOL LLAgent::calcCameraMinDistance(F32 &obj_min_distance) // clamp obj distance to diagonal of 10 by 10 cube obj_min_distance = llmin(obj_min_distance, 10.f * F_SQRT3); - obj_min_distance += gCamera->getNear() + (soft_limit ? 0.1f : 0.2f); + obj_min_distance += LLViewerCamera::getInstance()->getNear() + (soft_limit ? 0.1f : 0.2f); return TRUE; } @@ -1641,7 +1633,7 @@ F32 LLAgent::getCameraZoomFraction() { // 0.f -> camera zoomed all the way out // 1.f -> camera zoomed all the way in - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // already [0,1] @@ -1660,9 +1652,9 @@ F32 LLAgent::getCameraZoomFraction() { F32 min_zoom; const F32 DIST_FUDGE = 16.f; // meters - F32 max_zoom = gWorldPointer ? llmin(mDrawDistance - DIST_FUDGE, - gWorldPointer->getRegionWidthInMeters() - DIST_FUDGE, - MAX_CAMERA_DISTANCE_FROM_AGENT) : MAX_CAMERA_DISTANCE_FROM_AGENT; + F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, + MAX_CAMERA_DISTANCE_FROM_AGENT); F32 distance = (F32)mCameraFocusOffsetTarget.magVec(); if (mFocusObject.notNull()) @@ -1689,7 +1681,7 @@ void LLAgent::setCameraZoomFraction(F32 fraction) { // 0.f -> camera zoomed all the way out // 1.f -> camera zoomed all the way in - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { @@ -1710,7 +1702,7 @@ void LLAgent::setCameraZoomFraction(F32 fraction) F32 min_zoom = LAND_MIN_ZOOM; const F32 DIST_FUDGE = 16.f; // meters F32 max_zoom = llmin(mDrawDistance - DIST_FUDGE, - gWorldPointer->getRegionWidthInMeters() - DIST_FUDGE, + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE, MAX_CAMERA_DISTANCE_FROM_AGENT); if (mFocusObject.notNull()) @@ -1741,7 +1733,7 @@ void LLAgent::setCameraZoomFraction(F32 fraction) //----------------------------------------------------------------------------- void LLAgent::cameraOrbitAround(const F32 radians) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // do nothing for hud selection @@ -1764,7 +1756,7 @@ void LLAgent::cameraOrbitAround(const F32 radians) //----------------------------------------------------------------------------- void LLAgent::cameraOrbitOver(const F32 angle) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // do nothing for hud selection @@ -1781,7 +1773,7 @@ void LLAgent::cameraOrbitOver(const F32 angle) F32 angle_from_up = acos( camera_offset_unit * getReferenceUpVector() ); LLVector3d left_axis; - left_axis.setVec(gCamera->getLeftAxis()); + left_axis.setVec(LLViewerCamera::getInstance()->getLeftAxis()); F32 new_angle = llclamp(angle_from_up - angle, 1.f * DEG_TO_RAD, 179.f * DEG_TO_RAD); mCameraFocusOffsetTarget.rotVec(angle_from_up - new_angle, left_axis); @@ -1799,7 +1791,7 @@ void LLAgent::cameraZoomIn(const F32 fraction) return; } - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getObjectCount() && selection->getSelectType() == SELECT_TYPE_HUD) { // just update hud zoom level @@ -1834,7 +1826,7 @@ void LLAgent::cameraZoomIn(const F32 fraction) // Don't zoom too far back const F32 DIST_FUDGE = 16.f; // meters F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - gWorldPointer->getRegionWidthInMeters() - DIST_FUDGE ); + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); if (new_distance > max_distance) { @@ -1902,7 +1894,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) // Don't zoom too far back const F32 DIST_FUDGE = 16.f; // meters F32 max_distance = llmin(mDrawDistance - DIST_FUDGE, - gWorldPointer->getRegionWidthInMeters() - DIST_FUDGE ); + LLWorld::getInstance()->getRegionWidthInMeters() - DIST_FUDGE ); if (new_distance > max_distance) { @@ -1931,7 +1923,7 @@ void LLAgent::cameraOrbitIn(const F32 meters) void LLAgent::cameraPanIn(F32 meters) { LLVector3d at_axis; - at_axis.setVec(gCamera->getAtAxis()); + at_axis.setVec(LLViewerCamera::getInstance()->getAtAxis()); mFocusTargetGlobal += meters * at_axis; mFocusGlobal = mFocusTargetGlobal; @@ -1945,7 +1937,7 @@ void LLAgent::cameraPanIn(F32 meters) void LLAgent::cameraPanLeft(F32 meters) { LLVector3d left_axis; - left_axis.setVec(gCamera->getLeftAxis()); + left_axis.setVec(LLViewerCamera::getInstance()->getLeftAxis()); mFocusTargetGlobal += meters * left_axis; mFocusGlobal = mFocusTargetGlobal; @@ -1959,7 +1951,7 @@ void LLAgent::cameraPanLeft(F32 meters) void LLAgent::cameraPanUp(F32 meters) { LLVector3d up_axis; - up_axis.setVec(gCamera->getUpAxis()); + up_axis.setVec(LLViewerCamera::getInstance()->getUpAxis()); mFocusTargetGlobal += meters * up_axis; mFocusGlobal = mFocusTargetGlobal; @@ -2134,10 +2126,7 @@ void LLAgent::setBusy() //*TODO:Translate gBusyMenu->setLabel(LLString("Set Not Busy")); } - if (gFloaterMute) - { - gFloaterMute->updateButtons(); - } + LLFloaterMute::getInstance()->updateButtons(); } //----------------------------------------------------------------------------- @@ -2152,10 +2141,7 @@ void LLAgent::clearBusy() //*TODO:Translate gBusyMenu->setLabel(LLString("Set Busy")); } - if (gFloaterMute) - { - gFloaterMute->updateButtons(); - } + LLFloaterMute::getInstance()->updateButtons(); } //----------------------------------------------------------------------------- @@ -2172,7 +2158,7 @@ BOOL LLAgent::getBusy() const //----------------------------------------------------------------------------- void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::string& behavior_name, const LLQuaternion *target_rotation, void (*finish_callback)(BOOL, void *), void *callback_data, F32 stop_distance, F32 rot_threshold) { - if (!gAgent.getAvatarObject() || !gWorldPointer) + if (!gAgent.getAvatarObject()) { return; } @@ -2192,7 +2178,7 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s LLVector3d intersection; LLVector3 normal; LLViewerObject *hit_obj; - F32 heightDelta = gWorldPointer->resolveStepHeightGlobal(NULL, target_global, trace_target, intersection, normal, &hit_obj); + F32 heightDelta = LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, trace_target, intersection, normal, &hit_obj); if (stop_distance > 0.f) { @@ -2232,7 +2218,7 @@ void LLAgent::startAutoPilotGlobal(const LLVector3d &target_global, const std::s LLVector3 groundNorm; LLViewerObject *obj; - gWorldPointer->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj); + LLWorld::getInstance()->resolveStepHeightGlobal(NULL, target_global, traceEndPt, targetOnGround, groundNorm, &obj); F64 target_height = llmax((F64)gAgent.getAvatarObject()->getPelvisToFoot(), target_global.mdV[VZ] - targetOnGround.mdV[VZ]); // clamp z value of target to minimum height above ground @@ -2588,7 +2574,7 @@ void LLAgent::updateLookAt(const S32 mouse_x, const S32 mouse_y) // Move head based on cursor position ELookAtType lookAtType = LOOKAT_TARGET_NONE; LLVector3 headLookAxis; - LLCoordFrame frameCamera = *((LLCoordFrame*)gCamera); + LLCoordFrame frameCamera = *((LLCoordFrame*)LLViewerCamera::getInstance()); F32 x_from_center = ((F32) mouse_x / (F32) gViewerWindow->getWindowWidth() ) - 0.5f; F32 y_from_center = ((F32) mouse_y / (F32) gViewerWindow->getWindowHeight() ) - 0.5f; @@ -2644,11 +2630,11 @@ void LLAgent::setAvatarObject(LLVOAvatar *avatar) if (!mLookAt) { - mLookAt = (LLHUDEffectLookAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); + mLookAt = (LLHUDEffectLookAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); } if (!mPointAt) { - mPointAt = (LLHUDEffectPointAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); + mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); } if (!mLookAt.isNull()) @@ -2749,7 +2735,7 @@ void LLAgent::clearRenderState(U8 clearstate) //----------------------------------------------------------------------------- U8 LLAgent::getRenderState() { - if (gNoRender || gToolMgr == NULL || gSelectMgr == NULL || gKeyboard == NULL) + if (gNoRender || gKeyboard == NULL) { return 0; } @@ -2761,8 +2747,8 @@ U8 LLAgent::getRenderState() stopTyping(); } - if ((!gSelectMgr->getSelection()->isEmpty() && gSelectMgr->shouldShowSelection()) - || gToolMgr->getCurrentTool()->isEditing() ) + if ((!LLSelectMgr::getInstance()->getSelection()->isEmpty() && LLSelectMgr::getInstance()->shouldShowSelection()) + || LLToolMgr::getInstance()->getCurrentTool()->isEditing() ) { setRenderState(AGENT_STATE_EDITING); } @@ -2804,7 +2790,7 @@ void LLAgent::endAnimationUpdateUI() gMenuBarView->setVisible(TRUE); gStatusBar->setVisibleForMouselook(true); - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); // Only pop if we have pushed... if (TRUE == mViewsPushed) @@ -2852,7 +2838,7 @@ void LLAgent::endAnimationUpdateUI() { // make sure we ask to save changes - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); // HACK: If we're quitting, and we were in customize avatar, don't // let the mini-map go visible again. JC @@ -2895,7 +2881,7 @@ void LLAgent::endAnimationUpdateUI() // JC - Added for always chat in third person option gFocusMgr.setKeyboardFocus(NULL); - gToolMgr->setCurrentToolset(gMouselookToolset); + LLToolMgr::getInstance()->setCurrentToolset(gMouselookToolset); mViewsPushed = TRUE; @@ -2937,7 +2923,7 @@ void LLAgent::endAnimationUpdateUI() } if (mAvatarObject->getParent()) { - LLVector3 at_axis = gCamera->getAtAxis(); + LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); LLViewerObject* root_object = (LLViewerObject*)mAvatarObject->getRoot(); if (root_object->flagCameraDecoupled()) { @@ -2953,7 +2939,7 @@ void LLAgent::endAnimationUpdateUI() } else if (mCameraMode == CAMERA_MODE_CUSTOMIZE_AVATAR) { - gToolMgr->setCurrentToolset(gFaceEditToolset); + LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); gFloaterMap->pushVisible(FALSE); /* @@ -3076,7 +3062,7 @@ void LLAgent::updateCamera() { F32 input_rate = mOrbitInKey - mOrbitOutKey; - LLVector3d to_focus = gAgent.getPosGlobalFromAgent(gCamera->getOrigin()) - calcFocusPositionTargetGlobal(); + LLVector3d to_focus = gAgent.getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()) - calcFocusPositionTargetGlobal(); F32 distance_to_focus = (F32)to_focus.magVec(); // Move at distance (in meters) meters per second cameraOrbitIn( input_rate * distance_to_focus / gFPSClamped ); @@ -3278,15 +3264,15 @@ void LLAgent::updateCamera() // Move the camera //Ventrella - gCamera->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); - //gCamera->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); + LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent); + //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent); //end Ventrella //RN: translate UI offset after camera is oriented properly - gCamera->translate(gCamera->getLeftAxis() * ui_offset); + LLViewerCamera::getInstance()->translate(LLViewerCamera::getInstance()->getLeftAxis() * ui_offset); // Change FOV - gCamera->setView(gCamera->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); + LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor)); // follow camera when in customize mode if (cameraCustomizeAvatar()) @@ -3298,11 +3284,11 @@ void LLAgent::updateCamera() if(gVoiceClient && getRegion()) { LLMatrix3 rot; - rot.setRows(gCamera->getAtAxis(), gCamera->getLeftAxis (), gCamera->getUpAxis()); + rot.setRows(LLViewerCamera::getInstance()->getAtAxis(), LLViewerCamera::getInstance()->getLeftAxis (), LLViewerCamera::getInstance()->getUpAxis()); // MBW -- XXX -- Setting velocity to 0 for now. May figure it out later... gVoiceClient->setCameraPosition( - getRegion()->getPosGlobalFromRegion(gCamera->getOrigin()),// position + getRegion()->getPosGlobalFromRegion(LLViewerCamera::getInstance()->getOrigin()),// position LLVector3::zero, // velocity rot); // rotation matrix } @@ -3404,7 +3390,7 @@ F32 LLAgent::calcCustomizeAvatarUIOffset( const LLVector3d& camera_pos_global ) // Move the camera so that the avatar isn't covered up by this floater. F32 fraction_of_fov = 0.5f - (0.5f * (1.f - llmin(1.f, ((F32)rect.getWidth() / (F32)gViewerWindow->getWindowWidth())))); - F32 apparent_angle = fraction_of_fov * gCamera->getView() * gCamera->getAspect(); // radians + F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); // radians F32 offset = tan(apparent_angle); if( rect.mLeft < (gViewerWindow->getWindowWidth() - rect.mRight) ) @@ -3544,7 +3530,7 @@ void LLAgent::setupSitCamera() //----------------------------------------------------------------------------- const LLVector3 &LLAgent::getCameraPositionAgent() const { - return gCamera->getOrigin(); + return LLViewerCamera::getInstance()->getOrigin(); } //----------------------------------------------------------------------------- @@ -3552,14 +3538,7 @@ const LLVector3 &LLAgent::getCameraPositionAgent() const //----------------------------------------------------------------------------- LLVector3d LLAgent::getCameraPositionGlobal() const { - if (gCamera) - { - return getPosGlobalFromAgent(gCamera->getOrigin()); - } - else - { - return (LLVector3d::zero); - } + return getPosGlobalFromAgent(LLViewerCamera::getInstance()->getOrigin()); } //----------------------------------------------------------------------------- @@ -3809,7 +3788,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (!gSavedSettings.getBOOL("DisableCameraConstraints") && !gAgent.isGodlike()) { - LLViewerRegion* regionp = gWorldPointer->getRegionFromPosGlobal( + LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal( camera_position_global); bool constrain = true; if(regionp && regionp->canManageEstate()) @@ -3834,7 +3813,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) } // JC - Could constrain camera based on parcel stuff here. -// LLViewerRegion *regionp = gWorldPointer->getRegionFromPosGlobal(camera_position_global); +// LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(camera_position_global); // // if (regionp && !regionp->mParcelOverlay->isBuildCameraAllowed(regionp->getPosRegionFromGlobal(camera_position_global))) // { @@ -3847,14 +3826,7 @@ LLVector3d LLAgent::calcCameraPositionTargetGlobal(BOOL *hit_limit) // Don't let camera go underground F32 camera_min_off_ground = getCameraMinOffGround(); - if (gWorldPointer) - { - camera_land_height = gWorldPointer->resolveLandHeightGlobal(camera_position_global); - } - else - { - camera_land_height = 0.f; - } + camera_land_height = LLWorld::getInstance()->resolveLandHeightGlobal(camera_position_global); if (camera_position_global.mdV[VZ] < camera_land_height + camera_min_off_ground) { @@ -3890,7 +3862,7 @@ void LLAgent::handleScrollWheel(S32 clicks) } else { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); const F32 ROOT_ROOT_TWO = sqrt(F_SQRT2); // Block if camera is animating @@ -3970,7 +3942,7 @@ void LLAgent::changeCameraToMouselook(BOOL animate) // unpause avatar animation mPauseRequest = NULL; - gToolMgr->setCurrentToolset(gMouselookToolset); + LLToolMgr::getInstance()->setCurrentToolset(gMouselookToolset); gSavedSettings.setBOOL("FirstPersonBtnState", FALSE); gSavedSettings.setBOOL("MouselookBtnState", TRUE); @@ -3984,7 +3956,7 @@ void LLAgent::changeCameraToMouselook(BOOL animate) } //gViewerWindow->stopGrab(); - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); gViewerWindow->hideCursor(); gViewerWindow->moveCursorToCenter(); @@ -4048,11 +4020,11 @@ void LLAgent::changeCameraToFollow(BOOL animate) mCameraMode = CAMERA_MODE_FOLLOW; // bang-in the current focus, position, and up vector of the follow cam - mFollowCam.reset( mCameraPositionAgent, gCamera->getPointOfInterest(), LLVector3::z_axis ); + mFollowCam.reset( mCameraPositionAgent, LLViewerCamera::getInstance()->getPointOfInterest(), LLVector3::z_axis ); if (gBasicToolset) { - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); } if (mAvatarObject) @@ -4121,7 +4093,7 @@ void LLAgent::changeCameraToThirdPerson(BOOL animate) { if (gBasicToolset) { - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); } mCameraLag.clearVec(); @@ -4146,7 +4118,7 @@ void LLAgent::changeCameraToThirdPerson(BOOL animate) if (!mAvatarObject.isNull() && mAvatarObject->getParent()) { LLQuaternion obj_rot = ((LLViewerObject*)mAvatarObject->getParent())->getRenderRotation(); - at_axis = gCamera->getAtAxis(); + at_axis = LLViewerCamera::getInstance()->getAtAxis(); at_axis.mV[VZ] = 0.f; at_axis.normVec(); resetAxes(at_axis * ~obj_rot); @@ -4181,7 +4153,7 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_ani if (gFaceEditToolset) { - gToolMgr->setCurrentToolset(gFaceEditToolset); + LLToolMgr::getInstance()->setCurrentToolset(gFaceEditToolset); } gSavedSettings.setBOOL("FirstPersonBtnState", FALSE); @@ -4401,11 +4373,11 @@ void LLAgent::setCameraPosAndFocusGlobal(const LLVector3d& camera_pos, const LLV if( CAMERA_MODE_CUSTOMIZE_AVATAR == mCameraMode ) { // Compensate for the fact that the camera has already been offset to make room for LLFloaterCustomize. - mAnimationCameraStartGlobal -= LLVector3d(gCamera->getLeftAxis() * calcCustomizeAvatarUIOffset( mAnimationCameraStartGlobal )); + mAnimationCameraStartGlobal -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * calcCustomizeAvatarUIOffset( mAnimationCameraStartGlobal )); } } - //gCamera->setOrigin( gAgent.getPosAgentFromGlobal( camera_pos ) ); + //LLViewerCamera::getInstance()->setOrigin( gAgent.getPosAgentFromGlobal( camera_pos ) ); setFocusObject(gObjectList.findObject(object_id)); mFocusTargetGlobal = focus; mCameraFocusOffsetTarget = camera_pos - focus; @@ -4496,14 +4468,14 @@ void LLAgent::setFocusOnAvatar(BOOL focus_on_avatar, BOOL animate) if (!mAvatarObject.isNull() && mAvatarObject->getParent()) { LLQuaternion obj_rot = ((LLViewerObject*)mAvatarObject->getParent())->getRenderRotation(); - at_axis = gCamera->getAtAxis(); + at_axis = LLViewerCamera::getInstance()->getAtAxis(); at_axis.mV[VZ] = 0.f; at_axis.normVec(); resetAxes(at_axis * ~obj_rot); } else { - at_axis = gCamera->getAtAxis(); + at_axis = LLViewerCamera::getInstance()->getAtAxis(); at_axis.mV[VZ] = 0.f; at_axis.normVec(); resetAxes(at_axis); @@ -4521,7 +4493,7 @@ void LLAgent::heardChat(const LLUUID& id) { // log text and voice chat to speaker mgr // for keeping track of active speakers, etc. - gLocalSpeakerMgr->speakerChatted(id); + LLLocalSpeakerMgr::getInstance()->speakerChatted(id); // don't respond to your own voice if (id == getID()) return; @@ -4631,7 +4603,7 @@ void LLAgent::setStartPosition(U32 location_id) // this simulator. Clamp it to the region the agent is // in, a little bit in on each side. const F32 INSET = 0.5f; //meters - const F32 REGION_WIDTH = gWorldPointer->getRegionWidthInMeters(); + const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); LLVector3 agent_pos = getPositionAgent(); @@ -4647,7 +4619,7 @@ void LLAgent::setStartPosition(U32 location_id) // Don't let them go below ground, or too high. agent_pos.mV[VZ] = llclamp( agent_pos.mV[VZ], mRegionp->getLandHeightRegion( agent_pos ), - gWorldPointer->getRegionMaxHeight() ); + LLWorld::getInstance()->getRegionMaxHeight() ); LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetStartLocationRequest); @@ -4937,7 +4909,7 @@ void LLAgent::buildLocationString(std::string& str) // create a defult name and description for the landmark std::string buffer; - if( gParcelMgr->getAgentParcelName().empty() ) + if( LLViewerParcelMgr::getInstance()->getAgentParcelName().empty() ) { // the parcel doesn't have a name buffer = llformat("%.32s (%d, %d, %d)", @@ -4948,7 +4920,7 @@ void LLAgent::buildLocationString(std::string& str) { // the parcel has a name, so include it in the landmark name buffer = llformat("%.32s, %.32s (%d, %d, %d)", - gParcelMgr->getAgentParcelName().c_str(), + LLViewerParcelMgr::getInstance()->getAgentParcelName().c_str(), getRegion()->getName().c_str(), pos_x, pos_y, pos_z); } @@ -4968,7 +4940,7 @@ LLQuaternion LLAgent::getHeadRotation() } // We must be in mouselook - LLVector3 look_dir( gCamera->getAtAxis() ); + LLVector3 look_dir( LLViewerCamera::getInstance()->getAtAxis() ); LLVector3 up = look_dir % mFrameAgent.getLeftAxis(); LLVector3 left = up % look_dir; @@ -5209,7 +5181,7 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **) // refresh all group information gAgent.sendAgentDataUpdateRequest(); - gGroupMgr->clearGroupData(group_id); + LLGroupMgr::getInstance()->clearGroupData(group_id); // close the floater for this group, if any. LLFloaterGroupInfo::closeGroup(group_id); // refresh the group panel of the search window, if necessary. @@ -5288,7 +5260,7 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode // refresh all group information gAgent.sendAgentDataUpdateRequest(); - gGroupMgr->clearGroupData(group_id); + LLGroupMgr::getInstance()->clearGroupData(group_id); // close the floater for this group, if any. LLFloaterGroupInfo::closeGroup(group_id); // refresh the group panel of the search window, @@ -5749,14 +5721,14 @@ bool LLAgent::teleportCore(bool is_local) LLFloaterWorldMap::hide(NULL); LLFloaterDirectory::hide(NULL); - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); // Close all pie menus, deselect land, etc. // Don't change the camera until we know teleport succeeded. JC resetView(FALSE); // local logic - gViewerStats->incStat(LLViewerStats::ST_TELEPORT_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TELEPORT_COUNT); if (!is_local) { gTeleportDisplay = TRUE; @@ -5864,7 +5836,7 @@ void LLAgent::teleportCancel() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { LLViewerRegion* regionp = getRegion(); - LLSimInfo* info = gWorldMap->simInfoFromPosGlobal(pos_global); + LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if(regionp && info) { U32 x_pos; diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0a611c9bfa..aefa1af106 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -35,7 +35,7 @@ #include "llversionviewer.h" #include "llfeaturemanager.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llalertdialog.h" #include "llerrorcontrol.h" #include "llviewerimagelist.h" @@ -45,7 +45,6 @@ #include "llviewerstats.h" #include "llmd5.h" #include "llpumpio.h" -#include "llfloateractivespeakers.h" #include "llimpanel.h" #include "llmimetypes.h" #include "llstartup.h" @@ -96,7 +95,6 @@ #include "lltoolmgr.h" #include "llassetstorage.h" #include "llpolymesh.h" -#include "lleconomy.h" #include "llcachename.h" #include "audioengine.h" #include "llviewermenu.h" @@ -337,8 +335,8 @@ void request_initial_instant_messages() { static BOOL requested = FALSE; if (!requested - && gMuteListp - && gMuteListp->isLoaded() + && gMessageSystem + && LLMuteList::getInstance()->isLoaded() && gAgent.getAvatarObject()) { // Auto-accepted inventory items may require the avatar object @@ -503,6 +501,7 @@ void initGridChoice() gGridName = custom_server.c_str(); } } + gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel); } #endif @@ -669,13 +668,6 @@ bool LLAppViewer::init() } // Load art UUID information, don't require these strings to be declared in code. - LLString viewer_art_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"viewerart.xml"); - llinfos << "Loading art table from " << viewer_art_filename << llendl; - gViewerArt.loadFromFileLegacy(viewer_art_filename.c_str(), FALSE); - LLString textures_filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "textures", "textures.xml"); - llinfos << "Loading art table from " << textures_filename << llendl; - gViewerArt.loadFromFileLegacy(textures_filename.c_str(), FALSE); - LLString colors_base_filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "colors_base.xml"); llinfos << "Loading base colors from " << colors_base_filename << llendl; gColors.loadFromFileLegacy(colors_base_filename.c_str(), FALSE, TYPE_COL4U); @@ -691,13 +683,12 @@ bool LLAppViewer::init() // Widget construction depends on LLUI being initialized LLUI::initClass(&gSavedSettings, &gColors, - &gViewerArt, - &gImageList, + LLUIImageList::getInstance(), ui_audio_callback, &LLUI::sGLScaleFactor); LLWeb::initClass(); // do this after LLUI - gUICtrlFactory->setupPaths(); // update paths with correct language set + LLUICtrlFactory::getInstance()->setupPaths(); // update paths with correct language set ///////////////////////////////////////////////// // @@ -740,7 +731,7 @@ bool LLAppViewer::init() MemSetErrorHandler(first_mem_error_handler); #endif // LL_WINDOWS && LL_RELEASE_FOR_DOWNLOAD && LL_USE_SMARTHEAP - gViewerStats = new LLViewerStats(); + // *Note: this is where gViewerStats used to be created. // // Initialize the VFS, and gracefully handle initialization errors @@ -829,7 +820,7 @@ bool LLAppViewer::init() minRAMString >> minRAM; minRAM = minRAM * 1024 * 1024; - if(!gFeatureManagerp->isGPUSupported()) + if(!LLFeatureManager::getInstance()->isGPUSupported()) { minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU"); minSpecs += "\n"; @@ -878,9 +869,7 @@ bool LLAppViewer::mainLoop() LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); - // initialize voice stuff here - gLocalSpeakerMgr = new LLLocalSpeakerMgr(); - gActiveChannelSpeakerMgr = new LLActiveSpeakerMgr(); + // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. LLVoiceChannel::initClass(); LLVoiceClient::init(gServicePump); @@ -1097,15 +1086,9 @@ bool LLAppViewer::cleanup() gTransferManager.cleanup(); #endif - // Clean up map data storage - delete gWorldMap; - gWorldMap = NULL; + // Note: this is where gWorldMap used to be deleted. - delete gHUDManager; - gHUDManager = NULL; - - delete gToolMgr; - gToolMgr = NULL; + // Note: this is where gHUDManager used to be deleted. delete gAssetStorage; gAssetStorage = NULL; @@ -1115,17 +1098,12 @@ bool LLAppViewer::cleanup() delete gCacheName; gCacheName = NULL; - delete gGlobalEconomy; - gGlobalEconomy = NULL; - - delete gActiveChannelSpeakerMgr; - gActiveChannelSpeakerMgr = NULL; - - delete gLocalSpeakerMgr; - gLocalSpeakerMgr = NULL; + // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted. LLNotifyBox::cleanup(); + LLWorldMap::getInstance()->reset(); // release any images + llinfos << "Global stuff deleted" << llendflush; #if !LL_RELEASE_FOR_DOWNLOAD @@ -1139,9 +1117,7 @@ bool LLAppViewer::cleanup() llwarns << "Hack, skipping audio engine cleanup" << llendflush; #endif - llinfos << "Cleaning up feature manager" << llendflush; - delete gFeatureManagerp; - gFeatureManagerp = NULL; + // Note: this is where LLFeatureManager::getInstance()-> used to be deleted. // Patch up settings for next time // Must do this before we delete the viewer window, @@ -1224,8 +1200,7 @@ bool LLAppViewer::cleanup() LLViewerParcelMgr::cleanupGlobals(); - delete gViewerStats; - gViewerStats = NULL; + // *Note: this is where gViewerStats used to be deleted. //end_messaging_system(); @@ -1258,25 +1233,15 @@ bool LLAppViewer::cleanup() // save all settings, even if equals defaults gCrashSettings.saveToFile(crash_settings_filename.c_str(), FALSE); - delete gUICtrlFactory; - gUICtrlFactory = NULL; - gSavedSettings.cleanup(); - gViewerArt.cleanup(); gColors.cleanup(); gCrashSettings.cleanup(); // Save URL history file LLURLHistory::saveFile("url_history.xml"); - if (gMuteListp) - { - // save mute list - gMuteListp->cache(gAgent.getID()); - - delete gMuteListp; - gMuteListp = NULL; - } + // save mute list. gMuteList used to also be deleted here too. + LLMuteList::getInstance()->cache(gAgent.getID()); if (mPurgeOnExit) { @@ -1536,9 +1501,15 @@ bool LLAppViewer::initConfiguration() // *before* the user settings. Having to do this init here // seems odd. - // Need to do this before calling parseAlerts - gUICtrlFactory = new LLViewerUICtrlFactory(); + // This is where gUICtrlFactory used to be instantiated with a new LLUICtrlFactory + // which needed to happen before calling parseAlerts below. + // TODO: That method is still dependant upon the base LLUICtrlFactory constructor being called + // which registers some callbacks so I'm leaving in a call to getInstance here to cause that to + // still happen. This needs to be cleaned up later when the base and derived classes + // are planned to be combined. -MG + LLUICtrlFactory::getInstance(); + // Pre-load alerts.xml to define the warnings settings (always loads from skins/xui/en-us/) // Do this *before* loading the settings file LLAlertDialog::parseAlerts("alerts.xml", &gSavedSettings, TRUE); @@ -1783,10 +1754,7 @@ bool LLAppViewer::initConfiguration() LLVolumeMgr::initClass(); - // Initialize the feature manager - // The feature manager is responsible for determining what features - // are turned on/off in the app. - gFeatureManagerp = new LLFeatureManager; + // Note: this is where we used to initialize LLFeatureManager::getInstance()->. gStartTime = totalTime(); @@ -2194,10 +2162,8 @@ void LLAppViewer::handleViewerCrash() gMessageSystem->getCircuitInfo(gDebugInfo["CircuitInfo"]); gMessageSystem->stopLogging(); } - if (gWorldp) - { - gWorldp->getInfo(gDebugInfo); - } + + LLWorld::getInstance()->getInfo(gDebugInfo); // Close the debug file pApp->closeDebug(); @@ -2353,13 +2319,10 @@ void LLAppViewer::requestQuit() return; } - if (gHUDManager) - { - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); - effectp->setPositionGlobal(gAgent.getPositionGlobal()); - effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gHUDManager->sendEffects(); - } + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + effectp->setPositionGlobal(gAgent.getPositionGlobal()); + effectp->setColor(LLColor4U(gAgent.getEffectColor())); + LLHUDManager::getInstance()->sendEffects(); // Attempt to close all floaters that might be // editing things. @@ -2922,7 +2885,7 @@ void LLAppViewer::idle() { LLFastTimer t(LLFastTimer::FTM_NETWORK); // Update spaceserver timeinfo - gWorldp->setSpaceTimeUSec(gWorldp->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); + LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC)); ////////////////////////////////////// @@ -3056,7 +3019,7 @@ void LLAppViewer::idle() { // After agent and camera moved, figure out if we need to // deselect objects. - gSelectMgr->deselectAllIfTooFar(); + LLSelectMgr::getInstance()->deselectAllIfTooFar(); } @@ -3073,7 +3036,7 @@ void LLAppViewer::idle() if (!(logoutRequestSent() && hasSavedFinalSnapshot())) { - gObjectList.update(gAgent, *gWorldp); + gObjectList.update(gAgent, *LLWorld::getInstance()); } } @@ -3105,9 +3068,9 @@ void LLAppViewer::idle() { gFrameStats.start(LLFrameStats::UPDATE_EFFECTS); - gSelectMgr->updateEffects(); - gHUDManager->cleanupEffects(); - gHUDManager->sendEffects(); + LLSelectMgr::getInstance()->updateEffects(); + LLHUDManager::getInstance()->cleanupEffects(); + LLHUDManager::getInstance()->sendEffects(); } stop_glerror(); @@ -3127,11 +3090,11 @@ void LLAppViewer::idle() // Update surfaces, and surface textures as well. // - gWorldp->updateVisibilities(); + LLWorld::getInstance()->updateVisibilities(); { const F32 max_region_update_time = .001f; // 1ms LLFastTimer t(LLFastTimer::FTM_REGION_UPDATE); - gWorldp->updateRegions(max_region_update_time); + LLWorld::getInstance()->updateRegions(max_region_update_time); } ///////////////////////// @@ -3140,7 +3103,7 @@ void LLAppViewer::idle() // if (!gNoRender) { - gWorldp->updateClouds(gFrameDTClamped); + LLWorld::getInstance()->updateClouds(gFrameDTClamped); gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets // Update wind vector @@ -3148,7 +3111,7 @@ void LLAppViewer::idle() static LLVector3 average_wind; LLViewerRegion *regionp; - regionp = gWorldp->resolveRegionGlobal(wind_position_region, gAgent.getPositionGlobal()); // puts agent's local coords into wind_position + regionp = LLWorld::getInstance()->resolveRegionGlobal(wind_position_region, gAgent.getPositionGlobal()); // puts agent's local coords into wind_position if (regionp) { gWindVec = regionp->mWind.getVelocity(wind_position_region); @@ -3182,7 +3145,7 @@ void LLAppViewer::idle() gPipeline.updateMove(); gFrameStats.start(LLFrameStats::UPDATE_PARTICLES); - gWorldp->updateParticles(); + LLWorld::getInstance()->updateParticles(); } stop_glerror(); @@ -3449,9 +3412,9 @@ void LLAppViewer::disconnectViewer() } } - if (gSelectMgr) + if (LLSelectMgr::getInstance()) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } if (!gNoRender) @@ -3472,9 +3435,9 @@ void LLAppViewer::disconnectViewer() // Also writes cached agent settings to gSavedSettings gAgent.cleanup(); - gObjectList.destroy(); - delete gWorldp; - gWorldp = NULL; + // This is where we used to call gObjectList.destroy() and then delete gWorldp. + // Now we just ask the LLWorld singleton to cleanly shut down. + LLWorld::getInstance()->destroyClass(); cleanup_xfer_manager(); gDisconnected = TRUE; diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 76cfe92c4c..b43c9db40a 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -159,7 +159,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // deal with L$ errors if (reason == "insufficient funds") { - LLFloaterBuyCurrency::buyCurrency("Uploading costs", gGlobalEconomy->getPriceUpload()); + LLFloaterBuyCurrency::buyCurrency("Uploading costs", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); } else { @@ -209,7 +209,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) gAgent.sendReliableMessage(); LLString::format_map_t args; - args["[AMOUNT]"] = llformat("%d",gGlobalEconomy->getPriceUpload()); + args["[AMOUNT]"] = llformat("%d",LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); LLNotifyBox::showXml("UploadPayment", args); } diff --git a/indra/newview/llaudiosourcevo.cpp b/indra/newview/llaudiosourcevo.cpp index fac2e7bff2..b7f4820a59 100644 --- a/indra/newview/llaudiosourcevo.cpp +++ b/indra/newview/llaudiosourcevo.cpp @@ -71,51 +71,49 @@ void LLAudioSourceVO::updateGain() } BOOL mute = FALSE; - if (gParcelMgr) - { - LLVector3d pos_global; + LLVector3d pos_global; - if (mObjectp->isAttachment()) + if (mObjectp->isAttachment()) + { + LLViewerObject* parent = mObjectp; + while (parent && !parent->isAvatar()) { - LLViewerObject* parent = mObjectp; - while (parent - && !parent->isAvatar()) - { - parent = (LLViewerObject*)parent->getParent(); - } - if (parent) - pos_global = parent->getPositionGlobal(); + parent = (LLViewerObject*)parent->getParent(); } - - else - pos_global = mObjectp->getPositionGlobal(); - - if (!gParcelMgr->canHearSound(pos_global)) + if (parent) { - mute = TRUE; + pos_global = parent->getPositionGlobal(); } } + else + { + pos_global = mObjectp->getPositionGlobal(); + } + + if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) + { + mute = TRUE; + } - if (!mute && gMuteListp) + if (!mute) { - if (gMuteListp->isMuted(mObjectp->getID())) + if (LLMuteList::getInstance()->isMuted(mObjectp->getID())) { mute = TRUE; } - else if (gMuteListp->isMuted(mOwnerID, LLMute::flagObjectSounds)) + else if (LLMuteList::getInstance()->isMuted(mOwnerID, LLMute::flagObjectSounds)) { mute = TRUE; } else if (mObjectp->isAttachment()) { LLViewerObject* parent = mObjectp; - while (parent - && !parent->isAvatar()) + while (parent && !parent->isAvatar()) { parent = (LLViewerObject*)parent->getParent(); } if (parent - && gMuteListp->isMuted(parent->getID())) + && LLMuteList::getInstance()->isMuted(parent->getID())) { mute = TRUE; } diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 73c00c1d82..01b093e6f6 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -65,7 +65,7 @@ #include "llmultigesture.h" #include "llui.h" #include "llviewermenu.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // @@ -125,7 +125,7 @@ BOOL LLChatBar::postBuild() childSetCommitCallback("Say", onClickSay, this); // attempt to bind to an existing combo box named gesture - setGestureCombo(LLUICtrlFactory::getComboBoxByName(this, "Gesture")); + setGestureCombo(getChild<LLComboBox>( "Gesture")); LLButton * sayp = getChild<LLButton>("Say"); if(sayp) @@ -133,7 +133,7 @@ BOOL LLChatBar::postBuild() setDefaultBtn(sayp); } - mInputEditor = LLUICtrlFactory::getLineEditorByName(this, "Chat Editor"); + mInputEditor = getChild<LLLineEditor>("Chat Editor"); if (mInputEditor) { mInputEditor->setCallbackUserData(this); @@ -159,36 +159,34 @@ BOOL LLChatBar::postBuild() //----------------------------------------------------------------------- // virtual -BOOL LLChatBar::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLChatBar::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent) + // ALT-RETURN is reserved for windowed/fullscreen toggle + if( KEY_RETURN == key ) { - // ALT-RETURN is reserved for windowed/fullscreen toggle - if( KEY_RETURN == key ) + if (mask == MASK_CONTROL) { - if (mask == MASK_CONTROL) - { - // shout - sendChat(CHAT_TYPE_SHOUT); - handled = TRUE; - } - else if (mask == MASK_NONE) - { - // say - sendChat( CHAT_TYPE_NORMAL ); - handled = TRUE; - } + // shout + sendChat(CHAT_TYPE_SHOUT); + handled = TRUE; } - // only do this in main chatbar - else if ( KEY_ESCAPE == key && gChatBar == this) + else if (mask == MASK_NONE) { - stopChat(); - + // say + sendChat( CHAT_TYPE_NORMAL ); handled = TRUE; } } + // only do this in main chatbar + else if ( KEY_ESCAPE == key && gChatBar == this) + { + stopChat(); + + handled = TRUE; + } + return handled; } @@ -633,7 +631,7 @@ void send_chat_from_viewer(const std::string& utf8_out_text, EChatType type, S32 gAgent.sendReliableMessage(); - gViewerStats->incStat(LLViewerStats::ST_CHAT_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CHAT_COUNT); } diff --git a/indra/newview/llchatbar.h b/indra/newview/llchatbar.h index f677218dc1..c5cb741453 100644 --- a/indra/newview/llchatbar.h +++ b/indra/newview/llchatbar.h @@ -53,7 +53,7 @@ public: ~LLChatBar(); virtual BOOL postBuild(); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); void refresh(); void refreshGestures(); diff --git a/indra/newview/llcloud.cpp b/indra/newview/llcloud.cpp index ee793bf6e4..f5cb5e8256 100644 --- a/indra/newview/llcloud.cpp +++ b/indra/newview/llcloud.cpp @@ -157,7 +157,7 @@ void LLCloudGroup::updatePuffOwnership() } //llinfos << "Cloud moving to new group" << llendl; - LLCloudGroup *new_cgp = gWorldPointer->findCloudGroup(mCloudPuffs[i]); + LLCloudGroup *new_cgp = LLWorld::getInstance()->findCloudGroup(mCloudPuffs[i]); if (!new_cgp) { //llinfos << "Killing puff not in group" << llendl; diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index caf506a21e..8571046c6e 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -50,6 +50,8 @@ #include "llviewerimagelist.h" #include "llfocusmgr.h" +static LLRegisterWidget<LLColorSwatchCtrl> r("color_swatch"); + LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const LLColor4& color, void (*commit_callback)(LLUICtrl* ctrl, void* userdata), void* userdata ) @@ -74,8 +76,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect mBorder = new LLViewBorder("border", border_rect, LLViewBorder::BEVEL_IN); addChild(mBorder); - mAlphaGradientImage = gImageList.getImageFromUUID(LLUUID(gViewerArt.getString("color_swatch_alpha.tga")), - MIPMAP_FALSE, TRUE, GL_ALPHA8, GL_ALPHA); + mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga"); } LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect, const std::string& label, const LLColor4& color, @@ -102,8 +103,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const std::string& name, const LLRect& rect mBorder = new LLViewBorder("border", border_rect, LLViewBorder::BEVEL_IN); addChild(mBorder); - mAlphaGradientImage = gImageList.getImageFromUUID(LLUUID(gViewerArt.getString("color_swatch_alpha.tga")), - MIPMAP_FALSE, TRUE, GL_ALPHA8, GL_ALPHA); + mAlphaGradientImage = LLUI::getUIImage("color_swatch_alpha.tga"); } LLColorSwatchCtrl::~LLColorSwatchCtrl () @@ -129,13 +129,13 @@ BOOL LLColorSwatchCtrl::handleHover(S32 x, S32 y, MASK mask) return TRUE; } -BOOL LLColorSwatchCtrl::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLColorSwatchCtrl::handleUnicodeCharHere(llwchar uni_char) { - if( getVisible() && getEnabled() && !called_from_parent && ' ' == uni_char ) + if( ' ' == uni_char ) { showPicker(TRUE); } - return LLUICtrl::handleUnicodeCharHere(uni_char, called_from_parent); + return LLUICtrl::handleUnicodeCharHere(uni_char); } // forces color of this swatch and any associated floater to the input value, if currently invalid @@ -203,46 +203,41 @@ BOOL LLColorSwatchCtrl::handleMouseUp(S32 x, S32 y, MASK mask) // assumes GL state is set for 2D void LLColorSwatchCtrl::draw() { - if( getVisible() ) - { - mBorder->setKeyboardFocusHighlight(hasFocus()); - // Draw border - LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); - gl_rect_2d( border, mBorderColor, FALSE ); + mBorder->setKeyboardFocusHighlight(hasFocus()); + // Draw border + LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); + gl_rect_2d( border, mBorderColor, FALSE ); - LLRect interior = border; - interior.stretch( -1 ); + LLRect interior = border; + interior.stretch( -1 ); - // Check state - if ( mValid ) + // Check state + if ( mValid ) + { + // Draw the color swatch + gl_rect_2d_checkerboard( interior ); + gl_rect_2d(interior, mColor, TRUE); + LLColor4 opaque_color = mColor; + opaque_color.mV[VALPHA] = 1.f; + gGL.color4fv(opaque_color.mV); + if (mAlphaGradientImage.notNull()) { - // Draw the color swatch - gl_rect_2d_checkerboard( interior ); - gl_rect_2d(interior, mColor, TRUE); - LLColor4 opaque_color = mColor; - opaque_color.mV[VALPHA] = 1.f; - gGL.color4fv(opaque_color.mV); - if (mAlphaGradientImage.notNull()) + gGL.pushMatrix(); { - gGL.pushMatrix(); - { - gGL.translatef((F32)interior.mLeft, (F32)interior.mBottom, 0.f); - LLViewerImage::bindTexture(mAlphaGradientImage); - gl_rect_2d_simple_tex(interior.getWidth(), interior.getHeight()); - } - gGL.popMatrix(); + mAlphaGradientImage->draw(interior, mColor); } + gGL.popMatrix(); } - else - { - // Draw grey and an X - gl_rect_2d(interior, LLColor4::grey, TRUE); - - gl_draw_x(interior, LLColor4::black); - } + } + else + { + // Draw grey and an X + gl_rect_2d(interior, LLColor4::grey, TRUE); - LLUICtrl::draw(); + gl_draw_x(interior, LLColor4::black); } + + LLUICtrl::draw(); } void LLColorSwatchCtrl::setEnabled( BOOL enabled ) diff --git a/indra/newview/llcolorswatch.h b/indra/newview/llcolorswatch.h index cc9b9ad017..4b69df8dbb 100644 --- a/indra/newview/llcolorswatch.h +++ b/indra/newview/llcolorswatch.h @@ -66,8 +66,7 @@ public: ~LLColorSwatchCtrl (); virtual void setValue(const LLSD& value); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_COLOR_SWATCH; } - virtual LLString getWidgetTag() const { return LL_COLOR_SWATCH_CTRL_TAG; } + virtual LLSD getValue() const { return mColor.getValue(); } const LLColor4& get() { return mColor; } @@ -85,7 +84,7 @@ public: virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x,S32 y,MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); virtual void draw(); virtual void setEnabled( BOOL enabled ); virtual LLXMLNodePtr getXML(bool save_children = true) const; @@ -104,7 +103,7 @@ protected: LLUICtrlCallback mOnCancelCallback; LLUICtrlCallback mOnSelectCallback; - LLPointer<LLViewerImage> mAlphaGradientImage; + LLPointer<LLUIImage> mAlphaGradientImage; }; #endif // LL_LLBUTTON_H diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 087f8ac673..619b393d0b 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -56,7 +56,7 @@ #include "lldir.h" #include "llfloaterchat.h" #include "llviewerstats.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -106,7 +106,7 @@ LLFloaterScriptQueue::LLFloaterScriptQueue(const std::string& name, DRAG_ON_TOP, MINIMIZE_YES, CLOSE_YES) { - gUICtrlFactory->buildFloater(this,"floater_script_queue.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_queue.xml"); childSetAction("close",onCloseBtn,this); childSetEnabled("close",FALSE); @@ -201,7 +201,7 @@ BOOL LLFloaterScriptQueue::start() char buffer[MAX_STRING]; /*Flawfinder: ignore*/ snprintf(buffer, sizeof(buffer), "Starting %s of %d items.", mStartString, mObjectIDs.count()); /* Flawfinder: ignore */ - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); list->addCommentText(buffer); return nextObject(); @@ -235,7 +235,7 @@ BOOL LLFloaterScriptQueue::nextObject() if(isDone() && !mDone) { - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); mDone = TRUE; char buffer[MAX_STRING]; /*Flawfinder: ignore*/ @@ -412,10 +412,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { @@ -442,7 +439,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id, } if(queue) { - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(queue, "queue output"); + LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output"); list->addCommentText(buffer); } delete data; @@ -621,7 +618,7 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj, if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); char buffer[MAX_STRING]; /*Flawfinder: ignore*/ snprintf(buffer, sizeof(buffer), "Resetting '%s'.", item->getName().c_str()); /* Flawfinder: ignore */ list->addCommentText(buffer); @@ -684,7 +681,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj, if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); char buffer[MAX_STRING]; /*Flawfinder: ignore*/ snprintf(buffer, sizeof(buffer), "Running '%s'.", item->getName().c_str()); /* Flawfinder: ignore */ list->addCommentText(buffer); @@ -749,7 +746,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj, if (object) { LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "queue output"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); char buffer[MAX_STRING]; /*Flawfinder: ignore*/ snprintf(buffer, sizeof(buffer), "Not running '%s'.", item->getName().c_str()); /* Flawfinder: ignore */ list->addCommentText(buffer); diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 61ff316a2f..6aee25deca 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -349,7 +349,7 @@ void LLCurrencyUIManager::Impl::onCurrencyKey( void LLCurrencyUIManager::Impl::prepare() { - LLLineEditor* lindenAmount = LLUICtrlFactory::getLineEditorByName(&mPanel,"currency_amt"); + LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) { lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); @@ -370,7 +370,7 @@ void LLCurrencyUIManager::Impl::updateUI() mPanel.childShow("currency_action"); - LLLineEditor* lindenAmount = LLUICtrlFactory::getLineEditorByName(&mPanel,"currency_amt"); + LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) { lindenAmount->setVisible(true); diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 3fb7da7baa..4aeb1d74bf 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -131,13 +131,3 @@ LLDebugView::~LLDebugView() gTextureView = NULL; } -EWidgetType LLDebugView::getWidgetType() const -{ - return WIDGET_TYPE_DEBUG_VIEW; -} - -LLString LLDebugView::getWidgetTag() const -{ - return LL_DEBUG_VIEW_TAG; -} - diff --git a/indra/newview/lldebugview.h b/indra/newview/lldebugview.h index 36d367e40d..7678ad543a 100644 --- a/indra/newview/lldebugview.h +++ b/indra/newview/lldebugview.h @@ -54,9 +54,6 @@ public: LLDebugView(const std::string& name, const LLRect &rect); ~LLDebugView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - LLFrameStatView* mFrameStatView; LLFastTimerView* mFastTimerView; LLMemoryView* mMemoryView; diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index fd36ed666d..b73ea09a0c 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -85,7 +85,7 @@ LLDynamicArrayPtr<LLPointer<LLDrawable> > LLDrawable::sDeadList; void LLDrawable::incrementVisible() { sCurVisible++; - sCurPixelAngle = (F32) gViewerWindow->getWindowDisplayHeight()/gCamera->getView(); + sCurPixelAngle = (F32) gViewerWindow->getWindowDisplayHeight()/LLViewerCamera::getInstance()->getView(); } void LLDrawable::init() { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 4428854369..d22c459278 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -208,7 +208,7 @@ void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask // and it's close if(is_particle && !gSavedSettings.getBOOL("RenderUseShaderNearParticles")) { - if((dist < gCamera->getFar() * gSavedSettings.getF32("RenderShaderParticleThreshold"))) + if((dist < LLViewerCamera::getInstance()->getFar() * gSavedSettings.getF32("RenderShaderParticleThreshold"))) { use_shaders = FALSE; } diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 316c002c1b..6db67fb269 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -463,7 +463,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if ((sShaderLevel >= SHADER_LEVEL_CLOTH)) { LLMatrix4 rot_mat; - gCamera->getMatrixToLocal(rot_mat); + LLViewerCamera::getInstance()->getMatrixToLocal(rot_mat); LLMatrix4 cfr(OGL_TO_CFR_ROTATION); rot_mat *= cfr; diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index f4bc157168..4a9d8d1ec9 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -141,7 +141,12 @@ void LLStandardBumpmap::restoreGL() // llinfos << "Loading bumpmap: " << bump_file << " from viewerart" << llendl; gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mLabel = label; - gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = gImageList.getImage( LLUUID(gViewerArt.getString(bump_file)) ); + gStandardBumpmapList[LLStandardBumpmap::sStandardBumpmapCount].mImage = + gImageList.getImageFromFile(bump_file, + TRUE, + FALSE, + 0, + 0); LLStandardBumpmap::sStandardBumpmapCount++; } diff --git a/indra/newview/lldrawpoolground.cpp b/indra/newview/lldrawpoolground.cpp index 31c4e4fde9..d71c6de9cd 100644 --- a/indra/newview/lldrawpoolground.cpp +++ b/indra/newview/lldrawpoolground.cpp @@ -79,7 +79,7 @@ void LLDrawPoolGround::render(S32 pass) F32 water_height = gAgent.getRegion()->getWaterHeight(); glPushMatrix(); - LLVector3 origin = gCamera->getOrigin(); + LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); glTranslatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height)); LLFace *facep = mDrawFace[0]; diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 9276ee50e1..d3273f2eeb 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -103,14 +103,14 @@ void LLDrawPoolSky::render(S32 pass) LLGLClampToFarClip far_clip(glh_get_current_projection()); - LLGLEnable fog_enable( (mVertexShaderLevel < 1 && gCamera->cameraUnderWater()) ? GL_FOG : 0); + LLGLEnable fog_enable( (mVertexShaderLevel < 1 && LLViewerCamera::getInstance()->cameraUnderWater()) ? GL_FOG : 0); gPipeline.disableLights(); LLGLDisable clip(GL_CLIP_PLANE0); glPushMatrix(); - LLVector3 origin = gCamera->getOrigin(); + LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); glEnableClientState(GL_VERTEX_ARRAY); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index d8ebf33d38..634b502057 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -68,13 +68,15 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerImage *texturep) : // Hack! sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale"); sDetailMode = gSavedSettings.getS32("RenderTerrainDetail"); - mAlphaRampImagep = gImageList.getImageFromUUID(LLUUID(gViewerArt.getString("alpha_gradient.tga")), - TRUE, TRUE, GL_ALPHA8, GL_ALPHA); + mAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient.tga", + TRUE, TRUE, GL_ALPHA8, GL_ALPHA, + LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb")); mAlphaRampImagep->bind(0); mAlphaRampImagep->setClamp(TRUE, TRUE); - m2DAlphaRampImagep = gImageList.getImageFromUUID(LLUUID(gViewerArt.getString("alpha_gradient_2d.tga")), - TRUE, TRUE, GL_ALPHA8, GL_ALPHA); + m2DAlphaRampImagep = gImageList.getImageFromFile("alpha_gradient_2d.j2c", + TRUE, TRUE, GL_ALPHA8, GL_ALPHA, + LLUUID("38b86f85-2575-52a9-a531-23108d8da837")); m2DAlphaRampImagep->bind(0); m2DAlphaRampImagep->setClamp(TRUE, TRUE); diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 4dfe725731..f4e22a57f6 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -75,8 +75,7 @@ LLDrawPoolWater::LLDrawPoolWater() : mHBTex[1]->setClamp(TRUE, TRUE); mWaterImagep = gImageList.getImage(WATER_TEST); - //mWaterNormp = gImageList.getImage(LLUUID(gViewerArt.getString("water_normal.tga"))); - mWaterNormp = gImageList.getImage(LLWaterParamManager::instance()->getNormalMapID()); + mWaterNormp = gImageList.getImage(DEFAULT_WATER_NORMAL); restoreGL(); } @@ -100,7 +99,7 @@ LLDrawPool *LLDrawPoolWater::instancePool() void LLDrawPoolWater::prerender() { - mVertexShaderLevel = (gGLManager.mHasCubeMap && gFeatureManagerp->isFeatureAvailable("RenderCubeMap")) ? + mVertexShaderLevel = (gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")) ? LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_WATER) : 0; // got rid of modulation by light color since it got a little too @@ -112,7 +111,7 @@ void LLDrawPoolWater::prerender() S32 LLDrawPoolWater::getNumPasses() { - if (gCamera->getOrigin().mV[2] < 1024.f) + if (LLViewerCamera::getInstance()->getOrigin().mV[2] < 1024.f) { return 1; } @@ -177,11 +176,11 @@ void LLDrawPoolWater::render(S32 pass) glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_2D); // Texture unit 1 - LLVector3 camera_up = gCamera->getUpAxis(); + LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis(); F32 up_dot = camera_up * LLVector3::z_axis; LLColor4 water_color; - if (gCamera->cameraUnderWater()) + if (LLViewerCamera::getInstance()->cameraUnderWater()) { water_color.setVec(1.f, 1.f, 1.f, 0.4f); } @@ -261,7 +260,7 @@ void LLDrawPoolWater::render(S32 pass) glMatrixMode(GL_TEXTURE); glLoadIdentity(); - LLMatrix4 camera_mat = gCamera->getModelview(); + LLMatrix4 camera_mat = LLViewerCamera::getInstance()->getModelview(); LLMatrix4 camera_rot(camera_mat.getMat3()); camera_rot.invert(); @@ -405,7 +404,7 @@ void LLDrawPoolWater::shade() LLGLSLShader* shader; - F32 eyedepth = gCamera->getOrigin().mV[2] - gAgent.getRegion()->getWaterHeight(); + F32 eyedepth = LLViewerCamera::getInstance()->getOrigin().mV[2] - gAgent.getRegion()->getWaterHeight(); if (eyedepth < 0.f && LLPipeline::sWaterReflections) { @@ -488,7 +487,7 @@ void LLDrawPoolWater::shade() //shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix); shader->uniform1f(LLShaderMgr::WATER_WATERHEIGHT, eyedepth); shader->uniform1f(LLShaderMgr::WATER_TIME, sTime); - shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, gCamera->getOrigin().mV); + shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); shader->uniform3fv(LLShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); shader->uniform1f(LLShaderMgr::WATER_SPECULAR_EXP, light_exp); shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); @@ -508,9 +507,9 @@ void LLDrawPoolWater::shade() shader->uniform1f("sunAngle2", 0.1f + 0.2f*sunAngle); LLColor4 water_color; - LLVector3 camera_up = gCamera->getUpAxis(); + LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis(); F32 up_dot = camera_up * LLVector3::z_axis; - if (gCamera->cameraUnderWater()) + if (LLViewerCamera::getInstance()->cameraUnderWater()) { water_color.setVec(1.f, 1.f, 1.f, 0.4f); shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index e080e4e29b..ee0d9e58ad 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -96,7 +96,7 @@ void LLDrawPoolWLSky::endRenderPass( S32 pass ) void LLDrawPoolWLSky::renderDome(F32 camHeightLocal, LLGLSLShader * shader) const { - LLVector3 const & origin = gCamera->getOrigin(); + LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); llassert_always(NULL != shader); @@ -288,7 +288,7 @@ void LLDrawPoolWLSky::render(S32 pass) renderSkyHaze(camHeightLocal); - LLVector3 const & origin = gCamera->getOrigin(); + LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin(); glPushMatrix(); glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); diff --git a/indra/newview/lldynamictexture.cpp b/indra/newview/lldynamictexture.cpp index c925cc058c..24ee701ff2 100644 --- a/indra/newview/lldynamictexture.cpp +++ b/indra/newview/lldynamictexture.cpp @@ -148,11 +148,11 @@ void LLDynamicTexture::preRender(BOOL clear_depth) LLImageGL::unbindTexture(0, GL_TEXTURE_2D); } // Set up camera - mCamera.setOrigin(*gCamera); - mCamera.setAxes(*gCamera); - mCamera.setAspect(gCamera->getAspect()); - mCamera.setView(gCamera->getView()); - mCamera.setNear(gCamera->getNear()); + mCamera.setOrigin(*LLViewerCamera::getInstance()); + mCamera.setAxes(*LLViewerCamera::getInstance()); + mCamera.setAspect(LLViewerCamera::getInstance()->getAspect()); + mCamera.setView(LLViewerCamera::getInstance()->getView()); + mCamera.setNear(LLViewerCamera::getInstance()->getNear()); glViewport(mOrigin.mX, mOrigin.mY, mWidth, mHeight); if (clear_depth) @@ -177,11 +177,11 @@ void LLDynamicTexture::postRender(BOOL success) gViewerWindow->setupViewport(); // restore camera - gCamera->setOrigin(mCamera); - gCamera->setAxes(mCamera); - gCamera->setAspect(mCamera.getAspect()); - gCamera->setView(mCamera.getView()); - gCamera->setNear(mCamera.getNear()); + LLViewerCamera::getInstance()->setOrigin(mCamera); + LLViewerCamera::getInstance()->setAxes(mCamera); + LLViewerCamera::getInstance()->setAspect(mCamera.getAspect()); + LLViewerCamera::getInstance()->setView(mCamera.getView()); + LLViewerCamera::getInstance()->setNear(mCamera.getNear()); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 3e8d518c02..2157b50eb5 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -471,10 +471,8 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 void LLFace::renderSelectedUV(const S32 offset, const S32 count) { #if 0 - LLUUID uv_img_red_blue_id(gViewerArt.getString("uv_test1.tga")); - LLUUID uv_img_green_id(gViewerArt.getString("uv_test2.tga")); - LLViewerImage* red_blue_imagep = gImageList.getImage(uv_img_red_blue_id, TRUE, TRUE); - LLViewerImage* green_imagep = gImageList.getImage(uv_img_green_id, TRUE, TRUE); + LLViewerImage* red_blue_imagep = gImageList.getImageFromFile("uv_test1.j2c", TRUE, TRUE); + LLViewerImage* green_imagep = gImageList.getImageFromFile("uv_test2.tga", TRUE, TRUE); LLGLSObjectSelect object_select; LLGLEnable blend(GL_BLEND); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index f0ac46b7d6..5ebf599583 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -270,16 +270,6 @@ LLFastTimerView::~LLFastTimerView() delete[] mBarEnd; } -EWidgetType LLFastTimerView::getWidgetType() const -{ - return WIDGET_TYPE_FAST_TIMER_VIEW; -} - -LLString LLFastTimerView::getWidgetTag() const -{ - return LL_FAST_TIMER_VIEW_TAG; -} - BOOL LLFastTimerView::handleRightMouseDown(S32 x, S32 y, MASK mask) { if (mBarRect.pointInRect(x, y)) @@ -408,14 +398,10 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask) BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if (getVisible() && pointInView(x, y)) - { - LLFastTimer::sPauseHistory = TRUE; - mScrollIndex = llclamp(mScrollIndex - clicks, - 0, llmin(LLFastTimer::sLastFrameIndex, (S32)LLFastTimer::FTM_HISTORY_NUM-MAX_VISIBLE_HISTORY)); - return TRUE; - } - return FALSE; + LLFastTimer::sPauseHistory = TRUE; + mScrollIndex = llclamp(mScrollIndex - clicks, + 0, llmin(LLFastTimer::sLastFrameIndex, (S32)LLFastTimer::FTM_HISTORY_NUM-MAX_VISIBLE_HISTORY)); + return TRUE; } void LLFastTimerView::draw() @@ -437,7 +423,7 @@ void LLFastTimerView::draw() S32 left, top, right, bottom; S32 x, y, barw, barh, dx, dy; S32 texth, textw; - LLViewerImage* box_imagep = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square.tga")), MIPMAP_FALSE, TRUE); + LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("rounded_square.tga"); // Make sure all timers are accounted for // Set 'FTM_OTHER' to unaccounted ticks last frame @@ -806,7 +792,7 @@ void LLFastTimerView::draw() // Draw bars for each history entry // Special: -1 = show running average - LLViewerImage::bindTexture(box_imagep); + LLViewerImage::bindTexture(box_imagep->getImage()); for (S32 j=-1; j<histmax && y > LINE_GRAPH_HEIGHT; j++) { int sublevel_dx[FTV_DISPLAY_NUM+1]; @@ -938,7 +924,7 @@ void LLFastTimerView::draw() gGL.color4fv(color.mV); F32 start_fragment = llclamp((F32)(left - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f); F32 end_fragment = llclamp((F32)(right - sublevel_left[level]) / (F32)sublevel_dx[level], 0.f, 1.f); - gl_segmented_rect_2d_fragment_tex(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset, box_imagep->getWidth(), box_imagep->getHeight(), 16, start_fragment, end_fragment); + gl_segmented_rect_2d_fragment_tex(sublevel_left[level], top - level + scale_offset, sublevel_right[level], bottom + level - scale_offset, box_imagep->getTextureWidth(), box_imagep->getTextureHeight(), 16, start_fragment, end_fragment); } diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index d47cc003ac..3a1f99a9ae 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -41,9 +41,6 @@ public: LLFastTimerView(const std::string& name, const LLRect& rect); virtual ~LLFastTimerView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index e6fcfb6d40..4d8dbbebac 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -75,8 +75,6 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable.txt"; const char GPU_TABLE_FILENAME[] = "gpu_table.txt"; -LLFeatureManager *gFeatureManagerp = NULL; - LLFeatureInfo::LLFeatureInfo(const char *name, const BOOL available, const F32 level) : mValid(TRUE) { mName = name; diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h index 3d05bbe2e0..927f4ada45 100644 --- a/indra/newview/llfeaturemanager.h +++ b/indra/newview/llfeaturemanager.h @@ -1,6 +1,6 @@ /** * @file llfeaturemanager.h - * @brief LLFeatureManager class definition + * @brief The feature manager is responsible for determining what features are turned on/off in the app. * * $LicenseInfo:firstyear=2003&license=viewergpl$ * @@ -94,7 +94,7 @@ protected: }; -class LLFeatureManager : public LLFeatureList +class LLFeatureManager : public LLFeatureList, public LLSingleton<LLFeatureManager> { public: LLFeatureManager() : mInited(FALSE), mTableVersion(0), mSafe(FALSE), mGPUClass(GPU_CLASS_UNKNOWN) {} @@ -148,6 +148,5 @@ protected: BOOL mGPUSupported; }; -extern LLFeatureManager *gFeatureManagerp; #endif // LL_LLFEATUREMANAGER_H diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index f69f66bce2..b700faeccc 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -246,7 +246,6 @@ void LLVolumeImplFlexible::setAttributesOfAllSections() void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, const S32 detail) { - } //--------------------------------------------------------------------------------- @@ -280,7 +279,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, mVO->mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f); // Rendering sections increases with visible angle on the screen - mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/gCamera->getView()); + mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView()); if (mRenderRes > FLEXIBLE_OBJECT_MAX_SECTIONS) { mRenderRes = FLEXIBLE_OBJECT_MAX_SECTIONS; @@ -330,7 +329,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 id = parent->getVolumeInterfaceID(); } - U32 update_period = (U32) (gCamera->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1; + U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1; if ((LLDrawable::getCurrentFrame()+id)%update_period == 0) { @@ -359,7 +358,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() if (mSimulateRes == 0) { mVO->markForUpdate(TRUE); - if (!doIdleUpdate(gAgent, *gWorldp, 0.0)) + if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0)) { return; // we did not get updated or initialized, proceeding without can be dangerous } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 60385b8ca5..62fe68f67a 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -46,7 +46,7 @@ #include "llviewerregion.h" #include "llversionviewer.h" #include "llviewerbuild.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llappviewer.h" #include "llglheaders.h" #include "llmediamanager.h" @@ -70,7 +70,7 @@ LLFloaterAbout* LLFloaterAbout::sInstance = NULL; LLFloaterAbout::LLFloaterAbout() : LLFloater("floater_about", "FloaterAboutRect", "") { - gUICtrlFactory->buildFloater(this, "floater_about.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about.xml"); // Support for changing product name. LLString title("About "); @@ -157,13 +157,12 @@ LLFloaterAbout::LLFloaterAbout() } } - if (gViewerStats - && gPacketsIn > 0) + if (gPacketsIn > 0) { LLString packet_loss = llformat("Packets Lost: %.0f/%.0f (%.1f%%)", - gViewerStats->mPacketsLostStat.getCurrent(), + LLViewerStats::getInstance()->mPacketsLostStat.getCurrent(), F32(gPacketsIn), - 100.f*gViewerStats->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); + 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) ); support.append(packet_loss); support.append("\n"); } diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index d966f0d3c8..afa3fcddbe 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -61,7 +61,7 @@ #include "llviewermenufile.h" // upload_new_resource() #include "llvoavatar.h" #include "pipeline.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" S32 LLFloaterAnimPreview::sUploadAmount = 10; @@ -143,7 +143,7 @@ BOOL LLFloaterAnimPreview::postBuild() S32 btn_left = PREVIEW_HPAD; r.set( btn_left, y, btn_left + 32, y - BTN_HEIGHT ); - mPlayButton = LLViewerUICtrlFactory::getButtonByName(this, "play_btn"); + mPlayButton = getChild<LLButton>( "play_btn"); if (!mPlayButton) { mPlayButton = new LLButton("play_btn", LLRect(0,0,0,0)); @@ -157,7 +157,7 @@ BOOL LLFloaterAnimPreview::postBuild() mPlayButton->setScaleImage(TRUE); - mStopButton = LLViewerUICtrlFactory::getButtonByName(this, "stop_btn"); + mStopButton = getChild<LLButton>( "stop_btn"); if (!mStopButton) { mStopButton = new LLButton("stop_btn", LLRect(0,0,0,0)); @@ -265,7 +265,7 @@ BOOL LLFloaterAnimPreview::postBuild() //temp.mV[VZ] = 0.f; F32 pelvis_max_displacement = pelvis_offset + (temp.magVec() * 0.5f) + 1.f; - F32 camera_zoom = gCamera->getDefaultFOV() / (2.f * atan(pelvis_max_displacement / PREVIEW_CAMERA_DISTANCE)); + F32 camera_zoom = LLViewerCamera::getInstance()->getDefaultFOV() / (2.f * atan(pelvis_max_displacement / PREVIEW_CAMERA_DISTANCE)); mAnimPreview->setZoom(camera_zoom); @@ -1015,7 +1015,7 @@ LLPreviewAnimation::LLPreviewAnimation(S32 width, S32 height) : LLDynamicTexture mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); mDummyAvatar->startMotion(ANIM_AGENT_STAND, 5.f); mDummyAvatar->mSkirtLOD.setVisible(FALSE, TRUE); - gPipeline.markVisible(mDummyAvatar->mDrawable, *gCamera); + gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); // stop extraneous animations mDummyAvatar->stopMotion( ANIM_AGENT_HEAD_ROT, TRUE ); @@ -1069,15 +1069,15 @@ BOOL LLPreviewAnimation::render() LLQuaternion(mCameraYaw, LLVector3::z_axis); LLQuaternion av_rot = avatarp->mRoot.getWorldRotation() * camera_rot; - gCamera->setOriginAndLookAt( + LLViewerCamera::getInstance()->setOriginAndLookAt( target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + mCameraOffset) * av_rot), // camera LLVector3::z_axis, // up target_pos + (mCameraOffset * av_rot) ); // point of interest - gCamera->setView(gCamera->getDefaultFOV() / mCameraZoom); - gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); - mCameraRelPos = gCamera->getOrigin() - avatarp->mHeadp->getWorldPosition(); + mCameraRelPos = LLViewerCamera::getInstance()->getOrigin() - avatarp->mHeadp->getWorldPosition(); //avatarp->setAnimationData("LookAtPoint", (void *)&mCameraRelPos); diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp index f1bba7d9c5..faa69f7a03 100644 --- a/indra/newview/llfloaterauction.cpp +++ b/indra/newview/llfloaterauction.cpp @@ -48,7 +48,7 @@ #include "llviewerimagelist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llviewerdisplay.h" #include "llviewercontrol.h" @@ -74,7 +74,7 @@ LLFloaterAuction::LLFloaterAuction() : LLFloater("floater_auction"), mParcelID(-1) { - gUICtrlFactory->buildFloater(this, "floater_auction.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_auction.xml"); childSetValue("fence_check", LLSD( gSavedSettings.getBOOL("AuctionShowFence") ) ); @@ -106,8 +106,8 @@ void LLFloaterAuction::show() void LLFloaterAuction::initialize() { - mParcelp = gParcelMgr->getParcelSelection(); - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { @@ -141,7 +141,7 @@ void LLFloaterAuction::draw() { LLFloater::draw(); - if(getVisible() && !isMinimized() && mImage.notNull()) + if(!isMinimized() && mImage.notNull()) { LLRect rect; if (childGetRect("snapshot_icon", rect)) diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index a44b3b3755..0c1175b26c 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -41,7 +41,7 @@ #include "lllineeditor.h" #include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llagent.h" const S32 MIN_WIDTH = 200; @@ -88,7 +88,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker() : mCallback(NULL), mCallbackUserdata(NULL) { - gUICtrlFactory->buildFloater(this, "floater_avatar_picker.xml", NULL); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml", NULL); } BOOL LLFloaterAvatarPicker::postBuild() @@ -98,7 +98,7 @@ BOOL LLFloaterAvatarPicker::postBuild() childSetAction("Find", onBtnFind, this); childDisable("Find"); - mListNames = LLViewerUICtrlFactory::getScrollListByName(this, "Names"); + mListNames = getChild<LLScrollListCtrl>("Names"); childSetDoubleClickCallback("Names",onBtnAdd); childSetCommitCallback("Names", onList, this); childDisable("Names"); @@ -115,7 +115,7 @@ BOOL LLFloaterAvatarPicker::postBuild() mListNames->addCommentText("No results"); } - mInventoryPanel = (LLInventoryPanel*)this->getCtrlByNameAndType("Inventory Panel", WIDGET_TYPE_INVENTORY_PANEL); + mInventoryPanel = getChild<LLInventoryPanel>("Inventory Panel"); if(mInventoryPanel) { mInventoryPanel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD); @@ -388,7 +388,7 @@ void LLFloaterAvatarPicker::editKeystroke(LLLineEditor* caller, void* user_data) } // virtual -BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask) { if (key == KEY_RETURN && mask == MASK_NONE) @@ -410,5 +410,5 @@ BOOL LLFloaterAvatarPicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_p return TRUE; } - return LLFloater::handleKeyHere(key, mask, called_from_parent); + return LLFloater::handleKeyHere(key, mask); } diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index ace2d64d22..32e4c583c2 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -74,7 +74,7 @@ protected: void find(); void setAllowMultiple(BOOL allow_multiple); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); protected: LLScrollListCtrl* mListNames; diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp index f05f9a7b52..3870448652 100644 --- a/indra/newview/llfloateravatartextures.cpp +++ b/indra/newview/llfloateravatartextures.cpp @@ -35,7 +35,7 @@ #include "lltexturectrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerobjectlist.h" #include "llvoavatar.h" @@ -55,7 +55,7 @@ LLFloaterAvatarTextures* LLFloaterAvatarTextures::show(const LLUUID &id) LLFloaterAvatarTextures* floaterp = new LLFloaterAvatarTextures(id); // Builds and adds to gFloaterView - gUICtrlFactory->buildFloater(floaterp, "floater_avatar_textures.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_avatar_textures.xml"); gFloaterView->addChild(floaterp); floaterp->open(); /*Flawfinder: ignore*/ diff --git a/indra/newview/llfloaterbuildoptions.cpp b/indra/newview/llfloaterbuildoptions.cpp index 5e4cc89f8e..35add8d5b5 100644 --- a/indra/newview/llfloaterbuildoptions.cpp +++ b/indra/newview/llfloaterbuildoptions.cpp @@ -37,7 +37,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterbuildoptions.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // library includes #include "llfontgl.h" @@ -79,7 +79,7 @@ void LLFloaterBuildOptions::show(void*) { LLFloaterBuildOptions* floater = new LLFloaterBuildOptions(); - gUICtrlFactory->buildFloater(floater, "floater_build_options.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_build_options.xml"); floater->open(); /*Flawfinder: ignore*/ } } diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 2cf1f555ea..ce2d56612c 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -36,7 +36,7 @@ #include "llscrolllistctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewermessage.h" #include "llappviewer.h" // gPacificDaylightTime @@ -55,7 +55,7 @@ LLFloaterBump::LLFloaterBump() { sInstance = this; - gUICtrlFactory->buildFloater(this, "floater_bumps.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); } @@ -78,7 +78,7 @@ void LLFloaterBump::show(void *contents) sInstance = new LLFloaterBump(); } - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(sInstance, "bump_list"); + LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("bump_list"); if (!list) return; list->deleteAllItems(); diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 5ce5d8616b..34bdaffd76 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -46,7 +46,7 @@ #include "llselectmgr.h" #include "llscrolllistctrl.h" #include "llviewerobject.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" LLFloaterBuy* LLFloaterBuy::sInstance = NULL; @@ -54,7 +54,7 @@ LLFloaterBuy* LLFloaterBuy::sInstance = NULL; LLFloaterBuy::LLFloaterBuy() : LLFloater("floater_buy_object", "FloaterBuyRect", "") { - gUICtrlFactory->buildFloater(this, "floater_buy_object.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_object.xml"); childDisable("object_list"); childDisable("item_list"); @@ -72,17 +72,17 @@ LLFloaterBuy::~LLFloaterBuy() void LLFloaterBuy::reset() { - LLScrollListCtrl* object_list = LLUICtrlFactory::getScrollListByName(this, "object_list"); + LLScrollListCtrl* object_list = getChild<LLScrollListCtrl>("object_list"); if (object_list) object_list->deleteAllItems(); - LLScrollListCtrl* item_list = LLUICtrlFactory::getScrollListByName(this, "item_list"); + LLScrollListCtrl* item_list = getChild<LLScrollListCtrl>("item_list"); if (item_list) item_list->deleteAllItems(); } // static void LLFloaterBuy::show(const LLSaleInfo& sale_info) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getRootObjectCount() != 1) { @@ -104,7 +104,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) sInstance->open(); /*Flawfinder: ignore*/ sInstance->setFocus(TRUE); sInstance->mSaleInfo = sale_info; - sInstance->mObjectSelection = gSelectMgr->getEditSelection(); + sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); // Always center the dialog. User can change the size, // but purchases are important and should be center screen. @@ -133,7 +133,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) LLUUID owner_id; LLString owner_name; - BOOL owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); + BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { gViewerWindow->alertXml("BuyObjectOneOwner"); @@ -151,13 +151,13 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) LLSD row; // Compute icon for this item - LLUUID icon_id = get_item_icon_uuid(LLAssetType::AT_OBJECT, - LLInventoryType::IT_OBJECT, - 0x0, FALSE); + LLString icon_name = get_item_icon_name(LLAssetType::AT_OBJECT, + LLInventoryType::IT_OBJECT, + 0x0, FALSE); row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; - row["columns"][0]["value"] = icon_id; + row["columns"][0]["value"] = icon_name; // Append the permissions that you will acquire (not the current // permissions). @@ -256,13 +256,13 @@ void LLFloaterBuy::inventoryChanged(LLViewerObject* obj, item_is_multi = TRUE; } - LLUUID icon_id = get_item_icon_uuid(inv_item->getType(), + LLString icon_name = get_item_icon_name(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), item_is_multi); row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; - row["columns"][0]["value"] = icon_id; + row["columns"][0]["value"] = icon_name; // Append the permissions that you will acquire (not the current // permissions). @@ -307,7 +307,7 @@ void LLFloaterBuy::onClickBuy(void*) // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if // it doesn't match region info then sale is canceled. - gSelectMgr->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo ); + LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo ); sInstance->close(); } diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index b133a1e88b..34be223286 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -50,7 +50,7 @@ #include "llscrolllistctrl.h" #include "llviewerobject.h" #include "llviewerregion.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; @@ -58,7 +58,7 @@ LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; LLFloaterBuyContents::LLFloaterBuyContents() : LLFloater("floater_buy_contents", "FloaterBuyContentsRect", "") { - gUICtrlFactory->buildFloater(this, "floater_buy_contents.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_buy_contents.xml"); childSetAction("cancel_btn", onClickCancel, this); childSetAction("buy_btn", onClickBuy, this); @@ -79,7 +79,7 @@ LLFloaterBuyContents::~LLFloaterBuyContents() // static void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getRootObjectCount() != 1) { @@ -90,7 +90,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) // Create a new instance only if needed if (sInstance) { - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(sInstance, "item_list"); + LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("item_list"); if (list) list->deleteAllItems(); } else @@ -100,7 +100,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) sInstance->open(); /*Flawfinder: ignore*/ sInstance->setFocus(TRUE); - sInstance->mObjectSelection = gSelectMgr->getEditSelection(); + sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); // Always center the dialog. User can change the size, // but purchases are important and should be center screen. @@ -110,7 +110,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) LLUUID owner_id; LLString owner_name; - BOOL owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); + BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { gViewerWindow->alertXml("BuyContentsOneOwner"); @@ -223,13 +223,13 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, item_is_multi = TRUE; } - LLUUID icon_id = get_item_icon_uuid(inv_item->getType(), - inv_item->getInventoryType(), - inv_item->getFlags(), - item_is_multi); + LLString icon_name = get_item_icon_name(inv_item->getType(), + inv_item->getInventoryType(), + inv_item->getFlags(), + item_is_multi); row["columns"][0]["column"] = "icon"; row["columns"][0]["type"] = "icon"; - row["columns"][0]["value"] = icon_id; + row["columns"][0]["value"] = icon_name; // Append the permissions that you will acquire (not the current // permissions). @@ -291,7 +291,7 @@ void LLFloaterBuyContents::onClickBuy(void*) // *NOTE: doesn't work for multiple object buy, which UI does not // currently support sale info is used for verification only, if // it doesn't match region info then sale is canceled. - gSelectMgr->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo); + LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, sInstance->mSaleInfo); sInstance->close(); } diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index fb6cb40401..9741fbb7c7 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -40,7 +40,7 @@ #include "lltextbox.h" #include "llviewchildren.h" #include "llviewerwindow.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llweb.h" #include "llwindow.h" #include "llappviewer.h" @@ -97,7 +97,7 @@ LLFloaterBuyCurrencyUI* LLFloaterBuyCurrencyUI::soleInstance(bool createIfNeeded { sInstance = new LLFloaterBuyCurrencyUI(); - gUICtrlFactory->buildFloater(sInstance, "floater_buy_currency.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_currency.xml"); sInstance->center(); } @@ -221,7 +221,7 @@ void LLFloaterBuyCurrencyUI::updateUI() { mChildren.setBadge("step_error", LLViewChildren::BADGE_ERROR); - LLTextBox* message = LLUICtrlFactory::getTextBoxByName(this, "error_message"); + LLTextBox* message = getChild<LLTextBox>("error_message"); if (message) { message->setVisible(true); diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 5450b6de26..4d8f85159f 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -53,7 +53,7 @@ #include "lltexturectrl.h" #include "llviewchildren.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewertexteditor.h" @@ -291,7 +291,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) { sInstance = new LLFloaterBuyLandUI(); - gUICtrlFactory->buildFloater(sInstance, "floater_buy_land.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml"); sInstance->center(); static bool observingCacheName = false; @@ -305,7 +305,7 @@ LLFloaterBuyLandUI* LLFloaterBuyLandUI::soleInstance(bool createIfNeeded) if (!parcelSelectionObserver) { parcelSelectionObserver = new SelectionObserver; - gParcelMgr->addObserver(parcelSelectionObserver); + LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver); } } @@ -334,7 +334,7 @@ LLFloaterBuyLandUI::~LLFloaterBuyLandUI() { delete mTransaction; - gParcelMgr->deleteParcelBuy(mParcelBuyInfo); + LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo); if (sInstance == this) { @@ -347,14 +347,14 @@ void LLFloaterBuyLandUI::SelectionObserver::changed() LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); if (ui) { - if (gParcelMgr->selectionEmpty()) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { ui->close(); } else { ui->setParcel( - gParcelMgr->getSelectionRegion(), - gParcelMgr->getParcelSelection()); + LLViewerParcelMgr::getInstance()->getSelectionRegion(), + LLViewerParcelMgr::getInstance()->getParcelSelection()); } } } @@ -431,7 +431,7 @@ void LLFloaterBuyLandUI::updateParcelInfo() parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()); // Can't have more than region max tasks, regardless of parcel // object bonus factor. - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(region) { S32 max_tasks_per_region = (S32)region->getMaxTasks(); @@ -519,7 +519,7 @@ void LLFloaterBuyLandUI::updateParcelInfo() void LLFloaterBuyLandUI::updateCovenantInfo() { - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); @@ -729,7 +729,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) } BOOL remove_contribution = childGetValue("remove_contribution").asBoolean(); - mParcelBuyInfo = gParcelMgr->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(), + mParcelBuyInfo = LLViewerParcelMgr::getInstance()->setupParcelBuy(gAgent.getID(), gAgent.getSessionID(), gAgent.getGroupID(), mIsForGroup, mIsClaim, remove_contribution); if (mParcelBuyInfo @@ -747,7 +747,7 @@ void LLFloaterBuyLandUI::runWebSitePrep(const std::string& password) if (mSiteMembershipUpgrade) { - LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); + LLComboBox* levels = getChild<LLComboBox>( "account_level"); if (levels) { mUserPlanChoice = levels->getCurrentIndex(); @@ -798,8 +798,8 @@ void LLFloaterBuyLandUI::sendBuyLand() { if (mParcelBuyInfo) { - gParcelMgr->sendParcelBuy(mParcelBuyInfo); - gParcelMgr->deleteParcelBuy(mParcelBuyInfo); + LLViewerParcelMgr::getInstance()->sendParcelBuy(mParcelBuyInfo); + LLViewerParcelMgr::getInstance()->deleteParcelBuy(mParcelBuyInfo); mBought = true; } } @@ -1003,7 +1003,7 @@ void LLFloaterBuyLandUI::refreshUI() { // section zero: title area { - LLTextureCtrl* snapshot = LLViewerUICtrlFactory::getTexturePickerByName(this, "info_image"); + LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); if (snapshot) { snapshot->setImageAssetID( @@ -1061,7 +1061,7 @@ void LLFloaterBuyLandUI::refreshUI() ? LLViewChildren::BADGE_ERROR : LLViewChildren::BADGE_WARN); - LLTextBox* message = LLUICtrlFactory::getTextBoxByName(this, "error_message"); + LLTextBox* message = getChild<LLTextBox>("error_message"); if (message) { message->setVisible(true); @@ -1095,7 +1095,7 @@ void LLFloaterBuyLandUI::refreshUI() : getString("cant_own_land") ); - LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); + LLComboBox* levels = getChild<LLComboBox>( "account_level"); if (levels) { levels->setVisible(mSiteMembershipUpgrade); @@ -1296,7 +1296,7 @@ void LLFloaterBuyLandUI::startBuyPreConfirm() action += mSiteMembershipAction; action += "\n"; - LLComboBox* levels = LLUICtrlFactory::getComboBoxByName(this, "account_level"); + LLComboBox* levels = getChild<LLComboBox>( "account_level"); if (levels) { action += " * "; diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 3f510fc500..5ff75c4969 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -66,7 +66,7 @@ #include "llviewermessage.h" #include "llviewerwindow.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llchatbar.h" #include "lllogchat.h" #include "lltexteditor.h" @@ -81,7 +81,6 @@ extern void AddNewChatToLCD(const LLString &newLine); // const F32 INSTANT_MSG_SIZE = 8.0f; const F32 CHAT_MSG_SIZE = 8.0f; -const LLColor4 INSTANT_MSG_COLOR(1, 1, 1, 1); const LLColor4 MUTED_MSG_COLOR(0.5f, 0.5f, 0.5f, 1.f); const S32 MAX_CHATTER_COUNT = 16; @@ -102,7 +101,7 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed) mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL); // do not automatically open singleton floaters (as result of getInstance()) BOOL no_open = FALSE; - gUICtrlFactory->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml",&getFactoryMap(),no_open); childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes childSetVisible("Chat History Editor with mute",FALSE); @@ -140,12 +139,12 @@ void LLFloaterChat::draw() BOOL LLFloaterChat::postBuild() { - mPanel = (LLPanelActiveSpeakers*)LLUICtrlFactory::getPanelByName(this, "active_speakers_panel"); + mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel"); LLChatBar* chat_barp = getChild<LLChatBar>("chat_panel", TRUE); if (chat_barp) { - chat_barp->setGestureCombo(LLUICtrlFactory::getComboBoxByName(this, "Gesture")); + chat_barp->setGestureCombo(getChild<LLComboBox>( "Gesture")); } return TRUE; } @@ -274,7 +273,7 @@ void LLFloaterChat::onClickMute(void *data) { LLFloaterChat* self = (LLFloaterChat*)data; - LLComboBox* chatter_combo = LLUICtrlFactory::getComboBoxByName(self,"chatter combobox"); + LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox"); const LLString& name = chatter_combo->getSimple(); LLUUID id = chatter_combo->getCurrentID(); @@ -283,12 +282,9 @@ void LLFloaterChat::onClickMute(void *data) LLMute mute(id); mute.setFromDisplayName(name); - gMuteListp->add(mute); + LLMuteList::getInstance()->add(mute); - if (gFloaterMute) - { - LLFloaterMute::showInstance(); - } + LLFloaterMute::showInstance(); } //static @@ -298,7 +294,7 @@ void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data) //LLCheckBoxCtrl* - BOOL show_mute = LLUICtrlFactory::getCheckBoxByName(floater,"show mutes")->get(); + BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get(); LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor"); LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); @@ -351,9 +347,13 @@ void LLFloaterChat::addChat(const LLChat& chat, && !local_agent) { F32 size = CHAT_MSG_SIZE; - if(from_instant_message) + if (chat.mSourceType == CHAT_SOURCE_SYSTEM) + { + text_color = gSavedSettings.getColor("SystemChatColor"); + } + else if(from_instant_message) { - text_color = INSTANT_MSG_COLOR; + text_color = gSavedSettings.getColor("IMChatColor"); size = INSTANT_MSG_SIZE; } gConsole->addLine(chat.mText, size, text_color); @@ -458,7 +458,7 @@ void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , LLString line //static void* LLFloaterChat::createSpeakersPanel(void* data) { - return new LLPanelActiveSpeakers(gLocalSpeakerMgr, TRUE); + return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE); } //static diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index f18c31baf9..71de859703 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -35,7 +35,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloaterchatterbox.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llfloaterchat.h" #include "llfloaterfriends.h" #include "llfloatergroups.h" @@ -53,7 +53,7 @@ LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed) mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL); // do not automatically open singleton floaters (as result of getInstance()) BOOL no_open = FALSE; - gUICtrlFactory->buildFloater(this, "floater_my_friends.xml", &getFactoryMap(), no_open); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml", &getFactoryMap(), no_open); } LLFloaterMyFriends::~LLFloaterMyFriends() @@ -62,7 +62,7 @@ LLFloaterMyFriends::~LLFloaterMyFriends() BOOL LLFloaterMyFriends::postBuild() { - mTabs = LLUICtrlFactory::getTabContainerByName(this, "friends_and_groups"); + mTabs = getChild<LLTabContainer>("friends_and_groups"); return TRUE; } @@ -93,7 +93,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : { mAutoResize = FALSE; - gUICtrlFactory->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); if (gSavedSettings.getBOOL("ContactsTornOff")) { LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); @@ -128,33 +128,29 @@ LLFloaterChatterBox::~LLFloaterChatterBox() { } -BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask) { - if (getEnabled() - && mask == MASK_CONTROL) + if (key == 'W' && mask == MASK_CONTROL) { - if (key == 'W') + LLFloater* floater = getActiveFloater(); + // is user closeable and is system closeable + if (floater && floater->canClose()) { - LLFloater* floater = getActiveFloater(); - // is user closeable and is system closeable - if (floater && floater->canClose()) + if (floater->isCloseable()) { - if (floater->isCloseable()) - { - floater->close(); - } - else - { - // close chatterbox window if frontmost tab is reserved, non-closeable tab - // such as contacts or near me - close(); - } + floater->close(); + } + else + { + // close chatterbox window if frontmost tab is reserved, non-closeable tab + // such as contacts or near me + close(); } - return TRUE; } + return TRUE; } - return LLMultiFloater::handleKeyHere(key, mask, called_from_parent); + return LLMultiFloater::handleKeyHere(key, mask); } void LLFloaterChatterBox::draw() @@ -247,7 +243,7 @@ void LLFloaterChatterBox::addFloater(LLFloater* floaterp, { mTabContainer->unlockTabs(); // add chat history as second tab if contact window is present, first tab otherwise - if (getChildByName("floater_my_friends", TRUE)) + if (getChildView("floater_my_friends")) { // assuming contacts window is first tab, select it mTabContainer->selectFirstTab(); diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index 4b1da9c9bc..e74a2e3ffd 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -47,7 +47,7 @@ public: LLFloaterChatterBox(const LLSD& seed); virtual ~LLFloaterChatterBox(); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void draw(); /*virtual*/ void onOpen(); /*virtual*/ void onClose(bool app_quitting); diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 19793550cc..c805eea6ae 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -47,7 +47,7 @@ #include "v4coloru.h" #include "llbutton.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llgl.h" #include "llmemory.h" @@ -138,7 +138,7 @@ LLFloaterColorPicker:: createUI () { // build the majority of the gui using the factory builder - gUICtrlFactory->buildFloater ( this, "floater_color_picker.xml" ); + LLUICtrlFactory::getInstance()->buildFloater ( this, "floater_color_picker.xml" ); setVisible ( FALSE ); // create RGB type area (not really RGB but it's got R,G & B in it.,.. @@ -221,23 +221,23 @@ BOOL LLFloaterColorPicker:: postBuild() { - mCancelBtn = LLViewerUICtrlFactory::getButtonByName( this, "cancel_btn" ); + mCancelBtn = getChild<LLButton>( "cancel_btn" ); mCancelBtn->setClickedCallback ( onClickCancel ); mCancelBtn->setCallbackUserData ( this ); - mSelectBtn = LLViewerUICtrlFactory::getButtonByName( this, "select_btn"); + mSelectBtn = getChild<LLButton>( "select_btn"); mSelectBtn->setClickedCallback ( onClickSelect ); mSelectBtn->setCallbackUserData ( this ); mSelectBtn->setFocus ( TRUE ); - mPipetteBtn = LLViewerUICtrlFactory::getButtonByName ( this, "color_pipette" ); + mPipetteBtn = getChild<LLButton>("color_pipette" ); mPipetteBtn->setImages("eye_button_inactive.tga", "eye_button_active.tga"); mPipetteBtn->setClickedCallback( onClickPipette ); mPipetteBtn->setCallbackUserData ( this ); - mApplyImmediateCheck = LLViewerUICtrlFactory::getCheckBoxByName( this, "apply_immediate"); + mApplyImmediateCheck = getChild<LLCheckBoxCtrl>("apply_immediate"); mApplyImmediateCheck->set(gSavedSettings.getBOOL("ApplyColorImmediately")); mApplyImmediateCheck->setCommitCallback(onImmediateCheck); mApplyImmediateCheck->setCallbackUserData(this); @@ -468,18 +468,18 @@ void LLFloaterColorPicker::onClickPipette( void* data ) { LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data; - if ( self && gToolMgr) + if ( self) { BOOL pipette_active = self->mPipetteBtn->getToggleState(); pipette_active = !pipette_active; if (pipette_active) { - gToolPipette->setSelectCallback(onColorSelect, self); - gToolMgr->setTransientTool(gToolPipette); + LLToolPipette::getInstance()->setSelectCallback(onColorSelect, self); + LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); } else { - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); } } } @@ -587,8 +587,7 @@ void LLFloaterColorPicker::draw() mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } - mPipetteBtn->setEnabled(gToolMgr != NULL); - mPipetteBtn->setToggleState(gToolMgr && gToolMgr->getCurrentTool() == gToolPipette); + mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); mApplyImmediateCheck->setEnabled(mActive && mCanApplyImmediately); mSelectBtn->setEnabled(mActive); @@ -1227,8 +1226,8 @@ void LLFloaterColorPicker::setActive(BOOL active) void LLFloaterColorPicker::stopUsingPipette() { - if (gToolMgr && gToolMgr->getCurrentTool() == gToolPipette) + if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()) { - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); } } diff --git a/indra/newview/llfloaterdaycycle.cpp b/indra/newview/llfloaterdaycycle.cpp index 67694f49c2..ca1131face 100644 --- a/indra/newview/llfloaterdaycycle.cpp +++ b/indra/newview/llfloaterdaycycle.cpp @@ -41,7 +41,7 @@ #include "llmultisliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" @@ -64,10 +64,10 @@ const F32 LLFloaterDayCycle::sHoursPerDay = 24.0f; LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater("Day Cycle Floater") { - gUICtrlFactory->buildFloater(this, "floater_day_cycle_options.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_day_cycle_options.xml"); // add the combo boxes - LLComboBox* keyCombo = LLUICtrlFactory::getComboBoxByName(this, "WLKeyPresets"); + LLComboBox* keyCombo = getChild<LLComboBox>("WLKeyPresets"); if(keyCombo != NULL) { @@ -83,8 +83,7 @@ LLFloaterDayCycle::LLFloaterDayCycle() : LLFloater("Day Cycle Floater") } // add the time slider - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(this, - "WLTimeSlider"); + LLMultiSliderCtrl* sldr = getChild<LLMultiSliderCtrl>("WLTimeSlider"); sldr->addSlider(); @@ -148,16 +147,12 @@ void LLFloaterDayCycle::syncMenu() // std::map<std::string, LLVector4> & currentParams = LLWLParamManager::instance()->mCurParams.mParamValues; // set time - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(LLFloaterDayCycle::sDayCycle, - "WLTimeSlider"); + LLMultiSliderCtrl* sldr = LLFloaterDayCycle::sDayCycle->getChild<LLMultiSliderCtrl>("WLTimeSlider"); sldr->setCurSliderValue((F32)LLWLParamManager::instance()->mAnimator.getDayTime() * sHoursPerDay); - LLSpinCtrl* secSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLLengthOfDaySec"); - LLSpinCtrl* minSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLLengthOfDayHour"); + LLSpinCtrl* secSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDaySec"); + LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDayMin"); + LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLLengthOfDayHour"); F32 curRate; F32 hours, min, sec; @@ -188,8 +183,7 @@ void LLFloaterDayCycle::syncMenu() void LLFloaterDayCycle::syncSliderTrack() { // clear the slider - LLMultiSliderCtrl* kSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, - "WLDayCycleKeys"); + LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); kSldr->clear(); sSliderToKey.clear(); @@ -212,12 +206,12 @@ void LLFloaterDayCycle::syncTrack() } LLMultiSliderCtrl* sldr; - sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + sldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); llassert_always(sSliderToKey.size() == sldr->getValue().size()); LLMultiSliderCtrl* tSldr; - tSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLTimeSlider"); // create a new animation track @@ -267,7 +261,7 @@ void LLFloaterDayCycle::show() syncSliderTrack(); // comment in if you want the menu to rebuild each time - //gUICtrlFactory->buildFloater(dayCycle, "floater_day_cycle_options.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(dayCycle, "floater_day_cycle_options.xml"); //dayCycle->initCallbacks(); dayCycle->open(); @@ -291,13 +285,11 @@ void LLFloaterDayCycle::onRunAnimSky(void* userData) } LLMultiSliderCtrl* sldr; - sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, - "WLDayCycleKeys"); + sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); llassert_always(sSliderToKey.size() == sldr->getValue().size()); LLMultiSliderCtrl* tSldr; - tSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, - "WLTimeSlider"); + tSldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLTimeSlider"); // turn off linden time LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; @@ -324,7 +316,7 @@ void LLFloaterDayCycle::onStopAnimSky(void* userData) void LLFloaterDayCycle::onUseLindenTime(void* userData) { LLFloaterWindLight* wl = LLFloaterWindLight::instance(); - LLComboBox* box = LLUICtrlFactory::getComboBoxByName(wl, "WLPresetsCombo"); + LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo"); box->selectByValue(""); LLWLParamManager::instance()->mAnimator.mIsRunning = true; @@ -341,7 +333,7 @@ void LLFloaterDayCycle::onLoadDayCycle(void* userData) // set the param manager's track to the new one LLMultiSliderCtrl* tSldr; - tSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLTimeSlider"); LLWLParamManager::instance()->resetAnimator( tSldr->getCurSliderValue() / sHoursPerDay, false); @@ -359,7 +351,7 @@ void LLFloaterDayCycle::onSaveDayCycle(void* userData) void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData) { - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLTimeSlider"); /// get the slider value @@ -377,14 +369,10 @@ void LLFloaterDayCycle::onTimeSliderMoved(LLUICtrl* ctrl, void* userData) void LLFloaterDayCycle::onKeyTimeMoved(LLUICtrl* ctrl, void* userData) { - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sDayCycle, - "WLKeyPresets"); - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, - "WLDayCycleKeys"); - LLSpinCtrl* hourSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLCurKeyHour"); - LLSpinCtrl* minSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLCurKeyMin"); + LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("WLKeyPresets"); + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); + LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour"); + LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin"); if(sldr->getValue().size() == 0) { return; @@ -429,11 +417,11 @@ void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData) return; } - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); - LLSpinCtrl* hourSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, + LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>( "WLCurKeyHour"); - LLSpinCtrl* minSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, + LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>( "WLCurKeyMin"); F32 hour = hourSpin->get(); @@ -454,9 +442,9 @@ void LLFloaterDayCycle::onKeyTimeChanged(LLUICtrl* ctrl, void* userData) void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) { // get the time - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sDayCycle, + LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); // do nothing if no sliders @@ -481,13 +469,13 @@ void LLFloaterDayCycle::onKeyPresetChanged(LLUICtrl* ctrl, void* userData) void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData) { // get the time - LLSpinCtrl* secSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, + LLSpinCtrl* secSpin = sDayCycle->getChild<LLSpinCtrl>( "WLLengthOfDaySec"); - LLSpinCtrl* minSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, + LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>( "WLLengthOfDayMin"); - LLSpinCtrl* hourSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, + LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>( "WLLengthOfDayHour"); F32 hour; @@ -508,11 +496,11 @@ void LLFloaterDayCycle::onTimeRateChanged(LLUICtrl* ctrl, void* userData) void LLFloaterDayCycle::onAddKey(void* userData) { - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sDayCycle, + LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* kSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); - LLMultiSliderCtrl* tSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* tSldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLTimeSlider"); llassert_always(sSliderToKey.size() == kSldr->getValue().size()); @@ -528,7 +516,7 @@ void LLFloaterDayCycle::onAddKey(void* userData) void LLFloaterDayCycle::addSliderKey(F32 time, const LLString & presetName) { - LLMultiSliderCtrl* kSldr = LLUICtrlFactory::getMultiSliderByName(sDayCycle, + LLMultiSliderCtrl* kSldr = sDayCycle->getChild<LLMultiSliderCtrl>( "WLDayCycleKeys"); // make a slider @@ -553,8 +541,7 @@ void LLFloaterDayCycle::addSliderKey(F32 time, const LLString & presetName) void LLFloaterDayCycle::deletePreset(LLString& presetName) { - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName( - sDayCycle, "WLDayCycleKeys"); + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); /// delete any reference std::map<LLString, LLWLSkyKey>::iterator curr_preset, next_preset; @@ -576,10 +563,9 @@ void LLFloaterDayCycle::onDeleteKey(void* userData) return; } - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sDayCycle, + LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>( "WLKeyPresets"); - LLMultiSliderCtrl* sldr = LLUICtrlFactory::getMultiSliderByName( - sDayCycle, "WLDayCycleKeys"); + LLMultiSliderCtrl* sldr = sDayCycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); // delete from map const LLString& sldrName = sldr->getCurSlider(); @@ -596,10 +582,8 @@ void LLFloaterDayCycle::onDeleteKey(void* userData) comboBox->selectByValue(sSliderToKey[name].presetName); F32 time = sSliderToKey[name].time; - LLSpinCtrl* hourSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLCurKeyHour"); - LLSpinCtrl* minSpin = LLUICtrlFactory::getSpinnerByName(sDayCycle, - "WLCurKeyMin"); + LLSpinCtrl* hourSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyHour"); + LLSpinCtrl* minSpin = sDayCycle->getChild<LLSpinCtrl>("WLCurKeyMin"); // now set the spinners F32 hour = (F32)((S32)time); diff --git a/indra/newview/llfloaterenvsettings.cpp b/indra/newview/llfloaterenvsettings.cpp index 197e2ba15e..8570515f07 100644 --- a/indra/newview/llfloaterenvsettings.cpp +++ b/indra/newview/llfloaterenvsettings.cpp @@ -35,7 +35,7 @@ #include "llfloaterwindlight.h" #include "llfloaterwater.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llsliderctrl.h" #include "llcombobox.h" #include "llcolorswatch.h" @@ -55,7 +55,7 @@ LLFloaterEnvSettings* LLFloaterEnvSettings::sEnvSettings = NULL; LLFloaterEnvSettings::LLFloaterEnvSettings() : LLFloater("Environment Settings Floater") { - gUICtrlFactory->buildFloater(this, "floater_env_settings.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_env_settings.xml"); // load it up initCallbacks(); @@ -106,24 +106,14 @@ void LLFloaterEnvSettings::initCallbacks(void) void LLFloaterEnvSettings::syncMenu() { LLSliderCtrl* sldr; - sldr = LLUICtrlFactory::getSliderByName(sEnvSettings, - "EnvTimeSlider"); - if(NULL == sldr) - { - return; - } + sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider"); // sync the clock F32 val = (F32)LLWLParamManager::instance()->mAnimator.getDayTime(); LLString timeStr = timeToString(val); LLTextBox* textBox; - textBox = LLUICtrlFactory::getTextBoxByName(sEnvSettings, - "EnvTimeText"); - if(NULL == textBox) - { - return; - } + textBox = sEnvSettings->getChild<LLTextBox>("EnvTimeText"); textBox->setValue(timeStr); @@ -204,7 +194,7 @@ void LLFloaterEnvSettings::show() envSettings->syncMenu(); // comment in if you want the menu to rebuild each time - //gUICtrlFactory->buildFloater(envSettings, "floater_env_settings.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(envSettings, "floater_env_settings.xml"); //envSettings->initCallbacks(); envSettings->open(); @@ -232,8 +222,7 @@ void LLFloaterEnvSettings::onClose(bool app_quitting) void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldr; - sldr = LLUICtrlFactory::getSliderByName(sEnvSettings, - "EnvTimeSlider"); + sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvTimeSlider"); // deactivate animator LLWLParamManager::instance()->mAnimator.mIsRunning = false; @@ -253,8 +242,7 @@ void LLFloaterEnvSettings::onChangeDayTime(LLUICtrl* ctrl, void* userData) void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldr; - sldr = LLUICtrlFactory::getSliderByName(sEnvSettings, - "EnvCloudSlider"); + sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvCloudSlider"); // deactivate animator //LLWLParamManager::instance()->mAnimator.mIsRunning = false; @@ -267,10 +255,9 @@ void LLFloaterEnvSettings::onChangeCloudCoverage(LLUICtrl* ctrl, void* userData) void LLFloaterEnvSettings::onChangeWaterFogDensity(LLUICtrl* ctrl, void* userData) { LLSliderCtrl* sldr; - sldr = LLUICtrlFactory::getSliderByName(sEnvSettings, - "EnvWaterFogSlider"); + sldr = sEnvSettings->getChild<LLSliderCtrl>("EnvWaterFogSlider"); - if(NULL == sldr || NULL == userData) + if(NULL == userData) { return; } @@ -313,7 +300,7 @@ void LLFloaterEnvSettings::onUseEstateTime(void* userData) { // select the blank value in LLFloaterWindLight* wl = LLFloaterWindLight::instance(); - LLComboBox* box = LLUICtrlFactory::getComboBoxByName(wl, "WLPresetsCombo"); + LLComboBox* box = wl->getChild<LLComboBox>("WLPresetsCombo"); box->selectByValue(""); } diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp index 7c76923190..3579b2a058 100644 --- a/indra/newview/llfloaterevent.cpp +++ b/indra/newview/llfloaterevent.cpp @@ -37,10 +37,10 @@ // viewer project includes #include "llcommandhandler.h" #include "llpanelevent.h" -#include "llvieweruictrlfactory.h" // linden library includes #include "lluuid.h" +#include "lluictrlfactory.h" //////////////////////////////////////////////////////////////////////////// // LLFloaterEventInfo @@ -79,7 +79,7 @@ LLFloaterEventInfo::LLFloaterEventInfo(const std::string& name, const U32 event_ { mFactoryMap["event_details_panel"] = LLCallbackMap(LLFloaterEventInfo::createEventDetail, this); - gUICtrlFactory->buildFloater(this, "floater_preview_event.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_event.xml", &getFactoryMap()); gEventInfoInstances.addData(event_id, this); } @@ -100,7 +100,7 @@ void* LLFloaterEventInfo::createEventDetail(void* userdata) { LLFloaterEventInfo *self = (LLFloaterEventInfo*)userdata; self->mPanelEventp = new LLPanelEvent(); - gUICtrlFactory->buildPanel(self->mPanelEventp, "panel_event.xml"); + LLUICtrlFactory::getInstance()->buildPanel(self->mPanelEventp, "panel_event.xml"); return self->mPanelEventp; } diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index f5942cfbdd..b7e50145c3 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -51,7 +51,7 @@ #include "llnotify.h" #include "llresmgr.h" #include "llimview.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llmenucommands.h" #include "llviewercontrol.h" #include "llviewermessage.h" @@ -178,7 +178,7 @@ void LLPanelFriends::updateFriends(U32 changed_mask) // virtual BOOL LLPanelFriends::postBuild() { - mFriendsList = LLUICtrlFactory::getScrollListByName(this, "friend_list"); + mFriendsList = getChild<LLScrollListCtrl>("friend_list"); mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); mFriendsList->setMaximumSelectCallback(onMaximumSelect); mFriendsList->setCommitOnSelectionChange(TRUE); @@ -201,7 +201,7 @@ BOOL LLPanelFriends::postBuild() // primary sort = online status, secondary sort = name mFriendsList->sortByColumn("friend_name", TRUE); - mFriendsList->sortByColumn("icon_online_status", TRUE); + mFriendsList->sortByColumn("icon_online_status", FALSE); return TRUE; } @@ -219,37 +219,46 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) LLSD element; element["id"] = agent_id; - element["columns"][LIST_FRIEND_NAME]["column"] = "friend_name"; - element["columns"][LIST_FRIEND_NAME]["value"] = fullname; - element["columns"][LIST_FRIEND_NAME]["font"] = "SANSSERIF"; - element["columns"][LIST_FRIEND_NAME]["font-style"] = "NORMAL"; - element["columns"][LIST_ONLINE_STATUS]["column"] = "icon_online_status"; - element["columns"][LIST_ONLINE_STATUS]["type"] = "icon"; + LLSD& friend_column = element["columns"][LIST_FRIEND_NAME]; + friend_column["column"] = "friend_name"; + friend_column["value"] = fullname; + friend_column["font"] = "SANSSERIF"; + friend_column["font-style"] = "NORMAL"; + + LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; + online_status_column["column"] = "icon_online_status"; + online_status_column["type"] = "icon"; + if (online) { - element["columns"][LIST_FRIEND_NAME]["font-style"] = "BOLD"; - element["columns"][LIST_ONLINE_STATUS]["value"] = gViewerArt.getString("icon_avatar_online.tga"); + friend_column["font-style"] = "BOLD"; + online_status_column["value"] = "icon_avatar_online.tga"; } - element["columns"][LIST_VISIBLE_ONLINE]["column"] = "icon_visible_online"; - element["columns"][LIST_VISIBLE_ONLINE]["type"] = "checkbox"; - element["columns"][LIST_VISIBLE_ONLINE]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); + LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE]; + online_column["column"] = "icon_visible_online"; + online_column["type"] = "checkbox"; + online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); - element["columns"][LIST_VISIBLE_MAP]["column"] = "icon_visible_map"; - element["columns"][LIST_VISIBLE_MAP]["type"] = "checkbox"; - element["columns"][LIST_VISIBLE_MAP]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); + LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP]; + visible_map_column["column"] = "icon_visible_map"; + visible_map_column["type"] = "checkbox"; + visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); - element["columns"][LIST_EDIT_MINE]["column"] = "icon_edit_mine"; - element["columns"][LIST_EDIT_MINE]["type"] = "checkbox"; - element["columns"][LIST_EDIT_MINE]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); + LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE]; + edit_my_object_column["column"] = "icon_edit_mine"; + edit_my_object_column["type"] = "checkbox"; + edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); - element["columns"][LIST_EDIT_THEIRS]["column"] = "icon_edit_theirs"; - element["columns"][LIST_EDIT_THEIRS]["type"] = "checkbox"; - element["columns"][LIST_EDIT_THEIRS]["enabled"] = ""; - element["columns"][LIST_EDIT_THEIRS]["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); + LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS]; + edit_their_object_column["column"] = "icon_edit_theirs"; + edit_their_object_column["type"] = "checkbox"; + edit_their_object_column["enabled"] = ""; + edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); - element["columns"][LIST_FRIEND_UPDATE_GEN]["column"] = "friend_last_update_generation"; - element["columns"][LIST_FRIEND_UPDATE_GEN]["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; + LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN]; + update_gen_column["column"] = "friend_last_update_generation"; + update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; mFriendsList->addElement(element, ADD_BOTTOM); return have_name; @@ -265,7 +274,7 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh std::string fullname; BOOL have_name = gCacheName->getFullName(agent_id, fullname); - itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? gViewerArt.getString("icon_avatar_online.tga") : LLString()); + itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? "icon_avatar_online.tga" : LLString::null); itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); // render name of online friends in bold text ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(info->isOnline() ? LLFontGL::BOLD : LLFontGL::NORMAL); @@ -292,7 +301,7 @@ void LLPanelFriends::refreshRightsChangeList() bool can_offer_teleport = num_selected >= 1; bool selected_friends_online = true; - LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label"); + LLTextBox* processing_label = getChild<LLTextBox>("process_rights_label"); if(!mAllowRightsChange) { diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 171c7da0f9..e361309a61 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -52,7 +52,7 @@ #include "llscrollcontainer.h" #include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewergesture.h" #include "llviewerimagelist.h" #include "llviewerinventory.h" @@ -144,7 +144,7 @@ void LLFloaterGesture::show() LLFloaterGesture *self = new LLFloaterGesture(); // Builds and adds to gFloaterView - gUICtrlFactory->buildFloater(self, "floater_gesture.xml"); + LLUICtrlFactory::getInstance()->buildFloater(self, "floater_gesture.xml"); // Fix up rectangle LLRect rect = gSavedSettings.getRect("FloaterGestureRect2"); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index 27d427115b..c919302424 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -71,7 +71,7 @@ #include "llvlcomposition.h" #include "llsurface.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" @@ -124,7 +124,7 @@ LLFloaterGodTools::LLFloaterGodTools() factory_map["region"] = LLCallbackMap(createPanelRegion, this); factory_map["objects"] = LLCallbackMap(createPanelObjects, this); factory_map["request"] = LLCallbackMap(createPanelRequest, this); - gUICtrlFactory->buildFloater(this, "floater_god_tools.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_god_tools.xml", &factory_map); childSetTabChangeCallback("GodTools Tabs", "grid", onTabChanged, this); childSetTabChangeCallback("GodTools Tabs", "region", onTabChanged, this); @@ -853,18 +853,14 @@ void LLPanelRegionTools::onSelectRegion(void* userdata) { llinfos << "LLPanelRegionTools::onSelectRegion" << llendl; - if (!gWorldp) - { - return; - } - LLViewerRegion *regionp = gWorldp->getRegionFromPosGlobal(gAgent.getPositionGlobal()); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(gAgent.getPositionGlobal()); if (!regionp) { return; } LLVector3d north_east(REGION_WIDTH_METERS, REGION_WIDTH_METERS, 0); - gParcelMgr->selectLand(regionp->getOriginGlobal(), + LLViewerParcelMgr::getInstance()->selectLand(regionp->getOriginGlobal(), regionp->getOriginGlobal() + north_east, FALSE); } @@ -1261,12 +1257,12 @@ void LLPanelObjectTools::onClickSetBySelection(void* data) if (!panelp) return; const BOOL non_root_ok = TRUE; - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(NULL, non_root_ok); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(NULL, non_root_ok); if (!node) return; LLString owner_name; LLUUID owner_id; - gSelectMgr->selectGetOwner(owner_id, owner_name); + LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); panelp->mTargetAvatar = owner_id; LLString name = "Object " + node->mName + " owned by " + owner_name; @@ -1348,8 +1344,8 @@ void LLPanelRequestTools::refresh() list->operateOnAll(LLCtrlListInterface::OP_DELETE); list->addSimpleElement(SELECTION); list->addSimpleElement(AGENT_REGION); - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; LLString name = regionp->getName(); @@ -1400,7 +1396,7 @@ void LLPanelRequestTools::onClickRequest(void* data) std::string req = self->childGetValue("request"); req = req.substr(0, req.find_first_of(" ")); std::string param = self->childGetValue("parameter"); - gSelectMgr->sendGodlikeRequest(req, param); + LLSelectMgr::getInstance()->sendGodlikeRequest(req, param); } else if(dest == AGENT_REGION) { @@ -1409,8 +1405,8 @@ void LLPanelRequestTools::onClickRequest(void* data) else { // find region by name - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; if(dest == regionp->getName()) diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index 7a0f01e5a6..26ed03951c 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -52,7 +52,7 @@ #include "llselectmgr.h" #include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llimview.h" @@ -81,7 +81,7 @@ LLFloaterGroupPicker* LLFloaterGroupPicker::findInstance(const LLSD& seed) LLFloaterGroupPicker* LLFloaterGroupPicker::createInstance(const LLSD &seed) { LLFloaterGroupPicker* pickerp = new LLFloaterGroupPicker(seed); - gUICtrlFactory->buildFloater(pickerp, "floater_choose_group.xml"); + LLUICtrlFactory::getInstance()->buildFloater(pickerp, "floater_choose_group.xml"); return pickerp; } @@ -115,7 +115,7 @@ void LLFloaterGroupPicker::setPowersMask(U64 powers_mask) BOOL LLFloaterGroupPicker::postBuild() { - init_group_list(LLUICtrlFactory::getScrollListByName(this, "group list"), gAgent.getGroupID(), mPowersMask); + init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID(), mPowersMask); childSetAction("OK", onBtnOK, this); @@ -199,7 +199,7 @@ void LLPanelGroups::reset() childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); - init_group_list(LLUICtrlFactory::getScrollListByName(this, "group list"), gAgent.getGroupID()); + init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID()); enableButtons(); } @@ -210,7 +210,7 @@ BOOL LLPanelGroups::postBuild() childSetTextArg("groupcount", "[COUNT]", llformat("%d",gAgent.mGroups.count())); childSetTextArg("groupcount", "[MAX]", llformat("%d",MAX_AGENT_GROUPS)); - init_group_list(LLUICtrlFactory::getScrollListByName(this, "group list"), gAgent.getGroupID()); + init_group_list(getChild<LLScrollListCtrl>("group list"), gAgent.getGroupID()); childSetAction("Activate", onBtnActivate, this); diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp index a3c3acd3bb..d58517ee92 100644 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ b/indra/newview/llfloaterhardwaresettings.cpp @@ -40,7 +40,7 @@ #include "llstartup.h" #include "llradiogroup.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llimagegl.h" #include "pipeline.h" @@ -49,7 +49,7 @@ LLFloaterHardwareSettings* LLFloaterHardwareSettings::sHardwareSettings = NULL; LLFloaterHardwareSettings::LLFloaterHardwareSettings() : LLFloater("Hardware Settings Floater") { - gUICtrlFactory->buildFloater(this, "floater_hardware_settings.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hardware_settings.xml"); // load it up initCallbacks(); @@ -94,7 +94,7 @@ void LLFloaterHardwareSettings::refreshEnabledState() childSetMinValue("GrapicsCardTextureMemory", min_tex_mem); childSetMaxValue("GrapicsCardTextureMemory", max_tex_mem); - if (!gFeatureManagerp->isFeatureAvailable("RenderVBOEnable") || + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { childSetEnabled("vbo", FALSE); @@ -124,7 +124,7 @@ void LLFloaterHardwareSettings::show() hardSettings->center(); // comment in if you want the menu to rebuild each time - //gUICtrlFactory->buildFloater(hardSettings, "floater_hardware_settings.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(hardSettings, "floater_hardware_settings.xml"); //hardSettings->initCallbacks(); hardSettings->open(); @@ -153,17 +153,6 @@ void LLFloaterHardwareSettings::onClose(bool app_quitting) BOOL LLFloaterHardwareSettings::postBuild() { - requires("ani", WIDGET_TYPE_CHECKBOX); - requires("gamma", WIDGET_TYPE_SPINNER); - requires("vbo", WIDGET_TYPE_CHECKBOX); - requires("GrapicsCardTextureMemory", WIDGET_TYPE_SLIDER); - requires("fog", WIDGET_TYPE_SPINNER); - - if (!checkRequirements()) - { - return FALSE; - } - childSetAction("OK", onBtnOK, this); refresh(); diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp index 72110e4fff..7f311be9fd 100644 --- a/indra/newview/llfloaterhud.cpp +++ b/indra/newview/llfloaterhud.cpp @@ -11,7 +11,7 @@ #include "llfloaterhud.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llwebbrowserctrl.h" #include "llalertdialog.h" @@ -37,14 +37,14 @@ LLFloaterHUD::LLFloaterHUD() setBackgroundOpaque(TRUE); // Create floater from its XML definition - gUICtrlFactory->buildFloater(this, "floater_hud.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml"); // Position floater based on saved location LLRect saved_position_rect = gSavedSettings.getRect("FloaterHUDRect"); reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE); setRect(saved_position_rect); - mWebBrowser = LLViewerUICtrlFactory::getWebBrowserByName(this, "floater_hud_browser" ); + mWebBrowser = getChild<LLWebBrowserCtrl>("floater_hud_browser" ); if (mWebBrowser) { // Always refresh the browser diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index eb5ee352b9..0fdc1ccdc6 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -52,7 +52,7 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "pipeline.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerimagelist.h" //static @@ -616,7 +616,7 @@ LLImagePreviewAvatar::LLImagePreviewAvatar(S32 width, S32 height) : LLDynamicTex mDummyAvatar->slamPosition(); mDummyAvatar->updateJointLODs(); mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); - // gPipeline.markVisible(mDummyAvatar->mDrawable, *gCamera); + // gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); mTextureName = 0; } @@ -696,16 +696,16 @@ BOOL LLImagePreviewAvatar::render() LLQuaternion(mCameraYaw, LLVector3::z_axis); LLQuaternion av_rot = avatarp->mPelvisp->getWorldRotation() * camera_rot; - gCamera->setOriginAndLookAt( + LLViewerCamera::getInstance()->setOriginAndLookAt( target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + mCameraOffset) * av_rot), // camera LLVector3::z_axis, // up target_pos + (mCameraOffset * av_rot) ); // point of interest stop_glerror(); - gCamera->setAspect((F32)mWidth / mHeight); - gCamera->setView(gCamera->getDefaultFOV() / mCameraZoom); - gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setAspect((F32)mWidth / mHeight); + LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); LLVertexBuffer::stopRender(); avatarp->updateLOD(); @@ -787,7 +787,7 @@ LLImagePreviewSculpted::LLImagePreviewSculpted(S32 width, S32 height) : LLDynami mDummyAvatar->slamPosition(); mDummyAvatar->updateJointLODs(); mDummyAvatar->updateGeometry(mDummyAvatar->mDrawable); - gPipeline.markVisible(mDummyAvatar->mDrawable, *gCamera); + gPipeline.markVisible(mDummyAvatar->mDrawable, *LLViewerCamera::getInstance()); mTextureName = 0; */ } @@ -856,16 +856,16 @@ BOOL LLImagePreviewSculpted::render() LLQuaternion(mCameraYaw, LLVector3::z_axis); LLQuaternion av_rot = camera_rot; - gCamera->setOriginAndLookAt( + LLViewerCamera::getInstance()->setOriginAndLookAt( target_pos + ((LLVector3(mCameraDistance, 0.f, 0.f) + mCameraOffset) * av_rot), // camera LLVector3::z_axis, // up target_pos + (mCameraOffset * av_rot) ); // point of interest stop_glerror(); - gCamera->setAspect((F32) mWidth / mHeight); - gCamera->setView(gCamera->getDefaultFOV() / mCameraZoom); - gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setAspect((F32) mWidth / mHeight); + LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); gPipeline.enableLightsAvatar(); diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 4280e250d7..a2e26d27a8 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -40,7 +40,7 @@ #include "lltoolmgr.h" #include "llviewercontrol.h" #include "llviewerobject.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" LLFloaterInspect* LLFloaterInspect::sInstance = NULL; @@ -49,19 +49,19 @@ LLFloaterInspect::LLFloaterInspect(void) : mDirty(FALSE) { sInstance = this; - gUICtrlFactory->buildFloater(this, "floater_inspect.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml"); } LLFloaterInspect::~LLFloaterInspect(void) { if(!gFloaterTools->getVisible()) { - if(gToolMgr->getBaseTool() == gToolInspect) + if(LLToolMgr::getInstance()->getBaseTool() == LLToolCompInspect::getInstance()) { - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); } // Switch back to basic toolset - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); } else { @@ -80,7 +80,7 @@ void LLFloaterInspect::show(void* ignored) // setForceSelection ensures that the pie menu does not deselect things when it // looses the focus (this can happen with "select own objects only" enabled // VWR-1471 - BOOL forcesel = gSelectMgr->setForceSelection(TRUE); + BOOL forcesel = LLSelectMgr::getInstance()->setForceSelection(TRUE); if (!sInstance) // first use { @@ -88,10 +88,10 @@ void LLFloaterInspect::show(void* ignored) } sInstance->open(); - gToolMgr->setTransientTool(gToolInspect); - gSelectMgr->setForceSelection(forcesel); // restore previouis value + LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance()); + LLSelectMgr::getInstance()->setForceSelection(forcesel); // restore previouis value - sInstance->mObjectSelection = gSelectMgr->getSelection(); + sInstance->mObjectSelection = LLSelectMgr::getInstance()->getSelection(); sInstance->refresh(); } @@ -152,7 +152,7 @@ void LLFloaterInspect::onClickOwnerProfile(void* ctrl) BOOL LLFloaterInspect::postBuild() { - mObjectList = LLUICtrlFactory::getScrollListByName(this, "object_list"); + mObjectList = getChild<LLScrollListCtrl>("object_list"); childSetAction("button owner",onClickOwnerProfile, this); childSetAction("button creator",onClickCreatorProfile, this); childSetCommitCallback("object_list", onSelectObject); @@ -256,7 +256,7 @@ void LLFloaterInspect::refresh() void LLFloaterInspect::onFocusReceived() { - gToolMgr->setTransientTool(gToolInspect); + LLToolMgr::getInstance()->setTransientTool(LLToolCompInspect::getInstance()); LLFloater::onFocusReceived(); } diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp index 9f1bef5be7..1213d436cc 100644 --- a/indra/newview/llfloaterlagmeter.cpp +++ b/indra/newview/llfloaterlagmeter.cpp @@ -33,7 +33,7 @@ #include "llfloaterlagmeter.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerstats.h" #include "llviewerimage.h" #include "llviewercontrol.h" @@ -54,23 +54,23 @@ LLFloaterLagMeter * LLFloaterLagMeter::sInstance = NULL; LLFloaterLagMeter::LLFloaterLagMeter() : LLFloater("floater_lagmeter") { - gUICtrlFactory->buildFloater(this, "floater_lagmeter.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml"); // Don't let this window take keyboard focus -- it's confusing to // lose arrow-key driving when testing lag. setIsChrome(TRUE); - mClientButton = LLUICtrlFactory::getButtonByName(this, "client_lagmeter"); - mClientText = LLUICtrlFactory::getTextBoxByName(this, "client_text"); - mClientCause = LLUICtrlFactory::getTextBoxByName(this, "client_lag_cause"); + mClientButton = getChild<LLButton>("client_lagmeter"); + mClientText = getChild<LLTextBox>("client_text"); + mClientCause = getChild<LLTextBox>("client_lag_cause"); - mNetworkButton = LLUICtrlFactory::getButtonByName(this, "network_lagmeter"); - mNetworkText = LLUICtrlFactory::getTextBoxByName(this, "network_text"); - mNetworkCause = LLUICtrlFactory::getTextBoxByName(this, "network_lag_cause"); + mNetworkButton = getChild<LLButton>("network_lagmeter"); + mNetworkText = getChild<LLTextBox>("network_text"); + mNetworkCause = getChild<LLTextBox>("network_lag_cause"); - mServerButton = LLUICtrlFactory::getButtonByName(this, "server_lagmeter"); - mServerText = LLUICtrlFactory::getTextBoxByName(this, "server_text"); - mServerCause = LLUICtrlFactory::getTextBoxByName(this, "server_lag_cause"); + mServerButton = getChild<LLButton>("server_lagmeter"); + mServerText = getChild<LLTextBox>("server_text"); + mServerCause = getChild<LLTextBox>("server_lag_cause"); LLString config_string = getString("client_frame_rate_critical_fps", mStringArgs); mClientFrameTimeCritical = 1.0f / (float)atof( config_string.c_str() ); @@ -156,7 +156,7 @@ void LLFloaterLagMeter::show(void *data) void LLFloaterLagMeter::determineClient() { - F32 client_frame_time = gViewerStats->mFPSStat.getMeanDuration(); + F32 client_frame_time = LLViewerStats::getInstance()->mFPSStat.getMeanDuration(); bool find_cause = false; if (!gFocusMgr.getAppHasFocus()) @@ -207,8 +207,8 @@ void LLFloaterLagMeter::determineClient() void LLFloaterLagMeter::determineNetwork() { - F32 packet_loss = gViewerStats->mPacketsLostPercentStat.getMean(); - F32 ping_time = gViewerStats->mSimPingStat.getMean(); + F32 packet_loss = LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean(); + F32 ping_time = LLViewerStats::getInstance()->mSimPingStat.getMean(); bool find_cause_loss = false; bool find_cause_ping = false; @@ -258,7 +258,7 @@ void LLFloaterLagMeter::determineNetwork() void LLFloaterLagMeter::determineServer() { - F32 sim_frame_time = gViewerStats->mSimFrameMsec.getCurrent(); + F32 sim_frame_time = LLViewerStats::getInstance()->mSimFrameMsec.getCurrent(); bool find_cause = false; if(sim_frame_time >= mServerFrameTimeCritical) @@ -282,23 +282,23 @@ void LLFloaterLagMeter::determineServer() if(find_cause) { - if(gViewerStats->mSimSimPhysicsMsec.getCurrent() > mServerSingleProcessMaxTime) + if(LLViewerStats::getInstance()->mSimSimPhysicsMsec.getCurrent() > mServerSingleProcessMaxTime) { mServerCause->setText( getString("server_physics_cause_msg", mStringArgs) ); } - else if(gViewerStats->mSimScriptMsec.getCurrent() > mServerSingleProcessMaxTime) + else if(LLViewerStats::getInstance()->mSimScriptMsec.getCurrent() > mServerSingleProcessMaxTime) { mServerCause->setText( getString("server_scripts_cause_msg", mStringArgs) ); } - else if(gViewerStats->mSimNetMsec.getCurrent() > mServerSingleProcessMaxTime) + else if(LLViewerStats::getInstance()->mSimNetMsec.getCurrent() > mServerSingleProcessMaxTime) { mServerCause->setText( getString("server_net_cause_msg", mStringArgs) ); } - else if(gViewerStats->mSimAgentMsec.getCurrent() > mServerSingleProcessMaxTime) + else if(LLViewerStats::getInstance()->mSimAgentMsec.getCurrent() > mServerSingleProcessMaxTime) { mServerCause->setText( getString("server_agent_cause_msg", mStringArgs) ); } - else if(gViewerStats->mSimImagesMsec.getCurrent() > mServerSingleProcessMaxTime) + else if(LLViewerStats::getInstance()->mSimImagesMsec.getCurrent() > mServerSingleProcessMaxTime) { mServerCause->setText( getString("server_images_cause_msg", mStringArgs) ); } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index aafd5d7cb4..595f4afd72 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -60,7 +60,7 @@ #include "lltextbox.h" #include "lltexturectrl.h" #include "lluiconstants.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewermessage.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" @@ -130,12 +130,12 @@ void send_parcel_select_objects(S32 parcel_local_id, S32 return_type, { LLMessageSystem *msg = gMessageSystem; - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; // Since new highlight will be coming in, drop any highlights // that exist right now. - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); msg->newMessageFast(_PREHASH_ParcelSelectObjects); msg->nextBlockFast(_PREHASH_AgentData); @@ -191,9 +191,9 @@ void LLFloaterLand::onOpen() { // Done automatically when the selected parcel's properties arrive // (and hence we have the local id). - // gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER); + // LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN | AL_RENTER); - mParcel = gParcelMgr->getFloatingParcelSelection(); + mParcel = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); // Refresh even if not over a region so we don't get an // uninitialized dialog. The dialog is 0-region aware. @@ -204,12 +204,12 @@ void LLFloaterLand::onOpen() // virtual void LLFloaterLand::onClose(bool app_quitting) { - gParcelMgr->removeObserver( sObserver ); + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; sObserver = NULL; // Might have been showing owned objects - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); // Save which panel we had open sLastTab = mTabLand->getCurrentPanelIndex(); @@ -233,19 +233,18 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed) factory_map["land_media_panel"] = LLCallbackMap(createPanelLandMedia, this); factory_map["land_access_panel"] = LLCallbackMap(createPanelLandAccess, this); - gUICtrlFactory->buildFloater(this, "floater_about_land.xml", &factory_map, false); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_about_land.xml", &factory_map, false); sObserver = new LLParcelSelectionObserver(); - gParcelMgr->addObserver( sObserver ); + LLViewerParcelMgr::getInstance()->addObserver( sObserver ); } BOOL LLFloaterLand::postBuild() { - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(this, "landtab"); + LLTabContainer* tab = getChild<LLTabContainer>("landtab"); mTabLand = (LLTabContainer*) tab; - if (tab) { tab->selectTab(sLastTab); @@ -280,8 +279,6 @@ void* LLFloaterLand::createPanelLandGeneral(void* data) } // static - - void* LLFloaterLand::createPanelLandCovenant(void* data) { LLFloaterLand* self = (LLFloaterLand*)data; @@ -337,96 +334,96 @@ LLPanelLandGeneral::LLPanelLandGeneral(LLParcelSelectionHandle& parcel) BOOL LLPanelLandGeneral::postBuild() { - mEditName = LLUICtrlFactory::getLineEditorByName(this, "Name"); + mEditName = getChild<LLLineEditor>("Name"); mEditName->setCommitCallback(onCommitAny); childSetPrevalidate("Name", LLLineEditor::prevalidatePrintableNotPipe); childSetUserData("Name", this); - mEditDesc = LLUICtrlFactory::getTextEditorByName(this, "Description"); + mEditDesc = getChild<LLTextEditor>("Description"); mEditDesc->setCommitOnFocusLost(TRUE); mEditDesc->setCommitCallback(onCommitAny); childSetPrevalidate("Description", LLLineEditor::prevalidatePrintableNotPipe); childSetUserData("Description", this); - mTextSalePending = LLUICtrlFactory::getTextBoxByName(this, "SalePending"); - mTextOwnerLabel = LLUICtrlFactory::getTextBoxByName(this, "Owner:"); - mTextOwner = LLUICtrlFactory::getTextBoxByName(this, "OwnerText"); + mTextSalePending = getChild<LLTextBox>("SalePending"); + mTextOwnerLabel = getChild<LLTextBox>("Owner:"); + mTextOwner = getChild<LLTextBox>("OwnerText"); - mBtnProfile = LLUICtrlFactory::getButtonByName(this, "Profile..."); + mBtnProfile = getChild<LLButton>("Profile..."); mBtnProfile->setClickedCallback(onClickProfile, this); - mTextGroupLabel = LLUICtrlFactory::getTextBoxByName(this, "Group:"); - mTextGroup = LLUICtrlFactory::getTextBoxByName(this, "GroupText"); + mTextGroupLabel = getChild<LLTextBox>("Group:"); + mTextGroup = getChild<LLTextBox>("GroupText"); - mBtnSetGroup = LLUICtrlFactory::getButtonByName(this, "Set..."); + mBtnSetGroup = getChild<LLButton>("Set..."); mBtnSetGroup->setClickedCallback(onClickSetGroup, this); - mCheckDeedToGroup = LLUICtrlFactory::getCheckBoxByName(this, "check deed"); + mCheckDeedToGroup = getChild<LLCheckBoxCtrl>( "check deed"); childSetCommitCallback("check deed", onCommitAny, this); - mBtnDeedToGroup = LLUICtrlFactory::getButtonByName(this, "Deed..."); + mBtnDeedToGroup = getChild<LLButton>("Deed..."); mBtnDeedToGroup->setClickedCallback(onClickDeed, this); - mCheckContributeWithDeed = LLUICtrlFactory::getCheckBoxByName(this, "check contrib"); + mCheckContributeWithDeed = getChild<LLCheckBoxCtrl>( "check contrib"); childSetCommitCallback("check contrib", onCommitAny, this); - mSaleInfoNotForSale = LLUICtrlFactory::getTextBoxByName(this, "Not for sale."); + mSaleInfoNotForSale = getChild<LLTextBox>("Not for sale."); - mSaleInfoForSale1 = LLUICtrlFactory::getTextBoxByName(this, "For Sale: Price L$[PRICE]."); + mSaleInfoForSale1 = getChild<LLTextBox>("For Sale: Price L$[PRICE]."); - mBtnSellLand = LLUICtrlFactory::getButtonByName(this, "Sell Land..."); + mBtnSellLand = getChild<LLButton>("Sell Land..."); mBtnSellLand->setClickedCallback(onClickSellLand, this); - mSaleInfoForSale2 = LLUICtrlFactory::getTextBoxByName(this, "For sale to"); + mSaleInfoForSale2 = getChild<LLTextBox>("For sale to"); - mSaleInfoForSaleObjects = LLUICtrlFactory::getTextBoxByName(this, "Sell with landowners objects in parcel."); + mSaleInfoForSaleObjects = getChild<LLTextBox>("Sell with landowners objects in parcel."); - mSaleInfoForSaleNoObjects = LLUICtrlFactory::getTextBoxByName(this, "Selling with no objects in parcel."); + mSaleInfoForSaleNoObjects = getChild<LLTextBox>("Selling with no objects in parcel."); - mBtnStopSellLand = LLUICtrlFactory::getButtonByName(this, "Cancel Land Sale"); + mBtnStopSellLand = getChild<LLButton>("Cancel Land Sale"); mBtnStopSellLand->setClickedCallback(onClickStopSellLand, this); - mTextClaimDateLabel = LLUICtrlFactory::getTextBoxByName(this, "Claimed:"); - mTextClaimDate = LLUICtrlFactory::getTextBoxByName(this, "DateClaimText"); + mTextClaimDateLabel = getChild<LLTextBox>("Claimed:"); + mTextClaimDate = getChild<LLTextBox>("DateClaimText"); - mTextPriceLabel = LLUICtrlFactory::getTextBoxByName(this, "PriceLabel"); - mTextPrice = LLUICtrlFactory::getTextBoxByName(this, "PriceText"); + mTextPriceLabel = getChild<LLTextBox>("PriceLabel"); + mTextPrice = getChild<LLTextBox>("PriceText"); - mTextDwell = LLUICtrlFactory::getTextBoxByName(this, "DwellText"); + mTextDwell = getChild<LLTextBox>("DwellText"); - mBtnBuyLand = LLUICtrlFactory::getButtonByName(this, "Buy Land..."); + mBtnBuyLand = getChild<LLButton>("Buy Land..."); mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND); - mBtnBuyGroupLand = LLUICtrlFactory::getButtonByName(this, "Buy For Group..."); + mBtnBuyGroupLand = getChild<LLButton>("Buy For Group..."); mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND); - mBtnBuyPass = LLUICtrlFactory::getButtonByName(this, "Buy Pass..."); + mBtnBuyPass = getChild<LLButton>("Buy Pass..."); mBtnBuyPass->setClickedCallback(onClickBuyPass, this); - mBtnReleaseLand = LLUICtrlFactory::getButtonByName(this, "Abandon Land..."); + mBtnReleaseLand = getChild<LLButton>("Abandon Land..."); mBtnReleaseLand->setClickedCallback(onClickRelease, NULL); - mBtnReclaimLand = LLUICtrlFactory::getButtonByName(this, "Reclaim Land..."); + mBtnReclaimLand = getChild<LLButton>("Reclaim Land..."); mBtnReclaimLand->setClickedCallback(onClickReclaim, NULL); - mBtnStartAuction = LLUICtrlFactory::getButtonByName(this, "Linden Sale..."); + mBtnStartAuction = getChild<LLButton>("Linden Sale..."); mBtnStartAuction->setClickedCallback(onClickStartAuction, NULL); return TRUE; @@ -445,7 +442,7 @@ void LLPanelLandGeneral::refresh() LLParcel *parcel = mParcel->getParcel(); bool region_owner = false; - LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); + LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(regionp && (regionp->getOwner() == gAgent.getID())) { region_owner = true; @@ -672,16 +669,16 @@ void LLPanelLandGeneral::refresh() refreshNames(); mBtnBuyLand->setEnabled( - gParcelMgr->canAgentBuyParcel(parcel, false)); + LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false)); mBtnBuyGroupLand->setEnabled( - gParcelMgr->canAgentBuyParcel(parcel, true)); + LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, true)); // show pricing information S32 area; S32 claim_price; S32 rent_price; F32 dwell; - gParcelMgr->getDisplayInfo(&area, + LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, &claim_price, &rent_price, &for_sale, @@ -710,7 +707,7 @@ void LLPanelLandGeneral::refresh() mBtnReleaseLand->setEnabled( can_release ); } - BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned();; + BOOL use_pass = parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned();; mBtnBuyPass->setEnabled(use_pass); } } @@ -827,7 +824,7 @@ void LLPanelLandGeneral::setGroup(const LLUUID& group_id) //mTextGroup->setText(group_name); // Send update - gParcelMgr->sendParcelPropertiesUpdate(parcel); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(parcel); // Update UI refresh(); @@ -837,7 +834,7 @@ void LLPanelLandGeneral::setGroup(const LLUUID& group_id) void LLPanelLandGeneral::onClickBuyLand(void* data) { BOOL* for_group = (BOOL*)data; - gParcelMgr->startBuyLand(*for_group); + LLViewerParcelMgr::getInstance()->startBuyLand(*for_group); } BOOL LLPanelLandGeneral::enableDeedToGroup(void* data) @@ -853,29 +850,29 @@ void LLPanelLandGeneral::onClickDeed(void*) //LLParcel* parcel = mParcel->getParcel(); //if (parcel) //{ - gParcelMgr->startDeedLandToGroup(); + LLViewerParcelMgr::getInstance()->startDeedLandToGroup(); //} } // static void LLPanelLandGeneral::onClickRelease(void*) { - gParcelMgr->startReleaseLand(); + LLViewerParcelMgr::getInstance()->startReleaseLand(); } // static void LLPanelLandGeneral::onClickReclaim(void*) { lldebugs << "LLPanelLandGeneral::onClickReclaim()" << llendl; - gParcelMgr->reclaimParcel(); + LLViewerParcelMgr::getInstance()->reclaimParcel(); } // static BOOL LLPanelLandGeneral::enableBuyPass(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel(); - return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !gParcelMgr->isCollisionBanned()); + LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + return (parcel != NULL) && (parcel->getParcelFlag(PF_USE_PASS_LIST) && !LLViewerParcelMgr::getInstance()->isCollisionBanned()); } @@ -883,7 +880,7 @@ BOOL LLPanelLandGeneral::enableBuyPass(void* data) void LLPanelLandGeneral::onClickBuyPass(void* data) { LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data; - LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : gParcelMgr->getParcelSelection()->getParcel(); + LLParcel* parcel = panelp != NULL ? panelp->mParcel->getParcel() : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); if (!parcel) return; @@ -927,7 +924,7 @@ void LLPanelLandGeneral::cbBuyPass(S32 option, void* data) if (0 == option) { // User clicked OK - gParcelMgr->buyPass(); + LLViewerParcelMgr::getInstance()->buyPass(); } } @@ -965,7 +962,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setContributeWithDeed(contribute_with_deed); // Send update to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! panelp->refresh(); @@ -974,7 +971,7 @@ void LLPanelLandGeneral::onCommitAny(LLUICtrl *ctrl, void *userdata) // static void LLPanelLandGeneral::onClickSellLand(void* data) { - gParcelMgr->startSellLand(); + LLViewerParcelMgr::getInstance()->startSellLand(); } // static @@ -987,7 +984,7 @@ void LLPanelLandGeneral::onClickStopSellLand(void* data) parcel->setSalePrice(0); parcel->setAuthorizedBuyerID(LLUUID::null); - gParcelMgr->sendParcelPropertiesUpdate(parcel); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(parcel); } //--------------------------------------------------------------------------- @@ -1004,34 +1001,34 @@ BOOL LLPanelLandObjects::postBuild() { mFirstReply = TRUE; - mParcelObjectBonus = LLUICtrlFactory::getTextBoxByName(this, "parcel_object_bonus"); - mSWTotalObjects = LLUICtrlFactory::getTextBoxByName(this, "objects_available"); - mObjectContribution = LLUICtrlFactory::getTextBoxByName(this, "object_contrib_text"); - mTotalObjects = LLUICtrlFactory::getTextBoxByName(this, "total_objects_text"); - mOwnerObjects = LLUICtrlFactory::getTextBoxByName(this, "owner_objects_text"); + mParcelObjectBonus = getChild<LLTextBox>("parcel_object_bonus"); + mSWTotalObjects = getChild<LLTextBox>("objects_available"); + mObjectContribution = getChild<LLTextBox>("object_contrib_text"); + mTotalObjects = getChild<LLTextBox>("total_objects_text"); + mOwnerObjects = getChild<LLTextBox>("owner_objects_text"); - mBtnShowOwnerObjects = LLUICtrlFactory::getButtonByName(this, "ShowOwner"); + mBtnShowOwnerObjects = getChild<LLButton>("ShowOwner"); mBtnShowOwnerObjects->setClickedCallback(onClickShowOwnerObjects, this); - mBtnReturnOwnerObjects = LLUICtrlFactory::getButtonByName(this, "ReturnOwner..."); + mBtnReturnOwnerObjects = getChild<LLButton>("ReturnOwner..."); mBtnReturnOwnerObjects->setClickedCallback(onClickReturnOwnerObjects, this); - mGroupObjects = LLUICtrlFactory::getTextBoxByName(this, "group_objects_text"); - mBtnShowGroupObjects = LLUICtrlFactory::getButtonByName(this, "ShowGroup"); + mGroupObjects = getChild<LLTextBox>("group_objects_text"); + mBtnShowGroupObjects = getChild<LLButton>("ShowGroup"); mBtnShowGroupObjects->setClickedCallback(onClickShowGroupObjects, this); - mBtnReturnGroupObjects = LLUICtrlFactory::getButtonByName(this, "ReturnGroup..."); + mBtnReturnGroupObjects = getChild<LLButton>("ReturnGroup..."); mBtnReturnGroupObjects->setClickedCallback(onClickReturnGroupObjects, this); - mOtherObjects = LLUICtrlFactory::getTextBoxByName(this, "other_objects_text"); - mBtnShowOtherObjects = LLUICtrlFactory::getButtonByName(this, "ShowOther"); + mOtherObjects = getChild<LLTextBox>("other_objects_text"); + mBtnShowOtherObjects = getChild<LLButton>("ShowOther"); mBtnShowOtherObjects->setClickedCallback(onClickShowOtherObjects, this); - mBtnReturnOtherObjects = LLUICtrlFactory::getButtonByName(this, "ReturnOther..."); + mBtnReturnOtherObjects = getChild<LLButton>("ReturnOther..."); mBtnReturnOtherObjects->setClickedCallback(onClickReturnOtherObjects, this); - mSelectedObjects = LLUICtrlFactory::getTextBoxByName(this, "selected_objects_text"); - mCleanOtherObjectsTime = LLUICtrlFactory::getLineEditorByName(this, "clean other time"); + mSelectedObjects = getChild<LLTextBox>("selected_objects_text"); + mCleanOtherObjectsTime = getChild<LLLineEditor>("clean other time"); mCleanOtherObjectsTime->setFocusLostCallback(onLostFocus, this); mCleanOtherObjectsTime->setCommitCallback(onCommitClean); @@ -1039,22 +1036,15 @@ BOOL LLPanelLandObjects::postBuild() childSetPrevalidate("clean other time", LLLineEditor::prevalidateNonNegativeS32); childSetUserData("clean other time", this); - mBtnRefresh = LLUICtrlFactory::getButtonByName(this, "Refresh List"); + mBtnRefresh = getChild<LLButton>("Refresh List"); mBtnRefresh->setClickedCallback(onClickRefresh, this); - mBtnReturnOwnerList = LLUICtrlFactory::getButtonByName(this, "Return objects..."); + mBtnReturnOwnerList = getChild<LLButton>("Return objects..."); mBtnReturnOwnerList->setClickedCallback(onClickReturnOwnerList, this); - LLUUID image_id; - - image_id.set( gViewerArt.getString("icon_avatar_online.tga") ); - mIconAvatarOnline = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("icon_avatar_offline.tga") ); - mIconAvatarOffline = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("icon_group.tga") ); - mIconGroup = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); + mIconAvatarOnline = LLUIImageList::getInstance()->getUIImage("icon_avatar_online.tga"); + mIconAvatarOffline = LLUIImageList::getInstance()->getUIImage("icon_avatar_offline.tga"); + mIconGroup = LLUIImageList::getInstance()->getUIImage("icon_group.tga"); mOwnerList = getChild<LLNameListCtrl>("owner list"); mOwnerList->sortByColumn(3, FALSE); @@ -1146,7 +1136,7 @@ void LLPanelLandObjects::refresh() // Can't have more than region max tasks, regardless of parcel // object bonus factor. - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (region) { S32 max_tasks_per_region = (S32)region->getMaxTasks(); @@ -1223,7 +1213,7 @@ void send_other_clean_time_message(S32 parcel_local_id, S32 other_clean_time) { LLMessageSystem *msg = gMessageSystem; - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; msg->newMessageFast(_PREHASH_ParcelSetOtherCleanTime); @@ -1242,7 +1232,7 @@ void send_return_objects_message(S32 parcel_local_id, S32 return_type, { LLMessageSystem *msg = gMessageSystem; - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; msg->newMessageFast(_PREHASH_ParcelReturnObjects); @@ -1306,8 +1296,8 @@ void LLPanelLandObjects::callbackReturnOwnerObjects(S32 option, void* userdata) } } - gSelectMgr->unhighlightAll(); - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLSelectMgr::getInstance()->unhighlightAll(); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); lop->refresh(); } @@ -1328,8 +1318,8 @@ void LLPanelLandObjects::callbackReturnGroupObjects(S32 option, void* userdata) send_return_objects_message(parcel->getLocalID(), RT_GROUP); } } - gSelectMgr->unhighlightAll(); - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLSelectMgr::getInstance()->unhighlightAll(); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); lop->refresh(); } @@ -1346,8 +1336,8 @@ void LLPanelLandObjects::callbackReturnOtherObjects(S32 option, void* userdata) send_return_objects_message(parcel->getLocalID(), RT_OTHER); } } - gSelectMgr->unhighlightAll(); - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLSelectMgr::getInstance()->unhighlightAll(); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); lop->refresh(); } @@ -1380,8 +1370,8 @@ void LLPanelLandObjects::callbackReturnOwnerList(S32 option, void* userdata) } } } - gSelectMgr->unhighlightAll(); - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLSelectMgr::getInstance()->unhighlightAll(); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); self->refresh(); } @@ -1428,7 +1418,7 @@ void LLPanelLandObjects::onClickRefresh(void* userdata) LLParcel* parcel = self->mParcel->getParcel(); if (!parcel) return; - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!region) return; // ready the list for results @@ -1494,17 +1484,17 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo LLScrollListItem *row = new LLScrollListItem( TRUE, NULL, owner_id); if (is_group_owned) { - row->addColumn(self->mIconGroup.notNull() ? self->mIconGroup->getID() : LLUUID::null); + row->addColumn(self->mIconGroup); row->addColumn(OWNER_GROUP, FONT); } else if (is_online) { - row->addColumn(self->mIconAvatarOnline.notNull() ? self->mIconAvatarOnline->getID() : LLUUID::null); + row->addColumn(self->mIconAvatarOnline); row->addColumn(OWNER_ONLINE, FONT); } else // offline { - row->addColumn(self->mIconAvatarOffline.notNull() ? self->mIconAvatarOffline->getID() : LLUUID::null); + row->addColumn(self->mIconAvatarOffline); row->addColumn(OWNER_OFFLINE, FONT); } // Placeholder for name. @@ -1749,56 +1739,56 @@ BOOL LLPanelLandOptions::postBuild() { - mCheckEditObjects = LLUICtrlFactory::getCheckBoxByName(this, "edit objects check"); + mCheckEditObjects = getChild<LLCheckBoxCtrl>( "edit objects check"); childSetCommitCallback("edit objects check", onCommitAny, this); - mCheckEditGroupObjects = LLUICtrlFactory::getCheckBoxByName(this, "edit group objects check"); + mCheckEditGroupObjects = getChild<LLCheckBoxCtrl>( "edit group objects check"); childSetCommitCallback("edit group objects check", onCommitAny, this); - mCheckAllObjectEntry = LLUICtrlFactory::getCheckBoxByName(this, "all object entry check"); + mCheckAllObjectEntry = getChild<LLCheckBoxCtrl>( "all object entry check"); childSetCommitCallback("all object entry check", onCommitAny, this); - mCheckGroupObjectEntry = LLUICtrlFactory::getCheckBoxByName(this, "group object entry check"); + mCheckGroupObjectEntry = getChild<LLCheckBoxCtrl>( "group object entry check"); childSetCommitCallback("group object entry check", onCommitAny, this); - mCheckEditLand = LLUICtrlFactory::getCheckBoxByName(this, "edit land check"); + mCheckEditLand = getChild<LLCheckBoxCtrl>( "edit land check"); childSetCommitCallback("edit land check", onCommitAny, this); - mCheckLandmark = LLUICtrlFactory::getCheckBoxByName(this, "check landmark"); + mCheckLandmark = getChild<LLCheckBoxCtrl>( "check landmark"); childSetCommitCallback("check landmark", onCommitAny, this); - mCheckGroupScripts = LLUICtrlFactory::getCheckBoxByName(this, "check group scripts"); + mCheckGroupScripts = getChild<LLCheckBoxCtrl>( "check group scripts"); childSetCommitCallback("check group scripts", onCommitAny, this); - mCheckFly = LLUICtrlFactory::getCheckBoxByName(this, "check fly"); + mCheckFly = getChild<LLCheckBoxCtrl>( "check fly"); childSetCommitCallback("check fly", onCommitAny, this); - mCheckOtherScripts = LLUICtrlFactory::getCheckBoxByName(this, "check other scripts"); + mCheckOtherScripts = getChild<LLCheckBoxCtrl>( "check other scripts"); childSetCommitCallback("check other scripts", onCommitAny, this); - mCheckSafe = LLUICtrlFactory::getCheckBoxByName(this, "check safe"); + mCheckSafe = getChild<LLCheckBoxCtrl>( "check safe"); childSetCommitCallback("check safe", onCommitAny, this); - mPushRestrictionCtrl = LLUICtrlFactory::getCheckBoxByName(this, "PushRestrictCheck"); + mPushRestrictionCtrl = getChild<LLCheckBoxCtrl>( "PushRestrictCheck"); childSetCommitCallback("PushRestrictCheck", onCommitAny, this); - mCheckShowDirectory = LLUICtrlFactory::getCheckBoxByName(this, "ShowDirectoryCheck"); + mCheckShowDirectory = getChild<LLCheckBoxCtrl>( "ShowDirectoryCheck"); childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); - mCategoryCombo = LLUICtrlFactory::getComboBoxByName(this, "land category"); + mCategoryCombo = getChild<LLComboBox>( "land category"); childSetCommitCallback("land category", onCommitAny, this); - mMatureCtrl = LLUICtrlFactory::getCheckBoxByName(this, "MatureCheck"); + mMatureCtrl = getChild<LLCheckBoxCtrl>( "MatureCheck"); childSetCommitCallback("MatureCheck", onCommitAny, this); - mPublishHelpButton = LLUICtrlFactory::getButtonByName(this, "?"); + mPublishHelpButton = getChild<LLButton>("?"); mPublishHelpButton->setClickedCallback(onClickPublishHelp, this); @@ -1847,17 +1837,17 @@ BOOL LLPanelLandOptions::postBuild() } - mLocationText = LLUICtrlFactory::getTextBoxByName(this, "landing_point"); + mLocationText = getChild<LLTextBox>("landing_point"); - mSetBtn = LLUICtrlFactory::getButtonByName(this, "Set"); + mSetBtn = getChild<LLButton>("Set"); mSetBtn->setClickedCallback(onClickSet, this); - mClearBtn = LLUICtrlFactory::getButtonByName(this, "Clear"); + mClearBtn = getChild<LLButton>("Clear"); mClearBtn->setClickedCallback(onClickClear, this); - mLandingTypeCombo = LLUICtrlFactory::getComboBoxByName(this, "landing type"); + mLandingTypeCombo = getChild<LLComboBox>( "landing type"); childSetCommitCallback("landing type", onCommitAny, this); return TRUE; @@ -2031,12 +2021,12 @@ void LLPanelLandOptions::refresh() // virtual void LLPanelLandOptions::draw() { - LLParcel *parcel = gParcelMgr->getFloatingParcelSelection()->getParcel(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel(); if(parcel) { LLViewerRegion* region; - region = gParcelMgr->getSelectionRegion(); + region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); llassert(region); // Region should never be null. BOOL can_change_identity = region ? @@ -2091,7 +2081,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) S32 landing_type_index = self->mLandingTypeCombo->getCurrentIndex(); LLUUID snapshot_id = self->mSnapshotCtrl->getImageAssetID(); LLViewerRegion* region; - region = gParcelMgr->getSelectionRegion(); + region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!allow_other_scripts && region && region->getAllowDamage()) { @@ -2120,7 +2110,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setSnapshotID(snapshot_id); // Send current parcel data upstream to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! self->refresh(); @@ -2135,7 +2125,7 @@ void LLPanelLandOptions::onClickSet(void* userdata) LLParcel* selected_parcel = self->mParcel->getParcel(); if (!selected_parcel) return; - LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!agent_parcel) return; if (agent_parcel->getLocalID() != selected_parcel->getLocalID()) @@ -2148,7 +2138,7 @@ void LLPanelLandOptions::onClickSet(void* userdata) selected_parcel->setUserLocation(pos_region); selected_parcel->setUserLookAt(gAgent.getFrameAgent().getAtAxis()); - gParcelMgr->sendParcelPropertiesUpdate(selected_parcel); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(selected_parcel); self->refresh(); } @@ -2165,7 +2155,7 @@ void LLPanelLandOptions::onClickClear(void* userdata) selected_parcel->setUserLocation(zero_vec); selected_parcel->setUserLookAt(zero_vec); - gParcelMgr->sendParcelPropertiesUpdate(selected_parcel); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate(selected_parcel); self->refresh(); } @@ -2173,8 +2163,8 @@ void LLPanelLandOptions::onClickClear(void* userdata) // static void LLPanelLandOptions::onClickPublishHelp(void*) { - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); - LLParcel *parcel = gParcelMgr->getFloatingParcelSelection()->getParcel(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection()->getParcel(); llassert(region); // Region should never be null. bool can_change_identity = region && parcel ? @@ -2585,7 +2575,7 @@ void LLPanelLandAccess::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setPassHours( pass_hours ); // Send current parcel data upstream to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! self->refresh(); @@ -2612,7 +2602,7 @@ void LLPanelLandAccess::callbackAvatarCBAccess(const std::vector<std::string>& n if (parcel) { parcel->addToAccessList(id, 0); - gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); panelp->refresh(); } } @@ -2635,7 +2625,7 @@ void LLPanelLandAccess::onClickRemoveAccess(void* data) const LLUUID& agent_id = item->getUUID(); parcel->removeFromAccessList(agent_id); } - gParcelMgr->sendParcelAccessListUpdate(AL_ACCESS); + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_ACCESS); panelp->refresh(); } } @@ -2659,7 +2649,7 @@ void LLPanelLandAccess::callbackAvatarCBBanned(const std::vector<std::string>& n if (parcel) { parcel->addToBanList(id, 0); - gParcelMgr->sendParcelAccessListUpdate(AL_BAN); + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); panelp->refresh(); } } @@ -2682,7 +2672,7 @@ void LLPanelLandAccess::onClickRemoveBanned(void* data) const LLUUID& agent_id = item->getUUID(); parcel->removeFromBanList(agent_id); } - gParcelMgr->sendParcelAccessListUpdate(AL_BAN); + LLViewerParcelMgr::getInstance()->sendParcelAccessListUpdate(AL_BAN); panelp->refresh(); } } @@ -2709,7 +2699,7 @@ BOOL LLPanelLandCovenant::postBuild() // virtual void LLPanelLandCovenant::refresh() { - LLViewerRegion* region = gParcelMgr->getSelectionRegion(); + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(!region) return; LLTextBox* region_name = getChild<LLTextBox>("region_name_text"); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index 38d58fabfe..9979e8b24a 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -68,7 +68,7 @@ class LLPanelLandRenters; class LLPanelLandCovenant; class LLFloaterLand -: public LLFloater, public LLUISingleton<LLFloaterLand, VisibilityPolicy<LLFloater> > +: public LLFloater, public LLFloaterSingleton<LLFloaterLand> { friend class LLUISingleton<LLFloaterLand, VisibilityPolicy<LLFloater> >; public: @@ -281,9 +281,9 @@ protected: LLButton *mBtnReturnOwnerList; LLNameListCtrl *mOwnerList; - LLPointer<LLViewerImage> mIconAvatarOnline; - LLPointer<LLViewerImage> mIconAvatarOffline; - LLPointer<LLViewerImage> mIconGroup; + LLUIImagePtr mIconAvatarOnline; + LLUIImagePtr mIconAvatarOffline; + LLUIImagePtr mIconGroup; BOOL mFirstReply; diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp index b150c873fe..08ea7e1b8e 100644 --- a/indra/newview/llfloaterlandholdings.cpp +++ b/indra/newview/llfloaterlandholdings.cpp @@ -49,7 +49,7 @@ #include "llbutton.h" #include "lluiconstants.h" #include "llviewermessage.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // statics LLFloaterLandHoldings* LLFloaterLandHoldings::sInstance = NULL; @@ -59,7 +59,7 @@ LLFloaterLandHoldings* LLFloaterLandHoldings::sInstance = NULL; void LLFloaterLandHoldings::show(void*) { LLFloaterLandHoldings* floater = new LLFloaterLandHoldings(); - gUICtrlFactory->buildFloater(floater, "floater_land_holdings.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floater, "floater_land_holdings.xml"); floater->center(); // query_id null is known to be us @@ -250,7 +250,7 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**) void LLFloaterLandHoldings::buttonCore(S32 which) { - LLScrollListCtrl *list = LLUICtrlFactory::getScrollListByName(this, "parcel list"); + LLScrollListCtrl *list = getChild<LLScrollListCtrl>("parcel list"); if (!list) return; S32 index = list->getFirstSelectedIndex(); diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 7de980a075..d147f863ef 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -184,23 +184,20 @@ BOOL LLFloaterMap::canClose() // virtual void LLFloaterMap::draw() { - if( getVisible() ) + // Note: we can't just gAgent.check cameraMouselook() because the transition states are wrong. + if( gAgent.cameraMouselook()) { - // Note: we can't just gAgent.check cameraMouselook() because the transition states are wrong. - if( gAgent.cameraMouselook()) - { - setMouseOpaque(FALSE); - getDragHandle()->setMouseOpaque(FALSE); + setMouseOpaque(FALSE); + getDragHandle()->setMouseOpaque(FALSE); - drawChild(mMap); - } - else - { - setMouseOpaque(TRUE); - getDragHandle()->setMouseOpaque(TRUE); + drawChild(mMap); + } + else + { + setMouseOpaque(TRUE); + getDragHandle()->setMouseOpaque(TRUE); - LLFloater::draw(); - } + LLFloater::draw(); } } diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 1cac8fd4c5..2c7d40695b 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -45,7 +45,7 @@ #include "lldir.h" #include "llviewercontrol.h" #include "llviewermenufile.h" // upload_new_resource() -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // linden includes #include "llassetstorage.h" @@ -119,7 +119,7 @@ BOOL LLFloaterNameDesc::postBuild() childSetCommitCallback("name_form", doCommit, this); childSetValue("name_form", LLSD(asset_name)); - LLLineEditor *NameEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "name_form"); + LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form"); if (NameEditor) { NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN); @@ -131,7 +131,7 @@ BOOL LLFloaterNameDesc::postBuild() r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); childSetCommitCallback("description_form", doCommit, this); - LLLineEditor *DescEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "description_form"); + LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form"); if (DescEditor) { DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN); diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 0b79c85963..a3350b5225 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -50,7 +50,7 @@ #include "llselectmgr.h" #include "lluiconstants.h" #include "llviewerobject.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" @@ -63,7 +63,7 @@ LLFloaterOpenObject::LLFloaterOpenObject() { LLCallbackMap::map_t factory_map; factory_map["object_contents"] = LLCallbackMap(createPanelInventory, this); - gUICtrlFactory->buildFloater(this,"floater_openobject.xml",&factory_map); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_openobject.xml",&factory_map); childSetAction("copy_to_inventory_button", onClickMoveToInventory, this); childSetAction("copy_and_wear_button", onClickMoveAndWear, this); @@ -106,7 +106,7 @@ void LLFloaterOpenObject::dirty() // static void LLFloaterOpenObject::show() { - LLObjectSelectionHandle object_selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle object_selection = LLSelectMgr::getInstance()->getSelection(); if (object_selection->getRootObjectCount() != 1) { gViewerWindow->alertXml("UnableToViewContentsMoreThanOne"); @@ -123,7 +123,7 @@ void LLFloaterOpenObject::show() sInstance->open(); /* Flawfinder: ignore */ sInstance->setFocus(TRUE); - sInstance->mObjectSelection = gSelectMgr->getEditSelection(); + sInstance->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); } diff --git a/indra/newview/llfloaterparcel.cpp b/indra/newview/llfloaterparcel.cpp index bca4f4f42f..59e95fb943 100644 --- a/indra/newview/llfloaterparcel.cpp +++ b/indra/newview/llfloaterparcel.cpp @@ -37,10 +37,10 @@ // viewer project includes #include "llcommandhandler.h" #include "llpanelplace.h" -#include "llvieweruictrlfactory.h" // linden library includes #include "lluuid.h" +#include "lluictrlfactory.h" //----------------------------------------------------------------------------- // Globals @@ -84,7 +84,7 @@ void* LLFloaterParcelInfo::createPanelPlace(void* data) { LLFloaterParcelInfo* self = (LLFloaterParcelInfo*)data; self->mPanelParcelp = new LLPanelPlace(); // allow edit self - gUICtrlFactory->buildPanel(self->mPanelParcelp, "panel_place.xml"); + LLUICtrlFactory::getInstance()->buildPanel(self->mPanelParcelp, "panel_place.xml"); return self->mPanelParcelp; } @@ -96,7 +96,7 @@ LLFloaterParcelInfo::LLFloaterParcelInfo(const std::string& name, const LLUUID & mParcelID( parcel_id ) { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterParcelInfo::createPanelPlace, this); - gUICtrlFactory->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); gPlaceInfoInstances.addData(parcel_id, this); } diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 4d97688b2a..8741cdf510 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -46,7 +46,7 @@ #include "llbutton.h" #include "llviewercontrol.h" #include "llviewernetwork.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "lluploaddialog.h" #include "llviewerstats.h" #include "llviewerwindow.h" @@ -119,7 +119,7 @@ BOOL LLFloaterPostcard::postBuild() gAgent.buildFullname(name_string); childSetValue("name_form", LLSD(name_string)); - LLTextEditor* MsgField = LLUICtrlFactory::getTextEditorByName(this, "msg_form"); + LLTextEditor* MsgField = getChild<LLTextEditor>("msg_form"); if (MsgField) { MsgField->setWordWrap(TRUE); @@ -142,7 +142,7 @@ LLFloaterPostcard* LLFloaterPostcard::showFromSnapshot(LLImageJPEG *jpeg, LLImag // It's now our job to clean them up LLFloaterPostcard *instance = new LLFloaterPostcard(jpeg, img, image_scale, pos_taken_global); - gUICtrlFactory->buildFloater(instance, "floater_postcard.xml"); + LLUICtrlFactory::getInstance()->buildFloater(instance, "floater_postcard.xml"); S32 left, top; gFloaterView->getNewFloaterPosition(&left, &top); @@ -158,7 +158,7 @@ void LLFloaterPostcard::draw() LLGLSUIDefault gls_ui; LLFloater::draw(); - if(getVisible() && !isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull()) + if(!isMinimized() && mViewerImage.notNull() && mJPEGImage.notNull()) { LLRect rect(getRect()); @@ -332,7 +332,7 @@ void LLFloaterPostcard::onMsgFormFocusRecieved(LLFocusableElement* receiver, voi LLFloaterPostcard* self = (LLFloaterPostcard *)data; if(self) { - LLTextEditor* msgForm = LLUICtrlFactory::getTextEditorByName(self, "msg_form"); + LLTextEditor* msgForm = self->getChild<LLTextEditor>("msg_form"); if(msgForm && msgForm == receiver && msgForm->hasFocus() && !(self->mHasFirstMsgFocus)) { self->mHasFirstMsgFocus = true; diff --git a/indra/newview/llfloaterpostprocess.cpp b/indra/newview/llfloaterpostprocess.cpp index 33704fc720..5c42f1222f 100644 --- a/indra/newview/llfloaterpostprocess.cpp +++ b/indra/newview/llfloaterpostprocess.cpp @@ -35,7 +35,7 @@ #include "llsliderctrl.h" #include "llcheckboxctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerdisplay.h" #include "llpostprocess.h" #include "llcombobox.h" @@ -48,7 +48,7 @@ LLFloaterPostProcess* LLFloaterPostProcess::sPostProcess = NULL; LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater("Post-Process Floater") { - gUICtrlFactory->buildFloater(this, "floater_post_process.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_post_process.xml"); /// Color Filter Callbacks childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter"); @@ -75,11 +75,11 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater("Post-Process Floater") childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength"); // Effect loading and saving. - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "PPEffectsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo"); childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox); comboBox->setCommitCallback(onChangeEffectName); - LLLineEditor* editBox = LLUICtrlFactory::getLineEditorByName(this, "PPEffectNameEditor"); + LLLineEditor* editBox = getChild<LLLineEditor>("PPEffectNameEditor"); childSetAction("PPSaveEffect", &LLFloaterPostProcess::onSaveEffect, editBox); syncMenu(); @@ -186,8 +186,7 @@ void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl, void * userData) { // get the combo box and name LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl); - LLLineEditor* editBox = LLUICtrlFactory::getLineEditorByName(sPostProcess, - "PPEffectNameEditor"); + LLLineEditor* editBox = sPostProcess->getChild<LLLineEditor>("PPEffectNameEditor"); // set the parameter's new name editBox->setValue(comboBox->getSelectedValue()); @@ -231,23 +230,21 @@ void LLFloaterPostProcess::onClose(bool app_quitting) void LLFloaterPostProcess::syncMenu() { // add the combo boxe contents - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "PPEffectsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo"); - if(comboBox != NULL) { - comboBox->removeall(); - - LLSD::map_const_iterator currEffect; - for(currEffect = gPostProcess->mAllEffects.beginMap(); - currEffect != gPostProcess->mAllEffects.endMap(); - ++currEffect) - { - comboBox->add(currEffect->first); - } - - // set the current effect as selected. - comboBox->selectByValue(gPostProcess->getSelectedEffect()); + comboBox->removeall(); + + LLSD::map_const_iterator currEffect; + for(currEffect = gPostProcess->mAllEffects.beginMap(); + currEffect != gPostProcess->mAllEffects.endMap(); + ++currEffect) + { + comboBox->add(currEffect->first); } + // set the current effect as selected. + comboBox->selectByValue(gPostProcess->getSelectedEffect()); + /// Sync Color Filter Menu childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter()); //childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma()); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 345561f551..1ad58f2706 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -69,7 +69,7 @@ #include "llagent.h" #include "llviewercontrol.h" #include "llviewernetwork.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llkeyboard.h" #include "llscrollcontainer.h" @@ -326,36 +326,36 @@ void LLPreferenceCore::refreshEnabledGraphics() LLFloaterPreference::LLFloaterPreference() { - gUICtrlFactory->buildFloater(this, "floater_preferences.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preferences.xml"); } BOOL LLFloaterPreference::postBuild() { - requires("About...", WIDGET_TYPE_BUTTON); - requires("OK", WIDGET_TYPE_BUTTON); - requires("Cancel", WIDGET_TYPE_BUTTON); - requires("Apply", WIDGET_TYPE_BUTTON); - requires("pref core", WIDGET_TYPE_TAB_CONTAINER); + requires<LLButton>("About..."); + requires<LLButton>("OK"); + requires<LLButton>("Cancel"); + requires<LLButton>("Apply"); + requires<LLTabContainer>("pref core"); if (!checkRequirements()) { return FALSE; } - mAboutBtn = LLUICtrlFactory::getButtonByName(this, "About..."); + mAboutBtn = getChild<LLButton>("About..."); mAboutBtn->setClickedCallback(onClickAbout, this); - mApplyBtn = LLUICtrlFactory::getButtonByName(this, "Apply"); + mApplyBtn = getChild<LLButton>("Apply"); mApplyBtn->setClickedCallback(onBtnApply, this); - mCancelBtn = LLUICtrlFactory::getButtonByName(this, "Cancel"); + mCancelBtn = getChild<LLButton>("Cancel"); mCancelBtn->setClickedCallback(onBtnCancel, this); - mOKBtn = LLUICtrlFactory::getButtonByName(this, "OK"); + mOKBtn = getChild<LLButton>("OK"); mOKBtn->setClickedCallback(onBtnOK, this); mPreferenceCore = new LLPreferenceCore( - LLUICtrlFactory::getTabContainerByName(this, "pref core"), + getChild<LLTabContainer>("pref core"), getChild<LLButton>("OK") ); @@ -371,16 +371,6 @@ LLFloaterPreference::~LLFloaterPreference() delete mPreferenceCore; } - -void LLFloaterPreference::draw() -{ - if( getVisible() ) - { - LLFloater::draw(); - } -} - - void LLFloaterPreference::apply() { this->mPreferenceCore->apply(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 52592c0bad..b915dff660 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -118,7 +118,6 @@ public: protected: LLPreferenceCore *mPreferenceCore; - /*virtual*/ void draw(); /*virtual*/ void onClose(bool app_quitting); LLButton* mAboutBtn; diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index ace3eeac66..bea12fe017 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -56,7 +56,7 @@ #include "llviewerregion.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -65,7 +65,7 @@ // helper class to watch the inventory. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLPropertiesObserver : public LLInventoryObserver +class LLPropertiesObserver : public LLInventoryObserver, public LLSingleton<LLPropertiesObserver> { public: LLPropertiesObserver() {} @@ -73,7 +73,6 @@ public: virtual void changed(U32 mask); }; -LLPropertiesObserver* gPropertiesObserver = NULL; void LLPropertiesObserver::changed(U32 mask) { // if there's a change we're interested in. @@ -144,13 +143,13 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& mObjectID(object_id), mDirty(TRUE) { - gUICtrlFactory->buildFloater(this,"floater_inventory_item_properties.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_inventory_item_properties.xml"); // hack to make sure these floaters are observing the inventory. - if(!gPropertiesObserver) + if(!gInventory.containsObserver(LLPropertiesObserver::getInstance())) { - gPropertiesObserver = new LLPropertiesObserver; - gInventory.addObserver(gPropertiesObserver); + // Note: this is where gPropertiesObserver used to be constructed. + gInventory.addObserver(LLPropertiesObserver::getInstance()); } // add the object to the static structure LLUUID key = mItemID ^ mObjectID; @@ -473,7 +472,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) { childSetValue("CheckShareWithGroup",LLSD((BOOL)TRUE)); - LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); + LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { ctl->setTentative(FALSE); @@ -482,7 +481,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) else if (!is_group_copy && !is_group_modify && !is_group_move) { childSetValue("CheckShareWithGroup",LLSD((BOOL)FALSE)); - LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); + LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { ctl->setTentative(FALSE); @@ -490,7 +489,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) } else { - LLCheckBoxCtrl* ctl = LLUICtrlFactory::getCheckBoxByName(this,"CheckShareWithGroup"); + LLCheckBoxCtrl* ctl = getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(ctl) { ctl->setTentative(TRUE); @@ -543,7 +542,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) childSetValue("CheckNextOwnerCopy",LLSD(BOOL(next_owner_mask & PERM_COPY))); childSetValue("CheckNextOwnerTransfer",LLSD(BOOL(next_owner_mask & PERM_TRANSFER))); - LLRadioGroup* radioSaleType = LLUICtrlFactory::getRadioGroupByName(this,"RadioSaleType"); + LLRadioGroup* radioSaleType = getChild<LLRadioGroup>("RadioSaleType"); if (is_for_sale) { radioSaleType->setSelectedIndex((S32)sale_info.getSaleType() - 1); @@ -605,7 +604,7 @@ void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) { return; } - LLLineEditor* labelItemName = LLUICtrlFactory::getLineEditorByName(self,"LabelItemName"); + LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName"); if(labelItemName&& (item->getName() != labelItemName->getText()) && @@ -642,7 +641,7 @@ void LLFloaterProperties::onCommitDescription(LLUICtrl* ctrl, void* data) LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); if(!item) return; - LLLineEditor* labelItemDesc = LLUICtrlFactory::getLineEditorByName(self,"LabelItemDesc"); + LLLineEditor* labelItemDesc = self->getChild<LLLineEditor>("LabelItemDesc"); if(!labelItemDesc) { return; @@ -684,7 +683,7 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) LLPermissions perm(item->getPermissions()); - LLCheckBoxCtrl* CheckShareWithGroup = LLUICtrlFactory::getCheckBoxByName(self,"CheckShareWithGroup"); + LLCheckBoxCtrl* CheckShareWithGroup = self->getChild<LLCheckBoxCtrl>("CheckShareWithGroup"); if(CheckShareWithGroup) { @@ -692,26 +691,26 @@ void LLFloaterProperties::onCommitPermissions(LLUICtrl* ctrl, void* data) CheckShareWithGroup->get(), PERM_MODIFY | PERM_MOVE | PERM_COPY); } - LLCheckBoxCtrl* CheckEveryoneCopy = LLUICtrlFactory::getCheckBoxByName(self,"CheckEveryoneCopy"); + LLCheckBoxCtrl* CheckEveryoneCopy = self->getChild<LLCheckBoxCtrl>("CheckEveryoneCopy"); if(CheckEveryoneCopy) { perm.setEveryoneBits(gAgent.getID(), gAgent.getGroupID(), CheckEveryoneCopy->get(), PERM_COPY); } - LLCheckBoxCtrl* CheckNextOwnerModify = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerModify"); + LLCheckBoxCtrl* CheckNextOwnerModify = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerModify"); if(CheckNextOwnerModify) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), CheckNextOwnerModify->get(), PERM_MODIFY); } - LLCheckBoxCtrl* CheckNextOwnerCopy = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerCopy"); + LLCheckBoxCtrl* CheckNextOwnerCopy = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerCopy"); if(CheckNextOwnerCopy) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), CheckNextOwnerCopy->get(), PERM_COPY); } - LLCheckBoxCtrl* CheckNextOwnerTransfer = LLUICtrlFactory::getCheckBoxByName(self,"CheckNextOwnerTransfer"); + LLCheckBoxCtrl* CheckNextOwnerTransfer = self->getChild<LLCheckBoxCtrl>("CheckNextOwnerTransfer"); if(CheckNextOwnerTransfer) { perm.setNextOwnerBits(gAgent.getID(), gAgent.getGroupID(), @@ -805,7 +804,7 @@ void LLFloaterProperties::updateSaleInfo() // turn on sale info LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_COPY; - LLRadioGroup* RadioSaleType = LLUICtrlFactory::getRadioGroupByName(this,"RadioSaleType"); + LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("RadioSaleType"); if(RadioSaleType) { switch (RadioSaleType->getSelectedIndex()) @@ -832,7 +831,7 @@ void LLFloaterProperties::updateSaleInfo() sale_type = LLSaleInfo::FS_ORIGINAL; } - LLLineEditor* EditPrice = LLUICtrlFactory::getLineEditorByName(this,"EditPrice"); + LLLineEditor* EditPrice = getChild<LLLineEditor>("EditPrice"); S32 price = -1; if(EditPrice) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 00c6f0de73..fa9c9c9374 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -68,7 +68,7 @@ #include "llinventory.h" #include "lltexturectrl.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerimage.h" #include "llviewerimagelist.h" #include "llviewerregion.h" @@ -85,20 +85,6 @@ const S32 CORNER_COUNT = 4; /// Local class declaration ///---------------------------------------------------------------------------- -/* -class LLDispatchSetEstateOwner : public LLDispatchHandler -{ -public: - LLDispatchSetEstateOwner() {} - virtual ~LLDispatchSetEstateOwner() {} - virtual bool operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const sparam_t& strings, - const iparam_t& integers); -}; -*/ - class LLDispatchEstateUpdateInfo : public LLDispatchHandler { public: @@ -168,43 +154,43 @@ LLUUID LLFloaterRegionInfo::sRequestInvoice; LLFloaterRegionInfo::LLFloaterRegionInfo(const LLSD& seed) { - gUICtrlFactory->buildFloater(this, "floater_region_info.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_info.xml", NULL, FALSE); } BOOL LLFloaterRegionInfo::postBuild() { - mTab = gUICtrlFactory->getTabContainerByName(this, "region_panels"); + mTab = getChild<LLTabContainer>("region_panels"); // contruct the panels LLPanelRegionInfo* panel; panel = new LLPanelRegionGeneralInfo; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_general.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml"); mTab->addTabPanel(panel, panel->getLabel(), TRUE); panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_debug.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); panel = new LLPanelRegionTextureInfo; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_texture.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); panel = new LLPanelRegionTerrainInfo; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_terrain.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_estate.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); - gUICtrlFactory->buildPanel(panel, "panel_region_covenant.xml"); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml"); mTab->addTabPanel(panel, panel->getLabel(), FALSE); gMessageSystem->setHandlerFunc( @@ -233,24 +219,12 @@ void LLFloaterRegionInfo::onOpen() // static void LLFloaterRegionInfo::requestRegionInfo() { - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(findInstance(), "region_panels"); - if(tab) - { - LLPanel* panel; - - panel = LLUICtrlFactory::getPanelByName(tab, "General"); - if (panel) panel->setCtrlsEnabled(FALSE); + LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); - panel = LLUICtrlFactory::getPanelByName(tab, "Debug"); - if (panel) panel->setCtrlsEnabled(FALSE); - - panel = LLUICtrlFactory::getPanelByName(tab, "Terrain"); - if (panel) panel->setCtrlsEnabled(FALSE); - - panel = LLUICtrlFactory::getPanelByName(tab, "Estate"); - if (panel) panel->setCtrlsEnabled(FALSE); - - } + tab->getChild<LLPanel>("General")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Debug")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Terrain")->setCtrlsEnabled(FALSE); + tab->getChild<LLPanel>("Estate")->setCtrlsEnabled(FALSE); // Must allow anyone to request the RegionInfo data // so non-owners/non-gods can see the values. @@ -261,7 +235,6 @@ void LLFloaterRegionInfo::requestRegionInfo() msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); gAgent.sendReliableMessage(); - } // static @@ -278,11 +251,8 @@ void LLFloaterRegionInfo::processEstateOwnerRequest(LLMessageSystem* msg,void**) LLPanelEstateInfo::initDispatch(dispatch); } - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(findInstance(), "region_panels"); - if (!tab) return; - - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate"); - if (!panel) return; + LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); + LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); // unpack the message std::string request; @@ -316,8 +286,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) return; } - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(findInstance(), "region_panels"); - if(!tab) return; + LLTabContainer* tab = findInstance()->getChild<LLTabContainer>("region_panels"); LLViewerRegion* region = gAgent.getRegion(); BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); @@ -346,8 +315,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) msg->getF32("RegionInfo", "SunHour", sun_hour); // GENERAL PANEL - panel = LLUICtrlFactory::getPanelByName(tab, "General"); - if(!panel) return; + panel = tab->getChild<LLPanel>("General"); panel->childSetValue("region_text", LLSD(sim_name)); panel->childSetValue("block_terraform_check", (region_flags & REGION_FLAGS_BLOCK_TERRAFORM) ? TRUE : FALSE ); @@ -372,8 +340,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) // DEBUG PANEL - panel = LLUICtrlFactory::getPanelByName(tab, "Debug"); - if(!panel) return; + panel = tab->getChild<LLPanel>("Debug"); panel->childSetValue("region_text", LLSD(sim_name) ); panel->childSetValue("disable_scripts_check", LLSD((BOOL)(region_flags & REGION_FLAGS_SKIP_SCRIPTS)) ); @@ -382,8 +349,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) panel->setCtrlsEnabled(allow_modify); // TERRAIN PANEL - panel = LLUICtrlFactory::getPanelByName(tab, "Terrain"); - if(!panel) return; + panel = tab->getChild<LLPanel>("Terrain"); panel->childSetValue("region_text", LLSD(sim_name)); panel->childSetValue("water_height_spin", LLSD(water_height)); @@ -405,9 +371,8 @@ LLPanelEstateInfo* LLFloaterRegionInfo::getPanelEstate() { LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); if (!floater) return NULL; - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels"); - if (!tab) return NULL; - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab,"Estate"); + LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); + LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); return panel; } @@ -416,9 +381,8 @@ LLPanelEstateCovenant* LLFloaterRegionInfo::getPanelCovenant() { LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); if (!floater) return NULL; - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels"); - if (!tab) return NULL; - LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)LLUICtrlFactory::getPanelByName(tab, "Covenant"); + LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); + LLPanelEstateCovenant* panel = (LLPanelEstateCovenant*)tab->getChild<LLPanel>("Covenant"); return panel; } @@ -1055,7 +1019,7 @@ bool LLPanelRegionTextureInfo::refreshFromRegion(LLViewerRegion* region) for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) { snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ - texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); + texture_ctrl = getChild<LLTextureCtrl>(buffer); if(texture_ctrl) { lldebugs << "Detail Texture " << i << ": " @@ -1103,14 +1067,6 @@ BOOL LLPanelRegionTextureInfo::postBuild() return LLPanelRegionInfo::postBuild(); } -void LLPanelRegionTextureInfo::draw() -{ - if(getVisible()) - { - LLPanel::draw(); - } -} - BOOL LLPanelRegionTextureInfo::sendUpdate() { llinfos << "LLPanelRegionTextureInfo::sendUpdate()" << llendl; @@ -1133,7 +1089,7 @@ BOOL LLPanelRegionTextureInfo::sendUpdate() for(S32 i = 0; i < TERRAIN_TEXTURE_COUNT; ++i) { snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ - texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); + texture_ctrl = getChild<LLTextureCtrl>(buffer); if(texture_ctrl) { LLUUID tmp_id(texture_ctrl->getImageAssetID()); @@ -1163,7 +1119,7 @@ BOOL LLPanelRegionTextureInfo::validateTextureSizes() { char buffer[MAX_STRING]; /* Flawfinder: ignore */ snprintf(buffer, MAX_STRING, "texture_detail_%d", i); /* Flawfinder: ignore */ - LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this, buffer); + LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(buffer); if (!texture_ctrl) continue; LLUUID image_asset_id = texture_ctrl->getImageAssetID(); @@ -1285,10 +1241,10 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); if (!floater) return true; - LLTabContainer* tab = LLUICtrlFactory::getTabContainerByName(floater, "region_panels"); + LLTabContainer* tab = floater->getChild<LLTabContainer>("region_panels"); if (!tab) return true; - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)LLUICtrlFactory::getPanelByName(tab, "Estate"); + LLPanelEstateInfo* panel = (LLPanelEstateInfo*)tab->getChild<LLPanel>("Estate"); if (!panel) return true; BOOL estate_global_time = panel->getGlobalTime(); @@ -1854,7 +1810,7 @@ void LLPanelEstateInfo::accessRemoveCore(U32 operation_flag, const char* dialog_ { LLPanelEstateInfo* panel = LLFloaterRegionInfo::getPanelEstate(); if (!panel) return; - LLNameListCtrl* name_list = LLViewerUICtrlFactory::getNameListByName(panel, list_ctrl_name); + LLNameListCtrl* name_list = panel->getChild<LLNameListCtrl>(list_ctrl_name); if (!name_list) return; std::vector<LLScrollListItem*> list_vector = name_list->getAllSelected(); @@ -2120,7 +2076,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetCommitCallback("sun_hour_slider", onChangeChildCtrl, this); childSetCommitCallback("allowed_avatar_name_list", onChangeChildCtrl, this); - LLNameListCtrl *avatar_name_list = LLViewerUICtrlFactory::getNameListByName(this, "allowed_avatar_name_list"); + LLNameListCtrl *avatar_name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); if (avatar_name_list) { avatar_name_list->setCommitOnSelectionChange(TRUE); @@ -2131,7 +2087,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("remove_allowed_avatar_btn", onClickRemoveAllowedAgent, this); childSetCommitCallback("allowed_group_name_list", onChangeChildCtrl, this); - LLNameListCtrl* group_name_list = LLViewerUICtrlFactory::getNameListByName(this, "allowed_group_name_list"); + LLNameListCtrl* group_name_list = getChild<LLNameListCtrl>("allowed_group_name_list"); if (group_name_list) { group_name_list->setCommitOnSelectionChange(TRUE); @@ -2142,7 +2098,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("remove_allowed_group_btn", onClickRemoveAllowedGroup, this); childSetCommitCallback("banned_avatar_name_list", onChangeChildCtrl, this); - LLNameListCtrl* banned_name_list = LLViewerUICtrlFactory::getNameListByName(this, "banned_avatar_name_list"); + LLNameListCtrl* banned_name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); if (banned_name_list) { banned_name_list->setCommitOnSelectionChange(TRUE); @@ -2153,7 +2109,7 @@ BOOL LLPanelEstateInfo::postBuild() childSetAction("remove_banned_avatar_btn", onClickRemoveBannedAgent, this); childSetCommitCallback("estate_manager_name_list", onChangeChildCtrl, this); - LLNameListCtrl* manager_name_list = LLViewerUICtrlFactory::getNameListByName(this, "estate_manager_name_list"); + LLNameListCtrl* manager_name_list = getChild<LLNameListCtrl>("estate_manager_name_list"); if (manager_name_list) { manager_name_list->setCommitOnSelectionChange(TRUE); @@ -2556,13 +2512,13 @@ void LLPanelEstateInfo::callbackCacheName( void LLPanelEstateInfo::clearAccessLists() { - LLNameListCtrl* name_list = LLViewerUICtrlFactory::getNameListByName(this, "allowed_avatar_name_list"); + LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); if (name_list) { name_list->deleteAllItems(); } - name_list = LLViewerUICtrlFactory::getNameListByName(this, "banned_avatar_name_list"); + name_list = getChild<LLNameListCtrl>("banned_avatar_name_list"); if (name_list) { name_list->deleteAllItems(); @@ -2596,7 +2552,7 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name) } // enable the remove button if something is selected - LLNameListCtrl* name_list = LLViewerUICtrlFactory::getNameListByName(this, name); + LLNameListCtrl* name_list = getChild<LLNameListCtrl>(name); childSetEnabled(btn_name.c_str(), name_list && name_list->getFirstSelected() ? TRUE : FALSE); return (btn_name != ""); @@ -2869,10 +2825,7 @@ void LLPanelEstateCovenant::onLoadComplete(LLVFS *vfs, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) @@ -2993,33 +2946,6 @@ void LLPanelEstateCovenant::setCovenantTextEditor(const std::string& text) mEditor->setText(text); } -/* -// AgentData = agent_id -// RequestData = "setowner" -// StringData[0] = compressed owner id -// IntegerData[0] = serial -bool LLDispatchSetEstateOwner::operator()( - const LLDispatcher* dispatcher, - const std::string& key, - const sparam_t& strings, - const iparam_t& integers) -{ - LLFloaterRegionInfo* floater = LLFloaterRegionInfo::getInstance(); - if (!floater) return true; - - LLTabContainer* tab = (LLTabContainer*)(floater->getChildByName("region_panels")); - if (!tab) return true; - - LLPanelEstateInfo* panel = (LLPanelEstateInfo*)(tab->getChildByName("Estate")); - if (!panel) return true; - - // TODO -- check owner, and disable floater if owner - // does not match - - return true; -} -*/ - // key = "estateupdateinfo" // strings[0] = estate name // strings[1] = str(owner_id) @@ -3152,7 +3078,7 @@ bool LLDispatchSetEstateAccess::operator()( if (access_flags & ESTATE_ACCESS_ALLOWED_AGENTS) { LLNameListCtrl* allowed_agent_name_list; - allowed_agent_name_list = LLViewerUICtrlFactory::getNameListByName(panel, "allowed_avatar_name_list"); + allowed_agent_name_list = panel->getChild<LLNameListCtrl>("allowed_avatar_name_list"); int totalAllowedAgents = num_allowed_agents; @@ -3183,7 +3109,7 @@ bool LLDispatchSetEstateAccess::operator()( if (access_flags & ESTATE_ACCESS_ALLOWED_GROUPS) { LLNameListCtrl* allowed_group_name_list; - allowed_group_name_list = LLViewerUICtrlFactory::getNameListByName(panel, "allowed_group_name_list"); + allowed_group_name_list = panel->getChild<LLNameListCtrl>("allowed_group_name_list"); std::string msg = llformat("Allowed groups: (%d, max %d)", num_allowed_groups, @@ -3207,7 +3133,7 @@ bool LLDispatchSetEstateAccess::operator()( if (access_flags & ESTATE_ACCESS_BANNED_AGENTS) { LLNameListCtrl* banned_agent_name_list; - banned_agent_name_list = LLViewerUICtrlFactory::getNameListByName(panel, "banned_avatar_name_list"); + banned_agent_name_list = panel->getChild<LLNameListCtrl>("banned_avatar_name_list"); int totalBannedAgents = num_banned_agents; @@ -3244,7 +3170,7 @@ bool LLDispatchSetEstateAccess::operator()( panel->childSetValue("estate_manager_label", LLSD(msg)); LLNameListCtrl* estate_manager_name_list = - LLViewerUICtrlFactory::getNameListByName(panel, "estate_manager_name_list"); + panel->getChild<LLNameListCtrl>("estate_manager_name_list"); if (estate_manager_name_list) { estate_manager_name_list->deleteAllItems(); // Clear existing entries diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 6ef276a739..b7ee1cc17b 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -212,7 +212,6 @@ public: // LLPanel && LLView virtual BOOL postBuild(); - virtual void draw(); protected: virtual BOOL sendUpdate(); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 7dc404cab1..25b8abefc7 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -80,7 +80,7 @@ #include "lldir.h" #include "llselectmgr.h" #include "llviewerbuild.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llappviewer.h" #include "llassetuploadresponders.h" @@ -124,16 +124,16 @@ LLFloaterReporter::LLFloaterReporter( { if (report_type == BUG_REPORT) { - gUICtrlFactory->buildFloater(this, "floater_report_bug.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_bug.xml"); } else { - gUICtrlFactory->buildFloater(this, "floater_report_abuse.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml"); } childSetText("abuse_location_edit", gAgent.getSLURL() ); - LLButton* pick_btn = LLUICtrlFactory::getButtonByName(this, "pick_btn"); + LLButton* pick_btn = getChild<LLButton>("pick_btn"); if (pick_btn) { // XUI: Why aren't these in viewerart.ini? @@ -145,7 +145,7 @@ LLFloaterReporter::LLFloaterReporter( if (report_type != BUG_REPORT) { // abuser name is selected from a list - LLLineEditor* le = (LLLineEditor*)getCtrlByNameAndType("abuser_name_edit", WIDGET_TYPE_LINE_EDITOR); + LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); le->setEnabled( FALSE ); } @@ -454,12 +454,12 @@ void LLFloaterReporter::onClickCancel(void *userdata) void LLFloaterReporter::onClickObjPicker(void *userdata) { LLFloaterReporter *self = (LLFloaterReporter *)userdata; - gToolObjPicker->setExitCallback(LLFloaterReporter::closePickTool, self); - gToolMgr->setTransientTool(gToolObjPicker); + LLToolObjPicker::getInstance()->setExitCallback(LLFloaterReporter::closePickTool, self); + LLToolMgr::getInstance()->setTransientTool(LLToolObjPicker::getInstance()); self->mPicking = TRUE; self->childSetText("object_name", LLString::null); self->childSetText("owner_name", LLString::null); - LLButton* pick_btn = LLUICtrlFactory::getButtonByName(self, "pick_btn"); + LLButton* pick_btn = self->getChild<LLButton>("pick_btn"); if (pick_btn) pick_btn->setToggleState(TRUE); } @@ -469,12 +469,12 @@ void LLFloaterReporter::closePickTool(void *userdata) { LLFloaterReporter *self = (LLFloaterReporter *)userdata; - LLUUID object_id = gToolObjPicker->getObjectID(); + LLUUID object_id = LLToolObjPicker::getInstance()->getObjectID(); self->getObjectInfo(object_id); - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); self->mPicking = FALSE; - LLButton* pick_btn = LLUICtrlFactory::getButtonByName(self, "pick_btn"); + LLButton* pick_btn = self->getChild<LLButton>("pick_btn"); if (pick_btn) pick_btn->setToggleState(FALSE); } @@ -662,7 +662,7 @@ LLSD LLFloaterReporter::gatherReport() } LLString category_name; - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "category_combo"); + LLComboBox* combo = getChild<LLComboBox>( "category_combo"); if (combo) { category_name = combo->getSelectedItemLabel(); // want label, not value @@ -1003,7 +1003,7 @@ void LLFloaterReporter::addDescription(const LLString& description, LLMeanCollis LLFloaterReporter *self = gReporterInstances[COMPLAINT_REPORT]; if (self) { - LLTextEditor* text = LLUICtrlFactory::getTextEditorByName(self, "details_edit"); + LLTextEditor* text = self->getChild<LLTextEditor>("details_edit"); if (text) { text->insertText(description); diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 3a17e232b6..9a7634a739 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -31,7 +31,7 @@ #include "llviewerprecompiledheaders.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llfloaterscriptdebug.h" #include "llfontgl.h" @@ -84,7 +84,7 @@ BOOL LLFloaterScriptDebug::postBuild() if (mTabContainer) { // *FIX: apparantly fails for tab containers? -// mTabContainer->requires("all_scripts", WIDGET_TYPE_FLOATER); +// mTabContainer->requires<LLFloater>("all_scripts"); // mTabContainer->checkRequirements(); return TRUE; } @@ -104,7 +104,7 @@ LLFloater* LLFloaterScriptDebug::addOutputWindow(const LLUUID &object_id) sInstance = new LLFloaterScriptDebug(); LLCallbackMap::map_t factory_map; factory_map["all_scripts"] = LLCallbackMap(getOutputWindow, NULL); - gUICtrlFactory->buildFloater(sInstance, "floater_script_debug.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_script_debug.xml", &factory_map); sInstance->setVisible(FALSE); } @@ -128,7 +128,7 @@ void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std: if (objectp) { - objectp->setIcon(gImageList.getImage(LLUUID(gViewerArt.getString("script_error.tga")))); + objectp->setIcon(gImageList.getImageFromFile("script_error.j2c", TRUE, TRUE)); floater_label = llformat("%s(%.2f, %.2f)", user_name.c_str(), objectp->getPositionRegion().mV[VX], objectp->getPositionRegion().mV[VY]); } else diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index f3d8996b6a..025d726b82 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -42,7 +42,7 @@ #include "lltexturectrl.h" #include "llviewercontrol.h" #include "llviewerparcelmgr.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" // defined in llfloaterland.cpp @@ -122,7 +122,7 @@ LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded) { sInstance = new LLFloaterSellLandUI(); - gUICtrlFactory->buildFloater(sInstance, "floater_sell_land.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_sell_land.xml"); sInstance->center(); } @@ -131,7 +131,7 @@ LLFloaterSellLandUI* LLFloaterSellLandUI::soleInstance(bool createIfNeeded) if (!parcelSelectionObserver) { parcelSelectionObserver = new SelectionObserver; - gParcelMgr->addObserver(parcelSelectionObserver); + LLViewerParcelMgr::getInstance()->addObserver(parcelSelectionObserver); } return sInstance; @@ -156,14 +156,14 @@ void LLFloaterSellLandUI::SelectionObserver::changed() LLFloaterSellLandUI* ui = LLFloaterSellLandUI::soleInstance(false); if (ui) { - if (gParcelMgr->selectionEmpty()) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { ui->close(); } else { ui->setParcel( - gParcelMgr->getSelectionRegion(), - gParcelMgr->getParcelSelection()); + LLViewerParcelMgr::getInstance()->getSelectionRegion(), + LLViewerParcelMgr::getInstance()->getParcelSelection()); } } } @@ -251,22 +251,22 @@ void LLFloaterSellLandUI::updateParcelInfo() void LLFloaterSellLandUI::setBadge(const char* id, Badge badge) { - static LLUUID badgeOK(gViewerArt.getString("badge_ok.tga")); - static LLUUID badgeNote(gViewerArt.getString("badge_note.tga")); - static LLUUID badgeWarn(gViewerArt.getString("badge_warn.tga")); - static LLUUID badgeError(gViewerArt.getString("badge_error.tga")); + static LLString badgeOK("badge_ok.j2c"); + static LLString badgeNote("badge_note.j2c"); + static LLString badgeWarn("badge_warn.j2c"); + static LLString badgeError("badge_error.j2c"); - LLUUID badgeUUID; + LLString badgeName; switch (badge) { default: - case BADGE_OK: badgeUUID = badgeOK; break; - case BADGE_NOTE: badgeUUID = badgeNote; break; - case BADGE_WARN: badgeUUID = badgeWarn; break; - case BADGE_ERROR: badgeUUID = badgeError; break; + case BADGE_OK: badgeName = badgeOK; break; + case BADGE_NOTE: badgeName = badgeNote; break; + case BADGE_WARN: badgeName = badgeWarn; break; + case BADGE_ERROR: badgeName = badgeError; break; } - childSetValue(id, badgeUUID); + childSetValue(id, badgeName); } void LLFloaterSellLandUI::refreshUI() @@ -274,7 +274,7 @@ void LLFloaterSellLandUI::refreshUI() LLParcel* parcelp = mParcelSelection->getParcel(); if (!parcelp) return; - LLTextureCtrl* snapshot = LLViewerUICtrlFactory::getTexturePickerByName(this, "info_image"); + LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image"); if (snapshot) { snapshot->setImageAssetID(mParcelSnapshot); @@ -451,7 +451,7 @@ void LLFloaterSellLandUI::doShowObjects(void *userdata) // static void LLFloaterSellLandUI::callbackHighlightTransferable(S32 option, void* userdata) { - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); } // static @@ -546,7 +546,7 @@ void LLFloaterSellLandUI::onConfirmSale(S32 option, void *userdata) } // Send update to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); self->close(); } diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 7975bd95ef..bb44304ae6 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -32,7 +32,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloatersettingsdebug.h" #include "llfloater.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llfirstuse.h" #include "llcombobox.h" #include "llspinctrl.h" @@ -52,7 +52,7 @@ LLFloaterSettingsDebug::~LLFloaterSettingsDebug() BOOL LLFloaterSettingsDebug::postBuild() { - LLComboBox* settings_combo = LLUICtrlFactory::getComboBoxByName(this, "settings_combo"); + LLComboBox* settings_combo = getChild<LLComboBox>("settings_combo"); struct f : public LLControlGroup::ApplyFunctor { @@ -108,7 +108,7 @@ void LLFloaterSettingsDebug::show(void*) { sInstance = new LLFloaterSettingsDebug(); - gUICtrlFactory->buildFloater(sInstance, "floater_settings_debug.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_settings_debug.xml"); } sInstance->open(); /* Flawfinder: ignore */ @@ -216,10 +216,10 @@ void LLFloaterSettingsDebug::onClickDefault(void* user_data) // we've switched controls, or doing per-frame update, so update spinners, etc. void LLFloaterSettingsDebug::updateControl(LLControlVariable* controlp) { - LLSpinCtrl* spinner1 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_1"); - LLSpinCtrl* spinner2 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_2"); - LLSpinCtrl* spinner3 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_3"); - LLSpinCtrl* spinner4 = LLUICtrlFactory::getSpinnerByName(this, "val_spinner_4"); + LLSpinCtrl* spinner1 = getChild<LLSpinCtrl>("val_spinner_1"); + LLSpinCtrl* spinner2 = getChild<LLSpinCtrl>("val_spinner_2"); + LLSpinCtrl* spinner3 = getChild<LLSpinCtrl>("val_spinner_3"); + LLSpinCtrl* spinner4 = getChild<LLSpinCtrl>("val_spinner_4"); LLColorSwatchCtrl* color_swatch = getChild<LLColorSwatchCtrl>("color_swatch"); if (!spinner1 || !spinner2 || !spinner3 || !spinner4 || !color_swatch) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 1af6683218..962269ca89 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -53,7 +53,7 @@ #include "llsliderctrl.h" #include "llspinctrl.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerstats.h" #include "llviewercamera.h" #include "llviewerwindow.h" @@ -109,9 +109,6 @@ public: LLSnapshotLivePreview(const LLRect& rect); ~LLSnapshotLivePreview(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - /*virtual*/ void draw(); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); @@ -208,8 +205,8 @@ LLSnapshotLivePreview::LLSnapshotLivePreview (const LLRect& rect) : mDataSize(0), mSnapshotType(SNAPSHOT_POSTCARD), mSnapshotUpToDate(FALSE), - mCameraPos(gCamera->getOrigin()), - mCameraRot(gCamera->getQuaternion()), + mCameraPos(LLViewerCamera::getInstance()->getOrigin()), + mCameraRot(LLViewerCamera::getInstance()->getQuaternion()), mSnapshotActive(FALSE), mSnapshotBufferType(LLViewerWindow::SNAPSHOT_TYPE_COLOR) { @@ -355,16 +352,6 @@ void LLSnapshotLivePreview::setSnapshotQuality(S32 quality) } } -EWidgetType LLSnapshotLivePreview::getWidgetType() const -{ - return WIDGET_TYPE_SNAPSHOT_LIVE_PREVIEW; -} - -LLString LLSnapshotLivePreview::getWidgetTag() const -{ - return LL_SNAPSHOT_LIVE_PREVIEW_TAG; -} - void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y) { F32 line_width ; @@ -406,186 +393,183 @@ void LLSnapshotLivePreview::drawPreviewRect(S32 offset_x, S32 offset_y) void LLSnapshotLivePreview::draw() { - if(getVisible()) - { - if (mViewerImage[mCurImageIndex].notNull() && - mRawImageEncoded.notNull() && - mSnapshotUpToDate) + if (mViewerImage[mCurImageIndex].notNull() && + mRawImageEncoded.notNull() && + mSnapshotUpToDate) + { + LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f); + gl_rect_2d(getRect(), bg_color); + LLRect &rect = mImageRect[mCurImageIndex]; + LLRect shadow_rect = mImageRect[mCurImageIndex]; + shadow_rect.stretch(BORDER_WIDTH); + gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10); + + LLColor4 image_color(1.f, 1.f, 1.f, 1.f); + gGL.color4fv(image_color.mV); + LLViewerImage::bindTexture(mViewerImage[mCurImageIndex]); + // calculate UV scale + F32 uv_width = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mWidth[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f); + F32 uv_height = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mHeight[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f); + glPushMatrix(); { - LLColor4 bg_color(0.f, 0.f, 0.3f, 0.4f); - gl_rect_2d(getRect(), bg_color); - LLRect &rect = mImageRect[mCurImageIndex]; - LLRect shadow_rect = mImageRect[mCurImageIndex]; - shadow_rect.stretch(BORDER_WIDTH); - gl_drop_shadow(shadow_rect.mLeft, shadow_rect.mTop, shadow_rect.mRight, shadow_rect.mBottom, LLColor4(0.f, 0.f, 0.f, mNeedsFlash ? 0.f :0.5f), 10); - - LLColor4 image_color(1.f, 1.f, 1.f, 1.f); - gGL.color4fv(image_color.mV); - LLViewerImage::bindTexture(mViewerImage[mCurImageIndex]); - // calculate UV scale - F32 uv_width = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mWidth[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f); - F32 uv_height = mImageScaled[mCurImageIndex] ? 1.f : llmin((F32)mHeight[mCurImageIndex] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f); - glPushMatrix(); + glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); + gGL.begin(GL_QUADS); { - glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); - gGL.begin(GL_QUADS); - { - gGL.texCoord2f(uv_width, uv_height); - gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + gGL.texCoord2f(uv_width, uv_height); + gGL.vertex2i(rect.getWidth(), rect.getHeight() ); - gGL.texCoord2f(0.f, uv_height); - gGL.vertex2i(0, rect.getHeight() ); + gGL.texCoord2f(0.f, uv_height); + gGL.vertex2i(0, rect.getHeight() ); - gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(0, 0); + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2i(0, 0); - gGL.texCoord2f(uv_width, 0.f); - gGL.vertex2i(rect.getWidth(), 0); - } - gGL.end(); + gGL.texCoord2f(uv_width, 0.f); + gGL.vertex2i(rect.getWidth(), 0); } - glPopMatrix(); + gGL.end(); + } + glPopMatrix(); - gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha); - gl_rect_2d(getRect()); - if (mNeedsFlash) + gGL.color4f(1.f, 1.f, 1.f, mFlashAlpha); + gl_rect_2d(getRect()); + if (mNeedsFlash) + { + if (mFlashAlpha < 1.f) { - if (mFlashAlpha < 1.f) - { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); - } - else - { - mNeedsFlash = FALSE; - } + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); + mNeedsFlash = FALSE; } + } + else + { + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); + } - if (mShineCountdown > 0) + if (mShineCountdown > 0) + { + mShineCountdown--; + if (mShineCountdown == 0) { - mShineCountdown--; - if (mShineCountdown == 0) - { - mShineAnimTimer.start(); - } + mShineAnimTimer.start(); } - else if (mShineAnimTimer.getStarted()) + } + else if (mShineAnimTimer.getStarted()) + { + //LLDebugVarMessageBox::show("Shine time", &SHINE_TIME, 10.f, 0.1f); + //LLDebugVarMessageBox::show("Shine width", &SHINE_WIDTH, 2.f, 0.05f); + //LLDebugVarMessageBox::show("Shine opacity", &SHINE_OPACITY, 1.f, 0.05f); + + F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); + + // draw "shine" effect + LLLocalClipRect clip(getLocalRect()); { - //LLDebugVarMessageBox::show("Shine time", &SHINE_TIME, 10.f, 0.1f); - //LLDebugVarMessageBox::show("Shine width", &SHINE_WIDTH, 2.f, 0.05f); - //LLDebugVarMessageBox::show("Shine opacity", &SHINE_OPACITY, 1.f, 0.05f); - - F32 shine_interp = llmin(1.f, mShineAnimTimer.getElapsedTimeF32() / SHINE_TIME); - - // draw "shine" effect - LLLocalClipRect clip(getLocalRect()); + // draw diagonal stripe with gradient that passes over screen + S32 x1 = gViewerWindow->getWindowWidth() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); + S32 x2 = x1 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); + S32 x3 = x2 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); + S32 y1 = 0; + S32 y2 = gViewerWindow->getWindowHeight(); + + LLGLSNoTexture no_texture; + gGL.begin(GL_QUADS); { - // draw diagonal stripe with gradient that passes over screen - S32 x1 = gViewerWindow->getWindowWidth() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f))); - S32 x2 = x1 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); - S32 x3 = x2 + llround(gViewerWindow->getWindowWidth() * SHINE_WIDTH); - S32 y1 = 0; - S32 y2 = gViewerWindow->getWindowHeight(); - - LLGLSNoTexture no_texture; - gGL.begin(GL_QUADS); - { - gGL.color4f(1.f, 1.f, 1.f, 0.f); - gGL.vertex2i(x1, y1); - gGL.vertex2i(x1 + gViewerWindow->getWindowWidth(), y2); - gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); - gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); - gGL.vertex2i(x2, y1); - - gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); - gGL.vertex2i(x2, y1); - gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); - gGL.color4f(1.f, 1.f, 1.f, 0.f); - gGL.vertex2i(x3 + gViewerWindow->getWindowWidth(), y2); - gGL.vertex2i(x3, y1); - } - gGL.end(); + gGL.color4f(1.f, 1.f, 1.f, 0.f); + gGL.vertex2i(x1, y1); + gGL.vertex2i(x1 + gViewerWindow->getWindowWidth(), y2); + gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x2, y1); + + gGL.color4f(1.f, 1.f, 1.f, SHINE_OPACITY); + gGL.vertex2i(x2, y1); + gGL.vertex2i(x2 + gViewerWindow->getWindowWidth(), y2); + gGL.color4f(1.f, 1.f, 1.f, 0.f); + gGL.vertex2i(x3 + gViewerWindow->getWindowWidth(), y2); + gGL.vertex2i(x3, y1); } + gGL.end(); + } - if (mShineAnimTimer.getElapsedTimeF32() > SHINE_TIME) - { - mShineAnimTimer.stop(); - } + if (mShineAnimTimer.getElapsedTimeF32() > SHINE_TIME) + { + mShineAnimTimer.stop(); } } + } - // draw framing rectangle + // draw framing rectangle + { + LLGLSNoTexture no_texture; + gGL.color4f(1.f, 1.f, 1.f, 1.f); + LLRect outline_rect = mImageRect[mCurImageIndex]; + gGL.begin(GL_QUADS); { - LLGLSNoTexture no_texture; - gGL.color4f(1.f, 1.f, 1.f, 1.f); - LLRect outline_rect = mImageRect[mCurImageIndex]; - gGL.begin(GL_QUADS); - { - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); - gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); - - gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - - gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); - gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - - gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); - gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); - gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); - } - gGL.end(); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); + gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); + + gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); + gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); + gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + + gGL.vertex2i(outline_rect.mLeft, outline_rect.mTop); + gGL.vertex2i(outline_rect.mLeft, outline_rect.mBottom); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); + gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + + gGL.vertex2i(outline_rect.mRight, outline_rect.mBottom); + gGL.vertex2i(outline_rect.mRight, outline_rect.mTop); + gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); + gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mBottom - BORDER_WIDTH); } + gGL.end(); + } - // draw old image dropping away - if (mFallAnimTimer.getStarted()) + // draw old image dropping away + if (mFallAnimTimer.getStarted()) + { + S32 old_image_index = (mCurImageIndex + 1) % 2; + if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME) { - S32 old_image_index = (mCurImageIndex + 1) % 2; - if (mViewerImage[old_image_index].notNull() && mFallAnimTimer.getElapsedTimeF32() < FALL_TIME) + F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME; + F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f); + LLColor4 image_color(1.f, 1.f, 1.f, alpha); + gGL.color4fv(image_color.mV); + LLViewerImage::bindTexture(mViewerImage[old_image_index]); + // calculate UV scale + // *FIX get this to work with old image + BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull(); + F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f; + F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f; + glPushMatrix(); { - F32 fall_interp = mFallAnimTimer.getElapsedTimeF32() / FALL_TIME; - F32 alpha = clamp_rescale(fall_interp, 0.f, 1.f, 0.8f, 0.4f); - LLColor4 image_color(1.f, 1.f, 1.f, alpha); - gGL.color4fv(image_color.mV); - LLViewerImage::bindTexture(mViewerImage[old_image_index]); - // calculate UV scale - // *FIX get this to work with old image - BOOL rescale = !mImageScaled[old_image_index] && mViewerImage[mCurImageIndex].notNull(); - F32 uv_width = rescale ? llmin((F32)mWidth[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getWidth(), 1.f) : 1.f; - F32 uv_height = rescale ? llmin((F32)mHeight[old_image_index] / (F32)mViewerImage[mCurImageIndex]->getHeight(), 1.f) : 1.f; - glPushMatrix(); + LLRect& rect = mImageRect[old_image_index]; + glTranslatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); + glRotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); + gGL.begin(GL_QUADS); { - LLRect& rect = mImageRect[old_image_index]; - glTranslatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); - glRotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); - gGL.begin(GL_QUADS); - { - gGL.texCoord2f(uv_width, uv_height); - gGL.vertex2i(rect.getWidth(), rect.getHeight() ); - - gGL.texCoord2f(0.f, uv_height); - gGL.vertex2i(0, rect.getHeight() ); - - gGL.texCoord2f(0.f, 0.f); - gGL.vertex2i(0, 0); - - gGL.texCoord2f(uv_width, 0.f); - gGL.vertex2i(rect.getWidth(), 0); - } - gGL.end(); + gGL.texCoord2f(uv_width, uv_height); + gGL.vertex2i(rect.getWidth(), rect.getHeight() ); + + gGL.texCoord2f(0.f, uv_height); + gGL.vertex2i(0, rect.getHeight() ); + + gGL.texCoord2f(0.f, 0.f); + gGL.vertex2i(0, 0); + + gGL.texCoord2f(uv_width, 0.f); + gGL.vertex2i(rect.getWidth(), 0); } - glPopMatrix(); + gGL.end(); } + glPopMatrix(); } } } @@ -729,8 +713,8 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) { LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)snapshot_preview; - LLVector3 new_camera_pos = gCamera->getOrigin(); - LLQuaternion new_camera_rot = gCamera->getQuaternion(); + LLVector3 new_camera_pos = LLViewerCamera::getInstance()->getOrigin(); + LLQuaternion new_camera_rot = LLViewerCamera::getInstance()->getQuaternion(); if (gSavedSettings.getBOOL("FreezeTime") && (new_camera_pos != previewp->mCameraPos || dot(new_camera_rot, previewp->mCameraRot) < 0.995f)) { @@ -744,7 +728,7 @@ void LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->mSnapshotDelayTimer.hasExpired()); // don't take snapshots while ALT-zoom active - if (gToolCamera->hasMouseCapture()) + if (LLToolCamera::getInstance()->hasMouseCapture()) { previewp->mSnapshotActive = FALSE; } @@ -924,7 +908,7 @@ void LLSnapshotLivePreview::saveTexture() llwarns << "Error encoding snapshot" << llendl; } - gViewerStats->incStat(LLViewerStats::ST_SNAPSHOT_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_SNAPSHOT_COUNT ); } BOOL LLSnapshotLivePreview::saveLocal() @@ -1034,7 +1018,7 @@ LLViewerWindow::ESnapshotType LLFloaterSnapshot::Impl::getLayerType(LLFloaterSna // static void LLFloaterSnapshot::Impl::setResolution(LLFloaterSnapshot* floater, const std::string& comboname) { - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(floater, comboname); + LLComboBox* combo = floater->getChild<LLComboBox>(comboname); if (combo) { combo->setVisible(TRUE); @@ -1054,15 +1038,15 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) { previewp->mKeepAspectRatio = TRUE ; - combo = LLUICtrlFactory::getComboBoxByName(floaterp, "postcard_size_combo"); + combo = floaterp->getChild<LLComboBox>("postcard_size_combo"); combo->setCurrentByIndex(0) ; gSavedSettings.setS32("SnapshotPostcardLastResolution", 0) ; - combo = LLUICtrlFactory::getComboBoxByName(floaterp, "texture_size_combo"); + combo = floaterp->getChild<LLComboBox>("texture_size_combo"); combo->setCurrentByIndex(0) ; gSavedSettings.setS32("SnapshotTextureLastResolution", 0) ; - combo = LLUICtrlFactory::getComboBoxByName(floaterp, "local_size_combo"); + combo = floaterp->getChild<LLComboBox>("local_size_combo"); combo->setCurrentByIndex(0) ; gSavedSettings.setS32("SnapshotLocalLastResolution", 0) ; @@ -1097,13 +1081,10 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) // freeze everything else gSavedSettings.setBOOL("FreezeTime", TRUE); - if (gToolMgr->getCurrentToolset() != gCameraToolset) + if (LLToolMgr::getInstance()->getCurrentToolset() != gCameraToolset) { - sInstance->impl.mLastToolset = gToolMgr->getCurrentToolset(); - if (gToolMgr) - { - gToolMgr->setCurrentToolset(gCameraToolset); - } + sInstance->impl.mLastToolset = LLToolMgr::getInstance()->getCurrentToolset(); + LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset); } } else // turning off freeze frame mode @@ -1125,10 +1106,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) // restore last tool (e.g. pie menu, etc) if (sInstance->impl.mLastToolset) { - if (gToolMgr) - { - gToolMgr->setCurrentToolset(sInstance->impl.mLastToolset); - } + LLToolMgr::getInstance()->setCurrentToolset(sInstance->impl.mLastToolset); } } } @@ -1138,8 +1116,7 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { BOOL is_advance = gSavedSettings.getBOOL("AdvanceSnapshot") ; - - LLRadioGroup* snapshot_type_radio = LLUICtrlFactory::getRadioGroupByName(floater, "snapshot_type_radio"); + LLRadioGroup* snapshot_type_radio = floater->getChild<LLRadioGroup>("snapshot_type_radio"); snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType")); LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater); LLViewerWindow::ESnapshotType layer_type = getLayerType(floater); @@ -1149,11 +1126,11 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) floater->childSetVisible("local_size_combo", FALSE); LLComboBox* combo; - combo = LLUICtrlFactory::getComboBoxByName(floater, "postcard_size_combo"); + combo = floater->getChild<LLComboBox>("postcard_size_combo"); if (combo) combo->selectNthItem(gSavedSettings.getS32("SnapshotPostcardLastResolution")); - combo = LLUICtrlFactory::getComboBoxByName(floater, "texture_size_combo"); + combo = floater->getChild<LLComboBox>("texture_size_combo"); if (combo) combo->selectNthItem(gSavedSettings.getS32("SnapshotTextureLastResolution")); - combo = LLUICtrlFactory::getComboBoxByName(floater, "local_size_combo"); + combo = floater->getChild<LLComboBox>("local_size_combo"); if (combo) combo->selectNthItem(gSavedSettings.getS32("SnapshotLocalLastResolution")); floater->childSetVisible("upload_btn", FALSE); @@ -1438,7 +1415,6 @@ void LLFloaterSnapshot::Impl::onClickKeepAspectCheck(LLUICtrl* ctrl, void* data) } previewp->setSize(w, h) ; - checkAutoSnapshot(previewp, TRUE); } } @@ -1535,11 +1511,11 @@ void LLFloaterSnapshot::Impl::onCommitResolution(LLUICtrl* ctrl, void* data) // save off all selected resolution values LLComboBox* combo; - combo = LLUICtrlFactory::getComboBoxByName(view, "postcard_size_combo"); + combo = view->getChild<LLComboBox>("postcard_size_combo"); gSavedSettings.setS32("SnapshotPostcardLastResolution", combo->getCurrentIndex()); - combo = LLUICtrlFactory::getComboBoxByName(view, "texture_size_combo"); + combo = view->getChild<LLComboBox>("texture_size_combo"); gSavedSettings.setS32("SnapshotTextureLastResolution", combo->getCurrentIndex()); - combo = LLUICtrlFactory::getComboBoxByName(view, "local_size_combo"); + combo = view->getChild<LLComboBox>("local_size_combo"); gSavedSettings.setS32("SnapshotLocalLastResolution", combo->getCurrentIndex()); std::string sdstring = combobox->getSelectedValue(); @@ -1617,7 +1593,7 @@ void LLFloaterSnapshot::Impl::onCommitSnapshotType(LLUICtrl* ctrl, void* data) // static void LLFloaterSnapshot::Impl::comboSetCustom(LLFloaterSnapshot* floater, const std::string& comboname) { - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(floater, comboname); + LLComboBox* combo = floater->getChild<LLComboBox>(comboname); if (combo) { combo->setCurrentByIndex(combo->getItemCount() - 1); @@ -1695,13 +1671,13 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3 //static void LLFloaterSnapshot::Impl::resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) { - LLSpinCtrl *sctrl = LLViewerUICtrlFactory::getSpinnerByName(view, "snapshot_width") ; + LLSpinCtrl *sctrl = view->getChild<LLSpinCtrl>("snapshot_width") ; if(sctrl) { sctrl->setValue(width) ; } - sctrl = LLViewerUICtrlFactory::getSpinnerByName(view, "snapshot_height") ; + sctrl = view->getChild<LLSpinCtrl>("snapshot_height") ; if(sctrl) { sctrl->setValue(height) ; @@ -1773,10 +1749,7 @@ LLFloaterSnapshot::~LLFloaterSnapshot() if (impl.mLastToolset) { - if (gToolMgr) - { - gToolMgr->setCurrentToolset(impl.mLastToolset); - } + LLToolMgr::getInstance()->setCurrentToolset(impl.mLastToolset); } delete &impl; @@ -1858,7 +1831,7 @@ void LLFloaterSnapshot::draw() return; } - if(getVisible() && !isMinimized()) + if(!isMinimized()) { if (previewp && previewp->getDataSize() > 0) { @@ -1880,7 +1853,7 @@ void LLFloaterSnapshot::draw() if (previewp->getSnapshotUpToDate()) { LLString bytes_string; - gResMgr->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); childSetTextArg("file_size_label", "[SIZE]", bytes_string); } else @@ -1976,7 +1949,7 @@ void LLFloaterSnapshot::show(void*) { sInstance = new LLFloaterSnapshot(); - gUICtrlFactory->buildFloater(sInstance, "floater_snapshot.xml", NULL, FALSE); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_snapshot.xml", NULL, FALSE); //move snapshot floater to special purpose snapshotfloaterview gFloaterView->removeChild(sInstance); gSnapshotFloaterView->addChild(sInstance); @@ -2028,24 +2001,17 @@ BOOL LLSnapshotFloaterView::handleKey(KEY key, MASK mask, BOOL called_from_paren return LLFloaterView::handleKey(key, mask, called_from_parent); } - if (!getEnabled()) + if (called_from_parent) { - return FALSE; + // pass all keystrokes down + LLFloaterView::handleKey(key, mask, called_from_parent); } else { - if (called_from_parent) - { - // pass all keystrokes down - LLFloaterView::handleKey(key, mask, called_from_parent); - } - else - { - // bounce keystrokes back down - LLFloaterView::handleKey(key, mask, TRUE); - } - return TRUE; + // bounce keystrokes back down + LLFloaterView::handleKey(key, mask, TRUE); } + return TRUE; } BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) @@ -2058,7 +2024,7 @@ BOOL LLSnapshotFloaterView::handleMouseDown(S32 x, S32 y, MASK mask) // give floater a change to handle mouse, else camera tool if (childrenHandleMouseDown(x, y, mask) == NULL) { - gToolMgr->getCurrentTool()->handleMouseDown( x, y, mask ); + LLToolMgr::getInstance()->getCurrentTool()->handleMouseDown( x, y, mask ); } return TRUE; } @@ -2073,7 +2039,7 @@ BOOL LLSnapshotFloaterView::handleMouseUp(S32 x, S32 y, MASK mask) // give floater a change to handle mouse, else camera tool if (childrenHandleMouseUp(x, y, mask) == NULL) { - gToolMgr->getCurrentTool()->handleMouseUp( x, y, mask ); + LLToolMgr::getInstance()->getCurrentTool()->handleMouseUp( x, y, mask ); } return TRUE; } @@ -2088,7 +2054,7 @@ BOOL LLSnapshotFloaterView::handleHover(S32 x, S32 y, MASK mask) // give floater a change to handle mouse, else camera tool if (childrenHandleHover(x, y, mask) == NULL) { - gToolMgr->getCurrentTool()->handleHover( x, y, mask ); + LLToolMgr::getInstance()->getCurrentTool()->handleHover( x, y, mask ); } return TRUE; } diff --git a/indra/newview/llfloatertelehub.cpp b/indra/newview/llfloatertelehub.cpp index 9c837135d8..65b6d55480 100644 --- a/indra/newview/llfloatertelehub.cpp +++ b/indra/newview/llfloatertelehub.cpp @@ -45,7 +45,7 @@ #include "lltoolmgr.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" LLFloaterTelehub* LLFloaterTelehub::sInstance = NULL; @@ -62,8 +62,8 @@ void LLFloaterTelehub::show() sInstance = new LLFloaterTelehub(); // Show tools floater by selecting translate (select) tool - gToolMgr->setCurrentToolset(gBasicToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolTranslate ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompTranslate::getInstance() ); // Find tools floater, glue to bottom if (gFloaterTools) @@ -92,21 +92,21 @@ LLFloaterTelehub::LLFloaterTelehub() gMessageSystem->setHandlerFunc("TelehubInfo", processTelehubInfo); - gUICtrlFactory->buildFloater(sInstance, "floater_telehub.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_telehub.xml"); childSetAction("connect_btn", onClickConnect, this); childSetAction("disconnect_btn", onClickDisconnect, this); childSetAction("add_spawn_point_btn", onClickAddSpawnPoint, this); childSetAction("remove_spawn_point_btn", onClickRemoveSpawnPoint, this); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "spawn_points_list"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { // otherwise you can't walk with arrow keys while floater is up list->setAllowKeyboardMovement(FALSE); } - mObjectSelection = gSelectMgr->getEditSelection(); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); } LLFloaterTelehub::~LLFloaterTelehub() @@ -119,7 +119,7 @@ LLFloaterTelehub::~LLFloaterTelehub() void LLFloaterTelehub::draw() { - if (getVisible() && !isMinimized()) + if (!isMinimized()) { refresh(); } @@ -133,7 +133,7 @@ void LLFloaterTelehub::refresh() LLViewerObject* object = mObjectSelection->getFirstRootObject(children_ok); BOOL have_selection = (object != NULL); - BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); + BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); childSetEnabled("connect_btn", have_selection && all_volume); BOOL have_telehub = mTelehubObjectID.notNull(); @@ -142,7 +142,7 @@ void LLFloaterTelehub::refresh() BOOL space_avail = (mNumSpawn < MAX_SPAWNPOINTS_PER_TELEHUB); childSetEnabled("add_spawn_point_btn", have_selection && all_volume && space_avail); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "spawn_points_list"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { BOOL enable_remove = (list->getFirstSelected() != NULL); @@ -175,7 +175,7 @@ void LLFloaterTelehub::addBeacons() // Draw nice thick 3-pixel lines. gObjectList.addDebugBeacon(hub_pos_region, "", LLColor4::yellow, LLColor4::white, 4); - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(sInstance, "spawn_points_list"); + LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { S32 spawn_index = list->getFirstSelectedIndex(); @@ -189,26 +189,26 @@ void LLFloaterTelehub::addBeacons() void LLFloaterTelehub::sendTelehubInfoRequest() { - gSelectMgr->sendGodlikeRequest("telehub", "info ui"); + LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "info ui"); } // static void LLFloaterTelehub::onClickConnect(void* data) { - gSelectMgr->sendGodlikeRequest("telehub", "connect"); + LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "connect"); } // static void LLFloaterTelehub::onClickDisconnect(void* data) { - gSelectMgr->sendGodlikeRequest("telehub", "delete"); + LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "delete"); } // static void LLFloaterTelehub::onClickAddSpawnPoint(void* data) { - gSelectMgr->sendGodlikeRequest("telehub", "spawnpoint add"); - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->sendGodlikeRequest("telehub", "spawnpoint add"); + LLSelectMgr::getInstance()->deselectAll(); } // static @@ -216,7 +216,7 @@ void LLFloaterTelehub::onClickRemoveSpawnPoint(void* data) { if (!sInstance) return; - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(sInstance, "spawn_points_list"); + LLScrollListCtrl* list = sInstance->getChild<LLScrollListCtrl>("spawn_points_list"); if (!list) return; S32 spawn_index = list->getFirstSelectedIndex(); @@ -295,7 +295,7 @@ void LLFloaterTelehub::unpackTelehubInfo(LLMessageSystem* msg) childSetVisible("help_text_not_connected", false); } - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "spawn_points_list"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("spawn_points_list"); if (list) { list->deleteAllItems(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 6c65ace89a..7777544a4c 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -69,7 +69,6 @@ #include "lltoolpie.h" #include "lltoolpipette.h" #include "lltoolplacer.h" -#include "lltoolselect.h" #include "lltoolselectland.h" #include "llui.h" #include "llviewermenu.h" @@ -77,7 +76,7 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // Globals LLFloaterTools *gFloaterTools = NULL; @@ -184,50 +183,50 @@ BOOL LLFloaterTools::postBuild() getDragHandle()->setEnabled( !gSavedSettings.getBOOL("ToolboxAutoMove") ); LLRect rect; - mBtnFocus = LLUICtrlFactory::getButtonByName(this,"button focus");//btn; - childSetAction("button focus",LLFloaterTools::setEditTool, (void*)gToolCamera); - mBtnMove = LLUICtrlFactory::getButtonByName(this,"button move"); - childSetAction("button move",LLFloaterTools::setEditTool, (void*)gToolGrab); - mBtnEdit = LLUICtrlFactory::getButtonByName(this,"button edit"); - childSetAction("button edit",LLFloaterTools::setEditTool, (void*)gToolTranslate); - mBtnCreate = LLUICtrlFactory::getButtonByName(this,"button create"); - childSetAction("button create",LLFloaterTools::setEditTool, (void*)gToolCreate); - mBtnLand = LLUICtrlFactory::getButtonByName(this, "button land" ); - childSetAction("button land",LLFloaterTools::setEditTool, (void*)gToolParcel); - mTextStatus = LLUICtrlFactory::getTextBoxByName(this,"text status"); - mRadioZoom = LLUICtrlFactory::getCheckBoxByName(this,"radio zoom"); + mBtnFocus = getChild<LLButton>("button focus");//btn; + childSetAction("button focus",LLFloaterTools::setEditTool, (void*)LLToolCamera::getInstance()); + mBtnMove = getChild<LLButton>("button move"); + childSetAction("button move",LLFloaterTools::setEditTool, (void*)LLToolGrab::getInstance()); + mBtnEdit = getChild<LLButton>("button edit"); + childSetAction("button edit",LLFloaterTools::setEditTool, (void*)LLToolCompTranslate::getInstance()); + mBtnCreate = getChild<LLButton>("button create"); + childSetAction("button create",LLFloaterTools::setEditTool, (void*)LLToolCompCreate::getInstance()); + mBtnLand = getChild<LLButton>("button land" ); + childSetAction("button land",LLFloaterTools::setEditTool, (void*)LLToolSelectLand::getInstance()); + mTextStatus = getChild<LLTextBox>("text status"); + mRadioZoom = getChild<LLCheckBoxCtrl>("radio zoom"); childSetCommitCallback("slider zoom",commit_slider_zoom,this); - mRadioOrbit = LLUICtrlFactory::getCheckBoxByName(this,"radio orbit"); + mRadioOrbit = getChild<LLCheckBoxCtrl>("radio orbit"); childSetCommitCallback("radio orbit",commit_radio_orbit,this); - mRadioPan = LLUICtrlFactory::getCheckBoxByName(this,"radio pan"); + mRadioPan = getChild<LLCheckBoxCtrl>("radio pan"); childSetCommitCallback("radio pan",commit_radio_pan,this); - mRadioMove = LLUICtrlFactory::getCheckBoxByName(this,"radio move"); + mRadioMove = getChild<LLCheckBoxCtrl>("radio move"); childSetCommitCallback("radio move",click_popup_grab_drag,this); - mRadioLift = LLUICtrlFactory::getCheckBoxByName(this,"radio lift"); + mRadioLift = getChild<LLCheckBoxCtrl>("radio lift"); childSetCommitCallback("radio lift",click_popup_grab_lift,this); - mRadioSpin = LLUICtrlFactory::getCheckBoxByName(this,"radio spin"); + mRadioSpin = getChild<LLCheckBoxCtrl>("radio spin"); childSetCommitCallback("radio spin",click_popup_grab_spin,NULL); - mRadioPosition = LLUICtrlFactory::getCheckBoxByName(this,"radio position"); - childSetCommitCallback("radio position",commit_select_tool,gToolTranslate); - mRadioRotate = LLUICtrlFactory::getCheckBoxByName(this,"radio rotate"); - childSetCommitCallback("radio rotate",commit_select_tool,gToolRotate); - mRadioStretch = LLUICtrlFactory::getCheckBoxByName(this,"radio stretch"); - childSetCommitCallback("radio stretch",commit_select_tool,gToolStretch); - mRadioSelectFace = LLUICtrlFactory::getCheckBoxByName(this,"radio select face"); - childSetCommitCallback("radio select face",commit_select_tool,gToolFace); - mCheckSelectIndividual = LLUICtrlFactory::getCheckBoxByName(this,"checkbox edit linked parts"); + mRadioPosition = getChild<LLCheckBoxCtrl>("radio position"); + childSetCommitCallback("radio position",commit_select_tool,LLToolCompTranslate::getInstance()); + mRadioRotate = getChild<LLCheckBoxCtrl>("radio rotate"); + childSetCommitCallback("radio rotate",commit_select_tool,LLToolCompRotate::getInstance()); + mRadioStretch = getChild<LLCheckBoxCtrl>("radio stretch"); + childSetCommitCallback("radio stretch",commit_select_tool,LLToolCompScale::getInstance()); + mRadioSelectFace = getChild<LLCheckBoxCtrl>("radio select face"); + childSetCommitCallback("radio select face",commit_select_tool,LLToolFace::getInstance()); + mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts"); childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); childSetCommitCallback("checkbox edit linked parts",commit_select_component,this); - mCheckSnapToGrid = LLUICtrlFactory::getCheckBoxByName(this,"checkbox snap to grid"); + mCheckSnapToGrid = getChild<LLCheckBoxCtrl>("checkbox snap to grid"); childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled")); - mBtnGridOptions = LLUICtrlFactory::getButtonByName(this,"Options..."); + mBtnGridOptions = getChild<LLButton>("Options..."); childSetAction("Options...",onClickGridOptions, this); - mCheckStretchUniform = LLUICtrlFactory::getCheckBoxByName(this,"checkbox uniform"); + mCheckStretchUniform = getChild<LLCheckBoxCtrl>("checkbox uniform"); childSetValue("checkbox uniform",(BOOL)gSavedSettings.getBOOL("ScaleUniform")); - mCheckStretchTexture = LLUICtrlFactory::getCheckBoxByName(this,"checkbox stretch textures"); + mCheckStretchTexture = getChild<LLCheckBoxCtrl>("checkbox stretch textures"); childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); - mTextGridMode = LLUICtrlFactory::getTextBoxByName(this,"text ruler mode"); - mComboGridMode = LLUICtrlFactory::getComboBoxByName(this,"combobox grid mode"); + mTextGridMode = getChild<LLTextBox>("text ruler mode"); + mComboGridMode = getChild<LLComboBox>("combobox grid mode"); childSetCommitCallback("combobox grid mode",commit_grid_mode, this); // // Create Buttons @@ -267,7 +266,7 @@ BOOL LLFloaterTools::postBuild() &LLToolPlacerPanel::sGrass}; for(size_t t=0; t<sizeof(toolNames)/sizeof(toolNames[0]); ++t) { - LLButton *found = LLViewerUICtrlFactory::getButtonByName(this,toolNames[t]); + LLButton *found = getChild<LLButton>(toolNames[t]); if(found) { found->setClickedCallback(setObjectType,toolData[t]); @@ -276,38 +275,38 @@ BOOL LLFloaterTools::postBuild() llwarns << "Tool button not found! DOA Pending." << llendl; } } - mCheckCopySelection = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy selection"); + mCheckCopySelection = getChild<LLCheckBoxCtrl>("checkbox copy selection"); childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); - mCheckSticky = LLUICtrlFactory::getCheckBoxByName(this,"checkbox sticky"); + mCheckSticky = getChild<LLCheckBoxCtrl>("checkbox sticky"); childSetValue("checkbox sticky",(BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); - mCheckCopyCenters = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy centers"); + mCheckCopyCenters = getChild<LLCheckBoxCtrl>("checkbox copy centers"); childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); - mCheckCopyRotates = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy rotates"); + mCheckCopyRotates = getChild<LLCheckBoxCtrl>("checkbox copy rotates"); childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); - mRadioSelectLand = LLUICtrlFactory::getCheckBoxByName(this,"radio select land"); - childSetCommitCallback("radio select land",commit_select_tool, gToolParcel); - mRadioDozerFlatten = LLUICtrlFactory::getCheckBoxByName(this,"radio flatten"); + mRadioSelectLand = getChild<LLCheckBoxCtrl>("radio select land"); + childSetCommitCallback("radio select land",commit_select_tool, LLToolSelectLand::getInstance()); + mRadioDozerFlatten = getChild<LLCheckBoxCtrl>("radio flatten"); childSetCommitCallback("radio flatten",click_popup_dozer_mode, (void*)0); - mRadioDozerRaise = LLUICtrlFactory::getCheckBoxByName(this,"radio raise"); + mRadioDozerRaise = getChild<LLCheckBoxCtrl>("radio raise"); childSetCommitCallback("radio raise",click_popup_dozer_mode, (void*)1); - mRadioDozerLower = LLUICtrlFactory::getCheckBoxByName(this,"radio lower"); + mRadioDozerLower = getChild<LLCheckBoxCtrl>("radio lower"); childSetCommitCallback("radio lower",click_popup_dozer_mode, (void*)2); - mRadioDozerSmooth = LLUICtrlFactory::getCheckBoxByName(this,"radio smooth"); + mRadioDozerSmooth = getChild<LLCheckBoxCtrl>("radio smooth"); childSetCommitCallback("radio smooth",click_popup_dozer_mode, (void*)3); - mRadioDozerNoise = LLUICtrlFactory::getCheckBoxByName(this,"radio noise"); + mRadioDozerNoise = getChild<LLCheckBoxCtrl>("radio noise"); childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); - mRadioDozerRevert = LLUICtrlFactory::getCheckBoxByName(this,"radio revert"); + mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert"); childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); - mComboDozerSize = LLUICtrlFactory::getComboBoxByName(this,"combobox brush size"); + mComboDozerSize = getChild<LLComboBox>("combobox brush size"); childSetCommitCallback("combobox brush size",click_dozer_size, (void*)0); if(mComboDozerSize) mComboDozerSize->setCurrentByIndex(0); - mBtnApplyToSelection = LLUICtrlFactory::getButtonByName(this,"button apply to selection"); + mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); childSetAction("button apply to selection",click_apply_to_selection, (void*)0); - mCheckShowOwners = LLUICtrlFactory::getCheckBoxByName(this,"checkbox show owners"); + mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); childSetAction("button more", click_show_more, this); childSetAction("button less", click_show_more, this); - mTab = LLUICtrlFactory::getTabContainerByName(this,"Object Info Tabs"); + mTab = getChild<LLTabContainer>("Object Info Tabs"); if(mTab) { mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); @@ -406,7 +405,7 @@ LLFloaterTools::LLFloaterTools() factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo - gUICtrlFactory->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); mLargeHeight = getRect().getHeight(); mSmallHeight = mLargeHeight; @@ -445,7 +444,7 @@ void LLFloaterTools::refresh() const S32 INFO_WIDTH = getRect().getWidth(); const S32 INFO_HEIGHT = 384; LLRect object_info_rect(0, 0, INFO_WIDTH, -INFO_HEIGHT); - BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); + BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); S32 idx_features = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FEATURES]); S32 idx_face = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FACE]); @@ -502,7 +501,7 @@ void LLFloaterTools::resetToolState() void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) { - LLTool *tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); // HACK to allow seeing the buttons when you have the app in a window. // Keep the visibility the same as it @@ -517,7 +516,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) } // Focus buttons - BOOL focus_visible = ( tool == gToolCamera ); + BOOL focus_visible = ( tool == LLToolCamera::getInstance() ); mBtnFocus ->setToggleState( focus_visible ); @@ -545,7 +544,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) childSetValue( "slider zoom", gAgent.getCameraZoomFraction() * 0.5f); // Move buttons - BOOL move_visible = (tool == gToolGrab); + BOOL move_visible = (tool == LLToolGrab::getInstance()); if (mBtnMove) mBtnMove ->setToggleState( move_visible ); @@ -574,12 +573,12 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) } // Edit buttons - BOOL edit_visible = tool == gToolTranslate || - tool == gToolRotate || - tool == gToolStretch || - tool == gToolFace || - tool == gToolIndividual || - tool == gToolPipette; + BOOL edit_visible = tool == LLToolCompTranslate::getInstance() || + tool == LLToolCompRotate::getInstance() || + tool == LLToolCompScale::getInstance() || + tool == LLToolFace::getInstance() || + tool == LLToolIndividual::getInstance() || + tool == LLToolPipette::getInstance(); mBtnEdit ->setToggleState( edit_visible ); @@ -589,7 +588,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mRadioSelectFace) { mRadioSelectFace->setVisible( edit_visible ); - mRadioSelectFace->set( tool == gToolFace ); + mRadioSelectFace->set( tool == LLToolFace::getInstance() ); } if (mCheckSelectIndividual) @@ -598,9 +597,9 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) //mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); } - mRadioPosition ->set( tool == gToolTranslate ); - mRadioRotate ->set( tool == gToolRotate ); - mRadioStretch ->set( tool == gToolStretch ); + mRadioPosition ->set( tool == LLToolCompTranslate::getInstance() ); + mRadioRotate ->set( tool == LLToolCompRotate::getInstance() ); + mRadioStretch ->set( tool == LLToolCompScale::getInstance() ); if (mComboGridMode) { @@ -632,17 +631,17 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mTextGridMode) mTextGridMode->setVisible( edit_visible ); // Snap to grid disabled for grab tool - very confusing - if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == gToolGrab */ ); - if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == gToolGrab */ ); + if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); + if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ ); //mCheckSelectLinked ->setVisible( edit_visible ); if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible ); if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible ); // Create buttons - BOOL create_visible = (tool == gToolCreate); + BOOL create_visible = (tool == LLToolCompCreate::getInstance()); - mBtnCreate ->setToggleState( tool == gToolCreate ); + mBtnCreate ->setToggleState( tool == LLToolCompCreate::getInstance() ); if (mCheckCopySelection && mCheckCopySelection->get()) @@ -678,12 +677,12 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mCheckCopyRotates) mCheckCopyRotates->setEnabled( mCheckCopySelection->get() ); // Land buttons - BOOL land_visible = (tool == gToolLand || tool == gToolParcel ); + BOOL land_visible = (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance() ); if (mBtnLand) mBtnLand ->setToggleState( land_visible ); - // mRadioEditLand ->set( tool == gToolLand ); - if (mRadioSelectLand) mRadioSelectLand->set( tool == gToolParcel ); + // mRadioEditLand ->set( tool == LLToolBrushLand::getInstance() ); + if (mRadioSelectLand) mRadioSelectLand->set( tool == LLToolSelectLand::getInstance() ); // mRadioEditLand ->setVisible( land_visible ); if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); @@ -693,44 +692,44 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) if (mRadioDozerFlatten) { - mRadioDozerFlatten ->set( tool == gToolLand && dozer_mode == 0); + mRadioDozerFlatten ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 0); mRadioDozerFlatten ->setVisible( land_visible ); } if (mRadioDozerRaise) { - mRadioDozerRaise ->set( tool == gToolLand && dozer_mode == 1); + mRadioDozerRaise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 1); mRadioDozerRaise ->setVisible( land_visible ); } if (mRadioDozerLower) { - mRadioDozerLower ->set( tool == gToolLand && dozer_mode == 2); + mRadioDozerLower ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 2); mRadioDozerLower ->setVisible( land_visible ); } if (mRadioDozerSmooth) { - mRadioDozerSmooth ->set( tool == gToolLand && dozer_mode == 3); + mRadioDozerSmooth ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 3); mRadioDozerSmooth ->setVisible( land_visible ); } if (mRadioDozerNoise) { - mRadioDozerNoise ->set( tool == gToolLand && dozer_mode == 4); + mRadioDozerNoise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 4); mRadioDozerNoise ->setVisible( land_visible ); } if (mRadioDozerRevert) { - mRadioDozerRevert ->set( tool == gToolLand && dozer_mode == 5); + mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5); mRadioDozerRevert ->setVisible( land_visible ); } if (mComboDozerSize) { mComboDozerSize ->setCurrentByIndex(dozer_size); mComboDozerSize ->setVisible( land_visible ); - mComboDozerSize ->setEnabled( tool == gToolLand ); + mComboDozerSize ->setEnabled( tool == LLToolBrushLand::getInstance() ); } if (mBtnApplyToSelection) { mBtnApplyToSelection->setVisible( land_visible ); - mBtnApplyToSelection->setEnabled( land_visible && !gParcelMgr->selectionEmpty() && tool != gToolParcel); + mBtnApplyToSelection->setEnabled( land_visible && !LLViewerParcelMgr::getInstance()->selectionEmpty() && tool != LLToolSelectLand::getInstance()); } if (mCheckShowOwners) { @@ -742,8 +741,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) // BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); - mTab->setVisible(show_more && tool != gToolLand && tool != gToolParcel); - mPanelLandInfo->setVisible(show_more && (tool == gToolLand || tool == gToolParcel)); + mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance()); + mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance())); } @@ -757,8 +756,8 @@ BOOL LLFloaterTools::canClose() // virtual void LLFloaterTools::onOpen() { - mParcelSelection = gParcelMgr->getFloatingParcelSelection(); - mObjectSelection = gSelectMgr->getEditSelection(); + mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); gMenuBarView->setItemVisible("Tools", TRUE); gMenuBarView->arrange(); @@ -776,7 +775,7 @@ void LLFloaterTools::onClose(bool app_quitting) gAgent.resetView(gSavedSettings.getBOOL("EditCameraMovement")); // exit component selection mode - gSelectMgr->promoteSelectionToRoot(); + LLSelectMgr::getInstance()->promoteSelectionToRoot(); gSavedSettings.setBOOL("EditLinkedParts", FALSE); gViewerWindow->showCursor(); @@ -787,10 +786,10 @@ void LLFloaterTools::onClose(bool app_quitting) mObjectSelection = NULL; // Switch back to basic toolset - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); // we were already in basic toolset, using build tools // so manually reset tool to default (pie menu tool) - gToolMgr->getCurrentToolset()->selectFirstTool(); + LLToolMgr::getInstance()->getCurrentToolset()->selectFirstTool(); gMenuBarView->setItemVisible("Tools", FALSE); gMenuBarView->arrange(); @@ -891,19 +890,19 @@ void commit_slider_zoom(LLUICtrl *ctrl, void*) void click_popup_rotate_left(void*) { - gSelectMgr->selectionRotateAroundZ( 45.f ); + LLSelectMgr::getInstance()->selectionRotateAroundZ( 45.f ); dialog_refresh_all(); } void click_popup_rotate_reset(void*) { - gSelectMgr->selectionResetRotation(); + LLSelectMgr::getInstance()->selectionResetRotation(); dialog_refresh_all(); } void click_popup_rotate_right(void*) { - gSelectMgr->selectionRotateAroundZ( -45.f ); + LLSelectMgr::getInstance()->selectionRotateAroundZ( -45.f ); dialog_refresh_all(); } @@ -912,7 +911,7 @@ void click_popup_dozer_mode(LLUICtrl *, void *user) { S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); S32 mode = (S32)(intptr_t) user; - gFloaterTools->setEditTool( gToolLand ); + gFloaterTools->setEditTool( LLToolBrushLand::getInstance() ); gSavedSettings.setS32("RadioLandBrushAction", mode); gSavedSettings.setBOOL("ShowParcelOwners", show_owners); } @@ -931,7 +930,7 @@ void click_dozer_size(LLUICtrl *ctrl, void *user) void click_apply_to_selection(void* user) { - gToolLand->modifyLandInSelectionGlobal(); + LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); } void commit_select_tool(LLUICtrl *ctrl, void *data) @@ -957,11 +956,11 @@ void commit_select_component(LLUICtrl *ctrl, void *data) if (select_individuals) { - gSelectMgr->demoteSelectionToIndividuals(); + LLSelectMgr::getInstance()->demoteSelectionToIndividuals(); } else { - gSelectMgr->promoteSelectionToRoot(); + LLSelectMgr::getInstance()->promoteSelectionToRoot(); } } @@ -969,7 +968,7 @@ void commit_grid_mode(LLUICtrl *ctrl, void *data) { LLComboBox* combo = (LLComboBox*)ctrl; - gSelectMgr->setGridMode((EGridMode)combo->getCurrentIndex()); + LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex()); } // static @@ -997,6 +996,6 @@ void LLFloaterTools::setEditTool(void* tool_pointer) void LLFloaterTools::onFocusReceived() { - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); LLFloater::onFocusReceived(); } diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index 593d1f5114..5d2f21e370 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -46,7 +46,7 @@ #include "lltracker.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL; @@ -62,7 +62,7 @@ void LLFloaterTopObjects::show() } sInstance = new LLFloaterTopObjects(); - gUICtrlFactory->buildFloater(sInstance, "floater_top_objects.xml"); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_top_objects.xml"); sInstance->center(); } @@ -85,7 +85,7 @@ BOOL LLFloaterTopObjects::postBuild() childSetCommitCallback("objects_list", onCommitObjectsList, this); childSetDoubleClickCallback("objects_list", onDoubleClickObjectsList); childSetFocus("objects_list"); - LLScrollListCtrl *objects_list = LLUICtrlFactory::getScrollListByName(this, "objects_list"); + LLScrollListCtrl *objects_list = getChild<LLScrollListCtrl>("objects_list"); if (objects_list) { objects_list->setCommitOnSelectionChange(TRUE); @@ -106,7 +106,7 @@ BOOL LLFloaterTopObjects::postBuild() /* - LLLineEditor* line_editor = LLUICtrlFactory::getLineEditorByName(this, "owner_name_editor"); + LLLineEditor* line_editor = getChild<LLLineEditor>("owner_name_editor"); if (line_editor) { line_editor->setCommitOnFocusLost(FALSE); @@ -114,7 +114,7 @@ BOOL LLFloaterTopObjects::postBuild() line_editor->setCallbackUserData(this); } - line_editor = LLUICtrlFactory::getLineEditorByName(this, "object_name_editor"); + line_editor = getChild<LLLineEditor>("object_name_editor"); if (line_editor) { line_editor->setCommitOnFocusLost(FALSE); @@ -247,7 +247,7 @@ void LLFloaterTopObjects::onCommitObjectsList(LLUICtrl* ctrl, void* data) void LLFloaterTopObjects::updateSelectionInfo() { - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "objects_list"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list"); if (!list) return; @@ -445,7 +445,7 @@ void LLFloaterTopObjects::onGetByOwnerName(LLUICtrl* ctrl, void* data) void LLFloaterTopObjects::showBeacon() { - LLScrollListCtrl* list = LLUICtrlFactory::getScrollListByName(this, "objects_list"); + LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list"); if (!list) return; LLScrollListItem* first_selected = list->getFirstSelected(); diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 5875c4bef7..6b51687c68 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -42,7 +42,7 @@ #include "llstartup.h" #include "message.h" #include "llagent.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llviewerstats.h" #include "llui.h" @@ -62,11 +62,11 @@ LLFloaterTOS* LLFloaterTOS::show(ETOSType type, const std::string & message) if (type == TOS_TOS) { - gUICtrlFactory->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml"); + LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_tos.xml"); } else { - gUICtrlFactory->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml"); + LLUICtrlFactory::getInstance()->buildFloater(LLFloaterTOS::sInstance, "floater_critical.xml"); } return LLFloaterTOS::sInstance; @@ -132,7 +132,7 @@ BOOL LLFloaterTOS::postBuild() if ( mType != TOS_TOS ) { // this displays the critical message - LLTextEditor *Editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text"); + LLTextEditor *Editor = getChild<LLTextEditor>("tos_text"); if (Editor) { Editor->setHandleEditKeysDirectly( TRUE ); @@ -146,14 +146,14 @@ BOOL LLFloaterTOS::postBuild() } // disable Agree to TOS radio button until the page has fully loaded - LLRadioGroup* tos_agreement = LLUICtrlFactory::getRadioGroupByName(this, "tos_agreement"); + LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); if ( tos_agreement ) { tos_agreement->setEnabled( false ); }; // hide the SL text widget if we're displaying TOS with using a browser widget. - LLTextEditor *editor = LLUICtrlFactory::getTextEditorByName(this, "tos_text"); + LLTextEditor *editor = getChild<LLTextEditor>("tos_text"); if ( editor ) { editor->setVisible( FALSE ); @@ -194,7 +194,7 @@ void LLFloaterTOS::setSiteIsAlive( bool alive ) { // normally this is set when navigation to TOS page navigation completes (so you can't accept before TOS loads) // but if the page is unavailable, we need to do this now - LLRadioGroup* tos_agreement = LLUICtrlFactory::getRadioGroupByName(this, "tos_agreement"); + LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); if ( tos_agreement ) { tos_agreement->setEnabled( true ); @@ -286,7 +286,7 @@ void LLFloaterTOS::onNavigateComplete( const EventType& eventIn ) { llinfos << "NAVIGATE COMPLETE" << llendl; // enable Agree to TOS radio button now that page has loaded - LLRadioGroup* tos_agreement = LLUICtrlFactory::getRadioGroupByName(this, "tos_agreement"); + LLRadioGroup* tos_agreement = getChild<LLRadioGroup>("tos_agreement"); if ( tos_agreement ) { tos_agreement->setEnabled( true ); diff --git a/indra/newview/llfloaterurldisplay.cpp b/indra/newview/llfloaterurldisplay.cpp index e0d547b34e..c68c6d3edb 100644 --- a/indra/newview/llfloaterurldisplay.cpp +++ b/indra/newview/llfloaterurldisplay.cpp @@ -35,7 +35,7 @@ #include "llfloaterurldisplay.h" #include "llpanelplace.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "v3dmath.h" @@ -46,7 +46,7 @@ LLFloaterURLDisplay::LLFloaterURLDisplay(const LLSD& sd) { mFactoryMap["place_details_panel"] = LLCallbackMap(LLFloaterURLDisplay::createPlaceDetail, this); - gUICtrlFactory->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_preview_url.xml", &getFactoryMap()); this->setVisible(false); // If positioned at 0,0 the teleport button is behind the toolbar. @@ -101,7 +101,7 @@ void* LLFloaterURLDisplay::createPlaceDetail(void* userdata) { LLFloaterURLDisplay *self = (LLFloaterURLDisplay*)userdata; self->mPlacePanel = new LLPanelPlace(); - gUICtrlFactory->buildPanel(self->mPlacePanel, "panel_place.xml"); + LLUICtrlFactory::getInstance()->buildPanel(self->mPlacePanel, "panel_place.xml"); return self->mPlacePanel; } diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index e9e2584b17..400927632c 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -38,7 +38,7 @@ // project includes #include "llcombobox.h" #include "llurlhistory.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llwindow.h" #include "llviewerwindow.h" @@ -89,9 +89,9 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) LLFloater(), mPanelLandMediaHandle(parent) { - gUICtrlFactory->buildFloater(this, "floater_url_entry.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_url_entry.xml"); - mMediaURLEdit = LLUICtrlFactory::getComboBoxByName(this, "media_entry"); + mMediaURLEdit = getChild<LLComboBox>("media_entry"); // Cancel button childSetAction("cancel_btn", onBtnCancel, this); diff --git a/indra/newview/llfloaterwater.cpp b/indra/newview/llfloaterwater.cpp index 0b02ea2623..f3f25f7847 100644 --- a/indra/newview/llfloaterwater.cpp +++ b/indra/newview/llfloaterwater.cpp @@ -41,12 +41,13 @@ #include "llcolorswatch.h" #include "llcheckboxctrl.h" #include "lltexturectrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" #include "llfloaterdaycycle.h" #include "llboost.h" +#include "llmultisliderctrl.h" #include "v4math.h" #include "llviewerdisplay.h" @@ -66,10 +67,10 @@ std::set<std::string> LLFloaterWater::sDefaultPresets; LLFloaterWater::LLFloaterWater() : LLFloater("water floater") { - gUICtrlFactory->buildFloater(this, "floater_water.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_water.xml"); // add the combo boxes - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WaterPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); if(comboBox != NULL) { @@ -150,7 +151,7 @@ void LLFloaterWater::initCallbacks(void) { childSetCommitCallback("WaterBlurMult", onFloatControlMoved, ¶m_mgr->mBlurMultiplier); // Load/save - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WaterPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WaterPresetsCombo"); //childSetAction("WaterLoadPreset", onLoadPreset, comboBox); childSetAction("WaterNewPreset", onNewPreset, comboBox); @@ -166,7 +167,7 @@ void LLFloaterWater::initCallbacks(void) { comboBox->setCommitCallback(onChangePresetName); LLTextureCtrl* textCtrl = getChild<LLTextureCtrl>("WaterNormalMap"); - textCtrl->setDefaultImageAssetID(LLUUID(gViewerArt.getString("water_normal.tga"))); + textCtrl->setDefaultImageAssetID(DEFAULT_WATER_NORMAL); childSetCommitCallback("WaterNormalMap", onNormalMapPicked, NULL); } @@ -199,8 +200,7 @@ void LLFloaterWater::newPromptCallback(S32 option, const LLString& text, void* u } if(option == 0) { - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWaterMenu, - "WaterPresetsCombo"); + LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>( "WaterPresetsCombo"); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); @@ -311,7 +311,7 @@ void LLFloaterWater::show() water->syncMenu(); // comment in if you want the menu to rebuild each time - //gUICtrlFactory->buildFloater(water, "floater_water.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(water, "floater_water.xml"); //water->initCallbacks(); water->open(); @@ -604,8 +604,7 @@ void LLFloaterWater::onNewPreset(void* userData) void LLFloaterWater::onSavePreset(void* userData) { // get the name - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWaterMenu, - "WaterPresetsCombo"); + LLComboBox* comboBox = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); // don't save the empty name if(comboBox->getSelectedItemLabel() == "") @@ -647,8 +646,7 @@ void LLFloaterWater::saveAlertCallback(S32 option, void* userdata) void LLFloaterWater::onDeletePreset(void* userData) { - LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWaterMenu, - "WaterPresetsCombo"); + LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); if(combo_box->getSelectedValue().asString() == "") { @@ -665,8 +663,7 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { - LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWaterMenu, - "WaterPresetsCombo"); + LLComboBox* combo_box = sWaterMenu->getChild<LLComboBox>("WaterPresetsCombo"); LLFloaterDayCycle* day_cycle = NULL; LLComboBox* key_combo = NULL; LLMultiSliderCtrl* mult_sldr = NULL; @@ -674,10 +671,8 @@ void LLFloaterWater::deleteAlertCallback(S32 option, void* userdata) if(LLFloaterDayCycle::isOpen()) { day_cycle = LLFloaterDayCycle::instance(); - key_combo = LLUICtrlFactory::getComboBoxByName(day_cycle, - "WaterKeyPresets"); - mult_sldr = LLUICtrlFactory::getMultiSliderByName(day_cycle, - "WaterDayCycleKeys"); + key_combo = day_cycle->getChild<LLComboBox>("WaterKeyPresets"); + mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WaterDayCycleKeys"); } LLString name = combo_box->getSelectedValue().asString(); diff --git a/indra/newview/llfloaterwindlight.cpp b/indra/newview/llfloaterwindlight.cpp index 2627ea3705..a83530e53c 100644 --- a/indra/newview/llfloaterwindlight.cpp +++ b/indra/newview/llfloaterwindlight.cpp @@ -41,7 +41,7 @@ #include "llmultisliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" @@ -68,10 +68,10 @@ static const F32 WL_SUN_AMBIENT_SLIDER_SCALE = 3.0f; LLFloaterWindLight::LLFloaterWindLight() : LLFloater("windlight floater") { - gUICtrlFactory->buildFloater(this, "floater_windlight_options.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_windlight_options.xml"); // add the combo boxes - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WLPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); if(comboBox != NULL) { @@ -214,7 +214,7 @@ void LLFloaterWindLight::initCallbacks(void) { // WL Top childSetAction("WLDayCycleMenuButton", onOpenDayCycle, NULL); // Load/save - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(this, "WLPresetsCombo"); + LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); //childSetAction("WLLoadPreset", onLoadPreset, comboBox); childSetAction("WLNewPreset", onNewPreset, comboBox); @@ -259,7 +259,7 @@ void LLFloaterWindLight::newPromptCallback(S32 option, const LLString& text, voi } if(option == 0) { - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWindLight, + LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); LLFloaterDayCycle* sDayCycle = NULL; @@ -267,7 +267,7 @@ void LLFloaterWindLight::newPromptCallback(S32 option, const LLString& text, voi if(LLFloaterDayCycle::isOpen()) { sDayCycle = LLFloaterDayCycle::instance(); - keyCombo = LLUICtrlFactory::getComboBoxByName(sDayCycle, + keyCombo = sDayCycle->getChild<LLComboBox>( "WLKeyPresets"); } @@ -459,7 +459,7 @@ void LLFloaterWindLight::show() windLight->syncMenu(); // comment in if you want the menu to rebuild each time - //gUICtrlFactory->buildFloater(windLight, "floater_windlight_options.xml"); + //LLUICtrlFactory::getInstance()->buildFloater(windLight, "floater_windlight_options.xml"); //windLight->initCallbacks(); windLight->open(); @@ -740,10 +740,8 @@ void LLFloaterWindLight::onSunMoved(LLUICtrl* ctrl, void* userData) { deactivateAnimator(); - LLSliderCtrl* sunSldr = LLUICtrlFactory::getSliderByName(sWindLight, - "WLSunAngle"); - LLSliderCtrl* eastSldr = LLUICtrlFactory::getSliderByName(sWindLight, - "WLEastAngle"); + LLSliderCtrl* sunSldr = sWindLight->getChild<LLSliderCtrl>("WLSunAngle"); + LLSliderCtrl* eastSldr = sWindLight->getChild<LLSliderCtrl>("WLEastAngle"); WLColorControl * colorControl = static_cast<WLColorControl *>(userData); @@ -794,7 +792,7 @@ void LLFloaterWindLight::onNewPreset(void* userData) void LLFloaterWindLight::onSavePreset(void* userData) { // get the name - LLComboBox* comboBox = LLUICtrlFactory::getComboBoxByName(sWindLight, + LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); // don't save the empty name @@ -835,7 +833,7 @@ void LLFloaterWindLight::saveAlertCallback(S32 option, void* userdata) void LLFloaterWindLight::onDeletePreset(void* userData) { - LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWindLight, + LLComboBox* combo_box = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); if(combo_box->getSelectedValue().asString() == "") @@ -853,7 +851,7 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata) // if they choose delete, do it. Otherwise, don't do anything if(option == 0) { - LLComboBox* combo_box = LLUICtrlFactory::getComboBoxByName(sWindLight, + LLComboBox* combo_box = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); LLFloaterDayCycle* day_cycle = NULL; LLComboBox* key_combo = NULL; @@ -862,10 +860,9 @@ void LLFloaterWindLight::deleteAlertCallback(S32 option, void* userdata) if(LLFloaterDayCycle::isOpen()) { day_cycle = LLFloaterDayCycle::instance(); - key_combo = LLUICtrlFactory::getComboBoxByName(day_cycle, + key_combo = day_cycle->getChild<LLComboBox>( "WLKeyPresets"); - mult_sldr = LLUICtrlFactory::getMultiSliderByName(day_cycle, - "WLDayCycleKeys"); + mult_sldr = day_cycle->getChild<LLMultiSliderCtrl>("WLDayCycleKeys"); } LLString name(combo_box->getSelectedValue().asString()); @@ -956,7 +953,7 @@ void LLFloaterWindLight::onCloudScrollXToggled(LLUICtrl* ctrl, void* userData) bool lock = cbCtrl->get(); LLWLParamManager::instance()->mCurParams.setEnableCloudScrollX(!lock); - LLSliderCtrl* sldr = LLUICtrlFactory::getSliderByName(sWindLight, + LLSliderCtrl* sldr = sWindLight->getChild<LLSliderCtrl>( "WLCloudScrollX"); if(cbCtrl->get()) @@ -978,7 +975,7 @@ void LLFloaterWindLight::onCloudScrollYToggled(LLUICtrl* ctrl, void* userData) bool lock = cbCtrl->get(); LLWLParamManager::instance()->mCurParams.setEnableCloudScrollY(!lock); - LLSliderCtrl* sldr = LLUICtrlFactory::getSliderByName(sWindLight, + LLSliderCtrl* sldr = sWindLight->getChild<LLSliderCtrl>( "WLCloudScrollY"); if(cbCtrl->get()) diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 8a40cdd062..3a4a3f3e1b 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -64,7 +64,7 @@ #include "llviewerstats.h" #include "llworldmap.h" #include "llworldmapview.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llappviewer.h" #include "llmapimagetype.h" #include "llweb.h" @@ -165,7 +165,7 @@ LLFloaterWorldMap::LLFloaterWorldMap() LLCallbackMap::map_t factory_map; factory_map["objects_mapview"] = LLCallbackMap(createWorldMapView, NULL); factory_map["terrain_mapview"] = LLCallbackMap(createWorldMapView, NULL); - gUICtrlFactory->buildFloater(this, "floater_world_map.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_world_map.xml", &factory_map); } // static @@ -176,29 +176,34 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { - mTabs = LLUICtrlFactory::getTabContainerByName(this, "maptab"); + mTabs = getChild<LLTabContainer>("maptab"); if (!mTabs) return FALSE; LLPanel *panel; - panel = LLUICtrlFactory::getPanelByName(mTabs, "objects_mapview"); + panel = mTabs->getChild<LLPanel>("objects_mapview"); if (panel) { mTabs->setTabChangeCallback(panel, onCommitBackground); mTabs->setTabUserData(panel, this); } - panel = LLUICtrlFactory::getPanelByName(mTabs, "terrain_mapview"); + panel = mTabs->getChild<LLPanel>("terrain_mapview"); if (panel) { mTabs->setTabChangeCallback(panel, onCommitBackground); mTabs->setTabUserData(panel, this); } - onCommitBackground((void*)this, false); + // The following callback syncs the worlmap tabs with the images. + // Commented out since it was crashing when LLWorldMap became a singleton. + // We should be fine without it but override the onOpen method and put it + // there if it turns out to be needed. -MG + // + //onCommitBackground((void*)this, false); //childSetCommitCallback("friend combo", onAvatarComboCommit, this); - //LLComboBox *avatar_combo = LLUICtrlFactory::getComboBoxByName(this, "friend combo"); + //LLComboBox *avatar_combo = getChild<LLComboBox>( "friend combo"); //if (avatar_combo) //{ // avatar_combo->selectFirstItem(); @@ -210,7 +215,7 @@ BOOL LLFloaterWorldMap::postBuild() childSetFocusChangedCallback("location", onLocationFocusChanged, this); - LLLineEditor *location_editor = LLUICtrlFactory::getLineEditorByName(this, "location"); + LLLineEditor *location_editor = getChild<LLLineEditor>("location"); if (location_editor) { location_editor->setKeystrokeCallback( onSearchTextEntry ); @@ -224,7 +229,7 @@ BOOL LLFloaterWorldMap::postBuild() childSetCommitCallback("landmark combo", onLandmarkComboCommit, this); - LLComboBox *landmark_combo = LLUICtrlFactory::getComboBoxByName(this, "landmark combo"); + LLComboBox *landmark_combo = getChild<LLComboBox>( "landmark combo"); if (landmark_combo) { landmark_combo->selectFirstItem(); @@ -294,14 +299,14 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) map_panel->updateVisibleBlocks(); // Reload the agent positions when we show the window - gWorldMap->eraseItems(); + LLWorldMap::getInstance()->eraseItems(); // Reload any maps that may have changed - gWorldMap->clearSimFlags(); + LLWorldMap::getInstance()->clearSimFlags(); const S32 panel_num = gFloaterWorldMap->mTabs->getCurrentPanelIndex(); const bool request_from_sim = true; - gWorldMap->setCurrentLayer(panel_num, request_from_sim); + LLWorldMap::getInstance()->setCurrentLayer(panel_num, request_from_sim); // We may already have a bounding box for the regions of the world, // so use that to adjust the view. @@ -335,9 +340,9 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target) // static void LLFloaterWorldMap::reloadIcons(void*) { - gWorldMap->eraseItems(); + LLWorldMap::getInstance()->eraseItems(); - gWorldMap->sendMapLayerRequest(); + LLWorldMap::getInstance()->sendMapLayerRequest(); } @@ -376,10 +381,7 @@ void LLFloaterWorldMap::setVisible( BOOL visible ) if( !visible ) { // While we're not visible, discard the overlay images we're using - if (gWorldMap) - { - gWorldMap->clearImageRefs(); - } + LLWorldMap::getInstance()->clearImageRefs(); } } @@ -394,7 +396,7 @@ BOOL LLFloaterWorldMap::handleHover(S32 x, S32 y, MASK mask) BOOL LLFloaterWorldMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { - if (getVisible() && !isMinimized() && isFrontmost()) + if (!isMinimized() && isFrontmost()) { F32 slider_value = (F32)childGetValue("zoom slider").asReal(); slider_value += ((F32)clicks * -0.3333f); @@ -421,11 +423,6 @@ void LLFloaterWorldMap::reshape( S32 width, S32 height, BOOL called_from_parent // virtual void LLFloaterWorldMap::draw() { - if( !getVisible() ) - { - return; - } - // Hide/Show Mature Events controls childSetVisible("events_mature_icon", !gAgent.isTeen()); childSetVisible("events_mature_label", !gAgent.isTeen()); @@ -488,7 +485,7 @@ void LLFloaterWorldMap::draw() childSetEnabled("Teleport", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status); - childSetEnabled("Show Destination", (BOOL)tracking_status || gWorldMap->mIsTrackingUnknownLocation); + childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation); childSetEnabled("copy_slurl", (mSLURL.size() > 0) ); setMouseOpaque(TRUE); @@ -558,7 +555,7 @@ void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) { LLUUID asset_id = mLandmarkAssetIDList.get( idx ); LLString name; - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "landmark combo"); + LLComboBox* combo = getChild<LLComboBox>( "landmark combo"); if (combo) name = combo->getSimple(); mTrackedStatus = LLTracker::TRACKING_LANDMARK; LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID @@ -598,32 +595,32 @@ void LLFloaterWorldMap::trackGenericItem(const LLItemInfo &item) void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) { - LLSimInfo* sim_info = gWorldMap->simInfoFromPosGlobal(pos_global); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if (!sim_info) { - gWorldMap->mIsTrackingUnknownLocation = TRUE; - gWorldMap->mInvalidLocation = FALSE; - gWorldMap->mUnknownLocation = pos_global; + LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE; + LLWorldMap::getInstance()->mInvalidLocation = FALSE; + LLWorldMap::getInstance()->mUnknownLocation = pos_global; LLTracker::stopTracking(NULL); S32 world_x = S32(pos_global.mdV[0] / 256); S32 world_y = S32(pos_global.mdV[1] / 256); - gWorldMap->sendMapBlockRequest(world_x, world_y, world_x, world_y, true); + LLWorldMap::getInstance()->sendMapBlockRequest(world_x, world_y, world_x, world_y, true); setDefaultBtn(""); return; } if (sim_info->mAccess == SIM_ACCESS_DOWN) { // Down sim. Show the blue circle of death! - gWorldMap->mIsTrackingUnknownLocation = TRUE; - gWorldMap->mUnknownLocation = pos_global; - gWorldMap->mInvalidLocation = TRUE; + LLWorldMap::getInstance()->mIsTrackingUnknownLocation = TRUE; + LLWorldMap::getInstance()->mUnknownLocation = pos_global; + LLWorldMap::getInstance()->mInvalidLocation = TRUE; LLTracker::stopTracking(NULL); setDefaultBtn(""); return; } LLString sim_name; - gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); + LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); LLString full_name = llformat("%s (%d, %d, %d)", @@ -635,9 +632,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) LLString tooltip(""); mTrackedStatus = LLTracker::TRACKING_LOCATION; LLTracker::trackLocation(pos_global, full_name, tooltip); - gWorldMap->mIsTrackingUnknownLocation = FALSE; - gWorldMap->mIsTrackingDoubleClick = FALSE; - gWorldMap->mIsTrackingCommit = FALSE; + LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; + LLWorldMap::getInstance()->mIsTrackingDoubleClick = FALSE; + LLWorldMap::getInstance()->mIsTrackingCommit = FALSE; setDefaultBtn("Teleport"); } @@ -660,7 +657,7 @@ void LLFloaterWorldMap::updateLocation() { // Make sure we know where we are before setting the current user position LLString agent_sim_name; - gotSimName = gWorldMap->simNameFromPosGlobal( agentPos, agent_sim_name ); + gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( agentPos, agent_sim_name ); if ( gotSimName ) { mSetToUserPosition = FALSE; @@ -687,7 +684,7 @@ void LLFloaterWorldMap::updateLocation() return; // invalid location } LLString sim_name; - gotSimName = gWorldMap->simNameFromPosGlobal( pos_global, sim_name ); + gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal( pos_global, sim_name ); if ((status != LLTracker::TRACKING_NOTHING) && (status != mTrackedStatus || pos_global != mTrackedLocation || sim_name != mTrackedSimName)) { @@ -728,7 +725,7 @@ void LLFloaterWorldMap::updateLocation() void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y_coord, S32 z_coord) { - LLSimInfo* sim_info = gWorldMap->simInfoFromName(region_name); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); z_coord = llclamp(z_coord, 0, 1000); if (sim_info) { @@ -750,9 +747,9 @@ void LLFloaterWorldMap::trackURL(const LLString& region_name, S32 x_coord, S32 y // pass sim name to combo box gFloaterWorldMap->mCompletingRegionName = region_name; - gWorldMap->sendNamedRegionRequest(region_name); + LLWorldMap::getInstance()->sendNamedRegionRequest(region_name); LLString::toLower(gFloaterWorldMap->mCompletingRegionName); - gWorldMap->mIsTrackingCommit = TRUE; + LLWorldMap::getInstance()->mIsTrackingCommit = TRUE; } } @@ -934,7 +931,7 @@ void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) { childSetValue("spin z", 0); } - gWorldMap->mIsTrackingCommit = FALSE; + LLWorldMap::getInstance()->mIsTrackingCommit = FALSE; mCompletingRegionName = ""; mExactMatch = FALSE; } @@ -972,8 +969,8 @@ void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) void LLFloaterWorldMap::adjustZoomSliderBounds() { // World size in regions - S32 world_width_regions = gWorldMap->getWorldWidth() / REGION_WIDTH_UNITS; - S32 world_height_regions = gWorldMap->getWorldHeight() / REGION_WIDTH_UNITS; + S32 world_width_regions = LLWorldMap::getInstance()->getWorldWidth() / REGION_WIDTH_UNITS; + S32 world_height_regions = LLWorldMap::getInstance()->getWorldHeight() / REGION_WIDTH_UNITS; // Pad the world size a little bit, so we have a nice border on // the edge @@ -1130,7 +1127,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata ) // Reset to user postion if nothing is tracked self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } -// + //// static //void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata ) //{ @@ -1175,7 +1172,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata ) // if (new_avatar_id.notNull()) // { // LLString name; -// LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(gFloaterWorldMap, "friend combo"); +// LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); // if (combo) name = combo->getSimple(); // self->trackAvatar(new_avatar_id, name); // onShowTargetBtn(self); @@ -1232,16 +1229,16 @@ void LLFloaterWorldMap::onLocationCommit( void* userdata ) LLString::toLower(str); gFloaterWorldMap->mCompletingRegionName = str; - gWorldMap->mIsTrackingCommit = TRUE; + LLWorldMap::getInstance()->mIsTrackingCommit = TRUE; self->mExactMatch = FALSE; if (str.length() >= 3) { - gWorldMap->sendNamedRegionRequest(str); + LLWorldMap::getInstance()->sendNamedRegionRequest(str); } else { str += "#"; - gWorldMap->sendNamedRegionRequest(str); + LLWorldMap::getInstance()->sendNamedRegionRequest(str); } } @@ -1252,7 +1249,7 @@ void LLFloaterWorldMap::onClearBtn(void* data) LLFloaterWorldMap* self = (LLFloaterWorldMap*)data; self->mTrackedStatus = LLTracker::TRACKING_NOTHING; LLTracker::stopTracking((void *)(intptr_t)TRUE); - gWorldMap->mIsTrackingUnknownLocation = FALSE; + LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; self->mSLURL = ""; // Clear the SLURL since it's invalid self->mSetToUserPosition = TRUE; // Revert back to the current user position } @@ -1326,9 +1323,9 @@ void LLFloaterWorldMap::centerOnTarget(BOOL animate) pos_global = LLTracker::getTrackedPositionGlobal() - gAgent.getCameraPositionGlobal(); } } - else if(gWorldMap->mIsTrackingUnknownLocation) + else if(LLWorldMap::getInstance()->mIsTrackingUnknownLocation) { - pos_global = gWorldMap->mUnknownLocation - gAgent.getCameraPositionGlobal();; + pos_global = LLWorldMap::getInstance()->mUnknownLocation - gAgent.getCameraPositionGlobal();; } else { @@ -1521,10 +1518,7 @@ void LLFloaterWorldMap::onCommitBackground(void* userdata, bool from_click) // Find my index S32 index = self->mTabs->getCurrentPanelIndex(); - if (gWorldMap) - { - gWorldMap->setCurrentLayer(index); - } + LLWorldMap::getInstance()->setCurrentLayer(index); } void LLFloaterWorldMap::updateSims(bool found_null_sim) @@ -1534,8 +1528,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) return; } - LLScrollListCtrl *list = gUICtrlFactory->getScrollListByName(this, "search_results"); - if (!list) return; + LLScrollListCtrl *list = getChild<LLScrollListCtrl>("search_results"); list->operateOnAll(LLCtrlListInterface::OP_DELETE); LLSD selected_value = list->getSelectedValue(); @@ -1545,7 +1538,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) BOOL match_found = FALSE; S32 num_results = 0; std::map<U64, LLSimInfo*>::const_iterator it; - for (it = gWorldMap->mSimInfoMap.begin(); it != gWorldMap->mSimInfoMap.end(); ++it) + for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) { LLSimInfo* info = (*it).second; LLString sim_name = info->mName; @@ -1554,7 +1547,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) if (sim_name_lower.substr(0, name_length) == mCompletingRegionName) { - if (gWorldMap->mIsTrackingCommit) + if (LLWorldMap::getInstance()->mIsTrackingCommit) { if (sim_name_lower == mCompletingRegionName) { @@ -1633,7 +1626,7 @@ void LLFloaterWorldMap::onCommitSearchResult(LLUICtrl*, void* userdata) LLString::toLower(sim_name); std::map<U64, LLSimInfo*>::const_iterator it; - for (it = gWorldMap->mSimInfoMap.begin(); it != gWorldMap->mSimInfoMap.end(); ++it) + for (it = LLWorldMap::getInstance()->mSimInfoMap.begin(); it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) { LLSimInfo* info = (*it).second; LLString info_sim_name = info->mName; diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 9ec7676195..1739cd5fef 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -58,7 +58,7 @@ #include "llviewerimagelist.h" #include "llviewerjointattachment.h" #include "llviewermenu.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llvoavatar.h" #include "llfloaterproperties.h" @@ -114,10 +114,11 @@ LLColor4 LLFolderViewItem::sHighlightBgColor; LLColor4 LLFolderViewItem::sHighlightFgColor; LLColor4 LLFolderViewItem::sFilterBGColor; LLColor4 LLFolderViewItem::sFilterTextColor; -LLColor4 LLFolderViewItem::sLoadingMessageTextColor; +LLColor4 LLFolderViewItem::sSuffixColor; +LLColor4 LLFolderViewItem::sSearchStatusColor; // Default constructor -LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon, +LLFolderViewItem::LLFolderViewItem( const LLString& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ) : @@ -145,12 +146,12 @@ LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon, setIcon(icon); if( !LLFolderViewItem::sFont ) { - LLFolderViewItem::sFont = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + LLFolderViewItem::sFont = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); } if (!LLFolderViewItem::sSmallFont) { - LLFolderViewItem::sSmallFont = gResMgr->getRes( LLFONT_SMALL ); + LLFolderViewItem::sSmallFont = LLResMgr::getInstance()->getRes( LLFONT_SMALL ); } // HACK: Can't be set above because gSavedSettings might not be constructed. @@ -159,10 +160,12 @@ LLFolderViewItem::LLFolderViewItem( const LLString& name, LLViewerImage* icon, LLFolderViewItem::sHighlightFgColor = gColors.getColor( "MenuItemHighlightFgColor" ); LLFolderViewItem::sFilterBGColor = gColors.getColor( "FilterBackgroundColor" ); LLFolderViewItem::sFilterTextColor = gColors.getColor( "FilterTextColor" ); - LLFolderViewItem::sLoadingMessageTextColor = gColors.getColor( "FolderViewLoadingMessageTextColor" ); + LLFolderViewItem::sSuffixColor = gColors.getColor( "InventoryItemSuffixColor" ); + LLFolderViewItem::sSearchStatusColor = gColors.getColor( "InventorySearchStatusColor" ); - mArrowImage = gImageList.getImage(LLUUID(gViewerArt.getString("folder_arrow.tga")), MIPMAP_FALSE, TRUE); - mBoxImage = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square.tga")), MIPMAP_FALSE, TRUE); + + mArrowImage = LLUI::getUIImage("folder_arrow.tga"); + mBoxImage = LLUI::getUIImage("rounded_square.tga"); refresh(); setTabStop(FALSE); @@ -267,13 +270,9 @@ void LLFolderViewItem::setFiltered(BOOL filtered, S32 filter_generation) mLastFilterGeneration = filter_generation; } -void LLFolderViewItem::setIcon(LLViewerImage* icon) +void LLFolderViewItem::setIcon(LLUIImagePtr icon) { mIcon = icon; - if (mIcon) - { - mIcon->setBoostLevel(LLViewerImage::BOOST_UI); - } } // refresh information from the listener @@ -369,16 +368,6 @@ void LLFolderViewItem::extendSelectionFromRoot(LLFolderViewItem* selection) getRoot()->extendSelection(selection, NULL, selected_items); } -EWidgetType LLFolderViewItem::getWidgetType() const -{ - return WIDGET_TYPE_FOLDER_ITEM; -} - -LLString LLFolderViewItem::getWidgetTag() const -{ - return LL_FOLDER_VIEW_ITEM_TAG; -} - EInventorySortGroup LLFolderViewItem::getSortGroup() { return SG_ITEM; @@ -649,7 +638,7 @@ BOOL LLFolderViewItem::handleMouseDown( S32 x, S32 y, MASK mask ) S32 screen_x; S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y ); - gToolDragAndDrop->setDragStart( screen_x, screen_y ); + LLToolDragAndDrop::getInstance()->setDragStart( screen_x, screen_y ); } return TRUE; } @@ -662,7 +651,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y ); BOOL can_drag = TRUE; - if( gToolDragAndDrop->isOverThreshold( screen_x, screen_y ) ) + if( LLToolDragAndDrop::getInstance()->isOverThreshold( screen_x, screen_y ) ) { LLFolderView* root = getRoot(); @@ -694,7 +683,7 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask ) // item. gViewerWindow->setKeyboardFocus(NULL); - return gToolDragAndDrop->handleHover( x, y, mask ); + return LLToolDragAndDrop::getInstance()->handleHover( x, y, mask ); } } } @@ -813,7 +802,7 @@ void LLFolderViewItem::draw() if (mArrowImage) { gl_draw_scaled_rotated_image(mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD, - ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, mArrowImage, sFgColor); + ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, mArrowImage->getImage(), sFgColor); } } @@ -905,8 +894,7 @@ void LLFolderViewItem::draw() if(mIcon) { - gl_draw_image(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight(), mIcon); - mIcon->addTextureStats( (F32)(mIcon->getWidth() * mIcon->getHeight())); + mIcon->draw(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight()); } if (!mLabel.empty()) @@ -934,7 +922,7 @@ void LLFolderViewItem::draw() if ( mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime") ) { - sFont->renderUTF8( "Loading... ", 0, text_left, y, sLoadingMessageTextColor, + sFont->renderUTF8( "Loading... ", 0, text_left, y, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, &right_x, FALSE); text_left = right_x; } @@ -944,7 +932,7 @@ void LLFolderViewItem::draw() S32_MAX, S32_MAX, &right_x, FALSE ); if (!mLabelSuffix.empty()) { - sFont->renderUTF8( mLabelSuffix, 0, right_x, y, LLColor4(0.75f, 0.85f, 0.85f, 1.f), + sFont->renderUTF8( mLabelSuffix, 0, right_x, y, sSuffixColor, LLFontGL::LEFT, LLFontGL::BOTTOM, mLabelStyle, S32_MAX, S32_MAX, &right_x, FALSE ); } @@ -961,9 +949,8 @@ void LLFolderViewItem::draw() S32 bottom = llfloor(getRect().getHeight() - sFont->getLineHeight() - 3); S32 top = getRect().getHeight(); - LLViewerImage::bindTexture(mBoxImage); - gGL.color4fv(sFilterBGColor.mV); - gl_segmented_rect_2d_tex(left, top, right, bottom, mBoxImage->getWidth(), mBoxImage->getHeight(), 16); + LLRect box_rect(left, top, right, bottom); + mBoxImage->draw(box_rect, sFilterBGColor); F32 match_string_left = text_left + sFont->getWidthF32(combined_string, 0, mStringMatchOffset); F32 y = (F32)getRect().getHeight() - sFont->getLineHeight() - (F32)TEXT_PAD; sFont->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y, @@ -985,7 +972,7 @@ void LLFolderViewItem::draw() ///---------------------------------------------------------------------------- // Default constructor -LLFolderViewFolder::LLFolderViewFolder( const LLString& name, LLViewerImage* icon, +LLFolderViewFolder::LLFolderViewFolder( const LLString& name, LLUIImagePtr icon, LLFolderView* root, LLFolderViewEventListener* listener ): LLFolderViewItem( name, icon, 0, root, listener ), // 0 = no create time @@ -1019,16 +1006,6 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) //mFolders.removeAllNodes(); } -EWidgetType LLFolderViewFolder::getWidgetType() const -{ - return WIDGET_TYPE_FOLDER; -} - -LLString LLFolderViewFolder::getWidgetTag() const -{ - return LL_FOLDER_VIEW_FOLDER_TAG; -} - // addToFolder() returns TRUE if it succeeds. FALSE otherwise BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) { @@ -2098,20 +2075,17 @@ BOOL LLFolderViewFolder::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL LLFolderViewFolder::handleRightMouseDown( S32 x, S32 y, MASK mask ) { BOOL handled = FALSE; - if( getVisible() ) + // fetch contents of this folder, as context menu can depend on contents + // still, user would have to open context menu again to see the changes + gInventory.fetchDescendentsOf(mListener->getUUID()); + + if( mIsOpen ) { - // fetch contents of this folder, as context menu can depend on contents - // still, user would have to open context menu again to see the changes - gInventory.fetchDescendentsOf(mListener->getUUID()); - - if( mIsOpen ) - { - handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; - } - if (!handled) - { - handled = LLFolderViewItem::handleRightMouseDown( x, y, mask ); - } + handled = childrenHandleRightMouseDown( x, y, mask ) != NULL; + } + if (!handled) + { + handled = LLFolderViewItem::handleRightMouseDown( x, y, mask ); } return handled; } @@ -2162,16 +2136,12 @@ BOOL LLFolderViewFolder::handleMouseDown( S32 x, S32 y, MASK mask ) BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) { - if (!getVisible()) - { - return FALSE; - } - BOOL rv = false; + BOOL handled = FALSE; if( mIsOpen ) { - rv = childrenHandleDoubleClick( x, y, mask ) != NULL; + handled = childrenHandleDoubleClick( x, y, mask ) != NULL; } - if( !rv ) + if( !handled ) { if(x < LEFT_INDENTATION + mIndentation && x > mIndentation - LEFT_PAD) { @@ -2184,9 +2154,9 @@ BOOL LLFolderViewFolder::handleDoubleClick( S32 x, S32 y, MASK mask ) setSelectionFromRoot(this, FALSE); toggleOpen(); } - return TRUE; + handled = TRUE; } - return rv; + return handled; } void LLFolderViewFolder::draw() @@ -2529,7 +2499,7 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- // Default constructor -LLFolderView::LLFolderView( const LLString& name, LLViewerImage* root_folder_icon, +LLFolderView::LLFolderView( const LLString& name, LLUIImagePtr root_folder_icon, const LLRect& rect, const LLUUID& source_id, LLView *parent_view ) : #if LL_WINDOWS #pragma warning( push ) @@ -2584,18 +2554,15 @@ LLFolderView::LLFolderView( const LLString& name, LLViewerImage* root_folder_ico NULL, NULL, this, - &LLLineEditor::prevalidatePrintableNotPipe, - LLViewBorder::BEVEL_NONE, - LLViewBorder::STYLE_LINE, - 2); - mRenamer->setWriteableBgColor(LLColor4::white); + &LLLineEditor::prevalidatePrintableNotPipe); + //mRenamer->setWriteableBgColor(LLColor4::white); // Escape is handled by reverting the rename, not commiting it (default behavior) mRenamer->setCommitOnFocusLost(TRUE); mRenamer->setVisible(FALSE); addChild(mRenamer); // make the popup menu available - LLMenuGL* menu = gUICtrlFactory->buildMenu("menu_inventory.xml", parent_view); + LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_inventory.xml", parent_view); if (!menu) { menu = new LLMenuGL(""); @@ -2643,16 +2610,6 @@ LLFolderView::~LLFolderView( void ) mItemMap.clear(); } -EWidgetType LLFolderView::getWidgetType() const -{ - return WIDGET_TYPE_FOLDER_VIEW; -} - -LLString LLFolderView::getWidgetTag() const -{ - return LL_FOLDER_VIEW_TAG; -} - BOOL LLFolderView::canFocusChildren() const { return FALSE; @@ -3156,7 +3113,7 @@ BOOL LLFolderView::startDrag(LLToolDragAndDrop::ESource source) cargo_ids.push_back(id); } - gToolDragAndDrop->beginMultiDrag(types, cargo_ids, source, mSourceID); + LLToolDragAndDrop::getInstance()->beginMultiDrag(types, cargo_ids, source, mSourceID); } return can_drag; } @@ -3187,15 +3144,11 @@ void LLFolderView::draw() { closeAutoOpenedFolders(); } - if(gViewerWindow->hasKeyboardFocus(this) && !getVisible()) - { - gViewerWindow->setKeyboardFocus( NULL ); - } // while dragging, update selection rendering to reflect single/multi drag status - if (gToolDragAndDrop->hasMouseCapture()) + if (LLToolDragAndDrop::getInstance()->hasMouseCapture()) { - EAcceptance last_accept = gToolDragAndDrop->getLastAccept(); + EAcceptance last_accept = LLToolDragAndDrop::getInstance()->getLastAccept(); if (last_accept == ACCEPT_YES_SINGLE || last_accept == ACCEPT_YES_COPY_SINGLE) { setShowSingleSelection(TRUE); @@ -3225,12 +3178,12 @@ void LLFolderView::draw() if (gInventory.backgroundFetchActive() || mCompletedFilterGeneration < mFilter.getMinRequiredGeneration()) { mStatusText = "Searching..."; // *TODO:translate - sFont->renderUTF8(mStatusText, 0, 2, 1, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); + sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); } else { mStatusText = "No matching items found in inventory."; // *TODO:translate - sFont->renderUTF8(mStatusText, 0, 2, 1, LLColor4::white, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); + sFont->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, S32_MAX, S32_MAX, NULL, FALSE ); } } @@ -3698,7 +3651,7 @@ void LLFolderView::setFocus(BOOL focus) LLFolderViewFolder::setFocus(focus); } -BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; @@ -3716,202 +3669,199 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) item = *(getChildList()->begin()); } - if( getVisible() && getEnabled() && !called_from_parent ) + switch( key ) { - switch( key ) - { - case KEY_F2: - mSearchString.clear(); - startRenamingSelectedItem(); - handled = TRUE; - break; - - case KEY_RETURN: - if (mask == MASK_NONE) - { - if( mRenameItem && mRenamer->getVisible() ) - { - finishRenamingItem(); - mSearchString.clear(); - handled = TRUE; - } - else - { - LLFolderView::openSelectedItems(); - handled = TRUE; - } - } - break; + case KEY_F2: + mSearchString.clear(); + startRenamingSelectedItem(); + handled = TRUE; + break; - case KEY_ESCAPE: - // mark flag don't commit + case KEY_RETURN: + if (mask == MASK_NONE) + { if( mRenameItem && mRenamer->getVisible() ) { - revertRenamingItem(); + finishRenamingItem(); + mSearchString.clear(); handled = TRUE; } else { - if( gViewerWindow->childHasKeyboardFocus( this ) ) - { - gViewerWindow->setKeyboardFocus( NULL ); - } + LLFolderView::openSelectedItems(); + handled = TRUE; } - mSearchString.clear(); - break; + } + break; - case KEY_PAGE_UP: - mSearchString.clear(); - mScrollContainer->pageUp(30); + case KEY_ESCAPE: + // mark flag don't commit + if( mRenameItem && mRenamer->getVisible() ) + { + revertRenamingItem(); handled = TRUE; - break; + } + else + { + if( gViewerWindow->childHasKeyboardFocus( this ) ) + { + gViewerWindow->setKeyboardFocus( NULL ); + } + } + mSearchString.clear(); + break; - case KEY_PAGE_DOWN: - mSearchString.clear(); - mScrollContainer->pageDown(30); - handled = TRUE; - break; + case KEY_PAGE_UP: + mSearchString.clear(); + mScrollContainer->pageUp(30); + handled = TRUE; + break; - case KEY_HOME: - mSearchString.clear(); - mScrollContainer->goToTop(); - handled = TRUE; - break; + case KEY_PAGE_DOWN: + mSearchString.clear(); + mScrollContainer->pageDown(30); + handled = TRUE; + break; - case KEY_END: - mSearchString.clear(); - mScrollContainer->goToBottom(); - break; + case KEY_HOME: + mSearchString.clear(); + mScrollContainer->goToTop(); + handled = TRUE; + break; - case KEY_DOWN: - if((mSelectedItems.size() > 0) && mScrollContainer) - { - LLFolderViewItem* last_selected = getCurSelectedItem(); + case KEY_END: + mSearchString.clear(); + mScrollContainer->goToBottom(); + break; - if (!mKeyboardSelection) - { - setSelection(last_selected, FALSE, TRUE); - mKeyboardSelection = TRUE; - } + case KEY_DOWN: + if((mSelectedItems.size() > 0) && mScrollContainer) + { + LLFolderViewItem* last_selected = getCurSelectedItem(); - LLFolderViewItem* next = NULL; - if (mask & MASK_SHIFT) + if (!mKeyboardSelection) + { + setSelection(last_selected, FALSE, TRUE); + mKeyboardSelection = TRUE; + } + + LLFolderViewItem* next = NULL; + if (mask & MASK_SHIFT) + { + // don't shift select down to children of folders (they are implicitly selected through parent) + next = last_selected->getNextOpenNode(FALSE); + if (next) { - // don't shift select down to children of folders (they are implicitly selected through parent) - next = last_selected->getNextOpenNode(FALSE); - if (next) + if (next->isSelected()) { - if (next->isSelected()) - { - // shrink selection - changeSelectionFromRoot(last_selected, FALSE); - } - else if (last_selected->getParentFolder() == next->getParentFolder()) - { - // grow selection - changeSelectionFromRoot(next, TRUE); - } + // shrink selection + changeSelectionFromRoot(last_selected, FALSE); + } + else if (last_selected->getParentFolder() == next->getParentFolder()) + { + // grow selection + changeSelectionFromRoot(next, TRUE); } } - else + } + else + { + next = last_selected->getNextOpenNode(); + if( next ) { - next = last_selected->getNextOpenNode(); - if( next ) + if (next == last_selected) { - if (next == last_selected) - { - return FALSE; - } - setSelection( next, FALSE, TRUE ); + return FALSE; } + setSelection( next, FALSE, TRUE ); } - scrollToShowSelection(); - mSearchString.clear(); - handled = TRUE; } - break; + scrollToShowSelection(); + mSearchString.clear(); + handled = TRUE; + } + break; - case KEY_UP: - if((mSelectedItems.size() > 0) && mScrollContainer) - { - LLFolderViewItem* last_selected = mSelectedItems.back(); + case KEY_UP: + if((mSelectedItems.size() > 0) && mScrollContainer) + { + LLFolderViewItem* last_selected = mSelectedItems.back(); - if (!mKeyboardSelection) - { - setSelection(last_selected, FALSE, TRUE); - mKeyboardSelection = TRUE; - } + if (!mKeyboardSelection) + { + setSelection(last_selected, FALSE, TRUE); + mKeyboardSelection = TRUE; + } - LLFolderViewItem* prev = NULL; - if (mask & MASK_SHIFT) + LLFolderViewItem* prev = NULL; + if (mask & MASK_SHIFT) + { + // don't shift select down to children of folders (they are implicitly selected through parent) + prev = last_selected->getPreviousOpenNode(FALSE); + if (prev) { - // don't shift select down to children of folders (they are implicitly selected through parent) - prev = last_selected->getPreviousOpenNode(FALSE); - if (prev) + if (prev->isSelected()) { - if (prev->isSelected()) - { - // shrink selection - changeSelectionFromRoot(last_selected, FALSE); - } - else if (last_selected->getParentFolder() == prev->getParentFolder()) - { - // grow selection - changeSelectionFromRoot(prev, TRUE); - } + // shrink selection + changeSelectionFromRoot(last_selected, FALSE); + } + else if (last_selected->getParentFolder() == prev->getParentFolder()) + { + // grow selection + changeSelectionFromRoot(prev, TRUE); } } - else + } + else + { + prev = last_selected->getPreviousOpenNode(); + if( prev ) { - prev = last_selected->getPreviousOpenNode(); - if( prev ) + if (prev == this) { - if (prev == this) - { - return FALSE; - } - setSelection( prev, FALSE, TRUE ); + return FALSE; } + setSelection( prev, FALSE, TRUE ); } - scrollToShowSelection(); - mSearchString.clear(); - - handled = TRUE; } - break; + scrollToShowSelection(); + mSearchString.clear(); + + handled = TRUE; + } + break; + + case KEY_RIGHT: + if(mSelectedItems.size()) + { + LLFolderViewItem* last_selected = getCurSelectedItem(); + last_selected->setOpen( TRUE ); + mSearchString.clear(); + handled = TRUE; + } + break; - case KEY_RIGHT: - if(mSelectedItems.size()) + case KEY_LEFT: + if(mSelectedItems.size()) + { + LLFolderViewItem* last_selected = getCurSelectedItem(); + LLFolderViewItem* parent_folder = last_selected->getParentFolder(); + if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - LLFolderViewItem* last_selected = getCurSelectedItem(); - last_selected->setOpen( TRUE ); - mSearchString.clear(); - handled = TRUE; + setSelection(parent_folder, FALSE, TRUE); } - break; - - case KEY_LEFT: - if(mSelectedItems.size()) + else { - LLFolderViewItem* last_selected = getCurSelectedItem(); - LLFolderViewItem* parent_folder = last_selected->getParentFolder(); - if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) - { - setSelection(parent_folder, FALSE, TRUE); - } - else - { - last_selected->setOpen( FALSE ); - } - mSearchString.clear(); - scrollToShowSelection(); - handled = TRUE; + last_selected->setOpen( FALSE ); } - break; + mSearchString.clear(); + scrollToShowSelection(); + handled = TRUE; } + break; } - if (!handled && gFocusMgr.childHasKeyboardFocus(getRoot())) + if (!handled && hasFocus()) { if (key == KEY_BACKSPACE) { @@ -3929,7 +3879,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) } -BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char) { if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL { @@ -4082,11 +4032,7 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const LLString &search_s BOOL LLFolderView::handleDoubleClick( S32 x, S32 y, MASK mask ) { - if (!getVisible()) - { - return FALSE; - } - + // skip LLFolderViewFolder::handleDoubleClick() return LLView::handleDoubleClick( x, y, mask ); } diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index d451e75fa6..28c2268952 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -81,7 +81,7 @@ public: virtual const LLUUID& getUUID() const = 0; virtual U32 getCreationDate() const = 0; // UTC seconds virtual PermissionMask getPermissionMask() const = 0; - virtual LLViewerImage* getIcon() const = 0; + virtual LLUIImagePtr getIcon() const = 0; virtual LLFontGL::StyleFlags getLabelStyle() const = 0; virtual LLString getLabelSuffix() const = 0; virtual void openItem( void ) = 0; @@ -323,7 +323,8 @@ protected: static LLColor4 sHighlightFgColor; static LLColor4 sFilterBGColor; static LLColor4 sFilterTextColor; - static LLColor4 sLoadingMessageTextColor; + static LLColor4 sSuffixColor; + static LLColor4 sSearchStatusColor; LLString mLabel; LLString mSearchableLabel; @@ -337,7 +338,7 @@ protected: BOOL mSelectPending; LLFontGL::StyleFlags mLabelStyle; LLString mLabelSuffix; - LLPointer<LLViewerImage> mIcon; + LLUIImagePtr mIcon; LLString mStatusText; BOOL mHasVisibleChildren; S32 mIndentation; @@ -348,8 +349,8 @@ protected: F32 mControlLabelRotation; LLFolderView* mRoot; BOOL mDragAndDropTarget; - LLPointer<LLViewerImage> mArrowImage; - LLPointer<LLViewerImage> mBoxImage; + LLUIImagePtr mArrowImage; + LLUIImagePtr mBoxImage; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; @@ -379,12 +380,9 @@ public: void filterFromRoot( void ); // creation_date is in UTC seconds - LLFolderViewItem( const LLString& name, LLViewerImage* icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); + LLFolderViewItem( const LLString& name, LLUIImagePtr icon, S32 creation_date, LLFolderView* root, LLFolderViewEventListener* listener ); virtual ~LLFolderViewItem( void ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - // addToFolder() returns TRUE if it succeeds. FALSE otherwise enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE }; virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); @@ -497,7 +495,7 @@ public: virtual void setFiltered(BOOL filtered, S32 filter_generation); // change the icon - void setIcon(LLViewerImage* icon); + void setIcon(LLUIImagePtr icon); // refresh information from the object being viewed. virtual void refresh(); @@ -569,14 +567,11 @@ public: RECURSE_UP_DOWN } ERecurseType; - LLFolderViewFolder( const LLString& name, LLViewerImage* icon, + LLFolderViewFolder( const LLString& name, LLUIImagePtr icon, LLFolderView* root, LLFolderViewEventListener* listener ); virtual ~LLFolderViewFolder( void ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual BOOL potentiallyVisible(); LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE ); @@ -726,12 +721,10 @@ public: static F32 sAutoOpenTime; - LLFolderView( const LLString& name, LLViewerImage* root_folder_icon, const LLRect& rect, + LLFolderView( const LLString& name, LLUIImagePtr root_folder_icon, const LLRect& rect, const LLUUID& source_id, LLView *parent_view ); virtual ~LLFolderView( void ); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; virtual BOOL canFocusChildren() const; // FolderViews default to sort by name. This will change that, @@ -833,8 +826,8 @@ public: // LLView functionality ///*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent ); - /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ); - /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ); + /*virtual*/ BOOL handleUnicodeCharHere(llwchar uni_char); /*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); /*virtual*/ BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 51e28047f5..adafd8e4c2 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1002,10 +1002,7 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 6459cd5033..a29136214c 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -86,7 +86,7 @@ BOOL LLAgent::setLookAt(ELookAtType target_type, LLViewerObject *object, LLVecto } if(!mLookAt || mLookAt->isDead()) { - mLookAt = (LLHUDEffectLookAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); + mLookAt = (LLHUDEffectLookAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_LOOKAT); mLookAt->setSourceObject(mAvatarObject); } @@ -103,7 +103,7 @@ BOOL LLAgent::setPointAt(EPointAtType target_type, LLViewerObject *object, LLVec if(!mPointAt || mPointAt->isDead()) { - mPointAt = (LLHUDEffectPointAt *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); + mPointAt = (LLHUDEffectPointAt *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINTAT); mPointAt->setSourceObject(mAvatarObject); } @@ -181,8 +181,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) top = llround((F32) top * LLUI::sGLScaleFactor.mV[VY]); bottom = llround((F32) bottom * LLUI::sGLScaleFactor.mV[VY]); - F32 old_far_plane = gCamera->getFar(); - F32 old_near_plane = gCamera->getNear(); + F32 old_far_plane = LLViewerCamera::getInstance()->getFar(); + F32 old_near_plane = LLViewerCamera::getInstance()->getNear(); S32 width = right - left + 1; S32 height = top - bottom + 1; @@ -220,17 +220,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { // ...select distance from control LLVector3 relative_av_pos = av_pos; - relative_av_pos -= gCamera->getOrigin(); + relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); - F32 new_far = relative_av_pos * gCamera->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance"); - F32 new_near = relative_av_pos * gCamera->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance"); + F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance"); + F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance"); new_near = llmax(new_near, 0.1f); - gCamera->setFar(new_far); - gCamera->setNear(new_near); + LLViewerCamera::getInstance()->setFar(new_far); + LLViewerCamera::getInstance()->setNear(new_near); } - gCamera->setPerspective(FOR_SELECTION, + LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, center_x-width/2, center_y-height/2, width, height, limit_select_distance); @@ -245,17 +245,17 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) { return true; } - S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); + S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); switch (result) { case 0: - gSelectMgr->unhighlightObjectOnly(vobjp); + LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp); break; case 1: // check vertices - if (!gCamera->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) + if (!LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) { - gSelectMgr->unhighlightObjectOnly(vobjp); + LLSelectMgr::getInstance()->unhighlightObjectOnly(vobjp); } break; default: @@ -264,15 +264,15 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) return true; } } func; - gSelectMgr->getHighlightedObjects()->applyToObjects(&func); + LLSelectMgr::getInstance()->getHighlightedObjects()->applyToObjects(&func); } if (grow_selection) { std::vector<LLDrawable*> potentials; - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) @@ -280,7 +280,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) LLSpatialPartition* part = region->getSpatialPartition(i); if (part) { - part->cull(*gCamera, &potentials, TRUE); + part->cull(*LLViewerCamera::getInstance(), &potentials, TRUE); } } } @@ -304,20 +304,20 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) continue; } - S32 result = gCamera->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); + S32 result = LLViewerCamera::getInstance()->sphereInFrustum(drawable->getPositionAgent(), drawable->getRadius()); if (result) { switch (result) { case 1: // check vertices - if (gCamera->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) + if (LLViewerCamera::getInstance()->areVertsVisible(vobjp, LLSelectMgr::sRectSelectInclusive)) { - gSelectMgr->highlightObjectOnly(vobjp); + LLSelectMgr::getInstance()->highlightObjectOnly(vobjp); } break; case 2: - gSelectMgr->highlightObjectOnly(vobjp); + LLSelectMgr::getInstance()->highlightObjectOnly(vobjp); break; default: break; @@ -332,8 +332,8 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) glMatrixMode(GL_MODELVIEW); // restore camera - gCamera->setFar(old_far_plane); - gCamera->setNear(old_near_plane); + LLViewerCamera::getInstance()->setFar(old_far_plane); + LLViewerCamera::getInstance()->setNear(old_near_plane); gViewerWindow->setup3DRender(); } @@ -343,10 +343,6 @@ static const F32 COMPASS_RANGE = 0.33f; void LLCompass::draw() { -// S32 left, top, right, bottom; - - if (!getVisible()) return; - glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); @@ -413,8 +409,6 @@ void LLCompass::draw() void LLHorizontalCompass::draw() { - if (!getVisible()) return; - LLGLSUIDefault gls_ui; S32 width = getRect().getWidth(); @@ -423,7 +417,7 @@ void LLHorizontalCompass::draw() if( mTexture ) { - const LLVector3& at_axis = gCamera->getAtAxis(); + const LLVector3& at_axis = LLViewerCamera::getInstance()->getAtAxis(); F32 center = atan2( at_axis.mV[VX], at_axis.mV[VY] ); center += F_PI; @@ -469,7 +463,7 @@ void LLWind::renderVectors() S32 i,j; F32 x,y; - F32 region_width_meters = gWorldPointer->getRegionWidthInMeters(); + F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); LLGLSNoTexture gls_no_texture; gGL.pushMatrix(); @@ -524,10 +518,10 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global, // resolves correctly so we can get a height value. const F32 FUDGE = 0.01f; - F32 sw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); - F32 se_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); - F32 ne_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); - F32 nw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); + F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); + F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); + F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); + F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); F32 sw_top = sw_bottom + PARCEL_POST_HEIGHT; F32 se_top = se_bottom + PARCEL_POST_HEIGHT; @@ -601,10 +595,10 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel ) // resolves correctly so we can get a height value. const F32 FUDGE = 0.01f; - F32 sw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); - F32 se_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); - F32 ne_bottom = gWorldp->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); - F32 nw_bottom = gWorldp->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); + F32 sw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, south, 0.f ) ); + F32 se_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, south, 0.f ) ); + F32 ne_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( east-FUDGE, north-FUDGE, 0.f ) ); + F32 nw_bottom = LLWorld::getInstance()->resolveLandHeightAgent( LLVector3( west, north-FUDGE, 0.f ) ); // little hack to make nearby lines not Z-fight east -= 0.1f; @@ -856,11 +850,11 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV if (use_pass && (mCollisionBanned == BA_NOT_ON_LIST)) { - LLViewerImage::bindTexture( getPassImage() ); + LLViewerImage::bindTexture(mPassImage); } else { - LLViewerImage::bindTexture( getBlockedImage() ); + LLViewerImage::bindTexture(mBlockedImage); } gGL.begin(GL_QUADS); @@ -1013,7 +1007,7 @@ void LLViewerObjectList::renderObjectBeacons() } S32 i; - //const LLFontGL *font = gResMgr->getRes(LLFONT_SANSSERIF); + //const LLFontGL *font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); LLGLSUIDefault gls_ui; diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index bb6abcd95b..542274b295 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -53,8 +53,6 @@ #include "llfloatergroupinfo.h" #include "lluictrlfactory.h" -LLGroupMgr sGroupMgr; // use local instance so that it gets cleaned up on application exit -LLGroupMgr* gGroupMgr = &sGroupMgr; const U32 MAX_CACHED_GROUPS = 10; @@ -705,7 +703,7 @@ void LLGroupMgrGroupData::sendRoleChanges() // If we create a new role, then we need to re-fetch all the role data. if (need_role_data) { - gGroupMgr->sendGroupRoleDataRequest(getID()); + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(getID()); } // Clean up change lists @@ -811,7 +809,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) LLUUID request_id; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id); - LLGroupMgrGroupData* group_datap = gGroupMgr->createGroupData(group_id); + LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id); if (group_datap->mMemberRequestID != request_id) { llwarns << "processGroupMembersReply: Received incorrect (stale?) request id" << llendl; @@ -867,7 +865,7 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) //if group members are loaded while titles are missing, load the titles. if(group_datap->mTitles.size() < 1) { - gGroupMgr->sendGroupTitlesRequest(group_id); + LLGroupMgr::getInstance()->sendGroupTitlesRequest(group_id); } } @@ -879,12 +877,12 @@ void LLGroupMgr::processGroupMembersReply(LLMessageSystem* msg, void** data) if (group_datap->mPendingRoleMemberRequest) { group_datap->mPendingRoleMemberRequest = FALSE; - gGroupMgr->sendGroupRoleMembersRequest(group_datap->mID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_datap->mID); } } group_datap->mChanged = TRUE; - gGroupMgr->notifyObservers(GC_MEMBER_DATA); + LLGroupMgr::getInstance()->notifyObservers(GC_MEMBER_DATA); } //static @@ -933,7 +931,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) msg->getBOOL("GroupData", "MaturePublish", mature); msg->getUUID(_PREHASH_GroupData, "OwnerRole", owner_role); - LLGroupMgrGroupData* group_datap = gGroupMgr->createGroupData(group_id); + LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->createGroupData(group_id); group_datap->mName = name; group_datap->mCharter = charter; @@ -951,7 +949,7 @@ void LLGroupMgr::processGroupPropertiesReply(LLMessageSystem* msg, void** data) group_datap->mGroupPropertiesDataComplete = TRUE; group_datap->mChanged = TRUE; - gGroupMgr->notifyObservers(GC_PROPERTIES); + LLGroupMgr::getInstance()->notifyObservers(GC_PROPERTIES); } // static @@ -972,7 +970,7 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) LLUUID request_id; msg->getUUIDFast(_PREHASH_GroupData, _PREHASH_RequestID, request_id); - LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id); if (group_data->mRoleDataRequestID != request_id) { llwarns << "processGroupRoleDataReply: Received incorrect (stale?) request id" << llendl; @@ -1013,12 +1011,12 @@ void LLGroupMgr::processGroupRoleDataReply(LLMessageSystem* msg, void** data) if (group_data->mPendingRoleMemberRequest) { group_data->mPendingRoleMemberRequest = FALSE; - gGroupMgr->sendGroupRoleMembersRequest(group_data->mID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(group_data->mID); } } group_data->mChanged = TRUE; - gGroupMgr->notifyObservers(GC_ROLE_DATA); + LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_DATA); } // static @@ -1042,7 +1040,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) U32 total_pairs; msg->getU32(_PREHASH_AgentData, "TotalPairs", total_pairs); - LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id); if (group_data->mRoleMembersRequestID != request_id) { @@ -1127,7 +1125,7 @@ void LLGroupMgr::processGroupRoleMembersReply(LLMessageSystem* msg, void** data) } group_data->mChanged = TRUE; - gGroupMgr->notifyObservers(GC_ROLE_MEMBER_DATA); + LLGroupMgr::getInstance()->notifyObservers(GC_ROLE_MEMBER_DATA); } // static @@ -1145,7 +1143,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) LLUUID group_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_GroupID, group_id ); - LLGroupMgrGroupData* group_data = gGroupMgr->createGroupData(group_id); + LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->createGroupData(group_id); LLUUID request_id; msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_RequestID, request_id); @@ -1177,7 +1175,7 @@ void LLGroupMgr::processGroupTitlesReply(LLMessageSystem* msg, void** data) } group_data->mChanged = TRUE; - gGroupMgr->notifyObservers(GC_TITLES); + LLGroupMgr::getInstance()->notifyObservers(GC_TITLES); } // static @@ -1210,7 +1208,7 @@ void LLGroupMgr::processJoinGroupReply(LLMessageSystem* msg, void ** data) // refresh all group information gAgent.sendAgentDataUpdateRequest(); - gGroupMgr->clearGroupData(group_id); + LLGroupMgr::getInstance()->clearGroupData(group_id); // refresh the floater for this group, if any. LLFloaterGroupInfo::refreshGroup(group_id); // refresh the group panel of the search window, if necessary. @@ -1232,7 +1230,7 @@ void LLGroupMgr::processLeaveGroupReply(LLMessageSystem* msg, void ** data) // refresh all group information gAgent.sendAgentDataUpdateRequest(); - gGroupMgr->clearGroupData(group_id); + LLGroupMgr::getInstance()->clearGroupData(group_id); // close the floater for this group, if any. LLFloaterGroupInfo::closeGroup(group_id); // refresh the group panel of the search window, if necessary. @@ -1286,11 +1284,11 @@ LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id) { LLGroupMgrGroupData* group_datap; - group_map_t::iterator existing_group = gGroupMgr->mGroups.find(id); - if (existing_group == gGroupMgr->mGroups.end()) + group_map_t::iterator existing_group = LLGroupMgr::getInstance()->mGroups.find(id); + if (existing_group == LLGroupMgr::getInstance()->mGroups.end()) { group_datap = new LLGroupMgrGroupData(id); - gGroupMgr->addGroup(group_datap); + LLGroupMgr::getInstance()->addGroup(group_datap); } else { @@ -1647,7 +1645,7 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id, bool start_message = true; LLMessageSystem* msg = gMessageSystem; - LLGroupMgrGroupData* group_datap = gGroupMgr->getGroupData(group_id); + LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id); if (!group_datap) return; for (std::vector<LLUUID>::iterator it = member_ids.begin(); @@ -1832,7 +1830,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) role_action_data->mPowerBit = set_power_mask; role_action_set->mActionSetData = role_action_data; - gGroupMgr->mRoleActionSets.push_back(role_action_set); + LLGroupMgr::getInstance()->mRoleActionSets.push_back(role_action_set); } return true; } @@ -1840,7 +1838,7 @@ bool LLGroupMgr::parseRoleActions(const LLString& xml_filename) // static void LLGroupMgr::debugClearAllGroups(void*) { - gGroupMgr->clearGroups(); + LLGroupMgr::getInstance()->clearGroups(); LLGroupMgr::parseRoleActions("role_actions.xml"); } diff --git a/indra/newview/llgroupmgr.h b/indra/newview/llgroupmgr.h index ee848ec16d..2cab236954 100644 --- a/indra/newview/llgroupmgr.h +++ b/indra/newview/llgroupmgr.h @@ -295,7 +295,7 @@ struct LLRoleActionSet std::vector<LLRoleAction*> mActions; }; -class LLGroupMgr +class LLGroupMgr : public LLSingleton<LLGroupMgr> { LOG_CLASS(LLGroupMgr); @@ -350,19 +350,18 @@ public: static void debugClearAllGroups(void*); void clearGroups(); void clearGroupData(const LLUUID& group_id); -protected: + +private: void notifyObservers(LLGroupChange gc); void addGroup(LLGroupMgrGroupData* group_datap); LLGroupMgrGroupData* createGroupData(const LLUUID &id); -protected: typedef std::multimap<LLUUID,LLGroupMgrObserver*> observer_multimap_t; observer_multimap_t mObservers; typedef std::map<LLUUID, LLGroupMgrGroupData*> group_map_t; group_map_t mGroups; }; -extern LLGroupMgr* gGroupMgr; #endif diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp index 236fdaf70f..613a234ba5 100644 --- a/indra/newview/llhudeffectbeam.cpp +++ b/indra/newview/llhudeffectbeam.cpp @@ -274,7 +274,7 @@ void LLHUDEffectBeam::render() // Init the color of the particles LLColor4U coloru = mColor; - + // Draw the particles S32 i; for (i = 0; i < NUM_POINTS; i++) diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index da734d6104..30d753dd81 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -196,7 +196,7 @@ void LLHUDEffectSpiral::triggerLocal() psb->setSourceObject(mSourceObject); psb->setTargetObject(mTargetObject); psb->setOwnerUUID(gAgent.getID()); - gWorldPointer->mPartSim.addPartSource(psb); + LLViewerPartSim::getInstance()->addPartSource(psb); mPartSourcep = psb; } } @@ -212,7 +212,7 @@ void LLHUDEffectSpiral::triggerLocal() psb->setColor(color); psb->mLKGTargetPosGlobal = mPositionGlobal; psb->setOwnerUUID(gAgent.getID()); - gWorldPointer->mPartSim.addPartSource(psb); + LLViewerPartSim::getInstance()->addPartSource(psb); mPartSourcep = psb; } } @@ -234,7 +234,7 @@ void LLHUDEffectSpiral::triggerLocal() } pss->setColor(color); pss->setOwnerUUID(gAgent.getID()); - gWorldPointer->mPartSim.addPartSource(pss); + LLViewerPartSim::getInstance()->addPartSource(pss); mPartSourcep = pss; } } diff --git a/indra/newview/llhudicon.cpp b/indra/newview/llhudicon.cpp index 1260a268e3..248caf07a9 100644 --- a/indra/newview/llhudicon.cpp +++ b/indra/newview/llhudicon.cpp @@ -102,28 +102,28 @@ void LLHUDIcon::renderIcon(BOOL for_select) // put icon above object, and in front // RN: don't use drawable radius, it's fricking HUGE - LLVector3 icon_relative_pos = (gCamera->getUpAxis() * ~mSourceObject->getRenderRotation()); + LLVector3 icon_relative_pos = (LLViewerCamera::getInstance()->getUpAxis() * ~mSourceObject->getRenderRotation()); icon_relative_pos.abs(); F32 distance_scale = llmin(mSourceObject->getScale().mV[VX] / icon_relative_pos.mV[VX], mSourceObject->getScale().mV[VY] / icon_relative_pos.mV[VY], mSourceObject->getScale().mV[VZ] / icon_relative_pos.mV[VZ]); F32 up_distance = 0.5f * distance_scale; - LLVector3 icon_position = obj_position + (up_distance * gCamera->getUpAxis()) * 1.2f; + LLVector3 icon_position = obj_position + (up_distance * LLViewerCamera::getInstance()->getUpAxis()) * 1.2f; - LLVector3 icon_to_cam = gCamera->getOrigin() - icon_position; + LLVector3 icon_to_cam = LLViewerCamera::getInstance()->getOrigin() - icon_position; icon_to_cam.normVec(); icon_position += icon_to_cam * mSourceObject->mDrawable->getRadius() * 1.1f; - mDistance = dist_vec(icon_position, gCamera->getOrigin()); + mDistance = dist_vec(icon_position, LLViewerCamera::getInstance()->getOrigin()); F32 alpha_factor = for_select ? 1.f : clamp_rescale(mDistance, DIST_START_FADE, DIST_END_FADE, 1.f, 0.f); LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; - gCamera->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); + LLViewerCamera::getInstance()->getPixelVectors(icon_position, y_pixel_vec, x_pixel_vec); F32 scale_factor = 1.f; if (mAnimTimer.getElapsedTimeF32() < ANIM_TIME) diff --git a/indra/newview/llhudmanager.cpp b/indra/newview/llhudmanager.cpp index 30a09a96d3..a936118ccf 100644 --- a/indra/newview/llhudmanager.cpp +++ b/indra/newview/llhudmanager.cpp @@ -42,8 +42,6 @@ #include "llviewercontrol.h" #include "llviewerobjectlist.h" -LLHUDManager *gHUDManager = NULL; - extern BOOL gNoRender; // These are loaded from saved settings. @@ -155,12 +153,6 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat return; } - if (!gHUDManager) - { - llwarns << "No gHUDManager!" << llendl; - return; - } - LLHUDEffect *effectp = NULL; LLUUID effect_id; U8 effect_type = 0; @@ -172,20 +164,20 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat effectp = NULL; LLHUDEffect::getIDType(mesgsys, k, effect_id, effect_type); S32 i; - for (i = 0; i < gHUDManager->mHUDEffects.count(); i++) + for (i = 0; i < LLHUDManager::getInstance()->mHUDEffects.count(); i++) { - LLHUDEffect *cur_effectp = gHUDManager->mHUDEffects[i]; + LLHUDEffect *cur_effectp = LLHUDManager::getInstance()->mHUDEffects[i]; if (!cur_effectp) { llwarns << "Null effect in effect manager, skipping" << llendl; - gHUDManager->mHUDEffects.remove(i); + LLHUDManager::getInstance()->mHUDEffects.remove(i); i--; continue; } if (cur_effectp->isDead()) { // llwarns << "Dead effect in effect manager, removing" << llendl; - gHUDManager->mHUDEffects.remove(i); + LLHUDManager::getInstance()->mHUDEffects.remove(i); i--; continue; } @@ -204,7 +196,7 @@ void LLHUDManager::processViewerEffect(LLMessageSystem *mesgsys, void **user_dat { if (!effectp) { - effectp = gHUDManager->createViewerEffect(effect_type, FALSE, FALSE); + effectp = LLHUDManager::getInstance()->createViewerEffect(effect_type, FALSE, FALSE); } if (effectp) diff --git a/indra/newview/llhudmanager.h b/indra/newview/llhudmanager.h index 934bcf44a1..c77dc1bfe5 100644 --- a/indra/newview/llhudmanager.h +++ b/indra/newview/llhudmanager.h @@ -44,7 +44,7 @@ class LLHUDAnimalControls; // End Ventrella class LLMessageSystem; -class LLHUDManager +class LLHUDManager : public LLSingleton<LLHUDManager> { public: LLHUDManager(); @@ -65,6 +65,4 @@ protected: LLDynamicArrayPtr<LLPointer<LLHUDEffect> > mHUDEffects; }; -extern LLHUDManager *gHUDManager; - #endif // LL_LLHUDMANAGER_H diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index bdbc849dc2..0f83da8240 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -61,10 +61,10 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, const BOOL orthographic) { // Do cheap plane culling - LLVector3 dir_vec = pos_agent - gCamera->getOrigin(); + LLVector3 dir_vec = pos_agent - LLViewerCamera::getInstance()->getOrigin(); dir_vec /= dir_vec.magVec(); - if (wstr.empty() || (!orthographic && dir_vec * gCamera->getAtAxis() <= 0.f)) + if (wstr.empty() || (!orthographic && dir_vec * LLViewerCamera::getInstance()->getAtAxis() <= 0.f)) { return; } @@ -78,15 +78,15 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, } else { - gCamera->getPixelVectors(pos_agent, up_axis, right_axis); + LLViewerCamera::getInstance()->getPixelVectors(pos_agent, up_axis, right_axis); } - LLCoordFrame render_frame = *gCamera; + LLCoordFrame render_frame = *LLViewerCamera::getInstance(); LLQuaternion rot; if (!orthographic) { rot = render_frame.getQuaternion(); - rot = rot * LLQuaternion(-F_PI_BY_TWO, gCamera->getYAxis()); - rot = rot * LLQuaternion(F_PI_BY_TWO, gCamera->getXAxis()); + rot = rot * LLQuaternion(-F_PI_BY_TWO, LLViewerCamera::getInstance()->getYAxis()); + rot = rot * LLQuaternion(F_PI_BY_TWO, LLViewerCamera::getInstance()->getXAxis()); } else { diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index e04a62167c..47e23f1c6a 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -175,9 +175,7 @@ void LLHUDText::renderText(BOOL for_select) mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); // *TODO: cache this image - LLUUID image_id; - image_id.set(gViewerArt.getString("rounded_square.tga")); - LLViewerImage* imagep = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); + LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); // *TODO: make this a per-text setting LLColor4 bg_color = gSavedSettings.getColor4("BackgroundChatColor"); @@ -211,10 +209,10 @@ void LLHUDText::renderText(BOOL for_select) } else { - gCamera->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); } - LLVector2 border_scale_vec((F32)border_width / (F32)imagep->getWidth(), (F32)border_height / (F32)imagep->getHeight()); + LLVector2 border_scale_vec((F32)border_width / (F32)imagep->getTextureWidth(), (F32)border_height / (F32)imagep->getTextureHeight()); LLVector3 width_vec = mWidth * x_pixel_vec; LLVector3 height_vec = mHeight * y_pixel_vec; LLVector3 scaled_border_width = (F32)llfloor(border_scale * (F32)border_width) * x_pixel_vec; @@ -223,7 +221,7 @@ void LLHUDText::renderText(BOOL for_select) mRadius = (width_vec + height_vec).magVec() * 0.5f; LLCoordGL screen_pos; - gCamera->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); + LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE); LLVector2 screen_offset; if (!mUseBubble) @@ -246,7 +244,7 @@ void LLHUDText::renderText(BOOL for_select) //} //else //{ - // render_position = gCamera->roundToPixel(render_position); + // render_position = LLViewerCamera::getInstance()->roundToPixel(render_position); //} if (mUseBubble) @@ -272,7 +270,7 @@ void LLHUDText::renderText(BOOL for_select) } else { - LLViewerImage::bindTexture(imagep); + LLViewerImage::bindTexture(imagep->getImage()); gGL.color4fv(bg_color.mV); gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec); @@ -616,25 +614,25 @@ void LLHUDText::updateVisibility() } // push text towards camera by radius of object, but not past camera - LLVector3 vec_from_camera = mPositionAgent - gCamera->getOrigin(); + LLVector3 vec_from_camera = mPositionAgent - LLViewerCamera::getInstance()->getOrigin(); LLVector3 dir_from_camera = vec_from_camera; dir_from_camera.normVec(); - if (dir_from_camera * gCamera->getAtAxis() <= 0.f) + if (dir_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= 0.f) { - mPositionAgent -= projected_vec(vec_from_camera, gCamera->getAtAxis()) * 1.f; - mPositionAgent += gCamera->getAtAxis() * (gCamera->getNear() + 0.1f); + mPositionAgent -= projected_vec(vec_from_camera, LLViewerCamera::getInstance()->getAtAxis()) * 1.f; + mPositionAgent += LLViewerCamera::getInstance()->getAtAxis() * (LLViewerCamera::getInstance()->getNear() + 0.1f); } - else if (vec_from_camera * gCamera->getAtAxis() <= gCamera->getNear() + 0.1f + mSourceObject->getVObjRadius()) + else if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) { - mPositionAgent = gCamera->getOrigin() + vec_from_camera * ((gCamera->getNear() + 0.1f) / (vec_from_camera * gCamera->getAtAxis())); + mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); } else { mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius(); } - mLastDistance = (mPositionAgent - gCamera->getOrigin()).magVec(); + mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); if (mLOD >= 3 || !mTextSegments.size() || (mDoFade && (mLastDistance > mFadeDistance + mFadeRange))) { @@ -645,14 +643,14 @@ void LLHUDText::updateVisibility() LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; - gCamera->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); LLVector3 render_position = mPositionAgent + (x_pixel_vec * mPositionOffset.mV[VX]) + (y_pixel_vec * mPositionOffset.mV[VY]); mOffscreen = FALSE; - if (!gCamera->sphereInFrustum(render_position, mRadius)) + if (!LLViewerCamera::getInstance()->sphereInFrustum(render_position, mRadius)) { if (!mVisibleOffScreen) { @@ -675,9 +673,9 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) LLVector2 screen_pos_vec; LLVector3 x_pixel_vec; LLVector3 y_pixel_vec; - gCamera->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); + LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec); LLVector3 world_pos = mPositionAgent + (offset.mV[VX] * x_pixel_vec) + (offset.mV[VY] * y_pixel_vec); - if (!gCamera->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) + if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(world_pos, screen_pos, FALSE) && mVisibleOffScreen) { // bubble off-screen, so find a spot for it along screen edge LLVector2 window_center(gViewerWindow->getWindowDisplayWidth() * 0.5f, gViewerWindow->getWindowDisplayHeight() * 0.5f); @@ -685,7 +683,7 @@ LLVector2 LLHUDText::updateScreenPos(LLVector2 &offset) screen_pos.mY - window_center.mV[VY]); delta_from_center.normVec(); - F32 camera_aspect = gCamera->getAspect(); + F32 camera_aspect = LLViewerCamera::getInstance()->getAspect(); F32 delta_aspect = llabs(delta_from_center.mV[VX] / delta_from_center.mV[VY]); if (camera_aspect / llmax(delta_aspect, 0.001f) > 1.f) { @@ -835,7 +833,7 @@ void LLHUDText::updateAll() } } - LLStat* camera_vel_stat = gCamera->getVelocityStat(); + LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat(); F32 camera_vel = camera_vel_stat->getCurrent(); if (camera_vel > MAX_STABLE_CAMERA_VELOCITY) { diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index 7f549bb2eb..59478cb031 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -59,16 +59,6 @@ LLHUDView::LLHUDView() LLHUDView::~LLHUDView() { } -EWidgetType LLHUDView::getWidgetType() const -{ - return WIDGET_TYPE_HUD_VIEW; -} - -LLString LLHUDView::getWidgetTag() const -{ - return LL_HUD_VIEW_TAG; -} - // virtual void LLHUDView::draw() { diff --git a/indra/newview/llhudview.h b/indra/newview/llhudview.h index cbefdc121e..ccd5f96f5f 100644 --- a/indra/newview/llhudview.h +++ b/indra/newview/llhudview.h @@ -44,9 +44,6 @@ public: LLHUDView(); virtual ~LLHUDView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual void draw(); const LLColor4& colorFromType(S32 type); diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index f0a48b9df5..7eac7eb598 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -62,7 +62,7 @@ #include "llviewermessage.h" #include "llviewerstats.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "lllogchat.h" #include "llfloaterhtml.h" @@ -1154,7 +1154,7 @@ void LLFloaterIMPanel::init(const LLString& session_label) mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); - gUICtrlFactory->buildFloater(this, + LLUICtrlFactory::getInstance()->buildFloater(this, xml_filename, &getFactoryMap(), FALSE); @@ -1217,12 +1217,12 @@ LLFloaterIMPanel::~LLFloaterIMPanel() BOOL LLFloaterIMPanel::postBuild() { - requires("chat_editor", WIDGET_TYPE_LINE_EDITOR); - requires("im_history", WIDGET_TYPE_TEXT_EDITOR); + requires<LLLineEditor>("chat_editor"); + requires<LLTextEditor>("im_history"); if (checkRequirements()) { - mInputEditor = LLUICtrlFactory::getLineEditorByName(this, "chat_editor"); + mInputEditor = getChild<LLLineEditor>("chat_editor"); mInputEditor->setFocusReceivedCallback( onInputEditorFocusReceived, this ); mInputEditor->setFocusLostCallback( onInputEditorFocusLost, this ); mInputEditor->setKeystrokeCallback( onInputEditorKeystroke ); @@ -1240,10 +1240,10 @@ BOOL LLFloaterIMPanel::postBuild() childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this); childSetAction("moderator_kick_speaker", onKickSpeaker, this); - //LLButton* close_btn = LLUICtrlFactory::getButtonByName(this, "close_btn"); + //LLButton* close_btn = getChild<LLButton>("close_btn"); //close_btn->setClickedCallback(&LLFloaterIMPanel::onClickClose, this); - mHistoryEditor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "im_history"); + mHistoryEditor = getChild<LLViewerTextEditor>("im_history"); mHistoryEditor->setParseHTML(TRUE); if ( IM_SESSION_GROUP_START == mDialog ) @@ -1286,16 +1286,16 @@ void LLFloaterIMPanel::onClickMuteVoice(void* user_data) LLFloaterIMPanel* floaterp = (LLFloaterIMPanel*)user_data; if (floaterp) { - BOOL is_muted = gMuteListp->isMuted(floaterp->mOtherParticipantUUID, LLMute::flagVoiceChat); + BOOL is_muted = LLMuteList::getInstance()->isMuted(floaterp->mOtherParticipantUUID, LLMute::flagVoiceChat); LLMute mute(floaterp->mOtherParticipantUUID, floaterp->getTitle(), LLMute::AGENT); if (!is_muted) { - gMuteListp->add(mute, LLMute::flagVoiceChat); + LLMuteList::getInstance()->add(mute, LLMute::flagVoiceChat); } else { - gMuteListp->remove(mute, LLMute::flagVoiceChat); + LLMuteList::getInstance()->remove(mute, LLMute::flagVoiceChat); } } } @@ -1384,7 +1384,7 @@ void LLFloaterIMPanel::draw() childSetVisible("speaker_volume", LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive()); childSetValue("speaker_volume", gVoiceClient->getUserVolume(mOtherParticipantUUID)); - childSetValue("mute_btn", gMuteListp->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat)); + childSetValue("mute_btn", LLMuteList::getInstance()->isMuted(mOtherParticipantUUID, LLMute::flagVoiceChat)); childSetVisible("mute_btn", LLVoiceClient::voiceEnabled() && mVoiceChannel->isActive()); } LLFloater::draw(); @@ -1540,33 +1540,30 @@ void LLFloaterIMPanel::selectNone() } -BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent ) +BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; - if( getVisible() && getEnabled() && !called_from_parent && gFocusMgr.childHasKeyboardFocus(this)) + if( KEY_RETURN == key && mask == MASK_NONE) { - if( KEY_RETURN == key && mask == MASK_NONE) - { - sendMsg(); - handled = TRUE; + sendMsg(); + handled = TRUE; - // Close talk panels on hitting return - // but not shift-return or control-return - if ( !gSavedSettings.getBOOL("PinTalkViewOpen") && !(mask & MASK_CONTROL) && !(mask & MASK_SHIFT) ) - { - gIMMgr->toggle(NULL); - } - } - else if ( KEY_ESCAPE == key ) + // Close talk panels on hitting return + // but not shift-return or control-return + if ( !gSavedSettings.getBOOL("PinTalkViewOpen") && !(mask & MASK_CONTROL) && !(mask & MASK_SHIFT) ) { - handled = TRUE; - gFocusMgr.setKeyboardFocus(NULL); + gIMMgr->toggle(NULL); + } + } + else if ( KEY_ESCAPE == key ) + { + handled = TRUE; + gFocusMgr.setKeyboardFocus(NULL); - // Close talk panel with escape - if( !gSavedSettings.getBOOL("PinTalkViewOpen") ) - { - gIMMgr->toggle(NULL); - } + // Close talk panel with escape + if( !gSavedSettings.getBOOL("PinTalkViewOpen") ) + { + gIMMgr->toggle(NULL); } } @@ -1889,7 +1886,7 @@ void LLFloaterIMPanel::sendMsg() BOOL other_was_typing = mOtherTyping; - addHistoryLine(gAgent.getID(), history_echo); + addHistoryLine(gAgent.getID(), history_echo, gSavedSettings.getColor("IMChatColor")); if (other_was_typing) { @@ -1905,7 +1902,7 @@ void LLFloaterIMPanel::sendMsg() mQueuedMsgsForInit.append(utf8_text); } - gViewerStats->incStat(LLViewerStats::ST_IM_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_IM_COUNT); } mInputEditor->setText(LLString::null); @@ -2190,3 +2187,4 @@ void LLFloaterIMPanel::onConfirmForceCloseError(S32 option, void* data) } + diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 7abfbbb937..c5bb8956cd 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -217,7 +217,7 @@ public: S32 getNumUnreadMessages() { return mNumUnreadMessages; } - BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + BOOL handleKeyHere(KEY key, MASK mask); BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 3242e7d474..203adc2fb5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -40,7 +40,7 @@ #include "llhttpclient.h" #include "llsdutil.h" #include "llstring.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llagent.h" #include "llcallingcard.h" @@ -152,7 +152,7 @@ LLFloaterIM::LLFloaterIM() // the size of the im-sesssion when they were created. This happens in // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater()) this->mAutoResize = FALSE; - gUICtrlFactory->buildFloater(this, "floater_im.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml"); } BOOL LLFloaterIM::postBuild() @@ -403,12 +403,12 @@ void LLIMMgr::addMessage( const LLVector3& position) { LLUUID other_participant_id = target_id; - bool is_from_system = target_id.isNull(); + bool is_from_system = target_id.isNull() || !strcmp(from, SYSTEM_FROM); // don't process muted IMs - if (gMuteListp->isMuted( + if (LLMuteList::getInstance()->isMuted( other_participant_id, - LLMute::flagTextChat) && !gMuteListp->isLinden(from)) + LLMute::flagTextChat) && !LLMuteList::getInstance()->isLinden(from)) { return; } @@ -488,7 +488,7 @@ void LLIMMgr::addMessage( } else { - floater->addHistoryLine(other_participant_id, msg); + floater->addHistoryLine(other_participant_id, msg, gSavedSettings.getColor("IMChatColor")); } LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD()); @@ -693,7 +693,7 @@ void LLIMMgr::inviteToSession( const LLString& session_handle) { //ignore invites from muted residents - if (gMuteListp->isMuted(caller_id)) + if (LLMuteList::getInstance()->isMuted(caller_id)) { return; } @@ -953,10 +953,10 @@ void LLIMMgr::inviteUserResponse(S32 option, void* user_data) case 2: // mute (also implies ignore, so this falls through to the "ignore" case below) { // mute the sender of this invite - if (!gMuteListp->isMuted(invitep->mCallerID)) + if (!LLMuteList::getInstance()->isMuted(invitep->mCallerID)) { LLMute mute(invitep->mCallerID, invitep->mCallerName, LLMute::AGENT); - gMuteListp->add(mute); + LLMuteList::getInstance()->add(mute); } } /* FALLTHROUGH */ @@ -1482,12 +1482,12 @@ public: (time_t) message_params["timestamp"].asInteger(); BOOL is_busy = gAgent.getBusy(); - BOOL is_muted = gMuteListp->isMuted( + BOOL is_muted = LLMuteList::getInstance()->isMuted( from_id, name.c_str(), LLMute::flagTextChat); - BOOL is_linden = gMuteListp->isLinden( + BOOL is_linden = LLMuteList::getInstance()->isLinden( name.c_str()); char separator_string[3]=": "; /* Flawfinder: ignore */ int message_offset=0; @@ -1631,3 +1631,4 @@ LLHTTPRegistration<LLViewerChatterBoxInvitation> gHTTPRegistrationMessageChatterBoxInvitation( "/message/ChatterBoxInvitation"); + diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index a0fa0e083c..c3a0a2d931 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -81,7 +81,7 @@ #include "llviewermessage.h" #include "llviewerregion.h" #include "lltabcontainer.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llselectmgr.h" #include "llfloateropenobject.h" @@ -124,11 +124,11 @@ const char* ICON_NAME[ICON_NAME_COUNT] = "inv_item_object.tga", "inv_item_object_multi.tga", "inv_item_notecard.tga", - "inv_item_bodypart.tga", + "inv_item_skin.tga", "inv_item_snapshot.tga", "inv_item_shape.tga", - "inv_item_bodypart.tga", + "inv_item_skin.tga", "inv_item_hair.tga", "inv_item_eyes.tga", "inv_item_shirt.tga", @@ -388,9 +388,10 @@ void hideContextEntries(LLMenuGL& menu, LLString name = (*itor)->getName(); // descend into split menus: - if ((name == "More") && (WIDGET_TYPE_MENU_ITEM_BRANCH == (*itor)->getWidgetType())) + LLMenuItemBranchGL* branchp = dynamic_cast<LLMenuItemBranchGL*>(*itor); + if ((name == "More") && branchp) { - hideContextEntries(*((LLMenuItemBranchGL *)(*itor))->getBranch(), entries_to_show, disabled_entries); + hideContextEntries(*branchp->getBranch(), entries_to_show, disabled_entries); } @@ -807,10 +808,9 @@ void LLItemBridge::restoreItem() } } -LLViewerImage* LLItemBridge::getIcon() const +LLUIImagePtr LLItemBridge::getIcon() const { - LLString uuid_string = gViewerArt.getString(ICON_NAME[OBJECT_ICON_NAME]); - return gImageList.getImage(LLUUID(uuid_string), MIPMAP_FALSE, TRUE); + return LLUI::getUIImage(ICON_NAME[OBJECT_ICON_NAME]); } PermissionMask LLItemBridge::getPermissionMask() const @@ -1133,7 +1133,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } // check to make sure source is agent inventory, and is represented there. - LLToolDragAndDrop::ESource source = gToolDragAndDrop->getSource(); + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL is_agent_inventory = (model->getCategory(inv_cat->getUUID()) != NULL) && (LLToolDragAndDrop::SOURCE_AGENT == source); @@ -1626,7 +1626,7 @@ void LLFolderBridge::restoreItem() } // Icons for folders are based on the preferred type -LLViewerImage* LLFolderBridge::getIcon() const +LLUIImagePtr LLFolderBridge::getIcon() const { const char* control = NULL; LLAssetType::EType preferred_type = LLAssetType::AT_NONE; @@ -1687,8 +1687,7 @@ LLViewerImage* LLFolderBridge::getIcon() const control = "inv_folder_plain_closed.tga"; break; } - LLString uuid_string = gViewerArt.getString(control); - return gImageList.getImage(LLUUID(uuid_string), MIPMAP_FALSE, TRUE); + return LLUI::getUIImage(control); } BOOL LLFolderBridge::renameItem(const LLString& new_name) @@ -2195,7 +2194,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLVOAvatar* avatar = gAgent.getAvatarObject(); if(!avatar) return FALSE; - LLToolDragAndDrop::ESource source = gToolDragAndDrop->getSource(); + LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; LLViewerObject* object = NULL; if(LLToolDragAndDrop::SOURCE_AGENT == source) @@ -2318,8 +2317,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, accept = TRUE; if(drop) { - copy_inventory_from_notecard(gToolDragAndDrop->getObjectID(), - gToolDragAndDrop->getSourceID(), inv_item); + copy_inventory_from_notecard(LLToolDragAndDrop::getInstance()->getObjectID(), + LLToolDragAndDrop::getInstance()->getSourceID(), inv_item); } } else if(LLToolDragAndDrop::SOURCE_LIBRARY == source) @@ -2351,7 +2350,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // | LLScriptBridge (DEPRECTED) | // +=================================================+ -LLViewerImage* LLScriptBridge::getIcon() const +LLUIImagePtr LLScriptBridge::getIcon() const { return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); } @@ -2363,7 +2362,7 @@ LLViewerImage* LLScriptBridge::getIcon() const LLString LLTextureBridge::sPrefix("Texture: "); -LLViewerImage* LLTextureBridge::getIcon() const +LLUIImagePtr LLTextureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); } @@ -2413,7 +2412,7 @@ void LLTextureBridge::openItem() LLString LLSoundBridge::sPrefix("Sound: "); -LLViewerImage* LLSoundBridge::getIcon() const +LLUIImagePtr LLSoundBridge::getIcon() const { return get_item_icon(LLAssetType::AT_SOUND, LLInventoryType::IT_SOUND, 0, FALSE); } @@ -2508,7 +2507,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLString LLLandmarkBridge::sPrefix("Landmark: "); -LLViewerImage* LLLandmarkBridge::getIcon() const +LLUIImagePtr LLLandmarkBridge::getIcon() const { return get_item_icon(LLAssetType::AT_LANDMARK, LLInventoryType::IT_LANDMARK, mVisited, FALSE); } @@ -2695,7 +2694,7 @@ void LLCallingCardBridge::performAction(LLFolderView* folder, LLInventoryModel* else LLItemBridge::performAction(folder, model, action); } -LLViewerImage* LLCallingCardBridge::getIcon() const +LLUIImagePtr LLCallingCardBridge::getIcon() const { BOOL online = FALSE; LLViewerInventoryItem* item = getItem(); @@ -2855,7 +2854,7 @@ BOOL LLCallingCardBridge::dragOrDrop(MASK mask, BOOL drop, LLString LLNotecardBridge::sPrefix("Note: "); -LLViewerImage* LLNotecardBridge::getIcon() const +LLUIImagePtr LLNotecardBridge::getIcon() const { return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); } @@ -2923,7 +2922,7 @@ void LLNotecardBridge::openItem() LLString LLGestureBridge::sPrefix("Gesture: "); -LLViewerImage* LLGestureBridge::getIcon() const +LLUIImagePtr LLGestureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_GESTURE, LLInventoryType::IT_GESTURE, 0, FALSE); } @@ -3055,7 +3054,7 @@ void LLGestureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLString LLAnimationBridge::sPrefix("Animation: "); -LLViewerImage* LLAnimationBridge::getIcon() const +LLUIImagePtr LLAnimationBridge::getIcon() const { return get_item_icon(LLAssetType::AT_ANIMATION, LLInventoryType::IT_ANIMATION, 0, FALSE); } @@ -3173,7 +3172,7 @@ BOOL LLObjectBridge::isItemRemovable() return LLInvFVBridge::isItemRemovable(); } -LLViewerImage* LLObjectBridge::getIcon() const +LLUIImagePtr LLObjectBridge::getIcon() const { return get_item_icon(LLAssetType::AT_OBJECT, mInvType, mAttachPt, mIsMultiObject ); } @@ -3223,7 +3222,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model gObjectList.findObject(item->getUUID()); if (found_obj) { - gSelectMgr->remove(found_obj); + LLSelectMgr::getInstance()->remove(found_obj); } else { @@ -3432,10 +3431,10 @@ BOOL LLObjectBridge::renameItem(const LLString& new_name) LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); if( obj ) { - gSelectMgr->deselectAll(); - gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); - gSelectMgr->selectionSetObjectName( new_name ); - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); + LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); + LLSelectMgr::getInstance()->selectionSetObjectName( new_name ); + LLSelectMgr::getInstance()->deselectAll(); } } } @@ -3450,7 +3449,7 @@ BOOL LLObjectBridge::renameItem(const LLString& new_name) LLString LLLSLTextBridge::sPrefix("Script: "); -LLViewerImage* LLLSLTextBridge::getIcon() const +LLUIImagePtr LLLSLTextBridge::getIcon() const { return get_item_icon(LLAssetType::AT_SCRIPT, LLInventoryType::IT_LSL, 0, FALSE); } @@ -4176,7 +4175,7 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata) LLViewerObject *found_obj = gObjectList.findObject( obj_item_array.get(i)->getUUID()); if (found_obj) { - gSelectMgr->remove(found_obj); + LLSelectMgr::getInstance()->remove(found_obj); } else { @@ -4243,7 +4242,7 @@ LLString LLWearableBridge::getLabelSuffix() const } } -LLViewerImage* LLWearableBridge::getIcon() const +LLUIImagePtr LLWearableBridge::getIcon() const { return get_item_icon(mAssetType, mInvType, mWearableType, FALSE); } diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 432854f62e..9fbdd09c40 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -235,7 +235,7 @@ public: virtual void selectItem(); virtual void restoreItem(); - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual const LLString& getDisplayName() const; virtual LLString getLabelSuffix() const; virtual PermissionMask getPermissionMask() const; @@ -275,7 +275,7 @@ public: virtual void restoreItem(); - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual BOOL renameItem(const LLString& new_name); virtual BOOL removeItem(); virtual BOOL isClipboardPasteable() const; @@ -337,7 +337,7 @@ class LLScriptBridge : public LLItemBridge { friend class LLInvFVBridge; public: - LLViewerImage* getIcon() const; + LLUIImagePtr getIcon() const; protected: LLScriptBridge( LLInventoryPanel* inventory, const LLUUID& uuid ) : @@ -351,7 +351,7 @@ class LLTextureBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -367,7 +367,7 @@ class LLSoundBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); virtual void previewItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); @@ -387,7 +387,7 @@ public: virtual const LLString& getPrefix() { return sPrefix; } virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -427,7 +427,7 @@ public: virtual LLString getLabelSuffix() const; //virtual const LLString& getDisplayName() const; - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); @@ -454,7 +454,7 @@ class LLNotecardBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -471,7 +471,7 @@ class LLGestureBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; // Only suffix for gesture items, not task items, because only // gestures in your inventory can be active. @@ -501,7 +501,7 @@ public: virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -519,7 +519,7 @@ class LLObjectBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void openItem(); virtual LLFontGL::StyleFlags getLabelStyle() const; @@ -552,7 +552,7 @@ class LLLSLTextBridge : public LLItemBridge public: virtual const LLString& getPrefix() { return sPrefix; } - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void openItem(); protected: @@ -568,7 +568,7 @@ class LLWearableBridge : public LLItemBridge { friend class LLInvFVBridge; public: - virtual LLViewerImage* getIcon() const; + virtual LLUIImagePtr getIcon() const; virtual void performAction(LLFolderView* folder, LLInventoryModel* model, LLString action); virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 17a8b84472..49f2256f61 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -930,6 +930,11 @@ void LLInventoryModel::removeObserver(LLInventoryObserver* observer) mObservers.erase(observer); } +BOOL LLInventoryModel::containsObserver(LLInventoryObserver* observer) +{ + return mObservers.find(observer) != mObservers.end(); +} + // Call this method when it's time to update everyone on a new state, // by default, the inventory model will not update observers // automatically. diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index c2ec01a1a0..6ec2af5d7b 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -243,6 +243,7 @@ public: // to remove it. void addObserver(LLInventoryObserver* observer); void removeObserver(LLInventoryObserver* observer); + BOOL containsObserver(LLInventoryObserver* observer); // // Misc Methods diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index 0027036b36..21dc28784b 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -48,6 +48,10 @@ #include "llglheaders.h" +static LLRegisterWidget<LLJoystickAgentSlide> r1("joystick_slide"); +static LLRegisterWidget<LLJoystickAgentTurn> r2("joystick_turn"); + + const F32 NUDGE_TIME = 0.25f; // in seconds const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed @@ -603,37 +607,33 @@ void LLJoystickCameraRotate::setToggleState( BOOL left, BOOL top, BOOL right, BO void LLJoystickCameraRotate::draw() { - - if( getVisible() ) - { - LLGLSUIDefault gls_ui; + LLGLSUIDefault gls_ui; - getImageUnselected()->draw( 0, 0 ); + getImageUnselected()->draw( 0, 0 ); - if( mInTop ) - { - drawRotatedImage( getImageSelected()->getImage(), 0 ); - } + if( mInTop ) + { + drawRotatedImage( getImageSelected()->getImage(), 0 ); + } - if( mInRight ) - { - drawRotatedImage( getImageSelected()->getImage(), 1 ); - } + if( mInRight ) + { + drawRotatedImage( getImageSelected()->getImage(), 1 ); + } - if( mInBottom ) - { - drawRotatedImage( getImageSelected()->getImage(), 2 ); - } + if( mInBottom ) + { + drawRotatedImage( getImageSelected()->getImage(), 2 ); + } - if( mInLeft ) - { - drawRotatedImage( getImageSelected()->getImage(), 3 ); - } + if( mInLeft ) + { + drawRotatedImage( getImageSelected()->getImage(), 3 ); + } - if (sDebugRects) - { - drawDebugRect(); - } + if (sDebugRects) + { + drawDebugRect(); } } @@ -722,8 +722,8 @@ LLJoystickCameraZoom::LLJoystickCameraZoom(const LLString& name, LLRect rect, co mInTop( FALSE ), mInBottom( FALSE ) { - mPlusInImage = gImageList.getImage(LLUI::findAssetUUIDByName(plus_in_img), MIPMAP_FALSE, TRUE); - mMinusInImage = gImageList.getImage(LLUI::findAssetUUIDByName(minus_in_img), MIPMAP_FALSE, TRUE); + mPlusInImage = LLUIImageList::getInstance()->getUIImage(plus_in_img); + mMinusInImage = LLUIImageList::getInstance()->getUIImage(minus_in_img); } @@ -789,26 +789,23 @@ void LLJoystickCameraZoom::setToggleState( BOOL top, BOOL bottom ) void LLJoystickCameraZoom::draw() { - if( getVisible() ) + if( mInTop ) { - if( mInTop ) - { - gl_draw_image( 0, 0, mPlusInImage ); - } - else - if( mInBottom ) - { - gl_draw_image( 0, 0, mMinusInImage ); - } - else - { - getImageUnselected()->draw( 0, 0 ); - } + mPlusInImage->draw(0,0); + } + else + if( mInBottom ) + { + mMinusInImage->draw(0,0); + } + else + { + getImageUnselected()->draw( 0, 0 ); + } - if (sDebugRects) - { - drawDebugRect(); - } + if (sDebugRects) + { + drawDebugRect(); } } diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h index 2cd53b4146..e2d95e184e 100644 --- a/indra/newview/lljoystickbutton.h +++ b/indra/newview/lljoystickbutton.h @@ -94,9 +94,6 @@ public: : LLJoystick(name, rect, default_image, selected_image, initial) { } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_JOYSTICK_TURN; } - virtual LLString getWidgetTag() const { return LL_JOYSTICK_TURN; } - virtual void onHeldDown(); static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -113,10 +110,6 @@ public: : LLJoystick(name, rect, default_image, selected_image, initial) { } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_JOYSTICK_SLIDE; } - virtual LLString getWidgetTag() const { return LL_JOYSTICK_SLIDE; } - - virtual void onHeldDown(); virtual void onMouseUp(); @@ -183,8 +176,8 @@ protected: protected: BOOL mInTop; BOOL mInBottom; - LLPointer<LLViewerImage> mPlusInImage; - LLPointer<LLViewerImage> mMinusInImage; + LLUIImagePtr mPlusInImage; + LLUIImagePtr mMinusInImage; }; diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 1d23dff54d..59b4d245ac 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -115,10 +115,7 @@ void LLLandmarkList::processGetAssetReply( } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status ) { diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 9b6ef2d079..af682508c9 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -53,7 +53,7 @@ #include "llviewerobject.h" #include "llviewerwindow.h" #include "llvoavatar.h" -#include "llworld.h" // for gWorldPointer +#include "llworld.h" // for LLWorld::getInstance() #include "llresmgr.h" #include "pipeline.h" #include "llglheaders.h" @@ -106,14 +106,14 @@ void LLManip::getManipNormal(LLViewerObject* object, EManipPart manip, LLVector3 LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); if (manip >= LL_X_ARROW && manip <= LL_Z_ARROW) { LLVector3 arrow_axis; getManipAxis(object, manip, arrow_axis); - LLVector3 cross = arrow_axis % gCamera->getAtAxis(); + LLVector3 cross = arrow_axis % LLViewerCamera::getInstance()->getAtAxis(); normal = cross % arrow_axis; normal.normVec(); } @@ -148,7 +148,7 @@ BOOL LLManip::getManipAxis(LLViewerObject* object, EManipPart manip, LLVector3 & LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); if (manip == LL_X_ARROW) { @@ -181,12 +181,12 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto } else { - cam_to_reference = reference_point - gCamera->getOrigin(); + cam_to_reference = reference_point - LLViewerCamera::getInstance()->getOrigin(); } F32 current_range = cam_to_reference.normVec(); F32 projected_translation_axis_length = (translate_axis % cam_to_reference).magVec(); - F32 subdivisions = llmax(projected_translation_axis_length * grid_scale / (current_range / gCamera->getPixelMeterRatio() * min_pixel_spacing), 0.f); + F32 subdivisions = llmax(projected_translation_axis_length * grid_scale / (current_range / LLViewerCamera::getInstance()->getPixelMeterRatio() * min_pixel_spacing), 0.f); subdivisions = llclamp((F32)pow(2.f, llfloor(log(subdivisions) / log(2.f))), 1.f / 32.f, 32.f); return subdivisions; @@ -194,7 +194,7 @@ F32 LLManip::getSubdivisionLevel(const LLVector3 &reference_point, const LLVecto void LLManip::handleSelect() { - mObjectSelection = gSelectMgr->getEditSelection(); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); } void LLManip::handleDeselect() @@ -260,7 +260,7 @@ BOOL LLManip::getMousePointOnPlaneGlobal(LLVector3d& point, S32 x, S32 y, LLVect if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { BOOL result = FALSE; - F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidth() - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; + F32 mouse_x = ((F32)x / gViewerWindow->getWindowWidth() - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; F32 mouse_y = ((F32)y / gViewerWindow->getWindowHeight() - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; LLVector3 origin_agent = gAgent.getPosAgentFromGlobal(origin); @@ -299,7 +299,7 @@ BOOL LLManip::nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, co if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) * gCamera->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; + F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) * LLViewerCamera::getInstance()->getAspect() / gAgent.getAvatarObject()->mHUDCurZoom; F32 mouse_y = (((F32)y / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; a1 = LLVector3(llmin(b1.mV[VX] - 0.1f, b2.mV[VX] - 0.1f, 0.f), -mouse_x, mouse_y); a2 = a1 + LLVector3(1.f, 0.f, 0.f); @@ -342,7 +342,7 @@ BOOL LLManip::nearestPointOnLineFromMouse( S32 x, S32 y, const LLVector3& b1, co LLVector3 LLManip::getSavedPivotPoint() const { - return gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); + return LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent(); } LLVector3 LLManip::getPivotPoint() @@ -351,7 +351,7 @@ LLVector3 LLManip::getPivotPoint() { return mObjectSelection->getFirstObject()->getPivotPositionAgent(); } - return gSelectMgr->getBBoxOfSelection().getCenterAgent(); + return LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent(); } @@ -360,7 +360,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) LLVector3 grid_origin; LLQuaternion grid_rot; LLVector3 grid_scale; - gSelectMgr->getGrid(grid_origin, grid_rot, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rot, grid_scale); const BOOL children_ok = TRUE; LLViewerObject* object = mObjectSelection->getFirstRootObject(children_ok); @@ -369,7 +369,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) return; } - //LLVector3 center_agent = gSelectMgr->getBBoxOfSelection().getCenterAgent(); + //LLVector3 center_agent = LLSelectMgr::getInstance()->getBBoxOfSelection().getCenterAgent(); LLVector3 center_agent = getPivotPoint(); glPushMatrix(); @@ -381,7 +381,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) grid_rot.getAngleAxis(&angle_radians, &x, &y, &z); glRotatef(angle_radians * RAD_TO_DEG, x, y, z); - F32 region_size = gWorldPointer->getRegionWidthInMeters(); + F32 region_size = LLWorld::getInstance()->getRegionWidthInMeters(); const F32 LINE_ALPHA = 0.33f; @@ -423,29 +423,24 @@ void LLManip::renderXYZ(const LLVector3 &vec) { const S32 PAD = 10; char feedback_string[128]; /*Flawfinder: ignore*/ - LLVector3 camera_pos = gCamera->getOrigin() + gCamera->getAtAxis(); + LLVector3 camera_pos = LLViewerCamera::getInstance()->getOrigin() + LLViewerCamera::getInstance()->getAtAxis(); S32 vertical_offset = gViewerWindow->getWindowHeight() / 2 - VERTICAL_OFFSET; S32 window_center_x = gViewerWindow->getWindowWidth() / 2; S32 window_center_y = gViewerWindow->getWindowHeight() / 2; - LLUUID image_id; - image_id.set(gViewerArt.getString("rounded_square.tga")); - LLViewerImage* imagep = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - glPushMatrix(); { + LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga"); gViewerWindow->setup2DRender(); const LLVector2& display_scale = gViewerWindow->getDisplayScale(); glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); gGL.color4f(0.f, 0.f, 0.f, 0.7f); - gl_draw_scaled_image_with_border(window_center_x - 115, + imagep->draw( + window_center_x - 115, window_center_y + vertical_offset - PAD, - 16, - 16, 235, PAD * 2 + 10, - imagep, LLColor4(0.f, 0.f, 0.f, 0.7f) ); } glPopMatrix(); @@ -457,31 +452,31 @@ void LLManip::renderXYZ(const LLVector3 &vec) LLGLDepthTest gls_depth(GL_FALSE); // render drop shadowed text snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f + 1.f, (F32)vertical_offset - 1.f, LLColor4::black, FALSE); // render text on top snprintf(feedback_string, sizeof(feedback_string), "X: %.3f", vec.mV[VX]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -102.f, (F32)vertical_offset, LLColor4(1.f, 0.5f, 0.5f, 1.f), FALSE); glColor3f(0.5f, 1.f, 0.5f); snprintf(feedback_string, sizeof(feedback_string), "Y: %.3f", vec.mV[VY]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, -27.f, (F32)vertical_offset, LLColor4(0.5f, 1.f, 0.5f, 1.f), FALSE); glColor3f(0.5f, 0.5f, 1.f); snprintf(feedback_string, sizeof(feedback_string), "Z: %.3f", vec.mV[VZ]); /* Flawfinder: ignore */ - hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *gResMgr->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); + hud_render_text(utf8str_to_wstring(feedback_string), camera_pos, *LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ), LLFontGL::NORMAL, 48.f, (F32)vertical_offset, LLColor4(0.5f, 0.5f, 1.f, 1.f), FALSE); } } void LLManip::renderTickText(const LLVector3& pos, const char* text, const LLColor4 &color) { - const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* big_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); BOOL hud_selection = mObjectSelection->getSelectType() == SELECT_TYPE_HUD; glMatrixMode(GL_MODELVIEW); @@ -511,8 +506,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi { LLLocale locale(LLLocale::USER_LOCALE); - const LLFontGL* big_fontp = gResMgr->getRes( LLFONT_SANSSERIF ); - const LLFontGL* small_fontp = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* big_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); + const LLFontGL* small_fontp = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); char val_string[128]; /*Flawfinder: ignore*/ char fraction_string[128]; /*Flawfinder: ignore*/ @@ -559,7 +554,7 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const char* suffi if (fractional_portion != 0) { - snprintf(fraction_string, sizeof(fraction_string), "%c%02d%s", gResMgr->getDecimalPoint(), fractional_portion, suffix); /* Flawfinder: ignore */ + snprintf(fraction_string, sizeof(fraction_string), "%c%02d%s", LLResMgr::getInstance()->getDecimalPoint(), fractional_portion, suffix); /* Flawfinder: ignore */ gViewerWindow->setupViewport(1, -1); hud_render_utf8text(val_string, render_pos, *big_fontp, LLFontGL::NORMAL, -1.f * big_fontp->getWidthF32(val_string), 3.f, shadow_color, hud_selection); diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index fb85c81d01..d98de5cb80 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -54,7 +54,6 @@ #include "llstatusbar.h" #include "llui.h" #include "llvoavatar.h" -#include "llviewborder.h" #include "llviewercamera.h" #include "llviewerobject.h" #include "llviewerobject.h" @@ -109,7 +108,7 @@ LLManipRotate::LLManipRotate( LLToolComposite* composite ) void LLManipRotate::handleSelect() { // *FIX: put this in mouseDown? - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); gFloaterTools->setStatusText("rotate"); LLManip::handleSelect(); } @@ -225,7 +224,7 @@ void LLManipRotate::render() LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); grid_rotation.getAngleAxis(&angle_radians, &x, &y, &z); glRotatef(angle_radians * RAD_TO_DEG, x, y, z); @@ -386,10 +385,10 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) highlightManipulators(x, y); S32 hit_part = mHighlightedPart; // we just started a drag, so save initial object positions - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_ROTATE); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_ROTATE); // save selection center - mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() ); //gSelectMgr->getSelectionCenterGlobal(); + mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() ); //LLSelectMgr::getInstance()->getSelectionCenterGlobal(); mManipPart = (EManipPart)hit_part; LLVector3 center = gAgent.getPosAgentFromGlobal( mRotationCenter ); @@ -435,7 +434,7 @@ BOOL LLManipRotate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) // Route future Mouse messages here preemptively. (Release on mouse up.) setMouseCapture( TRUE ); - gSelectMgr->enableSilhouette(FALSE); + LLSelectMgr::getInstance()->enableSilhouette(FALSE); return TRUE; } @@ -461,12 +460,12 @@ BOOL LLManipRotate::handleMouseUp(S32 x, S32 y, MASK mask) mManipPart = LL_NO_PART; // Might have missed last update due to timing. - gSelectMgr->sendMultipleUpdate( UPD_ROTATION | UPD_POSITION ); - gSelectMgr->enableSilhouette(TRUE); + LLSelectMgr::getInstance()->sendMultipleUpdate( UPD_ROTATION | UPD_POSITION ); + LLSelectMgr::getInstance()->enableSilhouette(TRUE); //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); - gSelectMgr->updateSelectionCenter(); - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->updateSelectionCenter(); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } return LLManip::handleMouseUp(x, y, mask); @@ -635,7 +634,7 @@ void LLManipRotate::drag( S32 x, S32 y ) if (object->isRootEdit() && !object->isAttachment()) { LLVector3d new_pos_global = gAgent.getPosGlobalFromAgent(new_position); - new_pos_global = gWorldp->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); + new_pos_global = LLWorld::getInstance()->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); new_position = gAgent.getPosAgentFromGlobal(new_pos_global); } @@ -704,8 +703,8 @@ void LLManipRotate::drag( S32 x, S32 y ) } // store changes to override updates - for (LLObjectSelection::iterator iter = gSelectMgr->getSelection()->begin(); - iter != gSelectMgr->getSelection()->end(); iter++) + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); @@ -716,7 +715,7 @@ void LLManipRotate::drag( S32 x, S32 y ) } } - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); // RN: just clear focus so camera doesn't follow spurious object updates gAgent.clearFocusObject(); @@ -744,7 +743,7 @@ void LLManipRotate::renderSnapGuides() LLQuaternion grid_rotation; LLVector3 constraint_axis = getConstraintAxis(); - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); if (!gSavedSettings.getBOOL("SnapEnabled")) { @@ -771,7 +770,7 @@ void LLManipRotate::renderSnapGuides() { test_axis = test_axis * ~grid_rotation; } - else if (gSelectMgr->getGridMode() == GRID_MODE_REF_OBJECT) + else if (LLSelectMgr::getInstance()->getGridMode() == GRID_MODE_REF_OBJECT) { test_axis = test_axis * ~grid_rotation; constrain_to_ref_object = TRUE; @@ -1118,7 +1117,7 @@ BOOL LLManipRotate::updateVisiblity() // JC - 03.26.2002 if (!hasMouseCapture()) { - mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() );//gSelectMgr->getSelectionCenterGlobal(); + mRotationCenter = gAgent.getPosGlobalFromAgent( getPivotPoint() );//LLSelectMgr::getInstance()->getSelectionCenterGlobal(); } BOOL visible = FALSE; @@ -1130,7 +1129,7 @@ BOOL LLManipRotate::updateVisiblity() mCenterToCamNorm = mCenterToCam; mCenterToCamMag = mCenterToCamNorm.normVec(); - mRadiusMeters = RADIUS_PIXELS / (F32) gCamera->getViewHeightInPixels(); + mRadiusMeters = RADIUS_PIXELS / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); mRadiusMeters /= gAgent.getAvatarObject()->mHUDCurZoom; mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag; @@ -1142,13 +1141,13 @@ BOOL LLManipRotate::updateVisiblity() } else { - visible = gCamera->projectPosAgentToScreen(center, mCenterScreen ); + visible = LLViewerCamera::getInstance()->projectPosAgentToScreen(center, mCenterScreen ); if( visible ) { mCenterToCam = gAgent.getCameraPositionAgent() - center; mCenterToCamNorm = mCenterToCam; mCenterToCamMag = mCenterToCamNorm.normVec(); - LLVector3 cameraAtAxis = gCamera->getAtAxis(); + LLVector3 cameraAtAxis = LLViewerCamera::getInstance()->getAtAxis(); cameraAtAxis.normVec(); F32 z_dist = -1.f * (mCenterToCam * cameraAtAxis); @@ -1165,8 +1164,8 @@ BOOL LLManipRotate::updateVisiblity() if (mCenterToCamMag > 0.001f) { - F32 fraction_of_fov = RADIUS_PIXELS / (F32) gCamera->getViewHeightInPixels(); - F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians + F32 fraction_of_fov = RADIUS_PIXELS / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); + F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians mRadiusMeters = z_dist * tan(apparent_angle); mCenterToProfilePlaneMag = mRadiusMeters * mRadiusMeters / mCenterToCamMag; @@ -1274,7 +1273,7 @@ LLVector3 LLManipRotate::getConstraintAxis() LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLSelectNode* first_node = mObjectSelection->getFirstMoveableNode(TRUE); if (first_node) @@ -1301,7 +1300,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLVector3 axis1; LLVector3 axis2; @@ -1311,7 +1310,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { test_axis = test_axis * ~grid_rotation; } - else if (gSelectMgr->getGridMode() == GRID_MODE_REF_OBJECT) + else if (LLSelectMgr::getInstance()->getGridMode() == GRID_MODE_REF_OBJECT) { test_axis = test_axis * ~grid_rotation; } @@ -1335,7 +1334,7 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y ) { axis1 = axis1 * grid_rotation; } - else if (gSelectMgr->getGridMode() == GRID_MODE_REF_OBJECT) + else if (LLSelectMgr::getInstance()->getGridMode() == GRID_MODE_REF_OBJECT) { axis1 = axis1 * grid_rotation; } @@ -1651,7 +1650,7 @@ LLVector3 LLManipRotate::intersectRayWithSphere( const LLVector3& ray_pt, const //static void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_dir ) { - if (gSelectMgr->getSelection()->getSelectType() == SELECT_TYPE_HUD) + if (LLSelectMgr::getInstance()->getSelection()->getSelectType() == SELECT_TYPE_HUD) { F32 mouse_x = (((F32)x / gViewerWindow->getWindowWidth()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; F32 mouse_y = ((((F32)y) / gViewerWindow->getWindowHeight()) - 0.5f) / gAgent.getAvatarObject()->mHUDCurZoom; @@ -1662,7 +1661,7 @@ void LLManipRotate::mouseToRay( S32 x, S32 y, LLVector3* ray_pt, LLVector3* ray_ else { *ray_pt = gAgent.getCameraPositionAgent(); - gCamera->projectScreenToPosAgent(x, y, ray_dir); + LLViewerCamera::getInstance()->projectScreenToPosAgent(x, y, ray_dir); *ray_dir -= *ray_pt; ray_dir->normVec(); } @@ -1672,7 +1671,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y ) { mHighlightedPart = LL_NO_PART; - //LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + //LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); LLViewerObject *first_object = mObjectSelection->getFirstMoveableObject(TRUE); if (!first_object) @@ -1691,7 +1690,7 @@ void LLManipRotate::highlightManipulators( S32 x, S32 y ) LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLVector3 rot_x_axis = LLVector3::x_axis * grid_rotation; LLVector3 rot_y_axis = LLVector3::y_axis * grid_rotation; diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 5252e3e3c6..cd9cd83968 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -159,9 +159,9 @@ inline void LLManipScale::conditionalHighlight( U32 part, const LLColor4* highli void LLManipScale::handleSelect() { - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); updateSnapGuides(bbox); - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); gFloaterTools->setStatusText("scale"); LLManip::handleSelect(); } @@ -226,13 +226,13 @@ void LLManipScale::render() const F32 BOX_HANDLE_BASE_SIZE = 50.0f; // box size in pixels = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR const F32 BOX_HANDLE_BASE_FACTOR = 0.2f; - LLVector3 center_agent = gAgent.getPosAgentFromGlobal(gSelectMgr->getSelectionCenterGlobal()); + LLVector3 center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); F32 range; F32 range_from_agent; if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { - mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) gCamera->getViewHeightInPixels(); + mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); mBoxHandleSize /= gAgent.getAvatarObject()->mHUDCurZoom; } else @@ -253,8 +253,8 @@ void LLManipScale::render() if (range > 0.001f) { // range != zero - F32 fraction_of_fov = BOX_HANDLE_BASE_SIZE / (F32) gCamera->getViewHeightInPixels(); - F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians + F32 fraction_of_fov = BOX_HANDLE_BASE_SIZE / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); + F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians mBoxHandleSize = range * tan(apparent_angle) * BOX_HANDLE_BASE_FACTOR; } else @@ -267,7 +267,7 @@ void LLManipScale::render() //////////////////////////////////////////////////////////////////////// // Draw bounding box - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); LLVector3 pos_agent = bbox.getPositionAgent(); LLQuaternion rot = bbox.getRotation(); @@ -338,10 +338,10 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) highlightManipulators(x, y); S32 hit_part = mHighlightedPart; - gSelectMgr->enableSilhouette(FALSE); + LLSelectMgr::getInstance()->enableSilhouette(FALSE); mManipPart = (EManipPart)hit_part; - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); LLVector3 box_center_agent = bbox.getCenterAgent(); LLVector3 box_corner_agent = bbox.localToAgent( unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox ) ); @@ -354,7 +354,7 @@ BOOL LLManipScale::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) mDragPointGlobal = mDragStartPointGlobal; // we just started a drag, so save initial object positions, orientations, and scales - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_SCALE); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_SCALE); // Route future Mouse messages here preemptively. (Release on mouse up.) setMouseCapture( TRUE ); @@ -384,16 +384,16 @@ BOOL LLManipScale::handleMouseUp(S32 x, S32 y, MASK mask) } //send texture update - gSelectMgr->adjustTexturesByScale(TRUE, getStretchTextures()); + LLSelectMgr::getInstance()->adjustTexturesByScale(TRUE, getStretchTextures()); - gSelectMgr->enableSilhouette(TRUE); + LLSelectMgr::getInstance()->enableSilhouette(TRUE); mManipPart = LL_NO_PART; // Might have missed last update due to UPDATE_DELAY timing - gSelectMgr->sendMultipleUpdate( mLastUpdateFlags ); + LLSelectMgr::getInstance()->sendMultipleUpdate( mLastUpdateFlags ); //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); } return LLManip::handleMouseUp(x, y, mask); } @@ -422,7 +422,7 @@ BOOL LLManipScale::handleHover(S32 x, S32 y, MASK mask) } // Patch up textures, if possible. - gSelectMgr->adjustTexturesByScale(FALSE, getStretchTextures()); + LLSelectMgr::getInstance()->adjustTexturesByScale(FALSE, getStretchTextures()); gViewerWindow->getWindow()->setCursor(UI_CURSOR_TOOLSCALE); return TRUE; @@ -434,7 +434,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) // If we have something selected, try to hit its manipulator handles. // Don't do this with nothing selected, as it kills the framerate. - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); if( canAffectSelection() ) { @@ -447,15 +447,15 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) transform *= cfr; LLMatrix4 window_scale; F32 zoom_level = 2.f * gAgent.getAvatarObject()->mHUDCurZoom; - window_scale.initAll(LLVector3(zoom_level / gCamera->getAspect(), zoom_level, 0.f), + window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f), LLQuaternion::DEFAULT, LLVector3::zero); transform *= window_scale; } else { - LLMatrix4 projMatrix = gCamera->getProjection(); - LLMatrix4 modelView = gCamera->getModelview(); + LLMatrix4 projMatrix = LLViewerCamera::getInstance()->getProjection(); + LLMatrix4 modelView = LLViewerCamera::getInstance()->getModelview(); transform.initAll(LLVector3(1.f, 1.f, 1.f), bbox.getRotation(), bbox.getPositionAgent()); transform *= modelView; @@ -819,8 +819,8 @@ void LLManipScale::drag( S32 x, S32 y ) } // store changes to override updates - for (LLObjectSelection::iterator iter = gSelectMgr->getSelection()->begin(); - iter != gSelectMgr->getSelection()->end(); iter++) + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++) { LLSelectNode* selectNode = *iter; LLViewerObject*cur = selectNode->getObject(); @@ -831,14 +831,14 @@ void LLManipScale::drag( S32 x, S32 y ) } } - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); gAgent.clearFocusObject(); } // Scale around the void LLManipScale::dragCorner( S32 x, S32 y ) { - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); // Suppress scale if mouse hasn't moved. if (x == mLastMouseX && y == mLastMouseY) @@ -1003,7 +1003,7 @@ void LLManipScale::dragCorner( S32 x, S32 y ) LLVector3d new_pos_global = drag_global + (selectNode->mSavedPositionGlobal - drag_global) * scale_factor; if (!cur->isAttachment()) { - new_pos_global = gWorldp->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); + new_pos_global = LLWorld::getInstance()->clipToVisibleRegions(selectNode->mSavedPositionGlobal, new_pos_global); } cur->setPositionAbsoluteGlobal( new_pos_global ); rebuild(cur); @@ -1081,7 +1081,7 @@ void LLManipScale::dragFace( S32 x, S32 y ) LLVector3 drag_start_dir_f; drag_start_dir_f.setVec(drag_start_dir_d); - LLBBox bbox = gSelectMgr->getBBoxOfSelection(); + LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); F32 s = 0; F32 t = 0; @@ -1224,7 +1224,7 @@ void LLManipScale::sendUpdates( BOOL send_position_update, BOOL send_scale_updat // enforce minimum update delay and don't stream updates on sub-object selections if( elapsed_time > UPDATE_DELAY && !gSavedSettings.getBOOL("EditLinkedParts") ) { - gSelectMgr->sendMultipleUpdate( update_flags ); + LLSelectMgr::getInstance()->sendMultipleUpdate( update_flags ); update_timer.reset(); mSendUpdateOnMouseUp = FALSE; } @@ -1288,7 +1288,7 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto if (cur->isRootEdit() && !cur->isAttachment()) { - LLVector3d new_pos_global = gWorldp->clipToVisibleRegions(selectNode->mSavedPositionGlobal, selectNode->mSavedPositionGlobal + delta_pos_global); + LLVector3d new_pos_global = LLWorld::getInstance()->clipToVisibleRegions(selectNode->mSavedPositionGlobal, selectNode->mSavedPositionGlobal + delta_pos_global); cur->setPositionGlobal( new_pos_global ); } else @@ -1340,7 +1340,7 @@ void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) guideline_end -= guideline_start; guideline_end.normVec(); - guideline_end *= gWorldPointer->getRegionWidthInMeters(); + guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters(); guideline_end += guideline_start; { @@ -1358,7 +1358,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) LLVector3 grid_origin; LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLVector3 box_corner_agent = bbox.localToAgent(unitVectorToLocalBBoxExtent( partToUnitVector( mManipPart ), bbox )); mScaleCenter = getUniform() ? bbox.getCenterAgent() : bbox.localToAgent(unitVectorToLocalBBoxExtent( -1.f * partToUnitVector( mManipPart ), bbox )); @@ -1372,8 +1372,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) } else { - F32 object_distance = dist_vec(mScaleCenter, gCamera->getOrigin()); - mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWindowWidth() * object_distance) / gCamera->getPixelMeterRatio(); + F32 object_distance = dist_vec(mScaleCenter, LLViewerCamera::getInstance()->getOrigin()); + mSnapRegimeOffset = (SNAP_GUIDE_SCREEN_OFFSET * gViewerWindow->getWindowWidth() * object_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); } LLVector3 cam_at_axis; F32 snap_guide_length; @@ -1384,9 +1384,9 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) } else { - cam_at_axis = gCamera->getAtAxis(); - F32 manipulator_distance = dist_vec(box_corner_agent, gCamera->getOrigin()); - snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWindowWidth() * manipulator_distance) / gCamera->getPixelMeterRatio(); + cam_at_axis = LLViewerCamera::getInstance()->getAtAxis(); + F32 manipulator_distance = dist_vec(box_corner_agent, LLViewerCamera::getInstance()->getOrigin()); + snap_guide_length = (SNAP_GUIDE_SCREEN_LENGTH * gViewerWindow->getWindowWidth() * manipulator_distance) / LLViewerCamera::getInstance()->getPixelMeterRatio(); } mSnapGuideLength = snap_guide_length / llmax(0.1f, (llmin(mSnapGuideDir1 * cam_at_axis, mSnapGuideDir2 * cam_at_axis))); @@ -1415,7 +1415,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) LLVector3 scale_snap = grid_scale; mScaleSnapUnit1 = scale_snap.scaleVec(partToUnitVector( mManipPart )).magVec(); mScaleSnapUnit2 = mScaleSnapUnit1; - mSnapGuideDir1 *= mSnapGuideDir1 * gCamera->getUpAxis() > 0.f ? 1.f : -1.f; + mSnapGuideDir1 *= mSnapGuideDir1 * LLViewerCamera::getInstance()->getUpAxis() > 0.f ? 1.f : -1.f; mSnapGuideDir2 = mSnapGuideDir1 * -1.f; mSnapDir1 = mScaleDir; mSnapDir2 = mScaleDir; @@ -1430,7 +1430,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox) } else { - local_camera_dir = (gCamera->getOrigin() - bbox.getCenterAgent()) * ~bbox.getRotation(); + local_camera_dir = (LLViewerCamera::getInstance()->getOrigin() - bbox.getCenterAgent()) * ~bbox.getRotation(); local_camera_dir.normVec(); } local_scale_dir -= projected_vec(local_scale_dir, local_camera_dir); @@ -1622,7 +1622,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) gGL.end(); } - LLVector2 screen_translate_axis(llabs(mScaleDir * gCamera->getLeftAxis()), llabs(mScaleDir * gCamera->getUpAxis())); + LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normVec(); S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); @@ -1728,7 +1728,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) LLVector3 text_origin = tick_pos + (mSnapGuideDir1 * mSnapRegimeOffset * (1.f + tick_scale)); - EGridMode grid_mode = gSelectMgr->getGridMode(); + EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 tick_val; if (grid_mode == GRID_MODE_WORLD) { @@ -1780,7 +1780,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) LLVector3 text_origin = tick_pos + (mSnapGuideDir2 * mSnapRegimeOffset * (1.f + tick_scale)); - EGridMode grid_mode = gSelectMgr->getGridMode(); + EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 tick_val; if (grid_mode == GRID_MODE_WORLD) { @@ -1814,10 +1814,10 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText) { - LLVector3 selection_center_start = gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); + LLVector3 selection_center_start = LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent(); LLVector3 offset_dir; - if (mSnapGuideDir1 * gCamera->getAtAxis() > mSnapGuideDir2 * gCamera->getAtAxis()) + if (mSnapGuideDir1 * LLViewerCamera::getInstance()->getAtAxis() > mSnapGuideDir2 * LLViewerCamera::getInstance()->getAtAxis()) { offset_dir = mSnapGuideDir2; } @@ -1834,7 +1834,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, grid_alpha, 0.f); hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); help_text = "to snap to grid"; - help_text_pos -= gCamera->getUpAxis() * mSnapRegimeOffset * 0.4f; + help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapRegimeOffset * 0.4f; hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); } } diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 98d67f3804..9856b47830 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -252,7 +252,7 @@ LLManipTranslate::~LLManipTranslate() void LLManipTranslate::handleSelect() { - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); gFloaterTools->setStatusText("move"); LLManip::handleSelect(); } @@ -309,12 +309,12 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) mHelpTextTimer.reset(); sNumTimesHelpTextShown++; - gSelectMgr->getGrid(mGridOrigin, mGridRotation, mGridScale); + LLSelectMgr::getInstance()->getGrid(mGridOrigin, mGridRotation, mGridScale); - gSelectMgr->enableSilhouette(FALSE); + LLSelectMgr::getInstance()->enableSilhouette(FALSE); // we just started a drag, so save initial object positions - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_MOVE); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_MOVE); mManipPart = (EManipPart)hit_part; mMouseDownX = x; @@ -345,7 +345,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) BOOL axis_exists = getManipAxis(selected_object, mManipPart, axis); getManipNormal(selected_object, mManipPart, mManipNormal); - //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(gSelectMgr->getSelectionCenterGlobal()); + //LLVector3 select_center_agent = gAgent.getPosAgentFromGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal()); // TomY: The above should (?) be identical to the below LLVector3 select_center_agent = getPivotPoint(); mSubdivisions = llclamp(getSubdivisionLevel(select_center_agent, axis_exists ? axis : LLVector3::z_axis, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); @@ -354,7 +354,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) if (mManipPart >= LL_YZ_PLANE && mManipPart <= LL_XY_PLANE) { LLCoordGL mouse_pos; - if (!gCamera->projectPosAgentToScreen(select_center_agent, mouse_pos)) + if (!LLViewerCamera::getInstance()->projectPosAgentToScreen(select_center_agent, mouse_pos)) { // mouse_pos may be nonsense llwarns << "Failed to project object center to screen" << llendl; @@ -367,7 +367,7 @@ BOOL LLManipTranslate::handleMouseDownOnPart( S32 x, S32 y, MASK mask ) } } - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); LLVector3d object_start_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); getMousePointOnPlaneGlobal(mDragCursorStartGlobal, x, y, object_start_global, mManipNormal); mDragSelectionStartGlobal = object_start_global; @@ -445,7 +445,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) if (mask == MASK_COPY) { // ...we're trying to make a copy - gSelectMgr->selectDuplicate(LLVector3::zero, FALSE); + LLSelectMgr::getInstance()->selectDuplicate(LLVector3::zero, FALSE); mCopyMadeThisDrag = TRUE; // When we make the copy, we don't want to do any other processing. @@ -487,7 +487,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) axis_d.setVec(axis_f); - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); LLVector3d current_pos_global = gAgent.getPosGlobalFromAgent(getPivotPoint()); mSubdivisions = llclamp(getSubdivisionLevel(getPivotPoint(), axis_f, getMinGridScale()), sGridMinSubdivisionLevel, sGridMaxSubdivisionLevel); @@ -558,7 +558,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) // snap to planar grid LLVector3 cursor_point_agent = gAgent.getPosAgentFromGlobal(cursor_point_global); - LLVector3 camera_plane_projection = gCamera->getAtAxis(); + LLVector3 camera_plane_projection = LLViewerCamera::getInstance()->getAtAxis(); camera_plane_projection -= projected_vec(camera_plane_projection, mManipNormal); camera_plane_projection.normVec(); LLVector3 camera_projected_dir = camera_plane_projection; @@ -709,7 +709,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) LLVector3d new_position_global = selectNode->mSavedPositionGlobal + clamped_relative_move; // Don't let object centers go too far underground - F64 min_height = gWorldp->getMinAllowedZ(object); + F64 min_height = LLWorld::getInstance()->getMinAllowedZ(object); if (new_position_global.mdV[VZ] < min_height) { new_position_global.mdV[VZ] = min_height; @@ -724,12 +724,12 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) // Grass is always drawn on the ground, so clamp its position to the ground if (object->getPCode() == LL_PCODE_LEGACY_GRASS) { - new_position_global.mdV[VZ] = gWorldp->resolveLandHeightGlobal(new_position_global) + 1.f; + new_position_global.mdV[VZ] = LLWorld::getInstance()->resolveLandHeightGlobal(new_position_global) + 1.f; } if (object->isRootEdit()) { - new_position_global = gWorldp->clipToVisibleRegions(object->getPositionGlobal(), new_position_global); + new_position_global = LLWorld::getInstance()->clipToVisibleRegions(object->getPositionGlobal(), new_position_global); } // PR: Only update if changed @@ -776,7 +776,7 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } } - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); gAgent.clearFocusObject(); dialog_refresh_all(); // ??? is this necessary? @@ -794,9 +794,9 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) return; } - //LLBBox bbox = gSelectMgr->getBBoxOfSelection(); - LLMatrix4 projMatrix = gCamera->getProjection(); - LLMatrix4 modelView = gCamera->getModelview(); + //LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); + LLMatrix4 projMatrix = LLViewerCamera::getInstance()->getProjection(); + LLMatrix4 modelView = LLViewerCamera::getInstance()->getModelview(); LLVector3 object_position = getPivotPoint(); @@ -804,7 +804,7 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLVector3 relative_camera_dir; @@ -819,14 +819,14 @@ void LLManipTranslate::highlightManipulators(S32 x, S32 y) transform *= cfr; LLMatrix4 window_scale; F32 zoom_level = 2.f * gAgent.getAvatarObject()->mHUDCurZoom; - window_scale.initAll(LLVector3(zoom_level / gCamera->getAspect(), zoom_level, 0.f), + window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f), LLQuaternion::DEFAULT, LLVector3::zero); transform *= window_scale; } else { - relative_camera_dir = (object_position - gCamera->getOrigin()) * ~grid_rotation; + relative_camera_dir = (object_position - LLViewerCamera::getInstance()->getOrigin()) * ~grid_rotation; relative_camera_dir.normVec(); transform.initRotTrans(grid_rotation, LLVector4(object_position)); @@ -1036,13 +1036,13 @@ BOOL LLManipTranslate::handleMouseUp(S32 x, S32 y, MASK mask) { // make sure arrow colors go back to normal mManipPart = LL_NO_PART; - gSelectMgr->enableSilhouette(TRUE); + LLSelectMgr::getInstance()->enableSilhouette(TRUE); // Might have missed last update due to UPDATE_DELAY timing. - gSelectMgr->sendMultipleUpdate( UPD_POSITION ); + LLSelectMgr::getInstance()->sendMultipleUpdate( UPD_POSITION ); mInSnapRegime = FALSE; - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_PICK); //gAgent.setObjectTracking(gSavedSettings.getBOOL("TrackFocusObject")); } @@ -1105,8 +1105,8 @@ void LLManipTranslate::renderSnapGuides() LLVector3 grid_scale; LLQuaternion grid_rotation; - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); - LLVector3 saved_selection_center = getSavedPivotPoint(); //gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); + LLVector3 saved_selection_center = getSavedPivotPoint(); //LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent(); LLVector3 selection_center = getPivotPoint(); LLViewerObject *first_object = first_node->getObject(); @@ -1149,7 +1149,7 @@ void LLManipTranslate::renderSnapGuides() } else { - at_axis_abs = saved_selection_center - gCamera->getOrigin(); + at_axis_abs = saved_selection_center - LLViewerCamera::getInstance()->getOrigin(); at_axis_abs.normVec(); at_axis_abs = at_axis_abs * ~grid_rotation; @@ -1225,14 +1225,14 @@ void LLManipTranslate::renderSnapGuides() } else { - LLVector3 cam_to_selection = getPivotPoint() - gCamera->getOrigin(); + LLVector3 cam_to_selection = getPivotPoint() - LLViewerCamera::getInstance()->getOrigin(); F32 current_range = cam_to_selection.normVec(); - guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWindowHeight() * current_range / gCamera->getPixelMeterRatio(); + guide_size_meters = SNAP_GUIDE_SCREEN_SIZE * gViewerWindow->getWindowHeight() * current_range / LLViewerCamera::getInstance()->getPixelMeterRatio(); - F32 fraction_of_fov = mAxisArrowLength / (F32) gCamera->getViewHeightInPixels(); - F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians + F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); + F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians F32 offset_at_camera = tan(apparent_angle) * 1.5f; - F32 range = dist_vec(gAgent.getPosAgentFromGlobal(first_node->mSavedPositionGlobal), gCamera->getOrigin()); + F32 range = dist_vec(gAgent.getPosAgentFromGlobal(first_node->mSavedPositionGlobal), LLViewerCamera::getInstance()->getOrigin()); mSnapOffsetMeters = range * offset_at_camera; } @@ -1362,7 +1362,7 @@ void LLManipTranslate::renderSnapGuides() sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale); - LLVector2 screen_translate_axis(llabs(translate_axis * gCamera->getLeftAxis()), llabs(translate_axis * gCamera->getUpAxis())); + LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis())); screen_translate_axis.normVec(); S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing); @@ -1387,7 +1387,7 @@ void LLManipTranslate::renderSnapGuides() { F32 snap_offset_meters; - if (mSnapOffsetAxis * gCamera->getUpAxis() > 0.f) + if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f) { snap_offset_meters = mSnapOffsetMeters; } @@ -1401,7 +1401,7 @@ void LLManipTranslate::renderSnapGuides() LLVector3 tick_offset = (tick_pos - mGridOrigin) * ~mGridRotation; F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale(); - EGridMode grid_mode = gSelectMgr->getGridMode(); + EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode(); F32 text_highlight = 0.8f; if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime) { @@ -1426,7 +1426,7 @@ void LLManipTranslate::renderSnapGuides() if (mHelpTextTimer.getElapsedTimeF32() < sHelpTextVisibleTime + sHelpTextFadeTime && sNumTimesHelpTextShown < sMaxTimesShowHelpText) { F32 snap_offset_meters_up; - if (mSnapOffsetAxis * gCamera->getUpAxis() > 0.f) + if (mSnapOffsetAxis * LLViewerCamera::getInstance()->getUpAxis() > 0.f) { snap_offset_meters_up = mSnapOffsetMeters; } @@ -1435,7 +1435,7 @@ void LLManipTranslate::renderSnapGuides() snap_offset_meters_up = -mSnapOffsetMeters; } - LLVector3 selection_center_start = getSavedPivotPoint();//gSelectMgr->getSavedBBoxOfSelection().getCenterAgent(); + LLVector3 selection_center_start = getSavedPivotPoint();//LLSelectMgr::getInstance()->getSavedBBoxOfSelection().getCenterAgent(); LLVector3 help_text_pos = selection_center_start + (snap_offset_meters_up * 3.f * mSnapOffsetAxis); const LLFontGL* big_fontp = LLFontGL::sSansSerif; @@ -1445,7 +1445,7 @@ void LLManipTranslate::renderSnapGuides() help_text_color.mV[VALPHA] = clamp_rescale(mHelpTextTimer.getElapsedTimeF32(), sHelpTextVisibleTime, sHelpTextVisibleTime + sHelpTextFadeTime, line_alpha, 0.f); hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); help_text = "to snap to grid"; - help_text_pos -= gCamera->getUpAxis() * mSnapOffsetMeters * 0.2f; + help_text_pos -= LLViewerCamera::getInstance()->getUpAxis() * mSnapOffsetMeters * 0.2f; hud_render_utf8text(help_text, help_text_pos, *big_fontp, LLFontGL::NORMAL, -0.5f * big_fontp->getWidthF32(help_text), 3.f, help_text_color, mObjectSelection->getSelectType() == SELECT_TYPE_HUD); } } @@ -1655,7 +1655,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, //setup clip plane normal = normal * grid_rotation; - if (normal * (gCamera->getOrigin()-selection_center) < 0) + if (normal * (LLViewerCamera::getInstance()->getOrigin()-selection_center) < 0) { normal = -normal; } @@ -1756,7 +1756,7 @@ void LLManipTranslate::renderTranslationHandles() LLQuaternion grid_rotation; LLGLDepthTest gls_depth(GL_FALSE); - gSelectMgr->getGrid(grid_origin, grid_rotation, grid_scale); + LLSelectMgr::getInstance()->getGrid(grid_origin, grid_rotation, grid_scale); LLVector3 at_axis; if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) { @@ -1764,7 +1764,7 @@ void LLManipTranslate::renderTranslationHandles() } else { - at_axis = gCamera->getAtAxis() * ~grid_rotation; + at_axis = LLViewerCamera::getInstance()->getAtAxis() * ~grid_rotation; } if (at_axis.mV[VX] > 0.f) @@ -1823,8 +1823,8 @@ void LLManipTranslate::renderTranslationHandles() if (range > 0.001f) { // range != zero - F32 fraction_of_fov = mAxisArrowLength / (F32) gCamera->getViewHeightInPixels(); - F32 apparent_angle = fraction_of_fov * gCamera->getView(); // radians + F32 fraction_of_fov = mAxisArrowLength / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); + F32 apparent_angle = fraction_of_fov * LLViewerCamera::getInstance()->getView(); // radians mArrowLengthMeters = range * tan(apparent_angle); } else @@ -1859,7 +1859,7 @@ void LLManipTranslate::renderTranslationHandles() } else { - relative_camera_dir = (selection_center - gCamera->getOrigin()) * invRotation; + relative_camera_dir = (selection_center - LLViewerCamera::getInstance()->getOrigin()) * invRotation; } relative_camera_dir.normVec(); diff --git a/indra/newview/llmemoryview.cpp b/indra/newview/llmemoryview.cpp index d554c272ee..4b4b0a36dc 100644 --- a/indra/newview/llmemoryview.cpp +++ b/indra/newview/llmemoryview.cpp @@ -67,16 +67,6 @@ LLMemoryView::~LLMemoryView() { } -EWidgetType LLMemoryView::getWidgetType() const -{ - return WIDGET_TYPE_MEMORY_VIEW; -} - -LLString LLMemoryView::getWidgetTag() const -{ - return LL_MEMORY_VIEW_TAG; -} - BOOL LLMemoryView::handleMouseDown(S32 x, S32 y, MASK mask) { if (mask & MASK_SHIFT) diff --git a/indra/newview/llmemoryview.h b/indra/newview/llmemoryview.h index 88889d18de..625499fab3 100644 --- a/indra/newview/llmemoryview.h +++ b/indra/newview/llmemoryview.h @@ -40,9 +40,6 @@ public: LLMemoryView(const std::string& name, const LLRect& rect); virtual ~LLMemoryView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 080413bb56..9c3c374a79 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -62,7 +62,7 @@ #include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llviewerstats.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llworld.h" #include "llworldmap.h" diff --git a/indra/newview/llmimetypes.cpp b/indra/newview/llmimetypes.cpp index e1bc3dbf11..e165650da1 100644 --- a/indra/newview/llmimetypes.cpp +++ b/indra/newview/llmimetypes.cpp @@ -34,7 +34,7 @@ #include "llmimetypes.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" LLMIMETypes::mime_info_map_t LLMIMETypes::sMap; LLMIMETypes::mime_widget_set_map_t LLMIMETypes::sWidgetMap; @@ -52,7 +52,7 @@ LLString sDefaultImpl; bool LLMIMETypes::parseMIMETypes(const LLString& xml_filename) { LLXMLNodePtr root; - bool success = LLViewerUICtrlFactory::getLayeredXMLNode(xml_filename, root); + bool success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root); if ( ! success || root.isNull() || ! root->hasName( "mimetypes" ) ) { llwarns << "Unable to read MIME type file: " diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp index 81e677433b..3318b04625 100644 --- a/indra/newview/llmorphview.cpp +++ b/indra/newview/llmorphview.cpp @@ -80,16 +80,6 @@ LLMorphView::LLMorphView(const std::string& name, const LLRect& rect) { } -EWidgetType LLMorphView::getWidgetType() const -{ - return WIDGET_TYPE_MORPH_VIEW; -} - -LLString LLMorphView::getWidgetTag() const -{ - return LL_MORPH_VIEW_TAG; -} - //----------------------------------------------------------------------------- // initialize() //----------------------------------------------------------------------------- @@ -110,8 +100,8 @@ void LLMorphView::initialize() avatarp->mSpecialRenderMode = 3; // set up camera for close look at avatar - mOldCameraNearClip = gCamera->getNear(); - gCamera->setNear(MORPH_NEAR_CLIP); + mOldCameraNearClip = LLViewerCamera::getInstance()->getNear(); + LLViewerCamera::getInstance()->setNear(MORPH_NEAR_CLIP); } //----------------------------------------------------------------------------- @@ -127,7 +117,7 @@ void LLMorphView::shutdown() avatarp->startMotion( ANIM_AGENT_BODY_NOISE ); avatarp->mSpecialRenderMode = 0; // reset camera - gCamera->setNear(mOldCameraNearClip); + LLViewerCamera::getInstance()->setNear(mOldCameraNearClip); } } diff --git a/indra/newview/llmorphview.h b/indra/newview/llmorphview.h index ecabaa9b81..670ddf601c 100644 --- a/indra/newview/llmorphview.h +++ b/indra/newview/llmorphview.h @@ -44,9 +44,6 @@ class LLMorphView : public LLView public: LLMorphView(const std::string& name, const LLRect& rect); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - void initialize(); void shutdown(); diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index eea729393c..a73da0940e 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -42,7 +42,7 @@ #include "llbutton.h" #include "llviewerwindow.h" #include "lljoystickbutton.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // // Constants @@ -68,34 +68,34 @@ LLFloaterMove::LLFloaterMove() : LLFloater("move floater") { setIsChrome(TRUE); - gUICtrlFactory->buildFloater(this,"floater_moveview.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml"); - mForwardButton = LLViewerUICtrlFactory::getJoystickAgentTurnByName(this, "forward btn"); + mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); mForwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mBackwardButton = LLViewerUICtrlFactory::getJoystickAgentTurnByName(this, "backward btn"); + mBackwardButton = getChild<LLJoystickAgentTurn>("backward btn"); mBackwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mSlideLeftButton = LLViewerUICtrlFactory::getJoystickAgentSlideByName(this, "slide left btn"); + mSlideLeftButton = getChild<LLJoystickAgentSlide>("slide left btn"); mSlideLeftButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mSlideRightButton = LLViewerUICtrlFactory::getJoystickAgentSlideByName(this, "slide right btn"); + mSlideRightButton = getChild<LLJoystickAgentSlide>("slide right btn"); mSlideRightButton->setHeldDownDelay(MOVE_BUTTON_DELAY); - mTurnLeftButton = LLUICtrlFactory::getButtonByName(this, "turn left btn"); + mTurnLeftButton = getChild<LLButton>("turn left btn"); mTurnLeftButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mTurnLeftButton->setHeldDownCallback( turnLeft ); - mTurnRightButton = LLUICtrlFactory::getButtonByName(this, "turn right btn"); + mTurnRightButton = getChild<LLButton>("turn right btn"); mTurnRightButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mTurnRightButton->setHeldDownCallback( turnRight ); - mMoveUpButton = LLUICtrlFactory::getButtonByName(this, "move up btn"); + mMoveUpButton = getChild<LLButton>("move up btn"); childSetAction("move up btn",moveUp,NULL); mMoveUpButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mMoveUpButton->setHeldDownCallback( moveUp ); - mMoveDownButton = LLUICtrlFactory::getButtonByName(this, "move down btn"); + mMoveDownButton = getChild<LLButton>("move down btn"); childSetAction("move down btn",moveDown,NULL); mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY); mMoveDownButton->setHeldDownCallback( moveDown ); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index 60d39b62bd..24eb9ee34a 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -59,14 +59,12 @@ #include "message.h" #include "llagent.h" -#include "llfloatermute.h" #include "llviewergenericmessage.h" // for gGenericDispatcher #include "llviewerwindow.h" #include "llworld.h" //for particle system banning #include "llviewerobject.h" #include "llviewerobjectlist.h" -LLMuteList* gMuteListp = NULL; std::map<LLUUID, F32> LLMuteList::sUserVolumeSettings; @@ -81,7 +79,7 @@ public: const LLUUID& invoice, const sparam_t& strings) { - gMuteListp->setLoaded(); + LLMuteList::getInstance()->setLoaded(); return true; } }; @@ -159,18 +157,27 @@ void LLMute::setFromDisplayName(const LLString& display_name) return; } +/* static */ +LLMuteList* LLMuteList::getInstance() +{ + // Register callbacks at the first time that we find that the message system has been created. + static BOOL registered = FALSE; + if( !registered && gMessageSystem != NULL) + { + registered = TRUE; + // Register our various callbacks + gMessageSystem->setHandlerFuncFast(_PREHASH_MuteListUpdate, processMuteListUpdate); + gMessageSystem->setHandlerFuncFast(_PREHASH_UseCachedMuteList, processUseCachedMuteList); + } + return LLSingleton<LLMuteList>::getInstance(); // Call the "base" implementation. +} + //----------------------------------------------------------------------------- // LLMuteList() //----------------------------------------------------------------------------- LLMuteList::LLMuteList() : mIsLoaded(FALSE) { - LLMessageSystem* msg = gMessageSystem; - - // Register our various callbacks - msg->setHandlerFuncFast(_PREHASH_MuteListUpdate, processMuteListUpdate); - msg->setHandlerFuncFast(_PREHASH_UseCachedMuteList, processUseCachedMuteList); - gGenericDispatcher.addHandler("emptymutelist", &sDispatchEmptyMuteList); // load per-resident voice volume information @@ -318,7 +325,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags) //Kill all particle systems owned by muted task if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT) { - gWorldPointer->mPartSim.clearParticlesByOwnerID(localmute.mID); + LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID); } } return TRUE; @@ -345,7 +352,7 @@ void LLMuteList::updateAdd(const LLMute& mute) msg->addU32("MuteFlags", mute.mFlags); gAgent.sendReliableMessage(); - mIsLoaded = TRUE; + mIsLoaded = TRUE; // why is this here? -MG } @@ -398,8 +405,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) } // Must be after erase. - notifyObservers(); - found = TRUE; + setLoaded(); // why is this here? -MG } // Clean up any legacy mutes @@ -411,8 +417,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) updateRemove(mute); mLegacyMutes.erase(legacy_it); // Must be after erase. - notifyObservers(); - found = TRUE; + setLoaded(); // why is this here? -MG } return found; @@ -502,8 +507,7 @@ BOOL LLMuteList::loadFromFile(const LLString& filename) } } fclose(fp); - mIsLoaded = TRUE; - notifyObservers(); + setLoaded(); return TRUE; } @@ -673,24 +677,22 @@ void LLMuteList::processMuteListUpdate(LLMessageSystem* msg, void**) void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**) { llinfos << "LLMuteList::processUseCachedMuteList()" << llendl; - if (!gMuteListp) return; char agent_id_string[UUID_STR_LENGTH]; /*Flawfinder: ignore*/ gAgent.getID().toString(agent_id_string); char filename[LL_MAX_PATH]; /*Flawfinder: ignore*/ snprintf(filename, sizeof(filename), "%s.cached_mute", gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string).c_str()); /* Flawfinder: ignore */ - gMuteListp->loadFromFile(filename); + LLMuteList::getInstance()->loadFromFile(filename); } void LLMuteList::onFileMuteList(void** user_data, S32 error_code, LLExtStat ext_status) { llinfos << "LLMuteList::processMuteListFile()" << llendl; - if (!gMuteListp) return; std::string *local_filename_and_path = (std::string*)user_data; if(local_filename_and_path && !local_filename_and_path->empty() && (error_code == 0)) { - gMuteListp->loadFromFile(local_filename_and_path->c_str()); + LLMuteList::getInstance()->loadFromFile(local_filename_and_path->c_str()); LLFile::remove(local_filename_and_path->c_str()); } delete local_filename_and_path; @@ -714,14 +716,6 @@ void LLMuteList::setLoaded() void LLMuteList::notifyObservers() { - // HACK: LLFloaterMute is constructed before LLMuteList, - // so it can't easily observe it. Changing this requires - // much reshuffling of the startup process. JC - if (gFloaterMute) - { - gFloaterMute->refreshMuteList(); - } - for (observer_set_t::iterator it = mObservers.begin(); it != mObservers.end(); ) diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 413a2933b3..dc69e98286 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -79,12 +79,17 @@ public: U32 mFlags; // flags pertaining to this mute entry }; -class LLMuteList +class LLMuteList : public LLSingleton<LLMuteList> { public: LLMuteList(); ~LLMuteList(); + // Implemented locally so that we can perform some delayed initialization. + // Callers should be careful to call this one and not LLSingleton<LLMuteList>::getInstance() + // which would circumvent that mechanism. -MG + static LLMuteList* getInstance(); + void addObserver(LLMuteListObserver* observer); void removeObserver(LLMuteListObserver* observer); @@ -170,6 +175,5 @@ public: virtual void onChange() = 0; }; -extern LLMuteList *gMuteListp; #endif //LL_MUTELIST_H diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index a36c67a879..3b4ac4f81e 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -42,6 +42,7 @@ #include "llstring.h" #include "llui.h" +static LLRegisterWidget<LLNameEditor> r("name_editor"); // statics std::set<LLNameEditor*> LLNameEditor::sInstances; @@ -55,10 +56,7 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data), void* userdata, - LLLinePrevalidateFunc prevalidate_func, - LLViewBorder::EBevel border_bevel, - LLViewBorder::EStyle border_style, - S32 border_thickness) + LLLinePrevalidateFunc prevalidate_func) : LLLineEditor(name, rect, "(retrieving)", glfont, @@ -67,10 +65,7 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, keystroke_callback, focus_lost_callback, userdata, - prevalidate_func, - border_bevel, - border_style, - border_thickness), + prevalidate_func), mNameID(name_id) { LLNameEditor::sInstances.insert(this); @@ -157,19 +152,6 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory node->getAttributeS32("max_length", max_text_length); LLFontGL* font = LLView::selectFont(node); - - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE; - LLString border_string; - node->getAttributeString("border_style", border_string); - LLString::toLower(border_string); - - if (border_string == "texture") - { - border_style = LLViewBorder::STYLE_TEXTURE; - } - - S32 border_thickness = 1; - node->getAttributeS32("border_thickness", border_thickness); LLUICtrlCallback commit_callback = NULL; @@ -178,14 +160,7 @@ LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory LLUUID::null, FALSE, font, max_text_length, - commit_callback, - NULL, - NULL, - NULL, - NULL, - LLViewBorder::BEVEL_IN, - border_style, - border_thickness); + commit_callback); LLString label; if(node->getAttributeString("label", label)) diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index a5a0c5d9c8..c7c94f458a 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -54,10 +54,7 @@ public: void (*keystroke_callback)(LLLineEditor* caller, void* user_data) = NULL, void (*focus_lost_callback)(LLFocusableElement* caller, void* user_data) = NULL, void* userdata = NULL, - LLLinePrevalidateFunc prevalidate_func = NULL, - LLViewBorder::EBevel border_bevel = LLViewBorder::BEVEL_IN, - LLViewBorder::EStyle border_style = LLViewBorder::STYLE_LINE, - S32 border_thickness = 1); + LLLinePrevalidateFunc prevalidate_func = NULL); // By default, follows top and left and is mouse-opaque. // If no text, text = name. // If no font, uses default system font. @@ -74,8 +71,6 @@ public: static void refreshAll(const LLUUID& id, const char* firstname, const char* lastname, BOOL is_group); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_NAME_EDITOR; } - virtual LLString getWidgetTag() const { return LL_NAME_EDITOR_TAG; } // Take/return agent UUIDs virtual void setValue( LLSD value ); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 5f1afccbdc..6e08eff6ee 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -39,6 +39,8 @@ #include "llagent.h" #include "llinventory.h" +static LLRegisterWidget<LLNameListCtrl> r("name_list"); + // statics std::set<LLNameListCtrl*> LLNameListCtrl::sInstances; diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index e6efd4e7e1..c49a163ba8 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -50,8 +50,7 @@ public: S32 name_column_index = 0, const LLString& tooltip = LLString::null); virtual ~LLNameListCtrl(); - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_NAME_LIST; } - virtual LLString getWidgetTag() const { return LL_NAME_LIST_CTRL_TAG; } + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index e24b5251e0..1550751e7f 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -103,15 +103,20 @@ LLNetMap::LLNetMap( mObjectImageCenterGlobal = gAgent.getCameraPositionGlobal(); + // TODO: exteralize hardcoded constants. const S32 DIR_WIDTH = 10; const S32 DIR_HEIGHT = 10; LLRect major_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH, 0 ); - - mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); - mTextBoxNorth->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); + const LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); + const LLRect minor_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH * 2, 0 ); + + // Note: removing special treatment for north compass point (DEV-10559). -MG + //mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); + //mTextBoxNorth->setFontStyle(LLFontGL::DROP_SHADOW_SOFT); + //addChild( mTextBoxNorth ); + mTextBoxNorth = new LLTextBox( "N", major_dir_rect ); + mTextBoxNorth->setColor( minor_color ); addChild( mTextBoxNorth ); - - LLColor4 minor_color( 1.f, 1.f, 1.f, .7f ); mTextBoxEast = new LLTextBox( "E", major_dir_rect ); mTextBoxEast->setColor( minor_color ); @@ -127,8 +132,6 @@ LLNetMap::LLNetMap( mTextBoxSouth->setColor( minor_color ); addChild( mTextBoxSouth ); - LLRect minor_dir_rect( 0, DIR_HEIGHT, DIR_WIDTH * 2, 0 ); - mTextBoxSouthEast = new LLTextBox( "SE", minor_dir_rect ); mTextBoxSouthEast->setColor( minor_color ); addChild( mTextBoxSouthEast ); @@ -170,17 +173,6 @@ LLNetMap::~LLNetMap() sInstance = NULL; } -EWidgetType LLNetMap::getWidgetType() const -{ - return WIDGET_TYPE_NET_MAP; -} - -LLString LLNetMap::getWidgetTag() const -{ - return LL_NET_MAP_TAG; -} - - void LLNetMap::setScale( F32 scale ) { gMiniMapScale = scale; @@ -194,20 +186,8 @@ void LLNetMap::setScale( F32 scale ) F32 half_width = (F32)(getRect().getWidth() / 2); F32 half_height = (F32)(getRect().getHeight() / 2); F32 radius = sqrt( half_width * half_width + half_height * half_height ); - F32 region_widths = (2.f*radius)/gMiniMapScale; - - F32 meters; - if (!gWorldPointer) - { - // Hack! Sometimes world hasn't been initialized at this point. - meters = 256.f*region_widths; - } - else - { - meters = region_widths * gWorldPointer->getRegionWidthInMeters(); - } - + F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); F32 num_pixels = (F32)mObjectImagep->getWidth(); mObjectMapTPM = num_pixels/meters; mObjectMapPixels = 2.f*radius; @@ -231,10 +211,6 @@ void LLNetMap::draw() { static LLFrameTimer map_timer; - if (!getVisible() || !gWorldPointer) - { - return; - } if (mObjectImagep.isNull()) { createObjectImage(); @@ -271,15 +247,15 @@ void LLNetMap::draw() if( LLNetMap::sRotateMap ) { // rotate subsequent draws to agent rotation - rotation = atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ); + rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); glRotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f); } // figure out where agent is - S32 region_width = llround(gWorldPointer->getRegionWidthInMeters()); + S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; // Find x and y position relative to camera's center. @@ -395,8 +371,8 @@ void LLNetMap::draw() LLVector3 pos_map; // Draw avatars - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; const LLVector3d& origin_global = regionp->getOriginGlobal(); @@ -463,16 +439,13 @@ void LLNetMap::draw() //drawTracking( gAgent.getPosGlobalFromAgent(gAgent.getFrameAgent().getCenter()), gSelfMapColor ); pos_global = gAgent.getPositionGlobal(); pos_map = globalPosToView(pos_global); - gl_draw_image(llround(pos_map.mV[VX]) - 4, - llround(pos_map.mV[VY]) - 4, - LLWorldMapView::sAvatarYouSmallImage, - LLColor4::white); + LLWorldMapView::sAvatarYouSmallImage->draw(llround(pos_map.mV[VX]) - 4, llround(pos_map.mV[VY]) - 4); // Draw frustum - F32 meters_to_pixels = gMiniMapScale/ gWorldPointer->getRegionWidthInMeters(); + F32 meters_to_pixels = gMiniMapScale/ LLWorld::getInstance()->getRegionWidthInMeters(); - F32 horiz_fov = gCamera->getView() * gCamera->getAspect(); - F32 far_clip_meters = gCamera->getFar(); + F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); + F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); F32 far_clip_pixels = far_clip_meters * meters_to_pixels; F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 ); @@ -501,7 +474,7 @@ void LLNetMap::draw() // If we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); gGL.translatef( ctr_x, ctr_y, 0 ); - glRotatef( atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); + glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); gGL.begin( GL_TRIANGLES ); gGL.vertex2f( 0, 0 ); gGL.vertex2f( -half_width_pixels, far_clip_pixels ); @@ -537,7 +510,7 @@ LLVector3 LLNetMap::globalPosToView( const LLVector3d& global_pos ) if( LLNetMap::sRotateMap ) { - F32 radians = atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ); + F32 radians = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); LLQuaternion rot(radians, LLVector3(0.f, 0.f, 1.f)); pos_local.rotVec( rot ); } @@ -581,7 +554,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) LLVector3 pos_local( (F32)x, (F32)y, 0 ); - F32 radians = - atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ); + F32 radians = - atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); if( LLNetMap::sRotateMap ) { @@ -589,7 +562,7 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) pos_local.rotVec( rot ); } - pos_local *= ( gWorldPointer->getRegionWidthInMeters() / gMiniMapScale ); + pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / gMiniMapScale ); LLVector3d pos_global; pos_global.setVec( pos_local ); @@ -612,7 +585,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_rect_s { return FALSE; } - LLViewerRegion* region = gWorldPointer->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( viewPosToGlobal( x, y ) ); if( region ) { msg.assign( region->getName() ); diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index dc696238ea..5d506c473c 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -51,9 +51,6 @@ public: LLNetMap(const std::string& name, const LLRect& rect, const LLColor4& bg_color ); virtual ~LLNetMap(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - virtual void draw(); virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index 89f2e6239a..993125ce0a 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -55,7 +55,7 @@ #include "llviewermedia.h" #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llvoiceclient.h" #include "llvoavatar.h" @@ -113,7 +113,7 @@ LLOverlayBar::LLOverlayBar() factory_map["voice_remote"] = LLCallbackMap(LLOverlayBar::createVoiceRemote, this); factory_map["chat_bar"] = LLCallbackMap(LLOverlayBar::createChatBar, this); - gUICtrlFactory->buildPanel(this, "panel_overlaybar.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_overlaybar.xml", &factory_map); } BOOL LLOverlayBar::postBuild() @@ -137,16 +137,6 @@ LLOverlayBar::~LLOverlayBar() // LLView destructor cleans up children } -EWidgetType LLOverlayBar::getWidgetType() const -{ - return WIDGET_TYPE_OVERLAY_BAR; -} - -LLString LLOverlayBar::getWidgetTag() const -{ - return LL_OVERLAY_BAR_TAG; -} - // virtual void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) { @@ -160,12 +150,12 @@ void LLOverlayBar::reshape(S32 width, S32 height, BOOL called_from_parent) void LLOverlayBar::layoutButtons() { - LLView* state_buttons_panel = getChildByName("state_buttons", TRUE); + LLView* state_buttons_panel = getChildView("state_buttons"); - if (state_buttons_panel && state_buttons_panel->getVisible()) + if (state_buttons_panel->getVisible()) { LLViewQuery query; - LLWidgetTypeFilter widget_filter(WIDGET_TYPE_BUTTON); + LLWidgetTypeFilter<LLButton> widget_filter; query.addPreFilter(LLEnabledFilter::getInstance()); query.addPreFilter(&widget_filter); @@ -201,7 +191,7 @@ void LLOverlayBar::refresh() BOOL buttons_changed = FALSE; BOOL im_received = gIMMgr->getIMReceived(); - LLButton* button = LLUICtrlFactory::getButtonByName(this, "IM Received"); + LLButton* button = getChild<LLButton>("IM Received"); if (button && button->getVisible() != im_received) { button->setVisible(im_received); @@ -211,7 +201,7 @@ void LLOverlayBar::refresh() } BOOL busy = gAgent.getBusy(); - button = LLUICtrlFactory::getButtonByName(this, "Set Not Busy"); + button = getChild<LLButton>("Set Not Busy"); if (button && button->getVisible() != busy) { button->setVisible(busy); @@ -221,7 +211,7 @@ void LLOverlayBar::refresh() } BOOL controls_grabbed = gAgent.anyControlGrabbed(); - button = LLUICtrlFactory::getButtonByName(this, "Release Keys"); + button = getChild<LLButton>("Release Keys"); if (button && button->getVisible() != controls_grabbed) { @@ -234,7 +224,7 @@ void LLOverlayBar::refresh() BOOL mouselook_grabbed; mouselook_grabbed = gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_DOWN_INDEX) || gAgent.isControlGrabbed(CONTROL_ML_LBUTTON_UP_INDEX); - button = LLUICtrlFactory::getButtonByName(this, "Mouselook"); + button = getChild<LLButton>("Mouselook"); if (button && button->getVisible() != mouselook_grabbed) { @@ -249,7 +239,7 @@ void LLOverlayBar::refresh() { sitting = gAgent.getAvatarObject()->mIsSitting; } - button = LLUICtrlFactory::getButtonByName(this, "Stand Up"); + button = getChild<LLButton>("Stand Up"); if (button && button->getVisible() != sitting) { @@ -326,7 +316,7 @@ void LLOverlayBar::onClickMouselook(void*) //static void LLOverlayBar::onClickStandUp(void*) { - gSelectMgr->deselectAllForStandingUp(); + LLSelectMgr::getInstance()->deselectAllForStandingUp(); gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); } @@ -361,7 +351,7 @@ void LLOverlayBar::toggleMediaPlay(void*) } else { - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { LLViewerParcelMedia::play(parcel); @@ -382,7 +372,7 @@ void LLOverlayBar::toggleMusicPlay(void*) gOverlayBar->mMusicState = PLAYING; // desired state if (gAudiop) { - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel ) { // this doesn't work properly when crossing parcel boundaries - even when the diff --git a/indra/newview/lloverlaybar.h b/indra/newview/lloverlaybar.h index 4fb438a712..06b39aa23a 100644 --- a/indra/newview/lloverlaybar.h +++ b/indra/newview/lloverlaybar.h @@ -57,9 +57,6 @@ public: LLOverlayBar(); ~LLOverlayBar(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - /*virtual*/ void refresh(); /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 9a0eef9a10..94bf17f531 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -74,14 +74,13 @@ #include "llviewergenericmessage.h" // send_generic_message #include "llviewerobjectlist.h" #include "llviewerregion.h" -#include "llviewborder.h" #include "llweb.h" #include "llinventorymodel.h" #include "roles_constants.h" #define kArraySize( _kArray ) ( sizeof( (_kArray) ) / sizeof( _kArray[0] ) ) -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // Statics std::list<LLPanelAvatar*> LLPanelAvatar::sAllPanels; @@ -104,9 +103,6 @@ public: LLDropTarget(const std::string& name, const LLRect& rect, const LLUUID& agent_id); ~LLDropTarget(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - void doDrop(EDragAndDropType cargo_type, void* cargo_data); // @@ -133,16 +129,6 @@ LLDropTarget::~LLDropTarget() { } -EWidgetType LLDropTarget::getWidgetType() const -{ - return WIDGET_TYPE_DROP_TARGET; -} - -LLString LLDropTarget::getWidgetTag() const -{ - return LL_DROP_TARGET_TAG; -} - void LLDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { llinfos << "LLDropTarget::doDrop()" << llendl; @@ -243,12 +229,9 @@ LLPanelAvatarTab::LLPanelAvatarTab(const std::string& name, const LLRect &rect, // virtual void LLPanelAvatarTab::draw() { - if (getVisible()) - { - refresh(); + refresh(); - LLPanel::draw(); - } + LLPanel::draw(); } void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* method) @@ -314,12 +297,12 @@ void LLPanelAvatarSecondLife::clearControls() mPartnerID = LLUUID::null; - LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(this,"groups"); + LLScrollListCtrl* group_list = getChild<LLScrollListCtrl>("groups"); if(group_list) { group_list->deleteAllItems(); } - LLScrollListCtrl* ratings_list = LLUICtrlFactory::getScrollListByName(this,"ratings"); + LLScrollListCtrl* ratings_list = getChild<LLScrollListCtrl>("ratings"); if(ratings_list) { ratings_list->deleteAllItems(); @@ -339,15 +322,6 @@ void LLPanelAvatarSecondLife::enableControls(BOOL self) childSetEnabled("allow_publish", self); childSetVisible("?", self); childSetEnabled("?", self); - - if (!self) - { - // This is because the LLTextEditor - // appears to reset the read only background color when - // setEnable is called, for some reason - LLTextEditor* about = LLUICtrlFactory::getTextEditorByName(this,"about"); - if (about) about->setReadOnlyBgColor(LLColor4::transparent); - } } @@ -361,7 +335,7 @@ void LLPanelAvatarSecondLife::onDoubleClickGroup(void* data) LLPanelAvatarSecondLife* self = (LLPanelAvatarSecondLife*)data; - LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(self,"groups"); + LLScrollListCtrl* group_list = self->getChild<LLScrollListCtrl>("groups"); if(group_list) { LLScrollListItem* item = group_list->getFirstSelected(); @@ -478,7 +452,7 @@ BOOL LLPanelAvatarNotes::postBuild(void) { childSetCommitCallback("notes edit",onCommitNotes,this); - LLTextEditor* te = LLUICtrlFactory::getTextEditorByName(this,"notes edit"); + LLTextEditor* te = getChild<LLTextEditor>("notes edit"); if(te) te->setCommitOnFocusLost(TRUE); return TRUE; } @@ -529,7 +503,7 @@ BOOL LLPanelAvatarAdvanced::postBuild() for(S32 tt=0; tt < mWantToCount; ++tt) { LLString ctlname = llformat("chk%d", tt); - mWantToCheck[tt] = LLUICtrlFactory::getCheckBoxByName(this,ctlname); + mWantToCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); } mSkillsCount = (6>kArraySize(mSkillsCheck))?kArraySize(mSkillsCheck):6; @@ -537,11 +511,11 @@ BOOL LLPanelAvatarAdvanced::postBuild() { //Find the Skills checkboxes and save off thier controls LLString ctlname = llformat("schk%d",tt); - mSkillsCheck[tt] = LLUICtrlFactory::getCheckBoxByName(this,ctlname); + mSkillsCheck[tt] = getChild<LLCheckBoxCtrl>(ctlname); } - mWantToEdit = LLUICtrlFactory::getLineEditorByName(this,"want_to_edit"); - mSkillsEdit = LLUICtrlFactory::getLineEditorByName(this,"skills_edit"); + mWantToEdit = getChild<LLLineEditor>("want_to_edit"); + mSkillsEdit = getChild<LLLineEditor>("skills_edit"); childSetVisible("skills_edit",LLPanelAvatar::sAllowFirstLife); childSetVisible("want_to_edit",LLPanelAvatar::sAllowFirstLife); @@ -717,17 +691,6 @@ void LLPanelAvatarAdvanced::enableControls(BOOL self) if (mWantToEdit) mWantToEdit->setEnabled(self); if (mSkillsEdit) mSkillsEdit->setEnabled(self); childSetEnabled("languages_edit",self); - - if (!self) - { - // This is because the LLTextEditor - // appears to reset the read only background color when - // setEnable is called, for some reason - if (mWantToEdit) mWantToEdit->setReadOnlyBgColor(LLColor4::transparent); - if (mSkillsEdit) mSkillsEdit->setReadOnlyBgColor(LLColor4::transparent); - LLLineEditor* languages_edit = getChild<LLLineEditor>("languages_edit"); - languages_edit->setReadOnlyBgColor(LLColor4::transparent); - } } void LLPanelAvatarAdvanced::setWantSkills(U32 want_to_mask, const std::string& want_to_text, @@ -828,7 +791,7 @@ void LLPanelAvatarClassified::refresh() { BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(this,"classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); S32 tab_count = tabs ? tabs->getTabCount() : 0; @@ -862,7 +825,7 @@ void LLPanelAvatarClassified::refresh() BOOL LLPanelAvatarClassified::canClose() { - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); for (S32 i = 0; i < tabs->getTabCount(); i++) { LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i); @@ -876,7 +839,7 @@ BOOL LLPanelAvatarClassified::canClose() BOOL LLPanelAvatarClassified::titleIsValid() { - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); if ( tabs ) { LLPanelClassified* panel = (LLPanelClassified*)tabs->getCurrentPanel(); @@ -894,7 +857,7 @@ BOOL LLPanelAvatarClassified::titleIsValid() void LLPanelAvatarClassified::apply() { - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); for (S32 i = 0; i < tabs->getTabCount(); i++) { LLPanelClassified* panel = (LLPanelClassified*)tabs->getPanelByIndex(i); @@ -905,7 +868,7 @@ void LLPanelAvatarClassified::apply() void LLPanelAvatarClassified::deleteClassifiedPanels() { - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); if (tabs) { tabs->deleteAllTabs(); @@ -925,7 +888,7 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, char classified_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/ LLPanelClassified* panel_classified = NULL; - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"classified tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("classified tab"); // Don't remove old panels. We need to be able to process multiple // packets for people who have lots of classifieds. JC @@ -983,7 +946,7 @@ void LLPanelAvatarClassified::callbackNew(S32 option, void* data) { LLPanelClassified* panel_classified = new LLPanelClassified(false, false); panel_classified->initNewClassified(); - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(self,"classified tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); if(tabs) { tabs->addTabPanel(panel_classified, panel_classified->getClassifiedName()); @@ -998,7 +961,7 @@ void LLPanelAvatarClassified::onClickDelete(void* data) { LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(self,"classified tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); LLPanelClassified* panel_classified = NULL; if(tabs) { @@ -1017,7 +980,7 @@ void LLPanelAvatarClassified::onClickDelete(void* data) void LLPanelAvatarClassified::callbackDelete(S32 option, void* data) { LLPanelAvatarClassified* self = (LLPanelAvatarClassified*)data; - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(self,"classified tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("classified tab"); LLPanelClassified* panel_classified=NULL; if(tabs) { @@ -1062,7 +1025,7 @@ LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name, void LLPanelAvatarPicks::refresh() { BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); - LLTabContainer* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"picks tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); S32 tab_count = tabs ? tabs->getTabCount() : 0; childSetEnabled("New...", self && tab_count < MAX_AVATAR_PICKS); childSetEnabled("Delete...", self && tab_count > 0); @@ -1075,7 +1038,7 @@ void LLPanelAvatarPicks::refresh() void LLPanelAvatarPicks::deletePickPanels() { - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(this,"picks tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); if(tabs) { tabs->deleteAllTabs(); @@ -1094,7 +1057,7 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) char pick_name[DB_PICK_NAME_SIZE]; /*Flawfinder: ignore*/ LLPanelPick* panel_pick = NULL; - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(this,"picks tab"); + LLTabContainer* tabs = getChild<LLTabContainer>("picks tab"); // Clear out all the old panels. We'll replace them with the correct // number of new panels. @@ -1144,7 +1107,7 @@ void LLPanelAvatarPicks::onClickNew(void* data) { LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; LLPanelPick* panel_pick = new LLPanelPick(FALSE); - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(self,"picks tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); panel_pick->initNewPick(); if(tabs) @@ -1159,7 +1122,7 @@ void LLPanelAvatarPicks::onClickNew(void* data) void LLPanelAvatarPicks::onClickDelete(void* data) { LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(self,"picks tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); LLPanelPick* panel_pick = tabs?(LLPanelPick*)tabs->getCurrentPanel():NULL; if (!panel_pick) return; @@ -1177,7 +1140,7 @@ void LLPanelAvatarPicks::onClickDelete(void* data) void LLPanelAvatarPicks::callbackDelete(S32 option, void* data) { LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(self,"picks tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab"); LLPanelPick* panel_pick = tabs?(LLPanelPick*)tabs->getCurrentPanel():NULL; LLMessageSystem* msg = gMessageSystem; @@ -1257,7 +1220,7 @@ LLPanelAvatar::LLPanelAvatar( factory_map["1st Life"] = LLCallbackMap(createPanelAvatarFirstLife, this); factory_map["My Notes"] = LLCallbackMap(createPanelAvatarNotes, this); - gUICtrlFactory->buildPanel(this, "panel_avatar.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar.xml", &factory_map); selectTab(0); @@ -1266,7 +1229,7 @@ LLPanelAvatar::LLPanelAvatar( BOOL LLPanelAvatar::postBuild(void) { - mTab = LLUICtrlFactory::getTabContainerByName(this,"tab"); + mTab = getChild<LLTabContainer>("tab"); childSetAction("Kick",onClickKick,this); childSetAction("Freeze",onClickFreeze, this); childSetAction("Unfreeze", onClickUnfreeze, this); @@ -1406,7 +1369,7 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, mDropTarget->setAgentID(mAvatarID); } - LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(this, "name"); + LLNameEditor* name_edit = getChild<LLNameEditor>("name"); if(name_edit) { if (name.empty()) @@ -1535,7 +1498,7 @@ void LLPanelAvatar::resetGroupList() if (mPanelSecondLife) { - LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(mPanelSecondLife,"groups"); + LLScrollListCtrl* group_list = mPanelSecondLife->getChild<LLScrollListCtrl>("groups"); if (group_list) { group_list->deleteAllItems(); @@ -1584,7 +1547,7 @@ void LLPanelAvatar::onClickIM(void* userdata) gIMMgr->setFloaterOpen(TRUE); std::string name; - LLNameEditor* nameedit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + LLNameEditor* nameedit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); if (nameedit) name = nameedit->getText(); gIMMgr->addSession(name, IM_NOTHING_SPECIAL, self->mAvatarID); } @@ -1601,7 +1564,7 @@ void LLPanelAvatar::onClickTrack(void* userdata) if( gFloaterWorldMap ) { std::string name; - LLNameEditor* nameedit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + LLNameEditor* nameedit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); if (nameedit) name = nameedit->getText(); gFloaterWorldMap->trackAvatar(self->mAvatarID, name); LLFloaterWorldMap::show(NULL, TRUE); @@ -1613,7 +1576,7 @@ void LLPanelAvatar::onClickTrack(void* userdata) void LLPanelAvatar::onClickAddFriend(void* userdata) { LLPanelAvatar* self = (LLPanelAvatar*) userdata; - LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + LLNameEditor* name_edit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); if (name_edit) { LLPanelFriends::requestFriendshipDialog(self->getAvatarID(), @@ -1629,21 +1592,21 @@ void LLPanelAvatar::onClickMute(void *userdata) LLPanelAvatar* self = (LLPanelAvatar*) userdata; LLUUID agent_id = self->getAvatarID(); - LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self->mPanelSecondLife, "name"); + LLNameEditor* name_edit = self->mPanelSecondLife->getChild<LLNameEditor>("name"); if (name_edit) { std::string agent_name = name_edit->getText(); LLFloaterMute::showInstance(); - if (gMuteListp->isMuted(agent_id)) + if (LLMuteList::getInstance()->isMuted(agent_id)) { - gFloaterMute->selectMute(agent_id); + LLFloaterMute::getInstance()->selectMute(agent_id); } else { LLMute mute(agent_id, agent_name, LLMute::AGENT); - gMuteListp->add(mute); + LLMuteList::getInstance()->add(mute); } } } @@ -1679,7 +1642,7 @@ void LLPanelAvatar::onClickOK(void *userdata) { self->sendAvatarPropertiesUpdate(); - LLTabContainer* tabs = LLUICtrlFactory::getTabContainerByName(self,"tab"); + LLTabContainer* tabs = self->getChild<LLTabContainer>("tab"); if ( tabs->getCurrentPanel() != self->mPanelClassified ) { self->mPanelClassified->apply(); @@ -1984,7 +1947,7 @@ void LLPanelAvatar::processAvatarGroupsReply(LLMessageSystem *msg, void**) continue; } - LLScrollListCtrl* group_list = LLUICtrlFactory::getScrollListByName(self->mPanelSecondLife,"groups"); + LLScrollListCtrl* group_list = self->mPanelSecondLife->getChild<LLScrollListCtrl>("groups"); // if(group_list) // { // group_list->deleteAllItems(); @@ -2316,7 +2279,7 @@ void LLPanelAvatar::onClickCSR(void* userdata) LLPanelAvatar* self = (LLPanelAvatar*)userdata; if (!self) return; - LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(self, "name"); + LLNameEditor* name_edit = self->getChild<LLNameEditor>("name"); if (!name_edit) return; LLString name = name_edit->getText(); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index fcf3eea7eb..560ed1768d 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -60,7 +60,7 @@ #include "lltexturectrl.h" #include "lluiconstants.h" #include "llurldispatcher.h" // for classified HTML detail click teleports -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" #include "llviewerwindow.h" #include "llworldmap.h" @@ -184,11 +184,11 @@ LLPanelClassified::LLPanelClassified(bool in_finder, bool from_search) std::string classified_def_file; if (mInFinder) { - gUICtrlFactory->buildPanel(this, "panel_classified.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_classified.xml"); } else { - gUICtrlFactory->buildPanel(this, "panel_avatar_classified.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_classified.xml"); } // Register dispatcher @@ -223,12 +223,12 @@ void LLPanelClassified::reset() BOOL LLPanelClassified::postBuild() { - mSnapshotCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); + mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); mSnapshotCtrl->setCommitCallback(onCommitAny); mSnapshotCtrl->setCallbackUserData(this); mSnapshotSize = mSnapshotCtrl->getRect(); - mNameEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "given_name_editor"); + mNameEditor = getChild<LLLineEditor>("given_name_editor"); mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); mNameEditor->setCommitOnFocusLost(TRUE); mNameEditor->setFocusReceivedCallback(onFocusReceived, this); @@ -236,35 +236,35 @@ BOOL LLPanelClassified::postBuild() mNameEditor->setCallbackUserData(this); mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); - mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); + mDescEditor = getChild<LLTextEditor>("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); mDescEditor->setFocusReceivedCallback(onFocusReceived, this); mDescEditor->setCommitCallback(onCommitAny); mDescEditor->setCallbackUserData(this); mDescEditor->setTabsToNextField(TRUE); - mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor"); + mLocationEditor = getChild<LLLineEditor>("location_editor"); - mSetBtn = LLViewerUICtrlFactory::getButtonByName(this, "set_location_btn"); + mSetBtn = getChild<LLButton>( "set_location_btn"); mSetBtn->setClickedCallback(onClickSet); mSetBtn->setCallbackUserData(this); - mTeleportBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_teleport_btn"); + mTeleportBtn = getChild<LLButton>( "classified_teleport_btn"); mTeleportBtn->setClickedCallback(onClickTeleport); mTeleportBtn->setCallbackUserData(this); - mMapBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_map_btn"); + mMapBtn = getChild<LLButton>( "classified_map_btn"); mMapBtn->setClickedCallback(onClickMap); mMapBtn->setCallbackUserData(this); if(mInFinder) { - mProfileBtn = LLViewerUICtrlFactory::getButtonByName(this, "classified_profile_btn"); + mProfileBtn = getChild<LLButton>( "classified_profile_btn"); mProfileBtn->setClickedCallback(onClickProfile); mProfileBtn->setCallbackUserData(this); } - mCategoryCombo = LLViewerUICtrlFactory::getComboBoxByName(this, "classified_category_combo"); + mCategoryCombo = getChild<LLComboBox>( "classified_category_combo"); LLClassifiedInfo::cat_map::iterator iter; for (iter = LLClassifiedInfo::sCategories.begin(); iter != LLClassifiedInfo::sCategories.end(); @@ -276,7 +276,7 @@ BOOL LLPanelClassified::postBuild() mCategoryCombo->setCommitCallback(onCommitAny); mCategoryCombo->setCallbackUserData(this); - mMatureCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "classified_mature_check"); + mMatureCheck = getChild<LLCheckBoxCtrl>( "classified_mature_check"); mMatureCheck->setCommitCallback(onCommitAny); mMatureCheck->setCallbackUserData(this); if (gAgent.isTeen()) @@ -287,18 +287,18 @@ BOOL LLPanelClassified::postBuild() if (!mInFinder) { - mAutoRenewCheck = LLUICtrlFactory::getCheckBoxByName(this, "auto_renew_check"); + mAutoRenewCheck = getChild<LLCheckBoxCtrl>( "auto_renew_check"); mAutoRenewCheck->setCommitCallback(onCommitAny); mAutoRenewCheck->setCallbackUserData(this); } - mUpdateBtn = LLUICtrlFactory::getButtonByName(this, "classified_update_btn"); + mUpdateBtn = getChild<LLButton>("classified_update_btn"); mUpdateBtn->setClickedCallback(onClickUpdate); mUpdateBtn->setCallbackUserData(this); if (!mInFinder) { - mClickThroughText = LLUICtrlFactory::getTextBoxByName(this, "click_through_text"); + mClickThroughText = getChild<LLTextBox>("click_through_text"); } return TRUE; @@ -351,10 +351,10 @@ void LLPanelClassified::saveCallback(S32 option, void* data) LLView* view = self; while (view) { - if (view->getWidgetType() == WIDGET_TYPE_FLOATER) + LLFloater* floaterp = dynamic_cast<LLFloater*>(view); + if (floaterp) { - LLFloater* f = (LLFloater*)view; - f->close(); + floaterp->close(); break; } view = view->getParent(); @@ -393,7 +393,7 @@ void LLPanelClassified::initNewClassified() mPaidFor = FALSE; // Try to fill in the current parcel - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { mNameEditor->setText(parcel->getName()); @@ -674,17 +674,16 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** self->mUpdateBtn->setLabel(self->getString("update_txt")); self->resetDirty(); + + self->resetDirty(); } } void LLPanelClassified::draw() { - if (getVisible()) - { - refresh(); + refresh(); - LLPanel::draw(); - } + LLPanel::draw(); } @@ -709,12 +708,13 @@ void LLPanelClassified::refresh() if(godlike) { //make it smaller, so text is more legible - mSnapshotCtrl->setRect(LLRect(20, 375, 320, 175)); - + mSnapshotCtrl->setOrigin(20, 175); + mSnapshotCtrl->reshape(300, 200); } else { - mSnapshotCtrl->setRect(mSnapshotSize); + mSnapshotCtrl->setOrigin(mSnapshotSize.mLeft, mSnapshotSize.mBottom); + mSnapshotCtrl->reshape(mSnapshotSize.getWidth(), mSnapshotSize.getHeight()); //normal } mNameEditor->setEnabled(godlike); @@ -1004,7 +1004,7 @@ LLFloaterPriceForListing::~LLFloaterPriceForListing() //virtual BOOL LLFloaterPriceForListing::postBuild() { - LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "price_edit"); + LLLineEditor* edit = getChild<LLLineEditor>("price_edit"); if (edit) { edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); @@ -1028,7 +1028,7 @@ void LLFloaterPriceForListing::show( void (*callback)(S32, LLString, void*), voi LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); // Builds and adds to gFloaterView - gUICtrlFactory->buildFloater(self, "floater_price_for_listing.xml"); + LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml"); self->center(); self->mCallback = callback; diff --git a/indra/newview/llpanelcontents.cpp b/indra/newview/llpanelcontents.cpp index fa7cdfbc97..e76a3dd554 100644 --- a/indra/newview/llpanelcontents.cpp +++ b/indra/newview/llpanelcontents.cpp @@ -109,20 +109,20 @@ void LLPanelContents::getState(LLViewerObject *objectp ) } LLUUID group_id; // used for SL-23488 - gSelectMgr->selectGetGroup(group_id); // sets group_id as a side effect SL-23488 + LLSelectMgr::getInstance()->selectGetGroup(group_id); // sets group_id as a side effect SL-23488 // BUG? Check for all objects being editable? BOOL editable = gAgent.isGodlike() || (objectp->permModify() && ( objectp->permYouOwner() || ( !group_id.isNull() && gAgent.isInGroup(group_id) ))); // solves SL-23488 - BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); + BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); // Edit script button - ok if object is editable and there's an // unambiguous destination for the object. if( editable && all_volume && - ((gSelectMgr->getSelection()->getRootObjectCount() == 1) - || (gSelectMgr->getSelection()->getObjectCount() == 1))) + ((LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() == 1) + || (LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1))) { //mBtnNewScript->setEnabled(TRUE); childSetEnabled("button new script",TRUE); @@ -138,7 +138,7 @@ void LLPanelContents::getState(LLViewerObject *objectp ) void LLPanelContents::refresh() { const BOOL children_ok = TRUE; - LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject(children_ok); + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); getState(object); if (mPanelInventory) @@ -157,7 +157,7 @@ void LLPanelContents::refresh() void LLPanelContents::onClickNewScript(void *userdata) { const BOOL children_ok = TRUE; - LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject(children_ok); + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); if(object) { LLPermissions perm; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index b87d18a545..8cc7844c0f 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -60,7 +60,7 @@ #include "llviewermedia.h" #include "llviewerobject.h" #include "llviewerstats.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // // Methods @@ -100,7 +100,7 @@ BOOL LLPanelFace::postBuild() // Allow any texture to be used during non-immediate mode. mTextureCtrl->setNonImmediateFilterPermMask(PERM_NONE); LLAggregatePermissions texture_perms; - if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) + if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms)) { BOOL can_copy = texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || @@ -128,14 +128,14 @@ BOOL LLPanelFace::postBuild() mColorSwatch->setCanApplyImmediately(TRUE); } - mLabelColorTransp = LLUICtrlFactory::getTextBoxByName(this,"color trans"); + mLabelColorTransp = getChild<LLTextBox>("color trans"); if(mLabelColorTransp) { mLabelColorTransp->setFollowsTop(); mLabelColorTransp->setFollowsLeft(); } - mCtrlColorTransp = LLUICtrlFactory::getSpinnerByName(this,"ColorTrans"); + mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); if(mCtrlColorTransp) { mCtrlColorTransp->setCommitCallback(LLPanelFace::onCommitAlpha); @@ -145,14 +145,14 @@ BOOL LLPanelFace::postBuild() mCtrlColorTransp->setFollowsLeft(); } - mCheckFullbright = LLUICtrlFactory::getCheckBoxByName(this,"checkbox fullbright"); + mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); if (mCheckFullbright) { mCheckFullbright->setCommitCallback(LLPanelFace::onCommitFullbright); mCheckFullbright->setCallbackUserData( this ); } - mLabelTexGen = LLUICtrlFactory::getTextBoxByName(this,"tex gen"); - mComboTexGen = LLUICtrlFactory::getComboBoxByName(this,"combobox texgen"); + mLabelTexGen = getChild<LLTextBox>("tex gen"); + mComboTexGen = getChild<LLComboBox>("combobox texgen"); if(mComboTexGen) { mComboTexGen->setCommitCallback(LLPanelFace::onCommitTexGen); @@ -160,8 +160,8 @@ BOOL LLPanelFace::postBuild() mComboTexGen->setCallbackUserData( this ); } - mLabelGlow = LLUICtrlFactory::getTextBoxByName(this,"glow label"); - mCtrlGlow = LLUICtrlFactory::getSpinnerByName(this,"glow"); + mLabelGlow = getChild<LLTextBox>("glow label"); + mCtrlGlow = getChild<LLSpinCtrl>("glow"); if(mCtrlGlow) { mCtrlGlow->setCommitCallback(LLPanelFace::onCommitGlow); @@ -210,69 +210,68 @@ void LLPanelFace::sendTexture() { id = mTextureCtrl->getImageAssetID(); } - gSelectMgr->selectionSetImage(id); + LLSelectMgr::getInstance()->selectionSetImage(id); } } void LLPanelFace::sendBump() { - LLComboBox* mComboBumpiness = gUICtrlFactory->getComboBoxByName(this,"combobox bumpiness"); + LLComboBox* mComboBumpiness = getChild<LLComboBox>("combobox bumpiness"); if(!mComboBumpiness)return; U8 bump = (U8) mComboBumpiness->getCurrentIndex() & TEM_BUMP_MASK; - gSelectMgr->selectionSetBumpmap( bump ); + LLSelectMgr::getInstance()->selectionSetBumpmap( bump ); } void LLPanelFace::sendTexGen() { - LLComboBox* mComboTexGen = gUICtrlFactory->getComboBoxByName(this,"combobox texgen"); + LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); if(!mComboTexGen)return; U8 tex_gen = (U8) mComboTexGen->getCurrentIndex() << TEM_TEX_GEN_SHIFT; - gSelectMgr->selectionSetTexGen( tex_gen ); + LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen ); } void LLPanelFace::sendShiny() { - LLComboBox* mComboShininess = gUICtrlFactory->getComboBoxByName(this,"combobox shininess"); + LLComboBox* mComboShininess = getChild<LLComboBox>("combobox shininess"); if(!mComboShininess)return; U8 shiny = (U8) mComboShininess->getCurrentIndex() & TEM_SHINY_MASK; - gSelectMgr->selectionSetShiny( shiny ); + LLSelectMgr::getInstance()->selectionSetShiny( shiny ); } void LLPanelFace::sendFullbright() { - LLCheckBoxCtrl* mCheckFullbright = gUICtrlFactory->getCheckBoxByName(this,"checkbox fullbright"); + LLCheckBoxCtrl* mCheckFullbright = getChild<LLCheckBoxCtrl>("checkbox fullbright"); if(!mCheckFullbright)return; U8 fullbright = mCheckFullbright->get() ? TEM_FULLBRIGHT_MASK : 0; - gSelectMgr->selectionSetFullbright( fullbright ); + LLSelectMgr::getInstance()->selectionSetFullbright( fullbright ); } void LLPanelFace::sendColor() { - LLColorSwatchCtrl* mColorSwatch = LLViewerUICtrlFactory::getColorSwatchByName(this,"colorswatch"); + LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); if(!mColorSwatch)return; LLColor4 color = mColorSwatch->get(); - gSelectMgr->selectionSetColorOnly( color ); + LLSelectMgr::getInstance()->selectionSetColorOnly( color ); } void LLPanelFace::sendAlpha() { - LLSpinCtrl* mCtrlColorTransp = LLViewerUICtrlFactory::getSpinnerByName(this,"ColorTrans"); + LLSpinCtrl* mCtrlColorTransp = getChild<LLSpinCtrl>("ColorTrans"); if(!mCtrlColorTransp)return; F32 alpha = (100.f - mCtrlColorTransp->get()) / 100.f; - gSelectMgr->selectionSetAlphaOnly( alpha ); + LLSelectMgr::getInstance()->selectionSetAlphaOnly( alpha ); } void LLPanelFace::sendGlow() { - LLSpinCtrl* mCtrlGlow = LLViewerUICtrlFactory::getSpinnerByName(this,"glow"); - if(!mCtrlGlow)return; + LLSpinCtrl* mCtrlGlow = getChild<LLSpinCtrl>("glow"); F32 glow = mCtrlGlow->get(); - gSelectMgr->selectionSetGlow( glow ); + LLSelectMgr::getInstance()->selectionSetGlow( glow ); } struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor @@ -282,14 +281,14 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor { BOOL valid; F32 value; - LLSpinCtrl* ctrlTexScaleS = LLViewerUICtrlFactory::getSpinnerByName(mPanel,"TexScaleU"); - LLSpinCtrl* ctrlTexScaleT = LLViewerUICtrlFactory::getSpinnerByName(mPanel,"TexScaleV"); - LLSpinCtrl* ctrlTexOffsetS = LLViewerUICtrlFactory::getSpinnerByName(mPanel,"TexOffsetU"); - LLSpinCtrl* ctrlTexOffsetT = LLViewerUICtrlFactory::getSpinnerByName(mPanel,"TexOffsetV"); - LLSpinCtrl* ctrlTexRotation = LLViewerUICtrlFactory::getSpinnerByName(mPanel,"TexRot"); - LLCheckBoxCtrl* checkFlipScaleS = LLViewerUICtrlFactory::getCheckBoxByName(mPanel,"checkbox flip s"); - LLCheckBoxCtrl* checkFlipScaleT = LLViewerUICtrlFactory::getCheckBoxByName(mPanel,"checkbox flip t"); - LLComboBox* comboTexGen = LLViewerUICtrlFactory::getComboBoxByName(mPanel,"combobox texgen"); + LLSpinCtrl* ctrlTexScaleS = mPanel->getChild<LLSpinCtrl>("TexScaleU"); + LLSpinCtrl* ctrlTexScaleT = mPanel->getChild<LLSpinCtrl>("TexScaleV"); + LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild<LLSpinCtrl>("TexOffsetU"); + LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>("TexOffsetV"); + LLSpinCtrl* ctrlTexRotation = mPanel->getChild<LLSpinCtrl>("TexRot"); + LLCheckBoxCtrl* checkFlipScaleS = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip s"); + LLCheckBoxCtrl* checkFlipScaleT = mPanel->getChild<LLCheckBoxCtrl>("checkbox flip t"); + LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen"); if (ctrlTexScaleS) { valid = !ctrlTexScaleS->getTentative() || !checkFlipScaleS->getTentative(); @@ -373,15 +372,15 @@ struct LLPanelFaceSendFunctor : public LLSelectedObjectFunctor void LLPanelFace::sendTextureInfo() { LLPanelFaceSetTEFunctor setfunc(this); - gSelectMgr->getSelection()->applyToTEs(&setfunc); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); LLPanelFaceSendFunctor sendfunc; - gSelectMgr->getSelection()->applyToObjects(&sendfunc); + LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); } void LLPanelFace::getState() { - LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstObject(); + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); if( objectp && objectp->getPCode() == LL_PCODE_VOLUME @@ -411,7 +410,7 @@ void LLPanelFace::getState() childSetEnabled("button apply",editable); bool identical; - LLTextureCtrl* texture_ctrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"texture control"); + LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control"); // Texture { @@ -424,7 +423,7 @@ void LLPanelFace::getState() return image ? image->getID() : LLUUID::null; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, id ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id ); if (identical) { @@ -463,7 +462,7 @@ void LLPanelFace::getState() { // texture_ctrl->setValid( editable ); - if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) + if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms)) { BOOL can_copy = texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || @@ -491,7 +490,7 @@ void LLPanelFace::getState() return object->getTE(face)->mScaleS; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, scale_s ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s ); childSetValue("TexScaleU",editable ? llabs(scale_s) : 0); childSetTentative("TexScaleU",LLSD((BOOL)(!identical))); childSetEnabled("TexScaleU",editable); @@ -509,7 +508,7 @@ void LLPanelFace::getState() return object->getTE(face)->mScaleT; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, scale_t ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t ); childSetValue("TexScaleV",llabs(editable ? llabs(scale_t) : 0)); childSetTentative("TexScaleV",LLSD((BOOL)(!identical))); @@ -530,7 +529,7 @@ void LLPanelFace::getState() return object->getTE(face)->mOffsetS; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, offset_s ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s ); childSetValue("TexOffsetU", editable ? offset_s : 0); childSetTentative("TexOffsetU",!identical); childSetEnabled("TexOffsetU",editable); @@ -545,7 +544,7 @@ void LLPanelFace::getState() return object->getTE(face)->mOffsetT; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, offset_t ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t ); childSetValue("TexOffsetV", editable ? offset_t : 0); childSetTentative("TexOffsetV",!identical); childSetEnabled("TexOffsetV",editable); @@ -562,14 +561,14 @@ void LLPanelFace::getState() return object->getTE(face)->mRotation; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, rotation ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation ); childSetValue("TexRot", editable ? rotation * RAD_TO_DEG : 0); childSetTentative("TexRot",!identical); childSetEnabled("TexRot",editable); } // Color swatch - LLColorSwatchCtrl* mColorSwatch = LLViewerUICtrlFactory::getColorSwatchByName(this,"colorswatch"); + LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); LLColor4 color = LLColor4::white; if(mColorSwatch) { @@ -580,7 +579,7 @@ void LLPanelFace::getState() return object->getTE(face)->getColor(); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, color ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, color ); mColorSwatch->setOriginal(color); mColorSwatch->set(color, TRUE); @@ -609,7 +608,7 @@ void LLPanelFace::getState() return object->getTE(face)->getGlow(); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, glow ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, glow ); childSetValue("glow",glow); childSetEnabled("glow",editable); @@ -628,7 +627,7 @@ void LLPanelFace::getState() return (F32)(object->getTE(face)->getShiny()); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, shinyf ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, shinyf ); LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess"); if (combobox_shininess) @@ -653,7 +652,7 @@ void LLPanelFace::getState() return (F32)(object->getTE(face)->getBumpmap()); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, bumpf ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, bumpf ); LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); if (combobox_bumpiness) @@ -678,7 +677,7 @@ void LLPanelFace::getState() return (F32)(object->getTE(face)->getTexGen()); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, genf ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, genf ); S32 selected_texgen = ((S32) genf) >> TEM_TEX_GEN_SHIFT; LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen"); @@ -716,7 +715,7 @@ void LLPanelFace::getState() return (F32)(object->getTE(face)->getFullbright()); } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, fullbrightf ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf ); childSetValue("checkbox fullbright",(S32)fullbrightf); childSetEnabled("checkbox fullbright",editable); @@ -743,11 +742,11 @@ void LLPanelFace::getState() return object->getTE(face)->mScaleS / object->getScale().mV[s_axis]; } } func; - identical = gSelectMgr->getSelection()->getSelectedTEValue( &func, repeats ); + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats ); childSetValue("rptctrl", editable ? repeats : 0); childSetTentative("rptctrl",!identical); - LLComboBox* mComboTexGen = LLViewerUICtrlFactory::getComboBoxByName(this,"combobox texgen"); + LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); if (mComboTexGen) { BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1); @@ -825,14 +824,14 @@ void LLPanelFace::onCommitAlpha(LLUICtrl* ctrl, void* userdata) // static void LLPanelFace::onCancelColor(LLUICtrl* ctrl, void* userdata) { - gSelectMgr->selectionRevertColors(); + LLSelectMgr::getInstance()->selectionRevertColors(); } // static void LLPanelFace::onSelectColor(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - gSelectMgr->saveSelectedObjectColors(); + LLSelectMgr::getInstance()->saveSelectedObjectColors(); self->sendColor(); } @@ -875,8 +874,8 @@ void LLPanelFace::onCommitGlow(LLUICtrl* ctrl, void* userdata) BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item, void*) { BOOL accept = TRUE; - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* obj = node->getObject(); @@ -894,7 +893,7 @@ void LLPanelFace::onCommitTexture( LLUICtrl* ctrl, void* userdata ) { LLPanelFace* self = (LLPanelFace*) userdata; - gViewerStats->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); self->sendTexture(); } @@ -902,14 +901,14 @@ void LLPanelFace::onCommitTexture( LLUICtrl* ctrl, void* userdata ) // static void LLPanelFace::onCancelTexture(LLUICtrl* ctrl, void* userdata) { - gSelectMgr->selectionRevertTextures(); + LLSelectMgr::getInstance()->selectionRevertTextures(); } // static void LLPanelFace::onSelectTexture(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - gSelectMgr->saveSelectedObjectTextures(); + LLSelectMgr::getInstance()->saveSelectedObjectTextures(); self->sendTexture(); } @@ -931,7 +930,7 @@ void LLPanelFace::onClickApply(void* userdata) //F32 repeats_per_meter = self->mCtrlRepeatsPerMeter->get(); F32 repeats_per_meter = (F32)self->childGetValue( "rptctrl" ).asReal();//self->mCtrlRepeatsPerMeter->get(); - gSelectMgr->selectionTexScaleAutofit( repeats_per_meter ); + LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter ); } // commit the fit media texture to prim button @@ -965,8 +964,8 @@ struct LLPanelFaceSetMediaFunctor : public LLSelectedTEFunctor void LLPanelFace::onClickAutoFix(void* userdata) { LLPanelFaceSetMediaFunctor setfunc; - gSelectMgr->getSelection()->applyToTEs(&setfunc); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc); LLPanelFaceSendFunctor sendfunc; - gSelectMgr->getSelection()->applyToObjects(&sendfunc); + LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc); } diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index d8faecf83d..fb86366cc6 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -42,7 +42,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "llviewermessage.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "llappviewer.h" @@ -160,16 +160,16 @@ LLPanelGroup::LLPanelGroup(const std::string& filename, mFactoryMap["roles_sub_tab"] = LLCallbackMap(LLPanelGroupRolesSubTab::createTab, &mID); mFactoryMap["actions_sub_tab"] = LLCallbackMap(LLPanelGroupActionsSubTab::createTab, &mID); - gGroupMgr->addObserver(this); + LLGroupMgr::getInstance()->addObserver(this); // Pass on construction of this panel to the control factory. - gUICtrlFactory->buildPanel(this, filename, &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, filename, &getFactoryMap()); mFilename = filename; } LLPanelGroup::~LLPanelGroup() { - gGroupMgr->removeObserver(this); + LLGroupMgr::getInstance()->removeObserver(this); int i; int tab_count = mTabContainer->getTabCount(); @@ -360,9 +360,9 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) { LLRect rect(getRect()); - gGroupMgr->removeObserver(this); + LLGroupMgr::getInstance()->removeObserver(this); mID = group_id; - gGroupMgr->addObserver(this); + LLGroupMgr::getInstance()->addObserver(this); //TODO: this is really bad, we should add a method // where the panels can just update themselves // on a group id change. Similar to update() but with a group @@ -371,7 +371,7 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id) // For now, rebuild panel //delete children and rebuild panel deleteAllChildren(); - gUICtrlFactory->buildPanel(this, mFilename, &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, mFilename, &getFactoryMap()); } void LLPanelGroup::selectTab(std::string tab_name) @@ -603,7 +603,7 @@ void LLPanelGroup::draw() void LLPanelGroup::refreshData() { - gGroupMgr->clearGroupData(getID()); + LLGroupMgr::getInstance()->clearGroupData(getID()); mCurrentTab->activate(); // 5 second timeout @@ -616,14 +616,13 @@ void LLPanelGroup::close() { // Pass this to the parent, if it is a floater. LLView* viewp = getParent(); - if (viewp - && WIDGET_TYPE_FLOATER == viewp->getWidgetType()) + LLFloater* floaterp = dynamic_cast<LLFloater*>(viewp); + if (floaterp) { // First, set the force close flag, since the floater // will be asking us whether it can close. mForceClose = TRUE; // Tell the parent floater to close. - LLFloater* floaterp = (LLFloater*) viewp; floaterp->close(); } } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 64c4354d36..86a8c4a399 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -33,7 +33,7 @@ #include "llpanelgroupgeneral.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llagent.h" #include "roles_constants.h" #include "llfloateravatarinfo.h" @@ -304,7 +304,7 @@ void LLPanelGroupGeneral::onCommitTitle(LLUICtrl* ctrl, void* data) { LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; if (self->mGroupID.isNull() || !self->mAllowEdit) return; - gGroupMgr->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID()); + LLGroupMgr::getInstance()->sendGroupTitleUpdate(self->mGroupID,self->mComboActiveTitle->getCurrentID()); self->update(GC_TITLES); } @@ -329,7 +329,7 @@ void LLPanelGroupGeneral::onClickJoin(void *userdata) lldebugs << "joining group: " << self->mGroupID << llendl; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(self->mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(self->mGroupID); if (gdatap) { @@ -350,7 +350,7 @@ void LLPanelGroupGeneral::onClickJoin(void *userdata) } else { - llwarns << "gGroupMgr->getGroupData(" << self->mGroupID + llwarns << "LLGroupMgr::getInstance()->getGroupData(" << self->mGroupID << ") was NULL" << llendl; } } @@ -366,7 +366,7 @@ void LLPanelGroupGeneral::joinDlgCB(S32 which, void *userdata) return; } - gGroupMgr->sendGroupMemberJoin(self->mGroupID); + LLGroupMgr::getInstance()->sendGroupMemberJoin(self->mGroupID); } // static @@ -392,17 +392,17 @@ bool LLPanelGroupGeneral::needsApply(LLString& mesg) void LLPanelGroupGeneral::activate() { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (mGroupID.notNull() && (!gdatap || mFirstUse)) { - gGroupMgr->sendGroupTitlesRequest(mGroupID); - gGroupMgr->sendGroupPropertiesRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupTitlesRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); if (!gdatap || !gdatap->isMemberDataComplete() ) { - gGroupMgr->sendGroupMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } mFirstUse = FALSE; @@ -446,12 +446,12 @@ bool LLPanelGroupGeneral::apply(LLString& mesg) LLString::format_map_t args; args["[MESSAGE]"] = mConfirmGroupCreateStr; gViewerWindow->alertXml("GenericAlertYesCancel", args, - createGroupCallback,this); + createGroupCallback,new LLHandle<LLPanel>(getHandle())); return false; } - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { @@ -496,7 +496,7 @@ bool LLPanelGroupGeneral::apply(LLString& mesg) if (can_change_ident || can_change_member_opts) { - gGroupMgr->sendUpdateGroupInfo(mGroupID); + LLGroupMgr::getInstance()->sendUpdateGroupInfo(mGroupID); } } @@ -526,7 +526,10 @@ void LLPanelGroupGeneral::cancel() // static void LLPanelGroupGeneral::createGroupCallback(S32 option, void* userdata) { - LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)userdata; + LLHandle<LLPanel> panel_handle = *(LLHandle<LLPanel>*)userdata; + delete (LLHandle<LLPanel>*)userdata; + + LLPanelGroupGeneral* self = dynamic_cast<LLPanelGroupGeneral*>(panel_handle.get()); if (!self) return; switch(option) @@ -537,7 +540,7 @@ void LLPanelGroupGeneral::createGroupCallback(S32 option, void* userdata) U32 enrollment_fee = (self->mCtrlEnrollmentFee->get() ? (U32) self->mSpinEnrollmentFee->get() : 0); - gGroupMgr->sendCreateGroupRequest(self->mGroupNameEditor->getText(), + LLGroupMgr::getInstance()->sendCreateGroupRequest(self->mGroupNameEditor->getText(), self->mEditCharter->getText(), self->mCtrlShowInGroupList->get(), self->mInsignia->getImageAssetID(), @@ -563,7 +566,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { if (mGroupID.isNull()) return; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; @@ -734,7 +737,7 @@ void LLPanelGroupGeneral::updateMembers() { mPendingMemberUpdate = FALSE; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!mListVisibleMembers || !gdatap || !gdatap->isMemberDataComplete()) diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index f5b4fc83ca..fed7247816 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -42,7 +42,7 @@ #include "lltextbox.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" class LLPanelGroupInvite::impl @@ -77,7 +77,7 @@ public: LLButton *mOKButton; LLButton *mRemoveButton; LLTextBox *mGroupName; - LLTextBox *mOwnerWarning; + LLString mOwnerWarning; bool mConfirmedOwnerInvite; void (*mCloseCallback)(void* data); @@ -94,7 +94,6 @@ LLPanelGroupInvite::impl::impl(const LLUUID& group_id): mOKButton ( NULL ), mRemoveButton( NULL ), mGroupName( NULL ), - mOwnerWarning ( NULL ), mConfirmedOwnerInvite( false ), mCloseCallback( NULL ), mCloseCallbackUserData( NULL ) @@ -147,7 +146,7 @@ void LLPanelGroupInvite::impl::submitInvitations() { std::map<LLUUID, LLUUID> role_member_pairs; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); // Default to everyone role. LLUUID role_id = LLUUID::null; @@ -160,7 +159,7 @@ void LLPanelGroupInvite::impl::submitInvitations() if ((role_id == gdatap->mOwnerRole) && (!mConfirmedOwnerInvite)) { LLString::format_map_t args; - args["[MESSAGE]"] = mOwnerWarning->getText(); + args["[MESSAGE]"] = mOwnerWarning; gViewerWindow->alertXml("GenericAlertYesCancel", args, inviteOwnerCallback, this); return; // we'll be called again if user confirms } @@ -175,7 +174,7 @@ void LLPanelGroupInvite::impl::submitInvitations() role_member_pairs[item->getUUID()] = role_id; } - gGroupMgr->sendGroupMemberInvites(mGroupID, role_member_pairs); + LLGroupMgr::getInstance()->sendGroupMemberInvites(mGroupID, role_member_pairs); //then close (*mCloseCallback)(mCloseCallbackUserData); @@ -363,7 +362,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const std::string& name, std::string panel_def_file; // Pass on construction of this panel to the control factory. - gUICtrlFactory->buildPanel(this, "panel_group_invite.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml", &getFactoryMap()); } LLPanelGroupInvite::~LLPanelGroupInvite() @@ -452,7 +451,7 @@ void LLPanelGroupInvite::update() void LLPanelGroupInvite::updateLists() { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mImplementation->mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mImplementation->mGroupID); bool waiting = false; if (gdatap) @@ -494,9 +493,9 @@ void LLPanelGroupInvite::updateLists() { if (!mPendingUpdate) { - gGroupMgr->sendGroupPropertiesRequest(mImplementation->mGroupID); - gGroupMgr->sendGroupMembersRequest(mImplementation->mGroupID); - gGroupMgr->sendGroupRoleDataRequest(mImplementation->mGroupID); + LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mImplementation->mGroupID); + LLGroupMgr::getInstance()->sendGroupMembersRequest(mImplementation->mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mImplementation->mGroupID); } mPendingUpdate = TRUE; } @@ -563,7 +562,7 @@ BOOL LLPanelGroupInvite::postBuild() button->setCallbackUserData(mImplementation); } - mImplementation->mOwnerWarning = (LLTextBox*)getChildByName("confirm_invite_owner_str", recurse); + mImplementation->mOwnerWarning = getString("confirm_invite_owner_str"); update(); diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index b19d3723a7..4ec8c0763b 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -46,7 +46,7 @@ #include "lltextbox.h" #include "lltabcontainer.h" #include "lltransactiontypes.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llstatusbar.h" #include "llfloaterworldmap.h" diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 4c16936b68..9c9c058685 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -76,8 +76,6 @@ public: // // LLView functionality - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -96,16 +94,6 @@ LLGroupDropTarget::LLGroupDropTarget(const std::string& name, const LLRect& rect { } -EWidgetType LLGroupDropTarget::getWidgetType() const -{ - return WIDGET_TYPE_DONTCARE; -} - -LLString LLGroupDropTarget::getWidgetTag() const -{ - return LL_GROUP_DROP_TARGET_TAG; -} - void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data) { llinfos << "LLGroupDropTarget::doDrop()" << llendl; @@ -328,12 +316,12 @@ void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item) item_is_multi = TRUE; }; - LLViewerImage* item_icon = get_item_icon(inv_item->getType(), + LLString icon_name = get_item_icon_name(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), item_is_multi ); - mCreateInventoryIcon->setImage(item_icon->getID()); + mCreateInventoryIcon->setImage(icon_name); mCreateInventoryIcon->setVisible(TRUE); std::stringstream ss; @@ -486,11 +474,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) row["columns"][0]["column"] = "icon"; if (has_attachment) { - LLUUID icon_id = get_item_icon_uuid( - (LLAssetType::EType)asset_type, - LLInventoryType::IT_NONE,FALSE, FALSE); + LLString icon_name = get_item_icon_name( + (LLAssetType::EType)asset_type, + LLInventoryType::IT_NONE,FALSE, FALSE); row["columns"][0]["type"] = "icon"; - row["columns"][0]["value"] = icon_id; + row["columns"][0]["value"] = icon_name; } row["columns"][1]["column"] = "subject"; @@ -554,11 +542,11 @@ void LLPanelGroupNotices::showNotice(const char* subject, { mInventoryOffer = inventory_offer; - LLViewerImage* item_icon = get_item_icon(mInventoryOffer->mType, + LLString icon_name = get_item_icon_name(mInventoryOffer->mType, LLInventoryType::IT_TEXTURE, 0, FALSE); - mViewInventoryIcon->setImage(item_icon->getID()); + mViewInventoryIcon->setImage(icon_name); mViewInventoryIcon->setVisible(TRUE); std::stringstream ss; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 8034ed6f03..c04b1b72cd 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -61,7 +61,7 @@ bool agentCanRemoveFromRole(const LLUUID& group_id, bool agentCanAddToRole(const LLUUID& group_id, const LLUUID& role_id) { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(group_id); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(group_id); if (!gdatap) { llwarns << "agentCanAddToRole " @@ -414,14 +414,14 @@ void LLPanelGroupRoles::update(LLGroupChange gc) void LLPanelGroupRoles::activate() { // Start requesting member and role data if needed. - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); //if (!gdatap || mFirstUse) { // Check member data. if (!gdatap || !gdatap->isMemberDataComplete() ) { - gGroupMgr->sendGroupMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } // Check role data. @@ -430,19 +430,19 @@ void LLPanelGroupRoles::activate() // Mildly hackish - clear all pending changes cancel(); - gGroupMgr->sendGroupRoleDataRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); } // Check role-member mapping data. if (!gdatap || !gdatap->isRoleMemberDataComplete() ) { - gGroupMgr->sendGroupRoleMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); } // Need this to get base group member powers if (!gdatap || !gdatap->isGroupPropertiesDataComplete() ) { - gGroupMgr->sendGroupPropertiesRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupPropertiesRequest(mGroupID); } mFirstUse = FALSE; @@ -529,23 +529,23 @@ BOOL LLPanelGroupSubTab::postBuild() bool no_recurse = false; LLIconCtrl* icon = getChild<LLIconCtrl>("power_folder_icon",no_recurse); - if (icon && icon->getImage().notNull()) + if (icon && !icon->getImageName().empty()) { - mActionIcons["folder"] = icon->getImage(); + mActionIcons["folder"] = icon->getImageName(); removeChild(icon, TRUE); } icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse); - if (icon && icon->getImage().notNull()) + if (icon && !icon->getImageName().empty()) { - mActionIcons["full"] = icon->getImage(); + mActionIcons["full"] = icon->getImageName(); removeChild(icon, TRUE); } icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse); - if (icon && icon->getImage().notNull()) + if (icon && !icon->getImageName().empty()) { - mActionIcons["partial"] = icon->getImage(); + mActionIcons["partial"] = icon->getImageName(); removeChild(icon, TRUE); } @@ -679,14 +679,14 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl, BOOL filter, BOOL is_owner_role) { - if (gGroupMgr->mRoleActionSets.empty()) + if (LLGroupMgr::getInstance()->mRoleActionSets.empty()) { llwarns << "Can't build action list - no actions found." << llendl; return; } - std::vector<LLRoleActionSet*>::iterator ras_it = gGroupMgr->mRoleActionSets.begin(); - std::vector<LLRoleActionSet*>::iterator ras_end = gGroupMgr->mRoleActionSets.end(); + std::vector<LLRoleActionSet*>::iterator ras_it = LLGroupMgr::getInstance()->mRoleActionSets.begin(); + std::vector<LLRoleActionSet*>::iterator ras_end = LLGroupMgr::getInstance()->mRoleActionSets.end(); for ( ; ras_it != ras_end; ++ras_it) { @@ -951,7 +951,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect() mAssignedRolesList->deleteAllItems(); mAllowedActionsList->deleteAllItems(); - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupMembersSubTab::handleMemberSelect() " @@ -1199,14 +1199,14 @@ void LLPanelGroupMembersSubTab::handleEjectMembers() mMembersList->deleteSelectedItems(); - gGroupMgr->sendGroupMemberEjects(mGroupID, + LLGroupMgr::getInstance()->sendGroupMemberEjects(mGroupID, selected_members); } void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id, LLRoleMemberChangeType type) { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; //add that the user is requesting to change the roles for selected @@ -1356,7 +1356,7 @@ void LLPanelGroupMembersSubTab::cancel() bool LLPanelGroupMembersSubTab::apply(LLString& mesg) { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "Unable to get group data for group " << mGroupID << llendl; @@ -1421,7 +1421,7 @@ void LLPanelGroupMembersSubTab::applyMemberChanges() { //sucks to do a find again here, but it is in constant time, so, could //be worse - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "Unable to get group data for group " << mGroupID << llendl; @@ -1446,7 +1446,7 @@ void LLPanelGroupMembersSubTab::applyMemberChanges() } mMemberRoleChangeData.clear(); - gGroupMgr->sendGroupRoleMemberChanges(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleMemberChanges(mGroupID); //force a UI update handleMemberSelect(); @@ -1485,7 +1485,7 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag //and then we have to build the powers up bases on the roles the agent //is in - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges() -- No group data!" << llendl; @@ -1598,7 +1598,7 @@ void LLPanelGroupMembersSubTab::update(LLGroupChange gc) return; } - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupMembersSubTab::update() -- No group data!" << llendl; @@ -1649,7 +1649,7 @@ void LLPanelGroupMembersSubTab::updateMembers() lldebugs << "LLPanelGroupMembersSubTab::updateMembers()" << llendl; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupMembersSubTab::updateMembers() -- No group data!" << llendl; @@ -1856,7 +1856,7 @@ bool LLPanelGroupRolesSubTab::needsApply(LLString& mesg) { lldebugs << "LLPanelGroupRolesSubTab::needsApply()" << llendl; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); return (mHasRoleChange // Text changed in current role || (gdatap && gdatap->pendingRoleChanges())); // Pending role changes in the group @@ -1867,7 +1867,7 @@ bool LLPanelGroupRolesSubTab::apply(LLString& mesg) lldebugs << "LLPanelGroupRolesSubTab::apply()" << llendl; saveRoleChanges(); - gGroupMgr->sendGroupRoleChanges(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleChanges(mGroupID); notifyObservers(); @@ -1877,7 +1877,7 @@ bool LLPanelGroupRolesSubTab::apply(LLString& mesg) void LLPanelGroupRolesSubTab::cancel() { mHasRoleChange = FALSE; - gGroupMgr->cancelGroupRoleChanges(mGroupID); + LLGroupMgr::getInstance()->cancelGroupRoleChanges(mGroupID); notifyObservers(); } @@ -1930,11 +1930,11 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) if (mGroupID.isNull()) return; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap || !gdatap->isRoleDataComplete()) { - gGroupMgr->sendGroupRoleDataRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); } else { @@ -2005,12 +2005,12 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc) if (!gdatap || !gdatap->isMemberDataComplete()) { - gGroupMgr->sendGroupMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } if (!gdatap || !gdatap->isRoleMemberDataComplete()) { - gGroupMgr->sendGroupRoleMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleMembersRequest(mGroupID); } if ((GC_ROLE_MEMBER_DATA == gc || GC_MEMBER_DATA == gc) @@ -2037,7 +2037,7 @@ void LLPanelGroupRolesSubTab::handleRoleSelect() mAssignedMembersList->deleteAllItems(); mAllowedActionsList->deleteAllItems(); - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() " @@ -2118,7 +2118,7 @@ void LLPanelGroupRolesSubTab::buildMembersList() { mAssignedMembersList->deleteAllItems(); - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() " @@ -2179,7 +2179,7 @@ void LLPanelGroupRolesSubTab::handleActionCheck(LLCheckBoxCtrl* check, bool forc { lldebugs << "LLPanelGroupRolesSubTab::handleActionSelect()" << llendl; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() " @@ -2313,7 +2313,7 @@ void LLPanelGroupRolesSubTab::handleMemberVisibilityChange(bool value) { lldebugs << "LLPanelGroupRolesSubTab::handleMemberVisibilityChange()" << llendl; - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) { llwarns << "LLPanelGroupRolesSubTab::handleRoleSelect() " @@ -2348,7 +2348,7 @@ void LLPanelGroupRolesSubTab::onCreateRole(void* user_data) void LLPanelGroupRolesSubTab::handleCreateRole() { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; @@ -2389,7 +2389,7 @@ void LLPanelGroupRolesSubTab::onDeleteRole(void* user_data) void LLPanelGroupRolesSubTab::handleDeleteRole() { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; @@ -2416,7 +2416,7 @@ void LLPanelGroupRolesSubTab::handleDeleteRole() void LLPanelGroupRolesSubTab::saveRoleChanges() { - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; @@ -2589,7 +2589,7 @@ void LLPanelGroupActionsSubTab::handleActionSelect() mActionDescription->clear(); } - LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); + LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(mGroupID); if (!gdatap) return; @@ -2611,7 +2611,7 @@ void LLPanelGroupActionsSubTab::handleActionSelect() } else { - gGroupMgr->sendGroupMembersRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupMembersRequest(mGroupID); } if (gdatap->isRoleDataComplete()) @@ -2632,6 +2632,6 @@ void LLPanelGroupActionsSubTab::handleActionSelect() } else { - gGroupMgr->sendGroupRoleDataRequest(mGroupID); + LLGroupMgr::getInstance()->sendGroupRoleDataRequest(mGroupID); } } diff --git a/indra/newview/llpanelgrouproles.h b/indra/newview/llpanelgrouproles.h index 89264abc94..8d16d613e9 100644 --- a/indra/newview/llpanelgrouproles.h +++ b/indra/newview/llpanelgrouproles.h @@ -45,7 +45,7 @@ class LLScrollListItem; // Forward declare for friend usage. //virtual BOOL LLPanelGroupSubTab::postBuildSubTab(LLView*); -typedef std::map<std::string,LLUUID> icon_map_t; +typedef std::map<std::string,std::string> icon_map_t; class LLPanelGroupRoles : public LLPanelGroupTab, public LLPanelGroupTabObserver diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 45e78f257f..a994a94fb7 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -43,7 +43,7 @@ #include "llviewerregion.h" #include "roles_constants.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" LLPanelLandSelectObserver* LLPanelLandInfo::sObserver = NULL; LLPanelLandInfo* LLPanelLandInfo::sInstance = NULL; @@ -81,7 +81,7 @@ LLPanelLandInfo::LLPanelLandInfo(const std::string& name) if (!sObserver) { sObserver = new LLPanelLandSelectObserver(); - gParcelMgr->addObserver( sObserver ); + LLViewerParcelMgr::getInstance()->addObserver( sObserver ); } } @@ -90,7 +90,7 @@ LLPanelLandInfo::LLPanelLandInfo(const std::string& name) // virtual LLPanelLandInfo::~LLPanelLandInfo() { - gParcelMgr->removeObserver( sObserver ); + LLViewerParcelMgr::getInstance()->removeObserver( sObserver ); delete sObserver; sObserver = NULL; @@ -111,8 +111,8 @@ void LLPanelLandInfo::refreshAll() // public void LLPanelLandInfo::refresh() { - LLParcel *parcel = gParcelMgr->getParcelSelection()->getParcel(); - LLViewerRegion *regionp = gParcelMgr->getSelectionRegion(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + LLViewerRegion *regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if (!parcel || !regionp) { @@ -177,9 +177,9 @@ void LLPanelLandInfo::refresh() // not just a single unit of land, // you must own part of it, // and it must not be a whole parcel. - if (gParcelMgr->getSelectedArea() > PARCEL_UNIT_AREA - //&& gParcelMgr->getSelfCount() > 1 - && !gParcelMgr->getParcelSelection()->getWholeParcelSelected()) + if (LLViewerParcelMgr::getInstance()->getSelectedArea() > PARCEL_UNIT_AREA + //&& LLViewerParcelMgr::getInstance()->getSelfCount() > 1 + && !LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) { childSetEnabled("button join land",TRUE); } @@ -197,12 +197,12 @@ void LLPanelLandInfo::refresh() S32 rent_price; BOOL for_sale; F32 dwell; - gParcelMgr->getDisplayInfo(&area, + LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, &claim_price, &rent_price, &for_sale, &dwell); - if(is_public || (is_for_sale && gParcelMgr->getParcelSelection()->getWholeParcelSelected())) + if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())) { childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price)); childSetTextArg("label_area_price","[AREA]", llformat("%d",area)); @@ -222,35 +222,35 @@ void LLPanelLandInfo::refresh() //static void LLPanelLandInfo::onClickClaim(void*) { - gParcelMgr->startBuyLand(); + LLViewerParcelMgr::getInstance()->startBuyLand(); } //static void LLPanelLandInfo::onClickRelease(void*) { - gParcelMgr->startReleaseLand(); + LLViewerParcelMgr::getInstance()->startReleaseLand(); } // static void LLPanelLandInfo::onClickDivide(void*) { - gParcelMgr->startDivideLand(); + LLViewerParcelMgr::getInstance()->startDivideLand(); } // static void LLPanelLandInfo::onClickJoin(void*) { - gParcelMgr->startJoinLand(); + LLViewerParcelMgr::getInstance()->startJoinLand(); } //static void LLPanelLandInfo::onClickAbout(void*) { // Promote the rectangle selection to a parcel selection - if (!gParcelMgr->getParcelSelection()->getWholeParcelSelected()) + if (!LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected()) { - gParcelMgr->selectParcelInRectangle(); + LLViewerParcelMgr::getInstance()->selectParcelInRectangle(); } LLFloaterLand::showInstance(); diff --git a/indra/newview/llpanellandmedia.cpp b/indra/newview/llpanellandmedia.cpp index db85294fcc..8df677a755 100644 --- a/indra/newview/llpanellandmedia.cpp +++ b/indra/newview/llpanellandmedia.cpp @@ -37,7 +37,7 @@ // viewer includes #include "llmimetypes.h" #include "llviewerparcelmgr.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // library includes #include "llcheckboxctrl.h" @@ -80,59 +80,52 @@ LLPanelLandMedia::~LLPanelLandMedia() BOOL LLPanelLandMedia::postBuild() { - mCheckSoundLocal = LLUICtrlFactory::getCheckBoxByName(this, "check sound local"); + mCheckSoundLocal = getChild<LLCheckBoxCtrl>("check sound local"); childSetCommitCallback("check sound local", onCommitAny, this); - mRadioVoiceChat = LLUICtrlFactory::getRadioGroupByName(this, "parcel_voice_channel"); + mRadioVoiceChat = getChild<LLRadioGroup>("parcel_voice_channel"); childSetCommitCallback("parcel_voice_channel", onCommitAny, this); - mMusicURLEdit = LLUICtrlFactory::getLineEditorByName(this, "music_url"); + mMusicURLEdit = getChild<LLLineEditor>("music_url"); childSetCommitCallback("music_url", onCommitAny, this); - mMediaTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "media texture"); - if (mMediaTextureCtrl) - { - mMediaTextureCtrl->setCommitCallback( onCommitAny ); - mMediaTextureCtrl->setCallbackUserData( this ); - mMediaTextureCtrl->setAllowNoTexture ( TRUE ); - mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - } - else - { - llwarns << "LLViewerUICtrlFactory::getTexturePickerByName() returned NULL for 'media texure'" << llendl; - } + mMediaTextureCtrl = getChild<LLTextureCtrl>("media texture"); + mMediaTextureCtrl->setCommitCallback( onCommitAny ); + mMediaTextureCtrl->setCallbackUserData( this ); + mMediaTextureCtrl->setAllowNoTexture ( TRUE ); + mMediaTextureCtrl->setImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); + mMediaTextureCtrl->setNonImmediateFilterPermMask(PERM_COPY | PERM_TRANSFER); - mMediaAutoScaleCheck = LLUICtrlFactory::getCheckBoxByName(this, "media_auto_scale"); + mMediaAutoScaleCheck = getChild<LLCheckBoxCtrl>("media_auto_scale"); childSetCommitCallback("media_auto_scale", onCommitAny, this); - mMediaLoopCheck = LLUICtrlFactory::getCheckBoxByName(this, "media_loop"); + mMediaLoopCheck = getChild<LLCheckBoxCtrl>("media_loop"); childSetCommitCallback("media_loop", onCommitAny, this); - mMediaUrlCheck = LLUICtrlFactory::getCheckBoxByName(this, "hide_media_url"); + mMediaUrlCheck = getChild<LLCheckBoxCtrl>("hide_media_url"); childSetCommitCallback("hide_media_url", onCommitAny, this); - mMusicUrlCheck = LLUICtrlFactory::getCheckBoxByName(this, "hide_music_url"); + mMusicUrlCheck = getChild<LLCheckBoxCtrl>("hide_music_url"); childSetCommitCallback("hide_music_url", onCommitAny, this); - mMediaURLEdit = LLUICtrlFactory::getLineEditorByName(this, "media_url"); + mMediaURLEdit = getChild<LLLineEditor>("media_url"); childSetCommitCallback("media_url", onCommitAny, this); - mMediaDescEdit = LLUICtrlFactory::getLineEditorByName(this, "url_description"); + mMediaDescEdit = getChild<LLLineEditor>("url_description"); childSetCommitCallback("url_description", onCommitAny, this); - mMediaTypeCombo = LLUICtrlFactory::getComboBoxByName(this, "media type"); + mMediaTypeCombo = getChild<LLComboBox>("media type"); childSetCommitCallback("media type", onCommitType, this); populateMIMECombo(); mMediaTypeCombo->sortByName(); - mMediaWidthCtrl = LLUICtrlFactory::getSpinnerByName(this, "media_size_width"); + mMediaWidthCtrl = getChild<LLSpinCtrl>("media_size_width"); childSetCommitCallback("media_size_width", onCommitAny, this); - mMediaHeightCtrl = LLUICtrlFactory::getSpinnerByName(this, "media_size_height"); + mMediaHeightCtrl = getChild<LLSpinCtrl>("media_size_height"); childSetCommitCallback("media_size_height", onCommitAny, this); - mMediaSizeCtrlLabel = LLUICtrlFactory::getTextBoxByName(this, "media_size"); + mMediaSizeCtrlLabel = getChild<LLTextBox>("media_size"); - mSetURLButton = LLUICtrlFactory::getButtonByName(this, "set_media_url"); + mSetURLButton = getChild<LLButton>("set_media_url"); childSetAction("set_media_url", onSetBtn, this); return TRUE; @@ -383,7 +376,7 @@ void LLPanelLandMedia::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setObscureMusic( obscure_music ); // Send current parcel data upstream to server - gParcelMgr->sendParcelPropertiesUpdate( parcel ); + LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); // Might have changed properties, so let's redraw! self->refresh(); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index b6e8c1a7f3..4047cd022f 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -65,7 +65,7 @@ #include "llnotify.h" #include "llappviewer.h" // for gHideLinks #include "llurlsimstring.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llhttpclient.h" #include "llweb.h" #include "llwebbrowserctrl.h" @@ -349,9 +349,9 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, gViewerWindow->getRootView()->addChildAtEnd(this); // Logo - mLogoImage = gImageList.getImage("startup_logo.tga", LLUUID::null, MIPMAP_FALSE, TRUE); + mLogoImage = LLUI::getUIImage("startup_logo.j2c"); - gUICtrlFactory->buildPanel(this, "panel_login.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml"); #if USE_VIEWER_AUTH //leave room for the login menu bar @@ -368,44 +368,41 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetUserData("password_edit", this); // change z sort of clickable text to be behind buttons - sendChildToBack(getChildByName("channel_text")); - sendChildToBack(getChildByName("version_text")); - sendChildToBack(getChildByName("forgot_password_text")); + sendChildToBack(getChildView("channel_text")); + sendChildToBack(getChildView("version_text")); + sendChildToBack(getChildView("forgot_password_text")); - LLLineEditor* edit = LLUICtrlFactory::getLineEditorByName(this, "password_edit"); + LLLineEditor* edit = getChild<LLLineEditor>("password_edit"); if (edit) edit->setDrawAsterixes(TRUE); - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(this, "start_location_combo"); - if (combo) - { - combo->setAllowTextEntry(TRUE, 128, FALSE); + LLComboBox* combo = getChild<LLComboBox>("start_location_combo"); + combo->setAllowTextEntry(TRUE, 128, FALSE); - // The XML file loads the combo with the following labels: - // 0 - "My Home" - // 1 - "My Last Location" - // 2 - "<Type region name>" + // The XML file loads the combo with the following labels: + // 0 - "My Home" + // 1 - "My Last Location" + // 2 - "<Type region name>" - BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); - LLString sim_string = LLURLSimString::sInstance.mSimString; - if (!sim_string.empty()) - { - // Replace "<Type region name>" with this region name - combo->remove(2); - combo->add( sim_string ); - combo->setTextEntry(sim_string); - combo->setCurrentByIndex( 2 ); - } - else if (login_last) - { - combo->setCurrentByIndex( 1 ); - } - else - { - combo->setCurrentByIndex( 0 ); - } - - combo->setCommitCallback( &LLPanelGeneral::set_start_location ); + BOOL login_last = gSavedSettings.getBOOL("LoginLastLocation"); + LLString sim_string = LLURLSimString::sInstance.mSimString; + if (!sim_string.empty()) + { + // Replace "<Type region name>" with this region name + combo->remove(2); + combo->add( sim_string ); + combo->setTextEntry(sim_string); + combo->setCurrentByIndex( 2 ); + } + else if (login_last) + { + combo->setCurrentByIndex( 1 ); } + else + { + combo->setCurrentByIndex( 0 ); + } + + combo->setCommitCallback( &LLPanelGeneral::set_start_location ); childSetAction("connect_btn", onClickConnect, this); @@ -413,71 +410,59 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetAction("quit_btn", onClickQuit, this); - LLTextBox* version_text = LLUICtrlFactory::getTextBoxByName(this, "version_text"); - if (version_text) - { - LLString version = llformat("%d.%d.%d (%d)", - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VIEWER_BUILD ); - version_text->setText(version); - version_text->setClickedCallback(onClickVersion); - version_text->setCallbackUserData(this); - } - - LLTextBox* channel_text = LLUICtrlFactory::getTextBoxByName(this, "channel_text"); - if (channel_text) - { - channel_text->setText(gSavedSettings.getString("VersionChannelName")); - channel_text->setClickedCallback(onClickVersion); - channel_text->setCallbackUserData(this); - } + LLTextBox* version_text = getChild<LLTextBox>("version_text"); + LLString version = llformat("%d.%d.%d (%d)", + LL_VERSION_MAJOR, + LL_VERSION_MINOR, + LL_VERSION_PATCH, + LL_VIEWER_BUILD ); + version_text->setText(version); + version_text->setClickedCallback(onClickVersion); + version_text->setCallbackUserData(this); + + LLTextBox* channel_text = getChild<LLTextBox>("channel_text"); + channel_text->setText(gSavedSettings.getString("VersionChannelName")); + channel_text->setClickedCallback(onClickVersion); + channel_text->setCallbackUserData(this); - LLTextBox* forgot_password_text = LLUICtrlFactory::getTextBoxByName(this, "forgot_password_text"); - if (forgot_password_text) - { - forgot_password_text->setClickedCallback(onClickForgotPassword); - } + LLTextBox* forgot_password_text = getChild<LLTextBox>("forgot_password_text"); + forgot_password_text->setClickedCallback(onClickForgotPassword); #endif // get the web browser control LLWebBrowserCtrl* web_browser = getChild<LLWebBrowserCtrl>("login_html"); - if ( web_browser ) - { - // Need to handle login secondlife:///app/ URLs - web_browser->setOpenAppSLURLs( true ); + // Need to handle login secondlife:///app/ URLs + web_browser->setOpenAppSLURLs( true ); - // observe browser events - web_browser->addObserver( this ); + // observe browser events + web_browser->addObserver( this ); - // don't make it a tab stop until SL-27594 is fixed - web_browser->setTabStop(FALSE); - web_browser->navigateToLocalPage( "loading", "loading.html" ); + // don't make it a tab stop until SL-27594 is fixed + web_browser->setTabStop(FALSE); + web_browser->navigateToLocalPage( "loading", "loading.html" ); - // make links open in external browser - web_browser->setOpenInExternalBrowser( true ); + // make links open in external browser + web_browser->setOpenInExternalBrowser( true ); - // force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through) - LLRect htmlRect = getRect(); + // force the size to be correct (XML doesn't seem to be sufficient to do this) (with some padding so the other login screen doesn't show through) + LLRect htmlRect = getRect(); #if USE_VIEWER_AUTH - htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight()); + htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY(), getRect().getWidth() + 6, getRect().getHeight()); #else - htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 ); + htmlRect.setCenterAndSize( getRect().getCenterX() - 2, getRect().getCenterY() + 40, getRect().getWidth() + 6, getRect().getHeight() - 78 ); #endif - web_browser->setRect( htmlRect ); - web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); - reshape( getRect().getWidth(), getRect().getHeight(), 1 ); - - // kick off a request to grab the url manually - gResponsePtr = LLIamHereLogin::build( this ); - std::string login_page = gSavedSettings.getString("LoginPage"); - if (login_page.empty()) - { - login_page = getString( "real_url" ); - } - LLHTTPClient::head( login_page, gResponsePtr ); - }; + web_browser->setRect( htmlRect ); + web_browser->reshape( htmlRect.getWidth(), htmlRect.getHeight(), TRUE ); + reshape( getRect().getWidth(), getRect().getHeight(), 1 ); + + // kick off a request to grab the url manually + gResponsePtr = LLIamHereLogin::build( this ); + std::string login_page = gSavedSettings.getString("LoginPage"); + if (login_page.empty()) + { + login_page = getString( "real_url" ); + } + LLHTTPClient::head( login_page, gResponsePtr ); #if !USE_VIEWER_AUTH // Initialize visibility (and don't force visibility - use prefs) @@ -549,15 +534,13 @@ LLPanelLogin::~LLPanelLogin() if ( gResponsePtr ) gResponsePtr->setParent( 0 ); - // We know we're done with the image, so be rid of it. - gImageList.deleteImage( mLogoImage ); + //// We know we're done with the image, so be rid of it. + //gImageList.deleteImage( mLogoImage ); } // virtual void LLPanelLogin::draw() { - if (!getVisible()) return; - glPushMatrix(); { F32 image_aspect = 1.333333f; @@ -578,14 +561,14 @@ void LLPanelLogin::draw() // draw a background box in black gl_rect_2d( 0, height - 264, width, 264, LLColor4( 0.0f, 0.0f, 0.0f, 1.f ) ); // draw the bottom part of the background image - just the blue background to the native client UI - gl_draw_scaled_image(0, -264, width + 8, mLogoImage->getHeight(), mLogoImage); + mLogoImage->draw(0, -264, width + 8, mLogoImage->getHeight()); #endif } else { // the HTML login page is not available so default to the original screen S32 offscreen_part = height / 3; - gl_draw_scaled_image(0, -offscreen_part, width, height+offscreen_part, mLogoImage); + mLogoImage->draw(0, -offscreen_part, width, height+offscreen_part); }; } glPopMatrix(); @@ -594,56 +577,50 @@ void LLPanelLogin::draw() } // virtual -BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLPanelLogin::handleKeyHere(KEY key, MASK mask) { - if (getVisible() && getEnabled()) + if (( KEY_RETURN == key ) && (MASK_ALT == mask)) { - if (( KEY_RETURN == key ) && (MASK_ALT == mask)) - { - gViewerWindow->toggleFullscreen(FALSE); - return TRUE; - } + gViewerWindow->toggleFullscreen(FALSE); + return TRUE; + } - if (('P' == key) && (MASK_CONTROL == mask)) - { - LLFloaterPreference::show(NULL); - return TRUE; - } + if (('P' == key) && (MASK_CONTROL == mask)) + { + LLFloaterPreference::show(NULL); + return TRUE; + } - if (('T' == key) && (MASK_CONTROL == mask)) - { - new LLFloaterSimple("floater_test.xml"); - return TRUE; - } - - if ( KEY_F1 == key ) - { - llinfos << "Spawning HTML help window" << llendl; - gViewerHtmlHelp.show(); - return TRUE; - } + if (('T' == key) && (MASK_CONTROL == mask)) + { + new LLFloaterSimple("floater_test.xml"); + return TRUE; + } + + if ( KEY_F1 == key ) + { + llinfos << "Spawning HTML help window" << llendl; + gViewerHtmlHelp.show(); + return TRUE; + } # if !LL_RELEASE_FOR_DOWNLOAD - if ( KEY_F2 == key ) - { - llinfos << "Spawning floater TOS window" << llendl; - LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,""); - tos_dialog->startModal(); - return TRUE; - } + if ( KEY_F2 == key ) + { + llinfos << "Spawning floater TOS window" << llendl; + LLFloaterTOS* tos_dialog = LLFloaterTOS::show(LLFloaterTOS::TOS_TOS,""); + tos_dialog->startModal(); + return TRUE; + } #endif - if (!called_from_parent) - { - if (KEY_RETURN == key && MASK_NONE == mask) - { - // let the panel handle UICtrl processing: calls onClickConnect() - return LLPanel::handleKeyHere(key, mask, called_from_parent); - } - } + if (KEY_RETURN == key && MASK_NONE == mask) + { + // let the panel handle UICtrl processing: calls onClickConnect() + return LLPanel::handleKeyHere(key, mask); } - return LLPanel::handleKeyHere(key, mask, called_from_parent); + return LLPanel::handleKeyHere(key, mask); } // virtual @@ -685,12 +662,12 @@ void LLPanelLogin::giveFocus() { // User saved his name but not his password. Move // focus to password field. - edit = LLUICtrlFactory::getLineEditorByName(sInstance, "password_edit"); + edit = sInstance->getChild<LLLineEditor>("password_edit"); } else { // User doesn't have a name, so start there. - edit = LLUICtrlFactory::getLineEditorByName(sInstance, "first_name_edit"); + edit = sInstance->getChild<LLLineEditor>("first_name_edit"); } if (edit) @@ -771,12 +748,9 @@ void LLPanelLogin::addServer(const char *server, S32 domain_name) return; } - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) - { - combo->add(server, LLSD(domain_name) ); - combo->setCurrentByIndex(0); - } + LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); + combo->add(server, LLSD(domain_name) ); + combo->setCurrentByIndex(0); } // static @@ -810,27 +784,24 @@ BOOL LLPanelLogin::getServer(LLString &server, S32 &domain_name) } else { - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) + LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); + LLSD combo_val = combo->getValue(); + if (LLSD::TypeInteger == combo_val.type()) { - LLSD combo_val = combo->getValue(); - if (LLSD::TypeInteger == combo_val.type()) - { - domain_name = combo->getValue().asInteger(); + domain_name = combo->getValue().asInteger(); - if ((S32)GRID_INFO_OTHER == domain_name) - { - server = gGridName; - } - } - else + if ((S32)GRID_INFO_OTHER == domain_name) { - // no valid selection, return other - domain_name = (S32)GRID_INFO_OTHER; - server = combo_val.asString(); + server = gGridName; } - user_picked = combo->isDirty(); } + else + { + // no valid selection, return other + domain_name = (S32)GRID_INFO_OTHER; + server = combo_val.asString(); + } + user_picked = combo->isDirty(); } return user_picked; @@ -845,11 +816,8 @@ void LLPanelLogin::getLocation(LLString &location) return; } - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "start_location_combo"); - if (combo) - { - location = combo->getValue().asString(); - } + LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); + location = combo->getValue().asString(); } // static @@ -860,8 +828,7 @@ void LLPanelLogin::refreshLocation( bool force_visible ) #if USE_VIEWER_AUTH loadLoginPage(); #else - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "start_location_combo"); - if (!combo) return; + LLComboBox* combo = sInstance->getChild<LLComboBox>("start_location_combo"); if (LLURLSimString::parse()) { @@ -1093,15 +1060,12 @@ void LLPanelLogin::onClickConnect(void *) // has both first and last name typed // store off custom server entry, if currently selected - LLComboBox* combo = LLUICtrlFactory::getComboBoxByName(sInstance, "server_combo"); - if (combo) + LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); + S32 selected_server = combo->getValue(); + if (selected_server == GRID_INFO_NONE) { - S32 selected_server = combo->getValue(); - if (selected_server == GRID_INFO_NONE) - { - LLString custom_server = combo->getValue().asString(); - gSavedSettings.setString("CustomServer", custom_server); - } + LLString custom_server = combo->getValue().asString(); + gSavedSettings.setString("CustomServer", custom_server); } sInstance->mCallback(0, sInstance->mCallbackData); } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 76a16528cb..ac6e3b0426 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -74,7 +74,7 @@ public: void *callback_data); ~LLPanelLogin(); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void draw(); virtual void setFocus( BOOL b ); @@ -114,7 +114,7 @@ private: static void onPassKey(LLLineEditor* caller, void* user_data); private: - LLPointer<LLViewerImage> mLogoImage; + LLPointer<LLUIImage> mLogoImage; void (*mCallback)(S32 option, void *userdata); void* mCallbackData; diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 1ad71075ae..83f72160e1 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -69,7 +69,7 @@ #include "llworld.h" #include "pipeline.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llfirstuse.h" #include "lldrawpool.h" @@ -110,57 +110,57 @@ BOOL LLPanelObject::postBuild() //-------------------------------------------------------- // Lock checkbox - mCheckLock = gUICtrlFactory->getCheckBoxByName(this,"checkbox locked"); + mCheckLock = getChild<LLCheckBoxCtrl>("checkbox locked"); childSetCommitCallback("checkbox locked",onCommitLock,this); // Physical checkbox - mCheckPhysics = gUICtrlFactory->getCheckBoxByName(this,"Physical Checkbox Ctrl"); + mCheckPhysics = getChild<LLCheckBoxCtrl>("Physical Checkbox Ctrl"); childSetCommitCallback("Physical Checkbox Ctrl",onCommitPhysics,this); // Temporary checkbox - mCheckTemporary = gUICtrlFactory->getCheckBoxByName(this,"Temporary Checkbox Ctrl"); + mCheckTemporary = getChild<LLCheckBoxCtrl>("Temporary Checkbox Ctrl"); childSetCommitCallback("Temporary Checkbox Ctrl",onCommitTemporary,this); // Phantom checkbox - mCheckPhantom = gUICtrlFactory->getCheckBoxByName(this,"Phantom Checkbox Ctrl"); + mCheckPhantom = getChild<LLCheckBoxCtrl>("Phantom Checkbox Ctrl"); childSetCommitCallback("Phantom Checkbox Ctrl",onCommitPhantom,this); // Position - mLabelPosition = gUICtrlFactory->getTextBoxByName(this,"label position"); - mCtrlPosX = gUICtrlFactory->getSpinnerByName(this,"Pos X"); + mLabelPosition = getChild<LLTextBox>("label position"); + mCtrlPosX = getChild<LLSpinCtrl>("Pos X"); childSetCommitCallback("Pos X",onCommitPosition,this); - mCtrlPosY = gUICtrlFactory->getSpinnerByName(this,"Pos Y"); + mCtrlPosY = getChild<LLSpinCtrl>("Pos Y"); childSetCommitCallback("Pos Y",onCommitPosition,this); - mCtrlPosZ = gUICtrlFactory->getSpinnerByName(this,"Pos Z"); + mCtrlPosZ = getChild<LLSpinCtrl>("Pos Z"); childSetCommitCallback("Pos Z",onCommitPosition,this); // Scale - mLabelSize = gUICtrlFactory->getTextBoxByName(this,"label size"); - mCtrlScaleX = gUICtrlFactory->getSpinnerByName(this,"Scale X"); + mLabelSize = getChild<LLTextBox>("label size"); + mCtrlScaleX = getChild<LLSpinCtrl>("Scale X"); childSetCommitCallback("Scale X",onCommitScale,this); // Scale Y - mCtrlScaleY = gUICtrlFactory->getSpinnerByName(this,"Scale Y"); + mCtrlScaleY = getChild<LLSpinCtrl>("Scale Y"); childSetCommitCallback("Scale Y",onCommitScale,this); // Scale Z - mCtrlScaleZ = gUICtrlFactory->getSpinnerByName(this,"Scale Z"); + mCtrlScaleZ = getChild<LLSpinCtrl>("Scale Z"); childSetCommitCallback("Scale Z",onCommitScale,this); // Rotation - mLabelRotation = gUICtrlFactory->getTextBoxByName(this,"label rotation"); - mCtrlRotX = gUICtrlFactory->getSpinnerByName(this,"Rot X"); + mLabelRotation = getChild<LLTextBox>("label rotation"); + mCtrlRotX = getChild<LLSpinCtrl>("Rot X"); childSetCommitCallback("Rot X",onCommitRotation,this); - mCtrlRotY = gUICtrlFactory->getSpinnerByName(this,"Rot Y"); + mCtrlRotY = getChild<LLSpinCtrl>("Rot Y"); childSetCommitCallback("Rot Y",onCommitRotation,this); - mCtrlRotZ = gUICtrlFactory->getSpinnerByName(this,"Rot Z"); + mCtrlRotZ = getChild<LLSpinCtrl>("Rot Z"); childSetCommitCallback("Rot Z",onCommitRotation,this); //-------------------------------------------------------- // material type popup - mLabelMaterial = gUICtrlFactory->getTextBoxByName(this,"label material"); - mComboMaterial = gUICtrlFactory->getComboBoxByName(this,"material"); + mLabelMaterial = getChild<LLTextBox>("label material"); + mComboMaterial = getChild<LLComboBox>("material"); childSetCommitCallback("material",onCommitMaterial,this); mComboMaterial->removeall(); // *TODO:translate @@ -176,84 +176,84 @@ BOOL LLPanelObject::postBuild() mComboMaterialItemCount = mComboMaterial->getItemCount(); // Base Type - mLabelBaseType = gUICtrlFactory->getTextBoxByName(this,"label basetype"); - mComboBaseType = gUICtrlFactory->getComboBoxByName(this,"comboBaseType"); + mLabelBaseType = getChild<LLTextBox>("label basetype"); + mComboBaseType = getChild<LLComboBox>("comboBaseType"); childSetCommitCallback("comboBaseType",onCommitParametric,this); // Cut - mLabelCut = gUICtrlFactory->getTextBoxByName(this,"text cut"); - mSpinCutBegin = gUICtrlFactory->getSpinnerByName(this,"cut begin"); + mLabelCut = getChild<LLTextBox>("text cut"); + mSpinCutBegin = getChild<LLSpinCtrl>("cut begin"); childSetCommitCallback("cut begin",onCommitParametric,this); mSpinCutBegin->setValidateBeforeCommit( precommitValidate ); - mSpinCutEnd = gUICtrlFactory->getSpinnerByName(this,"cut end"); + mSpinCutEnd = getChild<LLSpinCtrl>("cut end"); childSetCommitCallback("cut end",onCommitParametric,this); mSpinCutEnd->setValidateBeforeCommit( &precommitValidate ); // Hollow / Skew - mLabelHollow = gUICtrlFactory->getTextBoxByName(this,"text hollow"); - mLabelSkew = gUICtrlFactory->getTextBoxByName(this,"text skew"); - mSpinHollow = gUICtrlFactory->getSpinnerByName(this,"Scale 1"); + mLabelHollow = getChild<LLTextBox>("text hollow"); + mLabelSkew = getChild<LLTextBox>("text skew"); + mSpinHollow = getChild<LLSpinCtrl>("Scale 1"); childSetCommitCallback("Scale 1",onCommitParametric,this); mSpinHollow->setValidateBeforeCommit( &precommitValidate ); - mSpinSkew = gUICtrlFactory->getSpinnerByName(this,"Skew"); + mSpinSkew = getChild<LLSpinCtrl>("Skew"); childSetCommitCallback("Skew",onCommitParametric,this); mSpinSkew->setValidateBeforeCommit( &precommitValidate ); - mLabelHoleType = gUICtrlFactory->getTextBoxByName(this,"Hollow Shape"); + mLabelHoleType = getChild<LLTextBox>("Hollow Shape"); // Hole Type - mComboHoleType = gUICtrlFactory->getComboBoxByName(this,"hole"); + mComboHoleType = getChild<LLComboBox>("hole"); childSetCommitCallback("hole",onCommitParametric,this); // Twist - mLabelTwist = gUICtrlFactory->getTextBoxByName(this,"text twist"); - mSpinTwistBegin = gUICtrlFactory->getSpinnerByName(this,"Twist Begin"); + mLabelTwist = getChild<LLTextBox>("text twist"); + mSpinTwistBegin = getChild<LLSpinCtrl>("Twist Begin"); childSetCommitCallback("Twist Begin",onCommitParametric,this); mSpinTwistBegin->setValidateBeforeCommit( precommitValidate ); - mSpinTwist = gUICtrlFactory->getSpinnerByName(this,"Twist End"); + mSpinTwist = getChild<LLSpinCtrl>("Twist End"); childSetCommitCallback("Twist End",onCommitParametric,this); mSpinTwist->setValidateBeforeCommit( &precommitValidate ); // Scale - mSpinScaleX = gUICtrlFactory->getSpinnerByName(this,"Taper Scale X"); + mSpinScaleX = getChild<LLSpinCtrl>("Taper Scale X"); childSetCommitCallback("Taper Scale X",onCommitParametric,this); mSpinScaleX->setValidateBeforeCommit( &precommitValidate ); - mSpinScaleY = gUICtrlFactory->getSpinnerByName(this,"Taper Scale Y"); + mSpinScaleY = getChild<LLSpinCtrl>("Taper Scale Y"); childSetCommitCallback("Taper Scale Y",onCommitParametric,this); mSpinScaleY->setValidateBeforeCommit( &precommitValidate ); // Shear - mLabelShear = gUICtrlFactory->getTextBoxByName(this,"text topshear"); - mSpinShearX = gUICtrlFactory->getSpinnerByName(this,"Shear X"); + mLabelShear = getChild<LLTextBox>("text topshear"); + mSpinShearX = getChild<LLSpinCtrl>("Shear X"); childSetCommitCallback("Shear X",onCommitParametric,this); mSpinShearX->setValidateBeforeCommit( &precommitValidate ); - mSpinShearY = gUICtrlFactory->getSpinnerByName(this,"Shear Y"); + mSpinShearY = getChild<LLSpinCtrl>("Shear Y"); childSetCommitCallback("Shear Y",onCommitParametric,this); mSpinShearY->setValidateBeforeCommit( &precommitValidate ); // Path / Profile - mCtrlPathBegin = gUICtrlFactory->getSpinnerByName(this,"Path Limit Begin"); + mCtrlPathBegin = getChild<LLSpinCtrl>("Path Limit Begin"); childSetCommitCallback("Path Limit Begin",onCommitParametric,this); mCtrlPathBegin->setValidateBeforeCommit( &precommitValidate ); - mCtrlPathEnd = gUICtrlFactory->getSpinnerByName(this,"Path Limit End"); + mCtrlPathEnd = getChild<LLSpinCtrl>("Path Limit End"); childSetCommitCallback("Path Limit End",onCommitParametric,this); mCtrlPathEnd->setValidateBeforeCommit( &precommitValidate ); // Taper - mLabelTaper = gUICtrlFactory->getTextBoxByName(this,"text taper2"); - mSpinTaperX = gUICtrlFactory->getSpinnerByName(this,"Taper X"); + mLabelTaper = getChild<LLTextBox>("text taper2"); + mSpinTaperX = getChild<LLSpinCtrl>("Taper X"); childSetCommitCallback("Taper X",onCommitParametric,this); mSpinTaperX->setValidateBeforeCommit( precommitValidate ); - mSpinTaperY = gUICtrlFactory->getSpinnerByName(this,"Taper Y"); + mSpinTaperY = getChild<LLSpinCtrl>("Taper Y"); childSetCommitCallback("Taper Y",onCommitParametric,this); mSpinTaperY->setValidateBeforeCommit( precommitValidate ); // Radius Offset / Revolutions - mLabelRadiusOffset = gUICtrlFactory->getTextBoxByName(this,"text radius delta"); - mLabelRevolutions = gUICtrlFactory->getTextBoxByName(this,"text revolutions"); - mSpinRadiusOffset = gUICtrlFactory->getSpinnerByName(this,"Radius Offset"); + mLabelRadiusOffset = getChild<LLTextBox>("text radius delta"); + mLabelRevolutions = getChild<LLTextBox>("text revolutions"); + mSpinRadiusOffset = getChild<LLSpinCtrl>("Radius Offset"); childSetCommitCallback("Radius Offset",onCommitParametric,this); mSpinRadiusOffset->setValidateBeforeCommit( &precommitValidate ); - mSpinRevolutions = gUICtrlFactory->getSpinnerByName(this,"Revolutions"); + mSpinRevolutions = getChild<LLSpinCtrl>("Revolutions"); childSetCommitCallback("Revolutions",onCommitParametric,this); mSpinRevolutions->setValidateBeforeCommit( &precommitValidate ); @@ -272,7 +272,7 @@ BOOL LLPanelObject::postBuild() // Allow any texture to be used during non-immediate mode. mCtrlSculptTexture->setNonImmediateFilterPermMask(PERM_NONE); LLAggregatePermissions texture_perms; - if (gSelectMgr->selectGetAggregateTexturePermissions(texture_perms)) + if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms)) { BOOL can_copy = texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY || @@ -288,8 +288,8 @@ BOOL LLPanelObject::postBuild() } } - mLabelSculptType = gUICtrlFactory->getTextBoxByName(this, "label sculpt type"); - mCtrlSculptType = gUICtrlFactory->getComboBoxByName(this, "sculpt type control"); + mLabelSculptType = getChild<LLTextBox>("label sculpt type"); + mCtrlSculptType = getChild<LLComboBox>( "sculpt type control"); childSetCommitCallback("sculpt type control", onCommitSculptType, this); @@ -317,11 +317,11 @@ LLPanelObject::~LLPanelObject() void LLPanelObject::getState( ) { - LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstRootObject(); + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); LLViewerObject* root_objectp = objectp; if(!objectp) { - objectp = gSelectMgr->getSelection()->getFirstObject(); + objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); // *FIX: shouldn't we just keep the child? if (objectp) { @@ -430,13 +430,13 @@ void LLPanelObject::getState( ) BOOL owners_identical; LLUUID owner_id; LLString owner_name; - owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); + owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); // BUG? Check for all objects being editable? - S32 roots_selected = gSelectMgr->getSelection()->getRootObjectCount(); + S32 roots_selected = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); BOOL editable = root_objectp->permModify(); - S32 selected_count = gSelectMgr->getSelection()->getObjectCount(); - BOOL single_volume = (gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME )) + S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) && (selected_count == 1); // Select Single Message @@ -460,7 +460,7 @@ void LLPanelObject::getState( ) BOOL valid; U32 owner_mask_on; U32 owner_mask_off; - valid = gSelectMgr->selectGetPerm(PERM_OWNER, &owner_mask_on, &owner_mask_off); + valid = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, &owner_mask_on, &owner_mask_off); if(valid) { @@ -517,7 +517,7 @@ void LLPanelObject::getState( ) return object->getMaterial(); } } func; - bool material_same = gSelectMgr->getSelection()->getSelectedTEValue( &func, material_code ); + bool material_same = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, material_code ); if (editable && single_volume && material_same) { @@ -1075,7 +1075,7 @@ void LLPanelObject::getState( ) mSculptTypeRevert = sculpt_params->getSculptType(); } - LLTextureCtrl* mTextureCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this,"sculpt texture control"); + LLTextureCtrl* mTextureCtrl = getChild<LLTextureCtrl>("sculpt texture control"); if(mTextureCtrl) { mTextureCtrl->setTentative(FALSE); @@ -1122,7 +1122,7 @@ void LLPanelObject::sendIsPhysical() BOOL value = mCheckPhysics->get(); if( mIsPhysical != value ) { - gSelectMgr->selectionUpdatePhysics(value); + LLSelectMgr::getInstance()->selectionUpdatePhysics(value); mIsPhysical = value; llinfos << "update physics sent" << llendl; @@ -1138,7 +1138,7 @@ void LLPanelObject::sendIsTemporary() BOOL value = mCheckTemporary->get(); if( mIsTemporary != value ) { - gSelectMgr->selectionUpdateTemporary(value); + LLSelectMgr::getInstance()->selectionUpdateTemporary(value); mIsTemporary = value; llinfos << "update temporary sent" << llendl; @@ -1155,7 +1155,7 @@ void LLPanelObject::sendIsPhantom() BOOL value = mCheckPhantom->get(); if( mIsPhantom != value ) { - gSelectMgr->selectionUpdatePhantom(value); + LLSelectMgr::getInstance()->selectionUpdatePhantom(value); mIsPhantom = value; llinfos << "update phantom sent" << llendl; @@ -1171,7 +1171,7 @@ void LLPanelObject::sendCastShadows() BOOL value = mCheckCastShadows->get(); if( mCastShadows != value ) { - gSelectMgr->selectionUpdateCastShadows(value); + LLSelectMgr::getInstance()->selectionUpdateCastShadows(value); mCastShadows = value; llinfos << "update cast shadows sent" << llendl; @@ -1195,7 +1195,7 @@ void LLPanelObject::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) if (material_name != LEGACY_FULLBRIGHT_DESC) { U8 material_code = LLMaterialTable::basic.getMCode(material_name.c_str()); - gSelectMgr->selectionSetMaterial(material_code); + LLSelectMgr::getInstance()->selectionSetMaterial(material_code); } } } @@ -1573,7 +1573,7 @@ void LLPanelObject::sendRotation() mObject->setRotation(rotation, TRUE ); - gSelectMgr->sendMultipleUpdate(UPD_ROTATION); + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_ROTATION); } } @@ -1595,13 +1595,13 @@ void LLPanelObject::sendScale() BOOL dont_stretch_textures = !LLManipScale::getStretchTextures(); if (dont_stretch_textures) { - gSelectMgr->saveSelectedObjectTransform(SELECT_ACTION_TYPE_SCALE); + LLSelectMgr::getInstance()->saveSelectedObjectTransform(SELECT_ACTION_TYPE_SCALE); } mObject->setScale(newscale, TRUE); - gSelectMgr->sendMultipleUpdate(UPD_SCALE | UPD_POSITION); + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE | UPD_POSITION); - gSelectMgr->adjustTexturesByScale(TRUE, !dont_stretch_textures); + LLSelectMgr::getInstance()->adjustTexturesByScale(TRUE, !dont_stretch_textures); // llinfos << "scale sent" << llendl; } else @@ -1620,8 +1620,8 @@ void LLPanelObject::sendPosition() // Clamp the Z height const F32 height = newpos.mV[VZ]; - const F32 min_height = gWorldp->getMinAllowedZ(mObject); - const F32 max_height = gWorldPointer->getRegionMaxHeight(); + const F32 min_height = LLWorld::getInstance()->getMinAllowedZ(mObject); + const F32 max_height = LLWorld::getInstance()->getRegionMaxHeight(); if (!mObject->isAttachment()) { @@ -1639,7 +1639,7 @@ void LLPanelObject::sendPosition() // Grass is always drawn on the ground, so clamp its position to the ground if (mObject->getPCode() == LL_PCODE_LEGACY_GRASS) { - mCtrlPosZ->set(gWorldp->resolveLandHeightAgent(newpos) + 1.f); + mCtrlPosZ->set(LLWorld::getInstance()->resolveLandHeightAgent(newpos) + 1.f); } } @@ -1647,7 +1647,7 @@ void LLPanelObject::sendPosition() // won't get dumped by the simulator. LLVector3d new_pos_global = regionp->getPosGlobalFromRegion(newpos); - if ( gWorldPointer->positionRegionValidGlobal(new_pos_global) ) + if ( LLWorld::getInstance()->positionRegionValidGlobal(new_pos_global) ) { // send only if the position is changed, that is, the delta vector is not zero LLVector3d old_pos_global = mObject->getPositionGlobal(); @@ -1665,10 +1665,10 @@ void LLPanelObject::sendPosition() { mObject->setPositionEdit(newpos); } - gSelectMgr->sendMultipleUpdate(UPD_POSITION); + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); //mRootObject->sendPositionUpdate(); - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); // llinfos << "position sent" << llendl; } @@ -1726,9 +1726,9 @@ void LLPanelObject::draw() const LLColor4 blue( 0.f, 0.5f, 1.0f, 1); // Tune the colors of the labels - LLTool* tool = gToolMgr->getCurrentTool(); + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); - if (tool == gToolTranslate) + if (tool == LLToolCompTranslate::getInstance()) { mCtrlPosX ->setLabelColor(red); mCtrlPosY ->setLabelColor(green); @@ -1742,7 +1742,7 @@ void LLPanelObject::draw() mCtrlRotY ->setLabelColor(white); mCtrlRotZ ->setLabelColor(white); } - else if ( tool == gToolStretch ) + else if ( tool == LLToolCompScale::getInstance() ) { mCtrlPosX ->setLabelColor(white); mCtrlPosY ->setLabelColor(white); @@ -1756,7 +1756,7 @@ void LLPanelObject::draw() mCtrlRotY ->setLabelColor(white); mCtrlRotZ ->setLabelColor(white); } - else if ( tool == gToolRotate ) + else if ( tool == LLToolCompRotate::getInstance() ) { mCtrlPosX ->setLabelColor(white); mCtrlPosY ->setLabelColor(white); @@ -1846,7 +1846,7 @@ void LLPanelObject::onCommitLock(LLUICtrl *ctrl, void *data) BOOL new_state = self->mCheckLock->get(); - gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, !new_state, PERM_MOVE | PERM_MODIFY); + LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, !new_state, PERM_MOVE | PERM_MODIFY); } // static diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 8ab31acb49..7f9dae8a64 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -61,7 +61,7 @@ #include "llfloatergroups.h" #include "llnamebox.h" #include "llviewercontrol.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "roles_constants.h" ///---------------------------------------------------------------------------- @@ -109,7 +109,7 @@ BOOL LLPanelPermissions::postBuild() this->childSetCommitCallback("clickaction",LLPanelPermissions::onCommitClickAction,this); this->childSetCommitCallback("search_check",LLPanelPermissions::onCommitIncludeInSearch,this); - LLTextBox* group_rect_proxy = gUICtrlFactory->getTextBoxByName(this,"Group Name Proxy"); + LLTextBox* group_rect_proxy = getChild<LLTextBox>("Group Name Proxy"); if(group_rect_proxy ) { mLabelGroupName = new LLNameBox("Group Name", group_rect_proxy->getRect()); @@ -132,7 +132,7 @@ LLPanelPermissions::~LLPanelPermissions() void LLPanelPermissions::refresh() { - LLButton* BtnDeedToGroup = gUICtrlFactory->getButtonByName(this,"button deed"); + LLButton* BtnDeedToGroup = getChild<LLButton>("button deed"); if(BtnDeedToGroup) { LLString deedText; @@ -148,16 +148,16 @@ void LLPanelPermissions::refresh() BtnDeedToGroup->setLabelUnselected(deedText); } BOOL root_selected = TRUE; - LLSelectNode* nodep = gSelectMgr->getSelection()->getFirstRootNode(); - S32 object_count = gSelectMgr->getSelection()->getRootObjectCount(); + LLSelectNode* nodep = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); if(!nodep || 0 == object_count) { - nodep = gSelectMgr->getSelection()->getFirstNode(); - object_count = gSelectMgr->getSelection()->getObjectCount(); + nodep = LLSelectMgr::getInstance()->getSelection()->getFirstNode(); + object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); root_selected = FALSE; } - //BOOL attachment_selected = gSelectMgr->getSelection()->isAttachment(); + //BOOL attachment_selected = LLSelectMgr::getInstance()->getSelection()->isAttachment(); //attachment_selected = false; LLViewerObject* objectp = NULL; if(nodep) objectp = nodep->getObject(); @@ -222,7 +222,7 @@ void LLPanelPermissions::refresh() childSetValue("search_check", FALSE); childSetEnabled("search_check", false); - LLRadioGroup* RadioSaleType = gUICtrlFactory->getRadioGroupByName(this,"sale type"); + LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type"); if(RadioSaleType) { RadioSaleType->setSelectedIndex(-1); @@ -234,7 +234,7 @@ void LLPanelPermissions::refresh() childSetEnabled("EdCost",false); childSetEnabled("label click action",false); - LLComboBox* ComboClickAction = gUICtrlFactory->getComboBoxByName(this,"clickaction"); + LLComboBox* ComboClickAction = getChild<LLComboBox>("clickaction"); if(ComboClickAction) { ComboClickAction->setEnabled(FALSE); @@ -254,9 +254,9 @@ void LLPanelPermissions::refresh() BOOL is_one_object = (object_count == 1); // BUG: fails if a root and non-root are both single-selected. - BOOL is_perm_modify = (gSelectMgr->getSelection()->getFirstRootNode() - && gSelectMgr->selectGetRootsModify()) - || gSelectMgr->selectGetModify(); + BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode() + && LLSelectMgr::getInstance()->selectGetRootsModify()) + || LLSelectMgr::getInstance()->selectGetModify(); const LLView* keyboard_focus_view = gFocusMgr.getKeyboardFocus(); S32 string_index = 0; LLString MODIFY_INFO_STRINGS[] = @@ -283,7 +283,7 @@ void LLPanelPermissions::refresh() childSetEnabled("Creator:",true); BOOL creators_identical; LLString creator_name; - creators_identical = gSelectMgr->selectGetCreator(mCreatorID, + creators_identical = LLSelectMgr::getInstance()->selectGetCreator(mCreatorID, creator_name); childSetText("Creator Name",creator_name); @@ -295,13 +295,13 @@ void LLPanelPermissions::refresh() BOOL owners_identical; LLString owner_name; - owners_identical = gSelectMgr->selectGetOwner(mOwnerID, owner_name); + owners_identical = LLSelectMgr::getInstance()->selectGetOwner(mOwnerID, owner_name); // llinfos << "owners_identical " << (owners_identical ? "TRUE": "FALSE") << llendl; if (mOwnerID.isNull()) { - if(gSelectMgr->selectIsGroupOwned()) + if(LLSelectMgr::getInstance()->selectIsGroupOwned()) { // Group owned already displayed by selectGetOwner } @@ -309,7 +309,7 @@ void LLPanelPermissions::refresh() { // Display last owner if public LLString last_owner_name; - gSelectMgr->selectGetLastOwner(mLastOwnerID, last_owner_name); + LLSelectMgr::getInstance()->selectGetLastOwner(mLastOwnerID, last_owner_name); // It should never happen that the last owner is null and the owner // is null, but it seems to be a bug in the simulator right now. JC @@ -323,12 +323,12 @@ void LLPanelPermissions::refresh() childSetText("Owner Name",owner_name); childSetEnabled("Owner Name",TRUE); - childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || gSelectMgr->selectIsGroupOwned())); + childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned())); // update group text field childSetEnabled("Group:",true); LLUUID group_id; - BOOL groups_identical = gSelectMgr->selectGetGroup(group_id); + BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if (groups_identical) { if(mLabelGroupName) @@ -348,14 +348,14 @@ void LLPanelPermissions::refresh() if(is_one_object) { childSetEnabled("Name:",true); - LLLineEditor* LineEditorObjectName = gUICtrlFactory->getLineEditorByName(this,"Object Name"); + LLLineEditor* LineEditorObjectName = getChild<LLLineEditor>("Object Name"); if(keyboard_focus_view != LineEditorObjectName) { childSetText("Object Name",nodep->mName); } childSetEnabled("Description:",true); - LLLineEditor* LineEditorObjectDesc = gUICtrlFactory->getLineEditorByName(this,"Object Description"); + LLLineEditor* LineEditorObjectDesc = getChild<LLLineEditor>("Object Description"); if(LineEditorObjectDesc) { if(keyboard_focus_view != LineEditorObjectDesc) @@ -378,8 +378,8 @@ void LLPanelPermissions::refresh() // Pre-compute object info string - S32 prim_count = gSelectMgr->getSelection()->getObjectCount(); - S32 obj_count = gSelectMgr->getSelection()->getRootObjectCount(); + S32 prim_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); + S32 obj_count = LLSelectMgr::getInstance()->getSelection()->getRootObjectCount(); LLString object_info_string; if (1 == obj_count) @@ -406,17 +406,17 @@ void LLPanelPermissions::refresh() childSetEnabled("prim info",true); S32 price; - BOOL is_for_sale = gSelectMgr->selectIsForSale(price); + BOOL is_for_sale = LLSelectMgr::getInstance()->selectIsForSale(price); if (!is_for_sale) { price = DEFAULT_PRICE; } BOOL self_owned = (gAgent.getID() == mOwnerID); - BOOL group_owned = gSelectMgr->selectIsGroupOwned() ; - BOOL public_owned = (mOwnerID.isNull() && !gSelectMgr->selectIsGroupOwned()); - BOOL can_transfer = gSelectMgr->selectGetRootsTransfer(); - BOOL can_copy = gSelectMgr->selectGetRootsCopy(); + BOOL group_owned = LLSelectMgr::getInstance()->selectIsGroupOwned() ; + BOOL public_owned = (mOwnerID.isNull() && !LLSelectMgr::getInstance()->selectIsGroupOwned()); + BOOL can_transfer = LLSelectMgr::getInstance()->selectGetRootsTransfer(); + BOOL can_copy = LLSelectMgr::getInstance()->selectGetRootsCopy(); if(!owners_identical) { @@ -426,7 +426,7 @@ void LLPanelPermissions::refresh() } else if(self_owned || (group_owned && gAgent.hasPowerInGroup(group_id,GP_OBJECT_SET_SALE))) { - LLLineEditor* EditPrice = gUICtrlFactory->getLineEditorByName(this,"EdCost"); + LLLineEditor* EditPrice = getChild<LLLineEditor>("EdCost"); if(keyboard_focus_view != EditPrice) { childSetText("EdCost",llformat("%d",price)); @@ -478,23 +478,23 @@ void LLPanelPermissions::refresh() U32 next_owner_mask_on = 0; U32 next_owner_mask_off = 0; - valid_base_perms = gSelectMgr->selectGetPerm(PERM_BASE, + valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE, &base_mask_on, &base_mask_off); - valid_owner_perms = gSelectMgr->selectGetPerm(PERM_OWNER, + valid_owner_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER, &owner_mask_on, &owner_mask_off); - valid_group_perms = gSelectMgr->selectGetPerm(PERM_GROUP, + valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP, &group_mask_on, &group_mask_off); - valid_everyone_perms = gSelectMgr->selectGetPerm(PERM_EVERYONE, + valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE, &everyone_mask_on, &everyone_mask_off); - valid_next_perms = gSelectMgr->selectGetPerm(PERM_NEXT_OWNER, + valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER, &next_owner_mask_on, &next_owner_mask_off); @@ -724,10 +724,10 @@ void LLPanelPermissions::refresh() // reflect sale information LLSaleInfo sale_info; - BOOL valid_sale_info = gSelectMgr->selectGetSaleInfo(sale_info); + BOOL valid_sale_info = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info); LLSaleInfo::EForSale sale_type = sale_info.getSaleType(); - LLRadioGroup* RadioSaleType = gUICtrlFactory->getRadioGroupByName(this,"sale type"); + LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type"); if(RadioSaleType) { if (valid_sale_info) @@ -753,18 +753,18 @@ void LLPanelPermissions::refresh() } // Check search status of objects - BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); + BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ); bool include_in_search; - bool all_include_in_search = gSelectMgr->selectionGetIncludeInSearch(&include_in_search); + bool all_include_in_search = LLSelectMgr::getInstance()->selectionGetIncludeInSearch(&include_in_search); childSetEnabled("search_check", has_change_sale_ability && all_volume); childSetValue("search_check", include_in_search); childSetTentative("search_check", ! all_include_in_search); // Click action (touch, sit, buy) U8 click_action = 0; - if (gSelectMgr->selectionGetClickAction(&click_action)) + if (LLSelectMgr::getInstance()->selectionGetClickAction(&click_action)) { - LLComboBox* ComboClickAction = gUICtrlFactory->getComboBoxByName(this,"clickaction"); + LLComboBox* ComboClickAction = getChild<LLComboBox>("clickaction"); if(ComboClickAction) { ComboClickAction->setCurrentByIndex((S32)click_action); @@ -779,14 +779,14 @@ void LLPanelPermissions::refresh() void LLPanelPermissions::onClickClaim(void*) { // try to claim ownership - gSelectMgr->sendOwner(gAgent.getID(), gAgent.getGroupID()); + LLSelectMgr::getInstance()->sendOwner(gAgent.getID(), gAgent.getGroupID()); } // static void LLPanelPermissions::onClickRelease(void*) { // try to release ownership - gSelectMgr->sendOwner(LLUUID::null, LLUUID::null); + LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null); } // static @@ -802,10 +802,10 @@ void LLPanelPermissions::onClickOwner(void *data) { LLPanelPermissions *self = (LLPanelPermissions *)data; - if (gSelectMgr->selectIsGroupOwned()) + if (LLSelectMgr::getInstance()->selectIsGroupOwned()) { LLUUID group_id; - gSelectMgr->selectGetGroup(group_id); + LLSelectMgr::getInstance()->selectGetGroup(group_id); LLFloaterGroupInfo::showFromUUID(group_id); } else @@ -819,7 +819,7 @@ void LLPanelPermissions::onClickGroup(void* data) LLPanelPermissions* panelp = (LLPanelPermissions*)data; LLUUID owner_id; LLString name; - BOOL owners_identical = gSelectMgr->selectGetOwner(owner_id, name); + BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, name); LLFloater* parent_floater = gFloaterView->getParentFloater(panelp); if(owners_identical && (owner_id == gAgent.getID())) @@ -845,7 +845,7 @@ void LLPanelPermissions::cbGroupID(LLUUID group_id, void* userdata) { self->mLabelGroupName->setNameID(group_id, TRUE); } - gSelectMgr->sendGroup(group_id); + LLSelectMgr::getInstance()->sendGroup(group_id); } void callback_deed_to_group(S32 option, void*) @@ -853,11 +853,11 @@ void callback_deed_to_group(S32 option, void*) if (0 == option) { LLUUID group_id; - BOOL groups_identical = gSelectMgr->selectGetGroup(group_id); + BOOL groups_identical = LLSelectMgr::getInstance()->selectGetGroup(group_id); if(groups_identical && (gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED))) { - gSelectMgr->sendOwner(LLUUID::null, group_id, FALSE); -// gViewerStats->incStat(LLViewerStats::ST_RELEASE_COUNT); + LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); +// LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } } } @@ -875,7 +875,7 @@ void LLPanelPermissions::onClickDeedToGroup(void* data) // static void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm) { - LLViewerObject* object = gSelectMgr->getSelection()->getFirstRootObject(); + LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); if(!object) return; // Checkbox will have toggled itself @@ -883,7 +883,7 @@ void LLPanelPermissions::onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 LLCheckBoxCtrl *check = (LLCheckBoxCtrl *)ctrl; BOOL new_state = check->get(); - gSelectMgr->selectionSetObjectPermissions(field, new_state, perm); + LLSelectMgr::getInstance()->selectionSetObjectPermissions(field, new_state, perm); } // static @@ -931,11 +931,11 @@ void LLPanelPermissions::onCommitName(LLUICtrl*, void* data) { //llinfos << "LLPanelPermissions::onCommitName()" << llendl; LLPanelPermissions* self = (LLPanelPermissions*)data; - LLLineEditor* tb = gUICtrlFactory->getLineEditorByName(self,"Object Name"); + LLLineEditor* tb = self->getChild<LLLineEditor>("Object Name"); if(tb) { - gSelectMgr->selectionSetObjectName(tb->getText()); -// gSelectMgr->selectionSetObjectName(self->mLabelObjectName->getText()); + LLSelectMgr::getInstance()->selectionSetObjectName(tb->getText()); +// LLSelectMgr::getInstance()->selectionSetObjectName(self->mLabelObjectName->getText()); } } @@ -945,10 +945,10 @@ void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data) { //llinfos << "LLPanelPermissions::onCommitDesc()" << llendl; LLPanelPermissions* self = (LLPanelPermissions*)data; - LLLineEditor* le = gUICtrlFactory->getLineEditorByName(self,"Object Description"); + LLLineEditor* le = self->getChild<LLLineEditor>("Object Description"); if(le) { - gSelectMgr->selectionSetObjectDescription(le->getText()); + LLSelectMgr::getInstance()->selectionSetObjectDescription(le->getText()); } } @@ -971,11 +971,11 @@ void LLPanelPermissions::setAllSaleInfo() llinfos << "LLPanelPermissions::setAllSaleInfo()" << llendl; LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; - LLCheckBoxCtrl* mCheckPurchase = gUICtrlFactory->getCheckBoxByName(this,"checkbox for sale"); + LLCheckBoxCtrl* mCheckPurchase = getChild<LLCheckBoxCtrl>("checkbox for sale"); if(mCheckPurchase && mCheckPurchase->get()) { - LLRadioGroup* RadioSaleType = gUICtrlFactory->getRadioGroupByName(this,"sale type"); + LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type"); if(RadioSaleType) { switch(RadioSaleType->getSelectedIndex()) @@ -995,7 +995,7 @@ void LLPanelPermissions::setAllSaleInfo() } } } - LLLineEditor* mEditPrice = gUICtrlFactory->getLineEditorByName(this,"EdCost"); + LLLineEditor* mEditPrice = getChild<LLLineEditor>("EdCost"); S32 price = -1; if(mEditPrice) @@ -1010,17 +1010,17 @@ void LLPanelPermissions::setAllSaleInfo() } LLSaleInfo sale_info(sale_type, price); - gSelectMgr->selectionSetObjectSaleInfo(sale_info); + LLSelectMgr::getInstance()->selectionSetObjectSaleInfo(sale_info); // If turned off for-sale, make sure click-action buy is turned // off as well if (sale_type == LLSaleInfo::FS_NOT) { U8 click_action = 0; - gSelectMgr->selectionGetClickAction(&click_action); + LLSelectMgr::getInstance()->selectionGetClickAction(&click_action); if (click_action == CLICK_ACTION_BUY) { - gSelectMgr->selectionSetClickAction(CLICK_ACTION_TOUCH); + LLSelectMgr::getInstance()->selectionSetClickAction(CLICK_ACTION_TOUCH); } } } @@ -1046,14 +1046,14 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*) if (click_action == CLICK_ACTION_BUY) { LLSaleInfo sale_info; - gSelectMgr->selectGetSaleInfo(sale_info); + LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info); if (!sale_info.isForSale()) { gViewerWindow->alertXml("CantSetBuyObject"); // Set click action back to its old value U8 click_action = 0; - gSelectMgr->selectionGetClickAction(&click_action); + LLSelectMgr::getInstance()->selectionGetClickAction(&click_action); box->setCurrentByIndex((S32)click_action); return; @@ -1063,14 +1063,14 @@ void LLPanelPermissions::onCommitClickAction(LLUICtrl* ctrl, void*) { // Verify object has script with money() handler LLSelectionPayable payable; - bool can_pay = gSelectMgr->getSelection()->applyToObjects(&payable); + bool can_pay = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&payable); if (!can_pay) { // Warn, but do it anyway. gViewerWindow->alertXml("ClickActionNotPayable"); } } - gSelectMgr->selectionSetClickAction(click_action); + LLSelectMgr::getInstance()->selectionSetClickAction(click_action); } // static @@ -1079,6 +1079,6 @@ void LLPanelPermissions::onCommitIncludeInSearch(LLUICtrl* ctrl, void*) LLCheckBoxCtrl* box = (LLCheckBoxCtrl*)ctrl; llassert(box); - gSelectMgr->selectionSetIncludeInSearch(box->get()); + LLSelectMgr::getInstance()->selectionSetIncludeInSearch(box->get()); } diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 2a85d52689..674515273b 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -52,7 +52,7 @@ #include "lltexturectrl.h" #include "lluiconstants.h" #include "llviewergenericmessage.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerparcelmgr.h" #include "llworldmap.h" #include "llfloaterworldmap.h" @@ -88,11 +88,11 @@ LLPanelPick::LLPanelPick(BOOL top_pick) std::string pick_def_file; if (top_pick) { - gUICtrlFactory->buildPanel(this, "panel_top_pick.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_top_pick.xml"); } else { - gUICtrlFactory->buildPanel(this, "panel_avatar_pick.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml"); } } @@ -121,44 +121,44 @@ void LLPanelPick::reset() BOOL LLPanelPick::postBuild() { - mSnapshotCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); + mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); mSnapshotCtrl->setCommitCallback(onCommitAny); mSnapshotCtrl->setCallbackUserData(this); - mNameEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "given_name_editor"); + mNameEditor = getChild<LLLineEditor>("given_name_editor"); mNameEditor->setCommitOnFocusLost(TRUE); mNameEditor->setCommitCallback(onCommitAny); mNameEditor->setCallbackUserData(this); - mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); + mDescEditor = getChild<LLTextEditor>("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); mDescEditor->setCommitCallback(onCommitAny); mDescEditor->setCallbackUserData(this); mDescEditor->setTabsToNextField(TRUE); - mLocationEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "location_editor"); + mLocationEditor = getChild<LLLineEditor>("location_editor"); - mSetBtn = LLViewerUICtrlFactory::getButtonByName(this, "set_location_btn"); + mSetBtn = getChild<LLButton>( "set_location_btn"); mSetBtn->setClickedCallback(onClickSet); mSetBtn->setCallbackUserData(this); - mTeleportBtn = LLViewerUICtrlFactory::getButtonByName(this, "pick_teleport_btn"); + mTeleportBtn = getChild<LLButton>( "pick_teleport_btn"); mTeleportBtn->setClickedCallback(onClickTeleport); mTeleportBtn->setCallbackUserData(this); - mMapBtn = LLViewerUICtrlFactory::getButtonByName(this, "pick_map_btn"); + mMapBtn = getChild<LLButton>( "pick_map_btn"); mMapBtn->setClickedCallback(onClickMap); mMapBtn->setCallbackUserData(this); - mSortOrderText = LLViewerUICtrlFactory::getTextBoxByName(this, "sort_order_text"); + mSortOrderText = getChild<LLTextBox>("sort_order_text"); - mSortOrderEditor = LLViewerUICtrlFactory::getLineEditorByName(this, "sort_order_editor"); + mSortOrderEditor = getChild<LLLineEditor>("sort_order_editor"); mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt); mSortOrderEditor->setCommitOnFocusLost(TRUE); mSortOrderEditor->setCommitCallback(onCommitAny); mSortOrderEditor->setCallbackUserData(this); - mEnabledCheck = LLViewerUICtrlFactory::getCheckBoxByName(this, "enabled_check"); + mEnabledCheck = getChild<LLCheckBoxCtrl>( "enabled_check"); mEnabledCheck->setCommitCallback(onCommitAny); mEnabledCheck->setCallbackUserData(this); @@ -176,7 +176,7 @@ void LLPanelPick::initNewPick() mPosGlobal = gAgent.getPositionGlobal(); // Try to fill in the current parcel - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { mNameEditor->setText(parcel->getName()); @@ -367,12 +367,9 @@ void LLPanelPick::processPickInfoReply(LLMessageSystem *msg, void **) void LLPanelPick::draw() { - if (getVisible()) - { - refresh(); + refresh(); - LLPanel::draw(); - } + LLPanel::draw(); } diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index aa10dda62c..9985486170 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -52,7 +52,7 @@ #include "lltexturectrl.h" #include "llworldmap.h" #include "llviewerregion.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" //#include "llviewermenu.h" // create_landmark() #include "llweb.h" #include "llsdutil.h" @@ -85,33 +85,33 @@ BOOL LLPanelPlace::postBuild() // Since this is only used in the directory browser, always // disable the snapshot control. Otherwise clicking on it will // open a texture picker. - mSnapshotCtrl = LLViewerUICtrlFactory::getTexturePickerByName(this, "snapshot_ctrl"); + mSnapshotCtrl = getChild<LLTextureCtrl>("snapshot_ctrl"); mSnapshotCtrl->setEnabled(FALSE); - mNameEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "name_editor"); + mNameEditor = getChild<LLTextBox>("name_editor"); // Text boxes appear to have a " " in them by default. This breaks the // emptiness test for filling in data from the network. Slam to empty. mNameEditor->setText( LLString::null ); - mDescEditor = LLUICtrlFactory::getTextEditorByName(this, "desc_editor"); + mDescEditor = getChild<LLTextEditor>("desc_editor"); - mInfoEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "info_editor"); + mInfoEditor = getChild<LLTextBox>("info_editor"); - mLocationEditor = LLViewerUICtrlFactory::getTextBoxByName(this, "location_editor"); + mLocationEditor = getChild<LLTextBox>("location_editor"); - mTeleportBtn = LLViewerUICtrlFactory::getButtonByName(this, "teleport_btn"); + mTeleportBtn = getChild<LLButton>( "teleport_btn"); mTeleportBtn->setClickedCallback(onClickTeleport); mTeleportBtn->setCallbackUserData(this); - mMapBtn = LLViewerUICtrlFactory::getButtonByName(this, "map_btn"); + mMapBtn = getChild<LLButton>( "map_btn"); mMapBtn->setClickedCallback(onClickMap); mMapBtn->setCallbackUserData(this); - //mLandmarkBtn = LLViewerUICtrlFactory::getButtonByName(this, "landmark_btn"); + //mLandmarkBtn = getChild<LLButton>( "landmark_btn"); //mLandmarkBtn->setClickedCallback(onClickLandmark); //mLandmarkBtn->setCallbackUserData(this); - mAuctionBtn = LLViewerUICtrlFactory::getButtonByName(this, "auction_btn"); + mAuctionBtn = getChild<LLButton>( "auction_btn"); mAuctionBtn->setClickedCallback(onClickAuction); mAuctionBtn->setCallbackUserData(this); @@ -371,9 +371,9 @@ void LLPanelPlace::onClickTeleport(void* data) LLPanelPlace* self = (LLPanelPlace*)data; LLView* parent_viewp = self->getParent(); - if (parent_viewp->getWidgetType() == WIDGET_TYPE_FLOATER) + LLFloater* parent_floaterp = dynamic_cast<LLFloater*>(parent_viewp); + if (parent_floaterp) { - LLFloater* parent_floaterp = (LLFloater*)parent_viewp; parent_floaterp->close(); } // LLFloater* parent_floaterp = (LLFloater*)self->getParent(); diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index a9198cd6b4..c96f35d8dd 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -74,7 +74,7 @@ #include "pipeline.h" #include "lldrawpool.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" // "Features" Tab @@ -139,11 +139,11 @@ LLPanelVolume::~LLPanelVolume() void LLPanelVolume::getState( ) { - LLViewerObject* objectp = gSelectMgr->getSelection()->getFirstRootObject(); + LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); LLViewerObject* root_objectp = objectp; if(!objectp) { - objectp = gSelectMgr->getSelection()->getFirstObject(); + objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); // *FIX: shouldn't we just keep the child? if (objectp) { @@ -183,12 +183,12 @@ void LLPanelVolume::getState( ) BOOL owners_identical; LLUUID owner_id; LLString owner_name; - owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); + owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); // BUG? Check for all objects being editable? BOOL editable = root_objectp->permModify(); - BOOL single_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ) - && gSelectMgr->getSelection()->getObjectCount() == 1; + BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ) + && LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1; // Select Single Message if (single_volume) @@ -232,9 +232,9 @@ void LLPanelVolume::getState( ) } else { - ((LLPanel *) getChildByName ("Light Intensity", true))->clear(); - ((LLPanel *) getChildByName ("Light Radius", true))->clear(); - ((LLPanel *) getChildByName ("Light Falloff", true))->clear(); + getChild<LLSpinCtrl>("Light Intensity", true)->clear(); + getChild<LLSpinCtrl>("Light Radius", true)->clear(); + getChild<LLSpinCtrl>("Light Falloff", true)->clear(); childSetEnabled("label color",false); LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); @@ -292,14 +292,14 @@ void LLPanelVolume::getState( ) } else { - ((LLPanel *) getChildByName ("FlexNumSections", true))->clear(); - ((LLPanel *) getChildByName ("FlexGravity", true))->clear(); - ((LLPanel *) getChildByName ("FlexTension", true))->clear(); - ((LLPanel *) getChildByName ("FlexFriction", true))->clear(); - ((LLPanel *) getChildByName ("FlexWind", true))->clear(); - ((LLPanel *) getChildByName ("FlexForceX", true))->clear(); - ((LLPanel *) getChildByName ("FlexForceY", true))->clear(); - ((LLPanel *) getChildByName ("FlexForceZ", true))->clear(); + getChild<LLSpinCtrl>("FlexNumSections", true)->clear(); + getChild<LLSpinCtrl>("FlexGravity", true)->clear(); + getChild<LLSpinCtrl>("FlexTension", true)->clear(); + getChild<LLSpinCtrl>("FlexFriction", true)->clear(); + getChild<LLSpinCtrl>("FlexWind", true)->clear(); + getChild<LLSpinCtrl>("FlexForceX", true)->clear(); + getChild<LLSpinCtrl>("FlexForceY", true)->clear(); + getChild<LLSpinCtrl>("FlexForceZ", true)->clear(); childSetEnabled("FlexNumSections",false); childSetEnabled("FlexGravity",false); @@ -412,7 +412,7 @@ void LLPanelVolume::sendIsFlexible() if (objectp->getClickAction() == CLICK_ACTION_SIT) { - gSelectMgr->selectionSetClickAction(CLICK_ACTION_NONE); + LLSelectMgr::getInstance()->selectionSetClickAction(CLICK_ACTION_NONE); } } @@ -420,7 +420,7 @@ void LLPanelVolume::sendIsFlexible() if (volobjp->setIsFlexible(is_flexible)) { mObject->sendShapeUpdate(); - gSelectMgr->selectionUpdatePhantom(volobjp->flagPhantom()); + LLSelectMgr::getInstance()->selectionUpdatePhantom(volobjp->flagPhantom()); } llinfos << "update flexible sent" << llendl; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index cad38e36ff..d5f91596e8 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -231,11 +231,11 @@ void LLPreview::onCommit() LLViewerObject* obj = avatar->getWornAttachment( item->getUUID() ); if( obj ) { - gSelectMgr->deselectAll(); - gSelectMgr->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); - gSelectMgr->selectionSetObjectDescription( childGetText("desc") ); + LLSelectMgr::getInstance()->deselectAll(); + LLSelectMgr::getInstance()->addAsIndividual( obj, SELECT_ALL_TES, FALSE ); + LLSelectMgr::getInstance()->selectionSetObjectDescription( childGetText("desc") ); - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } } } @@ -374,7 +374,7 @@ BOOL LLPreview::handleMouseDown(S32 x, S32 y, MASK mask) S32 screen_x; S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y ); - gToolDragAndDrop->setDragStart(screen_x, screen_y); + LLToolDragAndDrop::getInstance()->setDragStart(screen_x, screen_y); return TRUE; } return LLFloater::handleMouseDown(x, y, mask); @@ -402,7 +402,7 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask) if(item && item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) - && gToolDragAndDrop->isOverThreshold(screen_x, screen_y)) + && LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y)) { EDragAndDropType type; type = LLAssetType::lookupDragAndDropType(item->getType()); @@ -415,11 +415,11 @@ BOOL LLPreview::handleHover(S32 x, S32 y, MASK mask) { src = LLToolDragAndDrop::SOURCE_AGENT; } - gToolDragAndDrop->beginDrag(type, + LLToolDragAndDrop::getInstance()->beginDrag(type, item->getUUID(), src, mObjectUUID); - return gToolDragAndDrop->handleHover(x, y, mask ); + return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask ); } } return LLFloater::handleHover(x,y,mask); diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 105103d10b..868278472f 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -42,14 +42,14 @@ #include "llfilepicker.h" #include "lllineeditor.h" #include "lluictrlfactory.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" extern LLAgent gAgent; LLPreviewAnim::LLPreviewAnim(const std::string& name, const LLRect& rect, const std::string& title, const LLUUID& item_uuid, const S32& activate, const LLUUID& object_uuid ) : LLPreview( name, rect, title, item_uuid, object_uuid) { - gUICtrlFactory->buildFloater(this,"floater_preview_animation.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_animation.xml"); childSetAction("Anim play btn",playAnim,this); childSetAction("Anim audition btn",auditionAnim,this); @@ -116,7 +116,7 @@ void LLPreviewAnim::playAnim( void *userdata ) { LLUUID itemID=item->getAssetUUID(); - LLButton* btn = LLUICtrlFactory::getButtonByName(self, "Anim play btn"); + LLButton* btn = self->getChild<LLButton>("Anim play btn"); if (btn) { btn->toggleState(); @@ -153,7 +153,7 @@ void LLPreviewAnim::auditionAnim( void *userdata ) { LLUUID itemID=item->getAssetUUID(); - LLButton* btn = LLUICtrlFactory::getButtonByName(self, "Anim audition btn"); + LLButton* btn = self->getChild<LLButton>("Anim audition btn"); if (btn) { btn->toggleState(); diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 691a786245..07e65e3d54 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -59,7 +59,7 @@ #include "llradiogroup.h" #include "llscrolllistctrl.h" #include "lltextbox.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerinventory.h" #include "llviewerobject.h" #include "llviewerobjectlist.h" @@ -134,7 +134,7 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& self->init(item_id, object_id); // Builds and adds to gFloaterView - gUICtrlFactory->buildFloater(self, "floater_preview_gesture.xml"); + LLUICtrlFactory::getInstance()->buildFloater(self, "floater_preview_gesture.xml"); self->setTitle(title); // Move window to top-left of screen @@ -185,18 +185,15 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& // virtual -BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask, - BOOL called_from_parent) +BOOL LLPreviewGesture::handleKeyHere(KEY key, MASK mask) { - if(getVisible() && getEnabled()) + if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) { - if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) - { - saveIfNeeded(); - return TRUE; - } + saveIfNeeded(); + return TRUE; } - return LLPreview::handleKeyHere(key, mask, called_from_parent); + + return LLPreview::handleKeyHere(key, mask); } @@ -397,7 +394,7 @@ BOOL LLPreviewGesture::postBuild() LLTextBox* text; LLCheckBoxCtrl* check; - edit = LLViewerUICtrlFactory::getLineEditorByName(this, "trigger_editor"); + edit = getChild<LLLineEditor>("trigger_editor"); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); edit->setCommitOnFocusLost(TRUE); @@ -405,11 +402,11 @@ BOOL LLPreviewGesture::postBuild() edit->setIgnoreTab(TRUE); mTriggerEditor = edit; - text = LLViewerUICtrlFactory::getTextBoxByName(this, "replace_text"); + text = getChild<LLTextBox>("replace_text"); text->setEnabled(FALSE); mReplaceText = text; - edit = LLViewerUICtrlFactory::getLineEditorByName(this, "replace_editor"); + edit = getChild<LLLineEditor>("replace_editor"); edit->setEnabled(FALSE); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); @@ -418,76 +415,76 @@ BOOL LLPreviewGesture::postBuild() edit->setIgnoreTab(TRUE); mReplaceEditor = edit; - combo = LLViewerUICtrlFactory::getComboBoxByName(this, "modifier_combo"); + combo = getChild<LLComboBox>( "modifier_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mModifierCombo = combo; - combo = LLViewerUICtrlFactory::getComboBoxByName(this, "key_combo"); + combo = getChild<LLComboBox>( "key_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mKeyCombo = combo; - list = LLViewerUICtrlFactory::getScrollListByName(this, "library_list"); + list = getChild<LLScrollListCtrl>("library_list"); list->setCommitCallback(onCommitLibrary); list->setDoubleClickCallback(onClickAdd); list->setCallbackUserData(this); mLibraryList = list; - btn = LLViewerUICtrlFactory::getButtonByName(this, "add_btn"); + btn = getChild<LLButton>( "add_btn"); btn->setClickedCallback(onClickAdd); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mAddBtn = btn; - btn = LLViewerUICtrlFactory::getButtonByName(this, "up_btn"); + btn = getChild<LLButton>( "up_btn"); btn->setClickedCallback(onClickUp); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mUpBtn = btn; - btn = LLViewerUICtrlFactory::getButtonByName(this, "down_btn"); + btn = getChild<LLButton>( "down_btn"); btn->setClickedCallback(onClickDown); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDownBtn = btn; - btn = LLViewerUICtrlFactory::getButtonByName(this, "delete_btn"); + btn = getChild<LLButton>( "delete_btn"); btn->setClickedCallback(onClickDelete); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDeleteBtn = btn; - list = LLViewerUICtrlFactory::getScrollListByName(this, "step_list"); + list = getChild<LLScrollListCtrl>("step_list"); list->setCommitCallback(onCommitStep); list->setCallbackUserData(this); mStepList = list; // Options - text = LLViewerUICtrlFactory::getTextBoxByName(this, "options_text"); + text = getChild<LLTextBox>("options_text"); text->setBorderVisible(TRUE); mOptionsText = text; - combo = LLViewerUICtrlFactory::getComboBoxByName(this, "animation_list"); + combo = getChild<LLComboBox>( "animation_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitAnimation); combo->setCallbackUserData(this); mAnimationCombo = combo; LLRadioGroup* group; - group = LLViewerUICtrlFactory::getRadioGroupByName(this, "animation_trigger_type"); + group = getChild<LLRadioGroup>("animation_trigger_type"); group->setVisible(FALSE); group->setCommitCallback(onCommitAnimationTrigger); group->setCallbackUserData(this); mAnimationRadio = group; - combo = LLViewerUICtrlFactory::getComboBoxByName(this, "sound_list"); + combo = getChild<LLComboBox>( "sound_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitSound); combo->setCallbackUserData(this); mSoundCombo = combo; - edit = LLViewerUICtrlFactory::getLineEditorByName(this, "chat_editor"); + edit = getChild<LLLineEditor>("chat_editor"); edit->setVisible(FALSE); edit->setCommitCallback(onCommitChat); //edit->setKeystrokeCallback(onKeystrokeCommit); @@ -496,19 +493,19 @@ BOOL LLPreviewGesture::postBuild() edit->setIgnoreTab(TRUE); mChatEditor = edit; - check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_anim_check"); + check = getChild<LLCheckBoxCtrl>( "wait_anim_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitAnimCheck = check; - check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_time_check"); + check = getChild<LLCheckBoxCtrl>( "wait_time_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitTimeCheck = check; - edit = LLViewerUICtrlFactory::getLineEditorByName(this, "wait_time_editor"); + edit = getChild<LLLineEditor>("wait_time_editor"); edit->setEnabled(FALSE); edit->setVisible(FALSE); edit->setPrevalidate(LLLineEditor::prevalidateFloat); @@ -520,17 +517,17 @@ BOOL LLPreviewGesture::postBuild() mWaitTimeEditor = edit; // Buttons at the bottom - check = LLViewerUICtrlFactory::getCheckBoxByName(this, "active_check"); + check = getChild<LLCheckBoxCtrl>( "active_check"); check->setCommitCallback(onCommitActive); check->setCallbackUserData(this); mActiveCheck = check; - btn = LLViewerUICtrlFactory::getButtonByName(this, "save_btn"); + btn = getChild<LLButton>( "save_btn"); btn->setClickedCallback(onClickSave); btn->setCallbackUserData(this); mSaveBtn = btn; - btn = LLViewerUICtrlFactory::getButtonByName(this, "preview_btn"); + btn = getChild<LLButton>( "preview_btn"); btn->setClickedCallback(onClickPreview); btn->setCallbackUserData(this); mPreviewBtn = btn; @@ -956,10 +953,7 @@ void LLPreviewGesture::onLoadComplete(LLVFS *vfs, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) @@ -988,7 +982,7 @@ void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture) if (item) { - LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); + LLLineEditor* descEditor = getChild<LLLineEditor>("desc"); descEditor->setText(item->getDescription()); }*/ @@ -1179,7 +1173,7 @@ void LLPreviewGesture::saveIfNeeded() } else if (gAssetStorage) { - LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); + LLLineEditor* descEditor = getChild<LLLineEditor>("desc"); LLSaveInfo* info = new LLSaveInfo(mItemUUID, mObjectUUID, descEditor->getText(), tid); gAssetStorage->storeAssetData(tid, LLAssetType::AT_GESTURE, onSaveComplete, info, FALSE); } diff --git a/indra/newview/llpreviewgesture.h b/indra/newview/llpreviewgesture.h index 4dea34ba1c..b4fa63b69b 100644 --- a/indra/newview/llpreviewgesture.h +++ b/indra/newview/llpreviewgesture.h @@ -53,7 +53,7 @@ public: static LLPreviewGesture* show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus = TRUE); // LLView - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 37d0ba8303..f9e1fc04dc 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -58,7 +58,7 @@ #include "llviewercontrol.h" // gSavedSettings #include "llappviewer.h" // app_abort_quit() #include "lllineeditor.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -99,13 +99,13 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name, if (show_keep_discard) { - gUICtrlFactory->buildFloater(this,"floater_preview_notecard_keep_discard.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard_keep_discard.xml"); childSetAction("Keep",onKeepBtn,this); childSetAction("Discard",onDiscardBtn,this); } else { - gUICtrlFactory->buildFloater(this,"floater_preview_notecard.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_notecard.xml"); childSetAction("Save",onClickSave,this); if( mAssetID.isNull() ) @@ -136,7 +136,7 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name, setTitle(title); - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if (editor) { @@ -154,7 +154,7 @@ LLPreviewNotecard::~LLPreviewNotecard() BOOL LLPreviewNotecard::postBuild() { - LLViewerTextEditor *ed = (LLViewerTextEditor *)gUICtrlFactory->getTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor"); if (ed) { ed->setNotecardInfo(mNotecardItemID, mObjectID); @@ -181,7 +181,7 @@ bool LLPreviewNotecard::saveItem(LLPointer<LLInventoryItem>* itemptr) void LLPreviewNotecard::setEnabled( BOOL enabled ) { - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); childSetEnabled("Notecard Editor", enabled); childSetVisible("lock", !enabled); @@ -197,7 +197,7 @@ void LLPreviewNotecard::draw() //childSetFocus("Save", FALSE); - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); BOOL script_changed = !editor->isPristine(); childSetEnabled("Save", script_changed && getEnabled()); @@ -206,24 +206,21 @@ void LLPreviewNotecard::draw() } // virtual -BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask, - BOOL called_from_parent) +BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask) { - if(getVisible() && getEnabled()) + if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) { - if(('S' == key) && (MASK_CONTROL == (mask & MASK_CONTROL))) - { - saveIfNeeded(); - return TRUE; - } + saveIfNeeded(); + return TRUE; } - return LLPreview::handleKeyHere(key, mask, called_from_parent); + + return LLPreview::handleKeyHere(key, mask); } // virtual BOOL LLPreviewNotecard::canClose() { - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if(mForceClose || editor->isPristine()) { @@ -242,7 +239,7 @@ BOOL LLPreviewNotecard::canClose() const LLInventoryItem* LLPreviewNotecard::getDragItem() { - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if(editor) { @@ -254,9 +251,7 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem() bool LLPreviewNotecard::hasEmbeddedInventory() { LLViewerTextEditor* editor = NULL; - editor = LLViewerUICtrlFactory::getViewerTextEditorByName( - this, - "Notecard Editor"); + editor = getChild<LLViewerTextEditor>("Notecard Editor"); if (!editor) return false; return editor->hasEmbeddedInventory(); } @@ -271,7 +266,7 @@ void LLPreviewNotecard::loadAsset() { // request the asset. const LLInventoryItem* item = getItem(); - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if (!editor) return; @@ -377,7 +372,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, buffer[file_length] = 0; - LLViewerTextEditor* previewEditor = LLViewerUICtrlFactory::getViewerTextEditorByName(preview, "Notecard Editor"); + LLViewerTextEditor* previewEditor = preview->getChild<LLViewerTextEditor>("Notecard Editor"); if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) ) { @@ -403,10 +398,7 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) @@ -475,7 +467,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem) } - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor"); + LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor"); if(!editor->isPristine()) { @@ -592,7 +584,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data // Perform item copy to inventory if (info->mCopyItem.notNull()) { - LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(info->mSelf, "Notecard Editor"); + LLViewerTextEditor* editor = info->mSelf->getChild<LLViewerTextEditor>("Notecard Editor"); if (editor) { editor->copyInventory(info->mCopyItem); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 233246ceaa..1c801abf59 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -61,7 +61,7 @@ public: // llview virtual void draw(); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void setEnabled( BOOL enabled ); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index dd49262cb2..26052968fc 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -78,7 +78,7 @@ #include "llviewerstats.h" #include "llviewertexteditor.h" #include "llviewerwindow.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llwebbrowserctrl.h" #include "lluictrlfactory.h" @@ -176,7 +176,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(std::string title, LLRect rect, LLS : LLFloater("script search",rect,title), mEditorCore(editor_core) { - gUICtrlFactory->buildFloater(this,"floater_script_search.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_search.xml"); childSetAction("search_btn", onBtnSearch,this); childSetAction("replace_btn", onBtnReplace,this); @@ -198,9 +198,10 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(std::string title, LLRect rect, LLS LLView* viewp = (LLView*)editor_core; while(viewp) { - if (viewp->getWidgetType() == WIDGET_TYPE_FLOATER) + LLFloater* floaterp = dynamic_cast<LLFloater*>(viewp); + if (floaterp) { - ((LLFloater*)viewp)->addDependentFloater(this); + floaterp->addDependentFloater(this); break; } viewp = viewp->getParent(); @@ -243,7 +244,7 @@ void LLFloaterScriptSearch::onBtnSearch(void *userdata) void LLFloaterScriptSearch::handleBtnSearch() { - LLCheckBoxCtrl* caseChk = LLUICtrlFactory::getCheckBoxByName(this,"case_text"); + LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); mEditorCore->mEditor->selectNext(childGetText("search_text"), caseChk->get()); } @@ -256,7 +257,7 @@ void LLFloaterScriptSearch::onBtnReplace(void *userdata) void LLFloaterScriptSearch::handleBtnReplace() { - LLCheckBoxCtrl* caseChk = LLUICtrlFactory::getCheckBoxByName(this,"case_text"); + LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); mEditorCore->mEditor->replaceText(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); } @@ -269,7 +270,7 @@ void LLFloaterScriptSearch::onBtnReplaceAll(void *userdata) void LLFloaterScriptSearch::handleBtnReplaceAll() { - LLCheckBoxCtrl* caseChk = LLUICtrlFactory::getCheckBoxByName(this,"case_text"); + LLCheckBoxCtrl* caseChk = getChild<LLCheckBoxCtrl>("case_text"); mEditorCore->mEditor->replaceTextAll(childGetText("search_text"), childGetText("replace_text"), caseChk->get()); } @@ -311,16 +312,15 @@ LLScriptEdCore::LLScriptEdCore( setBorderVisible(FALSE); - gUICtrlFactory->buildPanel(this, "floater_script_ed_panel.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this, "floater_script_ed_panel.xml"); - mErrorList = LLUICtrlFactory::getScrollListByName(this, "lsl errors"); + mErrorList = getChild<LLScrollListCtrl>("lsl errors"); - mFunctions = LLUICtrlFactory::getComboBoxByName(this, "Insert..."); + mFunctions = getChild<LLComboBox>( "Insert..."); childSetCommitCallback("Insert...", &LLScriptEdCore::onBtnInsertFunction, this); - mEditor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Script Editor"); - mEditor->setReadOnlyBgColor(gColors.getColor( "ScriptBgReadOnlyColor" ) ); + mEditor = getChild<LLViewerTextEditor>("Script Editor"); mEditor->setFollowsAll(); mEditor->setHandleEditKeysDirectly(TRUE); mEditor->setEnabled(TRUE); @@ -389,47 +389,47 @@ LLScriptEdCore::~LLScriptEdCore() void LLScriptEdCore::initMenu() { - LLMenuItemCallGL* menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Save"); + LLMenuItemCallGL* menuItem = getChild<LLMenuItemCallGL>("Save"); menuItem->setMenuCallback(onBtnSave, this); menuItem->setEnabledCallback(hasChanged); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Revert All Changes"); + menuItem = getChild<LLMenuItemCallGL>("Revert All Changes"); menuItem->setMenuCallback(onBtnUndoChanges, this); menuItem->setEnabledCallback(hasChanged); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Undo"); + menuItem = getChild<LLMenuItemCallGL>("Undo"); menuItem->setMenuCallback(onUndoMenu, this); menuItem->setEnabledCallback(enableUndoMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Redo"); + menuItem = getChild<LLMenuItemCallGL>("Redo"); menuItem->setMenuCallback(onRedoMenu, this); menuItem->setEnabledCallback(enableRedoMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Cut"); + menuItem = getChild<LLMenuItemCallGL>("Cut"); menuItem->setMenuCallback(onCutMenu, this); menuItem->setEnabledCallback(enableCutMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Copy"); + menuItem = getChild<LLMenuItemCallGL>("Copy"); menuItem->setMenuCallback(onCopyMenu, this); menuItem->setEnabledCallback(enableCopyMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Paste"); + menuItem = getChild<LLMenuItemCallGL>("Paste"); menuItem->setMenuCallback(onPasteMenu, this); menuItem->setEnabledCallback(enablePasteMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Select All"); + menuItem = getChild<LLMenuItemCallGL>("Select All"); menuItem->setMenuCallback(onSelectAllMenu, this); menuItem->setEnabledCallback(enableSelectAllMenu); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Search / Replace..."); + menuItem = getChild<LLMenuItemCallGL>("Search / Replace..."); menuItem->setMenuCallback(onSearchMenu, this); menuItem->setEnabledCallback(NULL); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "Help..."); + menuItem = getChild<LLMenuItemCallGL>("Help..."); menuItem->setMenuCallback(onBtnHelp, this); menuItem->setEnabledCallback(NULL); - menuItem = LLUICtrlFactory::getMenuItemCallByName(this, "LSL Wiki Help..."); + menuItem = getChild<LLMenuItemCallGL>("LSL Wiki Help..."); menuItem->setMenuCallback(onBtnDynamicHelp, this); menuItem->setEnabledCallback(NULL); } @@ -472,8 +472,8 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate) if (!help_floater) return; // update back and forward buttons - LLButton* fwd_button = LLUICtrlFactory::getButtonByName(help_floater, "fwd_btn"); - LLButton* back_button = LLUICtrlFactory::getButtonByName(help_floater, "back_btn"); + LLButton* fwd_button = help_floater->getChild<LLButton>("fwd_btn"); + LLButton* back_button = help_floater->getChild<LLButton>("back_btn"); LLWebBrowserCtrl* browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); back_button->setEnabled(browser->canNavigateBack()); fwd_button->setEnabled(browser->canNavigateForward()); @@ -536,7 +536,7 @@ void LLScriptEdCore::setHelpPage(const LLString& help_string) LLWebBrowserCtrl* web_browser = help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); if (!web_browser) return; - LLComboBox* history_combo = gUICtrlFactory->getComboBoxByName(help_floater, "history_combo"); + LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo"); if (!history_combo) return; LLUIString url_string = gSavedSettings.getString("LSLHelpURL"); @@ -556,7 +556,7 @@ void LLScriptEdCore::addHelpItemToHistory(const LLString& help_string) LLFloater* help_floater = mLiveHelpHandle.get(); if (!help_floater) return; - LLComboBox* history_combo = gUICtrlFactory->getComboBoxByName(help_floater, "history_combo"); + LLComboBox* history_combo = help_floater->getChild<LLComboBox>("history_combo"); if (!history_combo) return; // separate history items from full item list @@ -670,7 +670,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) } live_help_floater = new LLFloater("lsl_help"); - gUICtrlFactory->buildFloater(live_help_floater, "floater_lsl_guide.xml"); + LLUICtrlFactory::getInstance()->buildFloater(live_help_floater, "floater_lsl_guide.xml"); ((LLFloater*)corep->getParent())->addDependentFloater(live_help_floater, TRUE); live_help_floater->childSetCommitCallback("lock_check", onCheckLock, userdata); live_help_floater->childSetValue("lock_check", gSavedSettings.getBOOL("ScriptHelpFollowsCursor")); @@ -681,7 +681,7 @@ void LLScriptEdCore::onBtnDynamicHelp(void* userdata) LLWebBrowserCtrl* browser = live_help_floater->getChild<LLWebBrowserCtrl>("lsl_guide_html"); browser->setAlwaysRefresh(TRUE); - LLComboBox* help_combo = LLUICtrlFactory::getComboBoxByName(live_help_floater, "history_combo"); + LLComboBox* help_combo = live_help_floater->getChild<LLComboBox>("history_combo"); LLKeywordToken *token; LLKeywords::keyword_iterator_t token_it; for (token_it = corep->mEditor->keywordsBegin(); @@ -789,10 +789,7 @@ void LLScriptEdCore::onBtnInsertFunction(LLUICtrl *ui, void* userdata) // static void LLScriptEdCore::doSave( void* userdata, BOOL close_after_save ) { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_LSL_SAVE_COUNT ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_LSL_SAVE_COUNT ); LLScriptEdCore* self = (LLScriptEdCore*) userdata; @@ -1015,33 +1012,31 @@ void LLScriptEdCore::deleteBridges() } // virtual -BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask) { - if(getVisible() && getEnabled()) - { - bool just_control = MASK_CONTROL == (mask & MASK_MODIFIERS); + bool just_control = MASK_CONTROL == (mask & MASK_MODIFIERS); - if(('S' == key) && just_control) + if(('S' == key) && just_control) + { + if(mSaveCallback) { - if(mSaveCallback) - { - // don't close after saving - mSaveCallback(mUserdata, FALSE); - } - - return TRUE; + // don't close after saving + mSaveCallback(mUserdata, FALSE); } - if(('F' == key) && just_control) + return TRUE; + } + + if(('F' == key) && just_control) + { + if(mSearchReplaceCallback) { - if(mSearchReplaceCallback) - { - mSearchReplaceCallback(mUserdata); - } - - return TRUE; + mSearchReplaceCallback(mUserdata); } + + return TRUE; } + return FALSE; } @@ -1096,7 +1091,7 @@ LLPreviewLSL::LLPreviewLSL(const std::string& name, const LLRect& rect, factory_map["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this); - gUICtrlFactory->buildFloater(this,"floater_script_preview.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_script_preview.xml", &factory_map); const LLInventoryItem* item = getItem(); @@ -1316,7 +1311,7 @@ void LLPreviewLSL::uploadAssetLegacy(const std::string& filename, const LLUUID& item_id, const LLTransactionID& tid) { - LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc"); + LLLineEditor* descEditor = getChild<LLLineEditor>("desc"); LLScriptSaveInfo* info = new LLScriptSaveInfo(item_id, descEditor->getText(), tid); @@ -1517,10 +1512,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) @@ -1627,7 +1619,7 @@ LLLiveLSLEditor::LLLiveLSLEditor(const std::string& name, LLCallbackMap::map_t factory_map; factory_map["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); - gUICtrlFactory->buildFloater(this,"floater_live_lsleditor.xml", &factory_map); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_live_lsleditor.xml", &factory_map); childSetCommitCallback("running", LLLiveLSLEditor::onRunningCheckboxClicked, this); @@ -1830,10 +1822,7 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) @@ -1913,7 +1902,7 @@ void LLLiveLSLEditor::onRunningCheckboxClicked( LLUICtrl*, void* userdata ) { LLLiveLSLEditor* self = (LLLiveLSLEditor*) userdata; LLViewerObject* object = gObjectList.findObject( self->mObjectID ); - LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(self, "running"); + LLCheckBoxCtrl* runningCheckbox = self->getChild<LLCheckBoxCtrl>("running"); BOOL running = runningCheckbox->get(); //self->mRunningCheckbox->get(); if( object ) @@ -1961,39 +1950,37 @@ void LLLiveLSLEditor::onReset(void *userdata) void LLLiveLSLEditor::draw() { - if(getVisible()) + LLViewerObject* object = gObjectList.findObject(mObjectID); + LLCheckBoxCtrl* runningCheckbox = getChild<LLCheckBoxCtrl>( "running"); + if(object && mAskedForRunningInfo && mHaveRunningInfo) { - LLViewerObject* object = gObjectList.findObject(mObjectID); - LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(this, "running"); - if(object && mAskedForRunningInfo && mHaveRunningInfo) + if(object->permAnyOwner()) { - if(object->permAnyOwner()) - { - runningCheckbox->setLabel(getString("script_running")); - runningCheckbox->setEnabled(TRUE); - } - else - { - runningCheckbox->setLabel(getString("public_objects_can_not_run")); - runningCheckbox->setEnabled(FALSE); - // *FIX: Set it to false so that the ui is correct for - // a box that is released to public. It could be - // incorrect after a release/claim cycle, but will be - // correct after clicking on it. - runningCheckbox->set(FALSE); - } + runningCheckbox->setLabel(getString("script_running")); + runningCheckbox->setEnabled(TRUE); } - else if(!object) + else { - // HACK: Display this information in the title bar. - // Really ought to put in main window. - setTitle("Script (object out of range)"); + runningCheckbox->setLabel(getString("public_objects_can_not_run")); runningCheckbox->setEnabled(FALSE); - // object may have fallen out of range. - mHaveRunningInfo = FALSE; + // *FIX: Set it to false so that the ui is correct for + // a box that is released to public. It could be + // incorrect after a release/claim cycle, but will be + // correct after clicking on it. + runningCheckbox->set(FALSE); } - LLFloater::draw(); } + else if(!object) + { + // HACK: Display this information in the title bar. + // Really ought to put in main window. + setTitle("Script (object out of range)"); + runningCheckbox->setEnabled(FALSE); + // object may have fallen out of range. + mHaveRunningInfo = FALSE; + } + + LLFloater::draw(); } @@ -2103,7 +2090,7 @@ void LLLiveLSLEditor::saveIfNeeded() std::string url = gAgent.getRegion()->getCapability("UpdateScriptTaskInventory"); getWindow()->incBusyCount(); mPendingUploads++; - BOOL is_running = LLUICtrlFactory::getCheckBoxByName(this, "running")->get(); + BOOL is_running = getChild<LLCheckBoxCtrl>( "running")->get(); if (!url.empty()) { uploadAssetViaCaps(url, filename, mObjectID, @@ -2221,7 +2208,7 @@ void LLLiveLSLEditor::uploadAssetLegacy(const std::string& filename, LLFile::remove(dst_filename.c_str()); // If we successfully saved it, then we should be able to check/uncheck the running box! - LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(this, "running"); + LLCheckBoxCtrl* runningCheckbox = getChild<LLCheckBoxCtrl>( "running"); runningCheckbox->setLabel(getString("script_running")); runningCheckbox->setEnabled(TRUE); } @@ -2389,7 +2376,7 @@ void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) instance->mHaveRunningInfo = TRUE; BOOL running; msg->getBOOLFast(_PREHASH_Script, _PREHASH_Running, running); - LLCheckBoxCtrl* runningCheckbox = LLUICtrlFactory::getCheckBoxByName(instance, "running"); + LLCheckBoxCtrl* runningCheckbox = instance->getChild<LLCheckBoxCtrl>("running"); runningCheckbox->set(running); } } diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index 55b006908f..d7d96e2037 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -52,12 +52,11 @@ class LLMenuBarGL; class LLFloaterScriptSearch; class LLKeywordToken; -// Inner, implementation class. LLPreviewScript and LLLiveScriptEditor each own one of these. +// Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel { friend class LLPreviewScript; friend class LLPreviewLSL; - friend class LLLiveScriptEditor; friend class LLLiveLSLEditor; friend class LLFloaterScriptSearch; @@ -118,7 +117,7 @@ public: void selectFirstError(); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); protected: void deleteBridges(); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index b92a6d58c8..3c23bf15ae 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -41,7 +41,7 @@ #include "llresmgr.h" #include "llviewercontrol.h" #include "llviewermessage.h" // send_guid_sound_trigger -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" extern LLAudioEngine* gAudiop; extern LLAgent gAgent; @@ -52,15 +52,15 @@ LLPreviewSound::LLPreviewSound(const std::string& name, const LLRect& rect, cons LLPreview( name, rect, title, item_uuid, object_uuid) { - gUICtrlFactory->buildFloater(this,"floater_preview_sound.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_sound.xml"); childSetAction("Sound play btn",&LLPreviewSound::playSound,this); childSetAction("Sound audition btn",&LLPreviewSound::auditionSound,this); - LLButton* button = LLUICtrlFactory::getButtonByName(this, "Sound play btn"); + LLButton* button = getChild<LLButton>("Sound play btn"); button->setSoundFlags(LLView::SILENT); - button = LLUICtrlFactory::getButtonByName(this, "Sound audition btn"); + button = getChild<LLButton>("Sound audition btn"); button->setSoundFlags(LLView::SILENT); const LLInventoryItem* item = getItem(); diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index e1a9636fd0..392c9724a0 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -45,7 +45,7 @@ #include "llui.h" #include "llviewerimage.h" #include "llviewerimagelist.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "lllineeditor.h" @@ -159,14 +159,14 @@ void LLPreviewTexture::init() if (mCopyToInv) { - gUICtrlFactory->buildFloater(this,"floater_preview_embedded_texture.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_embedded_texture.xml"); childSetAction("Copy To Inventory",LLPreview::onBtnCopyToInv,this); } else if (mShowKeepDiscard) { - gUICtrlFactory->buildFloater(this,"floater_preview_texture_keep_discard.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture_keep_discard.xml"); childSetAction("Keep",onKeepBtn,this); childSetAction("Discard",onDiscardBtn,this); @@ -174,7 +174,7 @@ void LLPreviewTexture::init() else { - gUICtrlFactory->buildFloater(this,"floater_preview_texture.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_preview_texture.xml"); } @@ -193,100 +193,97 @@ void LLPreviewTexture::init() void LLPreviewTexture::draw() { - if( getVisible() ) + updateAspectRatio(); + + LLPreview::draw(); + + if (!isMinimized()) { - updateAspectRatio(); + LLGLSUIDefault gls_ui; + LLGLSNoTexture gls_notex; + + const LLRect& border = mClientRect; + LLRect interior = mClientRect; + interior.stretch( -PREVIEW_BORDER_WIDTH ); - LLPreview::draw(); + // ...border + gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f)); + gl_rect_2d_checkerboard( interior ); - if (!isMinimized()) + if ( mImage.notNull() ) { - LLGLSUIDefault gls_ui; - LLGLSNoTexture gls_notex; - - const LLRect& border = mClientRect; - LLRect interior = mClientRect; - interior.stretch( -PREVIEW_BORDER_WIDTH ); - - // ...border - gl_rect_2d( border, LLColor4(0.f, 0.f, 0.f, 1.f)); - gl_rect_2d_checkerboard( interior ); - - if ( mImage.notNull() ) + // Draw the texture + glColor3f( 1.f, 1.f, 1.f ); + gl_draw_scaled_image(interior.mLeft, + interior.mBottom, + interior.getWidth(), + interior.getHeight(), + mImage); + + // Pump the texture priority + F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); + mImage->addTextureStats( pixel_area ); + + // Don't bother decoding more than we can display, unless + // we're loading the full image. + if (!mLoadingFullImage) { - // Draw the texture - glColor3f( 1.f, 1.f, 1.f ); - gl_draw_scaled_image(interior.mLeft, - interior.mBottom, - interior.getWidth(), - interior.getHeight(), - mImage); - - // Pump the texture priority - F32 pixel_area = mLoadingFullImage ? (F32)MAX_IMAGE_AREA : (F32)(interior.getWidth() * interior.getHeight() ); - mImage->addTextureStats( pixel_area ); - - // Don't bother decoding more than we can display, unless - // we're loading the full image. - if (!mLoadingFullImage) - { - S32 int_width = interior.getWidth(); - S32 int_height = interior.getHeight(); - mImage->setKnownDrawSize(int_width, int_height); - } - else - { - // Don't use this feature - mImage->setKnownDrawSize(0, 0); - } + S32 int_width = interior.getWidth(); + S32 int_height = interior.getHeight(); + mImage->setKnownDrawSize(int_width, int_height); + } + else + { + // Don't use this feature + mImage->setKnownDrawSize(0, 0); + } - if( mLoadingFullImage ) + if( mLoadingFullImage ) + { + LLFontGL::sSansSerif->renderUTF8("Receiving:", 0, + interior.mLeft + 4, + interior.mBottom + 4, + LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, + LLFontGL::DROP_SHADOW); + + F32 data_progress = mImage->mDownloadProgress; + + // Draw the progress bar. + const S32 BAR_HEIGHT = 12; + const S32 BAR_LEFT_PAD = 80; + S32 left = interior.mLeft + 4 + BAR_LEFT_PAD; + S32 bar_width = getRect().getWidth() - left - RESIZE_HANDLE_WIDTH - 2; + S32 top = interior.mBottom + 4 + BAR_HEIGHT; + S32 right = left + bar_width; + S32 bottom = top - BAR_HEIGHT; + + LLColor4 background_color(0.f, 0.f, 0.f, 0.75f); + LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f); + LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f); + + gl_rect_2d(left, top, right, bottom, background_color); + + if (data_progress > 0.0f) { - LLFontGL::sSansSerif->renderUTF8("Receiving:", 0, - interior.mLeft + 4, - interior.mBottom + 4, - LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::DROP_SHADOW); - - F32 data_progress = mImage->mDownloadProgress; - - // Draw the progress bar. - const S32 BAR_HEIGHT = 12; - const S32 BAR_LEFT_PAD = 80; - S32 left = interior.mLeft + 4 + BAR_LEFT_PAD; - S32 bar_width = getRect().getWidth() - left - RESIZE_HANDLE_WIDTH - 2; - S32 top = interior.mBottom + 4 + BAR_HEIGHT; - S32 right = left + bar_width; - S32 bottom = top - BAR_HEIGHT; - - LLColor4 background_color(0.f, 0.f, 0.f, 0.75f); - LLColor4 decoded_color(0.f, 1.f, 0.f, 1.0f); - LLColor4 downloaded_color(0.f, 0.5f, 0.f, 1.0f); - - gl_rect_2d(left, top, right, bottom, background_color); - - if (data_progress > 0.0f) + // Downloaded bytes + right = left + llfloor(data_progress * (F32)bar_width); + if (right > left) { - // Downloaded bytes - right = left + llfloor(data_progress * (F32)bar_width); - if (right > left) - { - gl_rect_2d(left, top, right, bottom, downloaded_color); - } + gl_rect_2d(left, top, right, bottom, downloaded_color); } } - else - if( !mSavedFileTimer.hasExpired() ) - { - LLFontGL::sSansSerif->renderUTF8("File Saved", 0, - interior.mLeft + 4, - interior.mBottom + 4, - LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, - LLFontGL::DROP_SHADOW); - } } - } - } + else + if( !mSavedFileTimer.hasExpired() ) + { + LLFontGL::sSansSerif->renderUTF8("File Saved", 0, + interior.mLeft + 4, + interior.mBottom + 4, + LLColor4::white, LLFontGL::LEFT, LLFontGL::BOTTOM, + LLFontGL::DROP_SHADOW); + } + } + } } diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 2d67e432c3..76da53ea7b 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -102,16 +102,6 @@ LLProgressView::~LLProgressView() sInstance = NULL; } -EWidgetType LLProgressView::getWidgetType() const -{ - return WIDGET_TYPE_PROGRESS_VIEW; -} - -LLString LLProgressView::getWidgetTag() const -{ - return LL_PROGRESS_VIEW_TAG; -} - BOOL LLProgressView::handleMouseDown(S32 x, S32 y, MASK mask) { if ( mOutlineRect.pointInRect( x, y ) ) @@ -168,18 +158,14 @@ BOOL LLProgressView::handleHover(S32 x, S32 y, MASK mask) } -BOOL LLProgressView::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLProgressView::handleKeyHere(KEY key, MASK mask) { - if( getVisible() ) + // Suck up all keystokes except CTRL-Q. + if( ('Q' == key) && (MASK_CONTROL == mask) ) { - // Suck up all keystokes except CTRL-Q. - if( ('Q' == key) && (MASK_CONTROL == mask) ) - { - LLAppViewer::instance()->userQuit(); - } - return TRUE; + LLAppViewer::instance()->userQuit(); } - return FALSE; + return TRUE; } void LLProgressView::setVisible(BOOL visible) @@ -191,6 +177,7 @@ void LLProgressView::setVisible(BOOL visible) else if (!getVisible() && visible) { gFocusMgr.setTopCtrl(this); + setFocus(TRUE); mFadeTimer.stop(); mProgressTimer.start(); LLView::setVisible(visible); @@ -265,8 +252,8 @@ void LLProgressView::draw() S32 line_two_y = line_one_y - LINE_SPACING; const LLFontGL* font = LLFontGL::sSansSerif; - LLViewerImage* shadow_imagep = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square_soft.tga")), MIPMAP_FALSE, TRUE); - LLViewerImage* bar_imagep = gImageList.getImage(LLUUID(gViewerArt.getString("rounded_square.tga")), MIPMAP_FALSE, TRUE); + LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga"); + LLUIImagePtr bar_imagep = LLUI::getUIImage("rounded_square.tga"); //LLColor4 background_color = gColors.getColor("DefaultShadowLight"); LLColor4 background_color = LLColor4(0.3254f, 0.4f, 0.5058f, 1.0f); @@ -289,31 +276,21 @@ void LLProgressView::draw() S32 background_box_width = background_box_right - background_box_left + 1; S32 background_box_height = background_box_top - background_box_bottom + 1; - gl_draw_scaled_image_with_border( background_box_left + 2, + shadow_imagep->draw( background_box_left + 2, background_box_bottom - 2, - 16, - 16, background_box_width, background_box_height, - shadow_imagep, gColors.getColor( "ColorDropShadow" ) ); - - gl_draw_scaled_image_with_border( background_box_left, + bar_imagep->draw( background_box_left, background_box_bottom, - 16, - 16, background_box_width, background_box_height, - bar_imagep, LLColor4( 0.0f, 0.0f, 0.0f, 0.4f ) ); - gl_draw_scaled_image_with_border( background_box_left + 1, + bar_imagep->draw( background_box_left + 1, background_box_bottom + 1, - 16, - 16, background_box_width - 2, background_box_height - 2, - bar_imagep, LLColor4( 0.4f, 0.4f, 0.4f, 0.3f ) ); // we'll need this later for catching a click if it looks like it contains a link @@ -334,36 +311,34 @@ void LLProgressView::draw() LLFontGL::HCENTER, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW); - gl_draw_scaled_image_with_border( + shadow_imagep->draw( bar_left + 2, bar_bottom - 2, - 16, - 16, bar_width, bar_height, - shadow_imagep, gColors.getColor("ColorDropShadow")); - gl_draw_scaled_image_with_border( + bar_imagep->draw( bar_left, bar_bottom, - 16, - 16, bar_width, bar_height, - bar_imagep, LLColor4(0.7f, 0.7f, 0.8f, 1.0f)); - gl_draw_scaled_image_with_border(bar_left + 2, bar_bottom + 2, 16, 16, - bar_width - 4, bar_height - 4, - bar_imagep, + bar_imagep->draw( + bar_left + 2, + bar_bottom + 2, + bar_width - 4, + bar_height - 4, background_color); LLColor4 bar_color = LLColor4(0.5764f, 0.6627f, 0.8352f, 1.0f); bar_color.mV[3] = alpha; - gl_draw_scaled_image_with_border(bar_left + 2, bar_bottom + 2, 16, 16, - llround((bar_width - 4) * (mPercentDone / 100.f)), bar_height - 4, - bar_imagep, + bar_imagep->draw( + bar_left + 2, + bar_bottom + 2, + llround((bar_width - 4) * (mPercentDone / 100.f)), + bar_height - 4, bar_color); S32 line_three_y = line_two_y - LINE_SPACING * 3; diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index e9fe7e817e..63d19c27dc 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -44,15 +44,12 @@ public: LLProgressView(const std::string& name, const LLRect& rect); virtual ~LLProgressView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void setVisible(BOOL visible); void setText(const LLString& text); diff --git a/indra/newview/llregionposition.cpp b/indra/newview/llregionposition.cpp index e900bd076f..c9e1304a64 100644 --- a/indra/newview/llregionposition.cpp +++ b/indra/newview/llregionposition.cpp @@ -85,7 +85,7 @@ LLVector3d LLRegionPosition::getPositionGlobal() const void LLRegionPosition::setPositionGlobal(const LLVector3d& position_global ) { - mRegionp = gWorldPointer->getRegionFromPosGlobal(position_global); + mRegionp = LLWorld::getInstance()->getRegionFromPosGlobal(position_global); if (mRegionp) { mPositionRegion = mRegionp->getPosRegionFromGlobal(position_global); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index f468ce97ac..ba2434d7b0 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -100,7 +100,6 @@ extern LLVector3d gLastHitObjectOffset; // // Globals // -LLSelectMgr* gSelectMgr = NULL; BOOL gDebugSelectMgr = FALSE; @@ -156,8 +155,6 @@ static LLPointer<LLObjectSelection> sNullSelection; void LLSelectMgr::cleanupGlobals() { - delete gSelectMgr; - gSelectMgr = NULL; sNullSelection = NULL; } @@ -506,7 +503,7 @@ BOOL LLSelectMgr::removeObjectFromSelections(const LLUUID &id) LLTool *tool = NULL; if (!gNoRender) { - tool = gToolMgr->getCurrentTool(); + tool = LLToolMgr::getInstance()->getCurrentTool(); // It's possible that the tool is editing an object that is not selected LLViewerObject* tool_editing_object = tool->getEditingObject(); @@ -1420,7 +1417,7 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) { object->sendTEUpdate(); // 1 particle effect per object - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(object); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -2770,28 +2767,28 @@ void LLSelectMgr::confirmDelete(S32 option, void* data) LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); // attempt to derez into the trash. LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id); - gSelectMgr->sendListToRegions("DeRezObject", + LLSelectMgr::getInstance()->sendListToRegions("DeRezObject", packDeRezHeader, packObjectLocalID, (void*)info, SEND_ONLY_ROOTS); // VEFFECT: Delete Object - one effect for all deletes - if (gSelectMgr->mSelectedObjects->mSelectType != SELECT_TYPE_HUD) + if (LLSelectMgr::getInstance()->mSelectedObjects->mSelectType != SELECT_TYPE_HUD) { - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); - effectp->setPositionGlobal( gSelectMgr->getSelectionCenterGlobal() ); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + effectp->setPositionGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal() ); effectp->setColor(LLColor4U(gAgent.getEffectColor())); F32 duration = 0.5f; - duration += gSelectMgr->mSelectedObjects->getObjectCount() / 64.f; + duration += LLSelectMgr::getInstance()->mSelectedObjects->getObjectCount() / 64.f; effectp->setDuration(duration); } gAgent.setLookAt(LOOKAT_TARGET_CLEAR); // Keep track of how many objects have been deleted. - F64 obj_delete_count = gViewerStats->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT); - obj_delete_count += gSelectMgr->mSelectedObjects->getObjectCount(); - gViewerStats->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count ); + F64 obj_delete_count = LLViewerStats::getInstance()->getStat(LLViewerStats::ST_OBJECT_DELETE_COUNT); + obj_delete_count += LLSelectMgr::getInstance()->mSelectedObjects->getObjectCount(); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_OBJECT_DELETE_COUNT, obj_delete_count ); } break; case 1: @@ -3509,7 +3506,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point) return; } - BOOL build_mode = gToolMgr->inEdit(); + BOOL build_mode = LLToolMgr::getInstance()->inEdit(); // Special case: Attach to default location for this object. if (0 == attachment_point || get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, (S32)attachment_point, (LLViewerJointAttachment*)NULL)) @@ -4298,7 +4295,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data return (node->getObject()->mID == mID); } } func(id); - LLSelectNode* node = gSelectMgr->getSelection()->getFirstNode(&func); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstNode(&func); if (node) { @@ -4441,7 +4438,7 @@ void LLSelectMgr::processObjectPropertiesFamily(LLMessageSystem* msg, void** use return (node->getObject()->mID == mID); } } func(id); - LLSelectNode* node = gSelectMgr->getHoverObjects()->getFirstNode(&func); + LLSelectNode* node = LLSelectMgr::getInstance()->getHoverObjects()->getFirstNode(&func); if (node) { @@ -4467,7 +4464,7 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) if (reset_list) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } LLUUID full_id; @@ -4493,7 +4490,7 @@ void LLSelectMgr::processForceObjectSelect(LLMessageSystem* msg, void**) } // Don't select, just highlight - gSelectMgr->highlightObjectAndFamily(objects); + LLSelectMgr::getInstance()->highlightObjectAndFamily(objects); } @@ -4508,9 +4505,7 @@ void LLSelectMgr::updateSilhouettes() if (!mSilhouetteImagep) { - LLUUID id; - id.set( gViewerArt.getString("silhouette.tga") ); - mSilhouetteImagep = gImageList.getImage(id, TRUE, TRUE); + mSilhouetteImagep = gImageList.getImageFromFile("silhouette.j2c", TRUE, TRUE); } mHighlightedObjects->cleanupNodes(); @@ -4561,7 +4556,7 @@ void LLSelectMgr::updateSilhouettes() { if (num_sils_genned++ < MAX_SILS_PER_FRAME)// && objectp->mDrawable->isVisible()) { - generateSilhouette(node, gCamera->getOrigin()); + generateSilhouette(node, LLViewerCamera::getInstance()->getOrigin()); changed_objects.push_back(objectp); } else if (objectp->isAttachment()) @@ -4722,7 +4717,7 @@ void LLSelectMgr::updateSilhouettes() { if (num_sils_genned++ < MAX_SILS_PER_FRAME) { - generateSilhouette(node, gCamera->getOrigin()); + generateSilhouette(node, LLViewerCamera::getInstance()->getOrigin()); changed_objects.push_back(objectp); } else if (objectp->isAttachment() && objectp->getRootEdit()->mDrawable.notNull()) @@ -4792,7 +4787,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) glPushMatrix(); glLoadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); - glOrtho(-0.5f * gCamera->getAspect(), 0.5f * gCamera->getAspect(), -0.5f, 0.5f, 0.f, depth); + glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -5231,8 +5226,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) } else { - LLVector3 view_vector = gCamera->getOrigin() - objectp->getRenderPosition(); - silhouette_thickness = view_vector.magVec() * LLSelectMgr::sHighlightThickness * (gCamera->getView() / gCamera->getDefaultFOV()); + LLVector3 view_vector = LLViewerCamera::getInstance()->getOrigin() - objectp->getRenderPosition(); + silhouette_thickness = view_vector.magVec() * LLSelectMgr::sHighlightThickness * (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()); } F32 animationTime = (F32)LLFrameTimer::getElapsedSeconds(); @@ -5246,10 +5241,10 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.blendFunc(GL_SRC_COLOR, GL_ONE); LLGLEnable fog(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); - float d = (gCamera->getPointOfInterest()-gCamera->getOrigin()).magVec(); - LLColor4 fogCol = color * (F32)llclamp((gSelectMgr->getSelectionCenterGlobal()-gAgent.getCameraPositionGlobal()).magVec()/(gSelectMgr->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); + float d = (LLViewerCamera::getInstance()->getPointOfInterest()-LLViewerCamera::getInstance()->getOrigin()).magVec(); + LLColor4 fogCol = color * (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal()-gAgent.getCameraPositionGlobal()).magVec()/(LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec()*4), 0.0, 1.0); glFogf(GL_FOG_START, d); - glFogf(GL_FOG_END, d*(1 + (gCamera->getView() / gCamera->getDefaultFOV()))); + glFogf(GL_FOG_END, d*(1 + (LLViewerCamera::getInstance()->getView() / LLViewerCamera::getInstance()->getDefaultFOV()))); glFogfv(GL_FOG_COLOR, fogCol.mV); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); @@ -5377,7 +5372,7 @@ S32 get_family_count(LLViewerObject *parent) } else { - if (gSelectMgr->canSelectObject(child)) + if (LLSelectMgr::getInstance()->canSelectObject(child)) { count += get_family_count( child ); } @@ -5467,9 +5462,9 @@ void LLSelectMgr::updateSelectionCenter() } - if ( !(gAgentID == LLUUID::null) && gToolMgr) + if ( !(gAgentID == LLUUID::null)) { - LLTool *tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); if (mShowSelection) { LLVector3d select_center_global; @@ -5658,9 +5653,9 @@ void LLSelectMgr::validateSelection() { virtual bool apply(LLViewerObject* object) { - if (!gSelectMgr->canSelectObject(object)) + if (!LLSelectMgr::getInstance()->canSelectObject(object)) { - gSelectMgr->deselectObjectOnly(object); + LLSelectMgr::getInstance()->deselectObjectOnly(object); } return true; } diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 570bcef79a..598a962b3c 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -333,7 +333,7 @@ private: typedef LLSafeHandle<LLObjectSelection> LLObjectSelectionHandle; -class LLSelectMgr : public LLEditMenuHandler +class LLSelectMgr : public LLEditMenuHandler, public LLSingleton<LLSelectMgr> { public: static BOOL sRectSelectInclusive; // do we need to surround an object to pick it? @@ -708,8 +708,6 @@ private: LLAnimPauseRequest mPauseRequest; }; -extern LLSelectMgr* gSelectMgr; - // Utilities void dialog_refresh_all(); // Update subscribers to the selection list diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 84e14ef341..d610cd3fdf 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -1800,7 +1800,7 @@ S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* result BOOL earlyFail(LLCamera* camera, LLSpatialGroup* group) { - const F32 vel = (gCamera->getVelocityStat()->getCurrent()+0.2f); + const F32 vel = (LLViewerCamera::getInstance()->getVelocityStat()->getCurrent()+0.2f); LLVector3 c = group->mBounds[0]; LLVector3 r = group->mBounds[1]*SG_OCCLUSION_FUDGE + LLVector3(vel,vel,vel); @@ -2491,7 +2491,7 @@ void LLSpatialPartition::renderDebug() if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) { //sLastMaxTexPriority = lerp(sLastMaxTexPriority, sCurMaxTexPriority, gFrameIntervalSeconds); - sLastMaxTexPriority = (F32) gCamera->getScreenPixelArea(); + sLastMaxTexPriority = (F32) LLViewerCamera::getInstance()->getScreenPixelArea(); sCurMaxTexPriority = 0.f; } @@ -2504,7 +2504,7 @@ void LLSpatialPartition::renderDebug() gPipeline.disableLights(); LLSpatialBridge* bridge = asBridge(); - LLCamera* camera = gCamera; + LLCamera* camera = LLViewerCamera::getInstance(); if (bridge) { @@ -2521,7 +2521,7 @@ void LLSpatialPartition::renderDebug() BOOL LLSpatialPartition::isVisible(const LLVector3& v) { - if (!gCamera->sphereInFrustum(v, 4.0f)) + if (!LLViewerCamera::getInstance()->sphereInFrustum(v, 4.0f)) { return FALSE; } diff --git a/indra/newview/llsprite.cpp b/indra/newview/llsprite.cpp index 92fcbb6e6c..f74173425c 100644 --- a/indra/newview/llsprite.cpp +++ b/indra/newview/llsprite.cpp @@ -92,7 +92,7 @@ LLSprite::~LLSprite() void LLSprite::updateFace(LLFace &face) { - LLViewerCamera &camera = *gCamera; + LLViewerCamera &camera = *LLViewerCamera::getInstance(); // First, figure out how many vertices/indices we need. U32 num_vertices, num_indices; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f7de5a8c35..daaa117a9c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -51,7 +51,6 @@ #include "llcameraview.h" #include "llviewercontrol.h" #include "lldir.h" -#include "lleconomy.h" #include "llerrorcontrol.h" #include "llfiltersd2xmlrpc.h" #include "llfocusmgr.h" @@ -324,8 +323,6 @@ BOOL idle_startup() static LLString password; static std::vector<const char*> requested_options; - static U32 region_size = 256; - static F32 region_scale = 1.f; static U64 first_sim_handle = 0; static LLHost first_sim; static std::string first_sim_seed_cap; @@ -376,11 +373,11 @@ BOOL idle_startup() // Initialize stuff that doesn't need data from simulators // - if (gFeatureManagerp->isSafe()) + if (LLFeatureManager::getInstance()->isSafe()) { gViewerWindow->alertXml("DisplaySetToSafe"); } - else if ((gSavedSettings.getS32("LastFeatureVersion") < gFeatureManagerp->getVersion()) && + else if ((gSavedSettings.getS32("LastFeatureVersion") < LLFeatureManager::getInstance()->getVersion()) && (gSavedSettings.getS32("LastFeatureVersion") != 0)) { gViewerWindow->alertXml("DisplaySetToRecommended"); @@ -390,7 +387,7 @@ BOOL idle_startup() gViewerWindow->alertXml(gViewerWindow->getInitAlert()); } - gSavedSettings.setS32("LastFeatureVersion", gFeatureManagerp->getVersion()); + gSavedSettings.setS32("LastFeatureVersion", LLFeatureManager::getInstance()->getVersion()); LLString xml_file = LLUI::locateSkin("xui_version.xml"); LLXMLNodePtr root; @@ -536,11 +533,6 @@ BOOL idle_startup() } } - // initialize the economy - gGlobalEconomy = new LLGlobalEconomy(); - - - //------------------------------------------------- // Init audio, which may be needed for prefs dialog // or audio cues in connection UI. @@ -701,24 +693,19 @@ BOOL idle_startup() // skip directly to message template verification LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } - - // Create selection manager - // Must be done before menus created, because many enabled callbacks - // require its existance. - gSelectMgr = new LLSelectMgr(); - gParcelMgr = new LLViewerParcelMgr(); - gHUDManager = new LLHUDManager(); - gMuteListp = new LLMuteList(); + + // *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance(). + + // *NOTE: This is where gHUDManager used to bet allocated before becoming LLHUDManager::getInstance(). + + // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). // Initialize UI if (!gNoRender) { // Initialize all our tools. Must be done after saved settings loaded. - if ( gToolMgr == NULL ) - { - gToolMgr = new LLToolMgr(); - gToolMgr->initTools(); - } + // NOTE: This also is where gToolMgr used to be instantiated before being turned into a singleton. + LLToolMgr::getInstance()->initTools(); // Quickly get something onscreen to look at. gViewerWindow->initWorldUI(); @@ -920,11 +907,8 @@ BOOL idle_startup() //#define LL_MINIMIAL_REQUESTED_OPTIONS gDebugInfo["GridName"] = gGridInfo[gGridChoice].mLabel; - lldebugs << "STATE_LOGIN_AUTH_INIT" << llendl; - if (!gUserAuthp) - { - gUserAuthp = new LLUserAuth(); - } + // *Note: this is where gUserAuth used to be created. + requested_options.clear(); requested_options.push_back("inventory-root"); requested_options.push_back("inventory-skeleton"); @@ -1009,7 +993,7 @@ BOOL idle_startup() hashed_mac.hex_digest(hashed_mac_string); // TODO if statement here to use web_login_key - gUserAuthp->authenticate( + LLUserAuth::getInstance()->authenticate( sAuthUris[sAuthUriNum].c_str(), auth_method.c_str(), firstname.c_str(), @@ -1039,17 +1023,13 @@ BOOL idle_startup() // in curl, so take "may appear frozen" out of progress bar. JC auth_desc = "Logging in..."; set_startup_status(progress, auth_desc.c_str(), auth_message.c_str()); - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_LOGIN_NO_DATA_YET!" << llendl; - } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); if(LLUserAuth::E_NO_RESPONSE_YET == error) { //llinfos << "waiting..." << llendl; @@ -1064,17 +1044,13 @@ BOOL idle_startup() if(STATE_LOGIN_DOWNLOADING == LLStartUp::getStartupState()) { lldebugs << "STATE_LOGIN_DOWNLOADING" << llendl; - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_LOGIN_DOWNLOADING!" << llendl; - } // Process messages to keep from dropping circuit. LLMessageSystem* msg = gMessageSystem; while (msg->checkAllMessages(gFrameCount, gServicePump)) { } msg->processAcks(); - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); if(LLUserAuth::E_DOWNLOADING == error) { //llinfos << "downloading..." << llendl; @@ -1095,14 +1071,14 @@ BOOL idle_startup() const char* reason_response = NULL; const char* message_response = NULL; BOOL successful_login = FALSE; - LLUserAuth::UserAuthcode error = gUserAuthp->authResponse(); + LLUserAuth::UserAuthcode error = LLUserAuth::getInstance()->authResponse(); // reset globals gAcceptTOS = FALSE; gAcceptCriticalMessage = FALSE; switch(error) { case LLUserAuth::E_OK: - login_response = gUserAuthp->getResponse("login"); + login_response = LLUserAuth::getInstance()->getResponse("login"); if(login_response && (0 == strcmp(login_response, "true"))) { // Yay, login! @@ -1111,10 +1087,10 @@ BOOL idle_startup() else if(login_response && (0 == strcmp(login_response, "indeterminate"))) { llinfos << "Indeterminate login..." << llendl; - sAuthUris = LLSRV::rewriteURI(gUserAuthp->getResponse("next_url")); + sAuthUris = LLSRV::rewriteURI(LLUserAuth::getInstance()->getResponse("next_url")); sAuthUriNum = 0; - auth_method = gUserAuthp->getResponse("next_method"); - auth_message = gUserAuthp->getResponse("message"); + auth_method = LLUserAuth::getInstance()->getResponse("next_method"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if(auth_method.substr(0, 5) == "login") { auth_desc.assign("Authenticating..."); @@ -1131,8 +1107,8 @@ BOOL idle_startup() else { emsg << "Login failed.\n"; - reason_response = gUserAuthp->getResponse("reason"); - message_response = gUserAuthp->getResponse("message"); + reason_response = LLUserAuth::getInstance()->getResponse("reason"); + message_response = LLUserAuth::getInstance()->getResponse("message"); if (gHideLinks && reason_response && (0 == strcmp(reason_response, "disabled"))) { @@ -1195,7 +1171,7 @@ BOOL idle_startup() } if(reason_response && (0 == strcmp(reason_response, "update"))) { - auth_message = gUserAuthp->getResponse("message"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if (show_connect_box) { update_app(TRUE, auth_message); @@ -1210,7 +1186,7 @@ BOOL idle_startup() if(reason_response && (0 == strcmp(reason_response, "optional"))) { llinfos << "Login got optional update" << llendl; - auth_message = gUserAuthp->getResponse("message"); + auth_message = LLUserAuth::getInstance()->getResponse("message"); if (show_connect_box) { update_app(FALSE, auth_message); @@ -1230,7 +1206,7 @@ BOOL idle_startup() if (sAuthUriNum >= (int) sAuthUris.size() - 1) { emsg << "Unable to connect to " << LLAppViewer::instance()->getSecondLifeTitle() << ".\n"; - emsg << gUserAuthp->errorMessage(); + emsg << LLUserAuth::getInstance()->errorMessage(); } else { sAuthUriNum++; std::ostringstream s; @@ -1246,33 +1222,27 @@ BOOL idle_startup() // Version update and we're not showing the dialog if(quit) { - delete gUserAuthp; - gUserAuthp = NULL; + LLUserAuth::getInstance()->reset(); LLAppViewer::instance()->forceQuit(); return FALSE; } if(successful_login) { - if (!gUserAuthp) - { - llerrs << "No userauth on successful login!" << llendl; - } - // unpack login data needed by the application const char* text; - text = gUserAuthp->getResponse("agent_id"); + text = LLUserAuth::getInstance()->getResponse("agent_id"); if(text) gAgentID.set(text); gDebugInfo["AgentID"] = text; - text = gUserAuthp->getResponse("session_id"); + text = LLUserAuth::getInstance()->getResponse("session_id"); if(text) gAgentSessionID.set(text); gDebugInfo["SessionID"] = text; - text = gUserAuthp->getResponse("secure_session_id"); + text = LLUserAuth::getInstance()->getResponse("secure_session_id"); if(text) gAgent.mSecureSessionID.set(text); - text = gUserAuthp->getResponse("first_name"); + text = LLUserAuth::getInstance()->getResponse("first_name"); if(text) { // Remove quotes from string. Login.cgi sends these to force @@ -1281,7 +1251,7 @@ BOOL idle_startup() LLString::replaceChar(firstname, '"', ' '); LLString::trim(firstname); } - text = gUserAuthp->getResponse("last_name"); + text = LLUserAuth::getInstance()->getResponse("last_name"); if(text) lastname.assign(text); gSavedSettings.setString("FirstName", firstname); gSavedSettings.setString("LastName", lastname); @@ -1297,7 +1267,7 @@ BOOL idle_startup() gSavedSettings.setBOOL("RememberPassword", remember_password); gSavedSettings.setBOOL("LoginLastLocation", gSavedSettings.getBOOL("LoginLastLocation")); - text = gUserAuthp->getResponse("agent_access"); + text = LLUserAuth::getInstance()->getResponse("agent_access"); if(text && (text[0] == 'M')) { gAgent.setTeen(false); @@ -1307,15 +1277,15 @@ BOOL idle_startup() gAgent.setTeen(true); } - text = gUserAuthp->getResponse("start_location"); + text = LLUserAuth::getInstance()->getResponse("start_location"); if(text) agent_start_location.assign(text); - text = gUserAuthp->getResponse("circuit_code"); + text = LLUserAuth::getInstance()->getResponse("circuit_code"); if(text) { gMessageSystem->mOurCircuitCode = strtoul(text, NULL, 10); } - const char* sim_ip_str = gUserAuthp->getResponse("sim_ip"); - const char* sim_port_str = gUserAuthp->getResponse("sim_port"); + const char* sim_ip_str = LLUserAuth::getInstance()->getResponse("sim_ip"); + const char* sim_port_str = LLUserAuth::getInstance()->getResponse("sim_port"); if(sim_ip_str && sim_port_str) { U32 sim_port = strtoul(sim_port_str, NULL, 10); @@ -1325,8 +1295,8 @@ BOOL idle_startup() gMessageSystem->enableCircuit(first_sim, TRUE); } } - const char* region_x_str = gUserAuthp->getResponse("region_x"); - const char* region_y_str = gUserAuthp->getResponse("region_y"); + const char* region_x_str = LLUserAuth::getInstance()->getResponse("region_x"); + const char* region_y_str = LLUserAuth::getInstance()->getResponse("region_y"); if(region_x_str && region_y_str) { U32 region_x = strtoul(region_x_str, NULL, 10); @@ -1334,7 +1304,7 @@ BOOL idle_startup() first_sim_handle = to_region_handle(region_x, region_y); } - const char* look_at_str = gUserAuthp->getResponse("look_at"); + const char* look_at_str = LLUserAuth::getInstance()->getResponse("look_at"); if (look_at_str) { #if !LL_WINDOWS && !LL_DARWIN @@ -1347,10 +1317,10 @@ BOOL idle_startup() agent_start_look_at = ll_vector3_from_sd(sd); } - text = gUserAuthp->getResponse("seed_capability"); + text = LLUserAuth::getInstance()->getResponse("seed_capability"); if (text) first_sim_seed_cap = text; - text = gUserAuthp->getResponse("seconds_since_epoch"); + text = LLUserAuth::getInstance()->getResponse("seconds_since_epoch"); if(text) { U32 server_utc_time = strtoul(text, NULL, 10); @@ -1361,7 +1331,7 @@ BOOL idle_startup() } } - const char* home_location = gUserAuthp->getResponse("home"); + const char* home_location = LLUserAuth::getInstance()->getResponse("home"); if(home_location) { #if !LL_WINDOWS && !LL_DARWIN @@ -1378,9 +1348,9 @@ BOOL idle_startup() gAgent.setHomePosRegion(region_handle, position); } - gAgent.mMOTD.assign(gUserAuthp->getResponse("message")); + gAgent.mMOTD.assign(LLUserAuth::getInstance()->getResponse("message")); LLUserAuth::options_t options; - if(gUserAuthp->getOptions("inventory-root", options)) + if(LLUserAuth::getInstance()->getOptions("inventory-root", options)) { LLUserAuth::response_t::iterator it; it = options[0].find("folder_id"); @@ -1392,7 +1362,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("login-flags", options)) + if(LLUserAuth::getInstance()->getOptions("login-flags", options)) { LLUserAuth::response_t::iterator it; LLUserAuth::response_t::iterator no_flag = options[0].end(); @@ -1420,7 +1390,7 @@ BOOL idle_startup() } } options.clear(); - if (gUserAuthp->getOptions("initial-outfit", options) + if (LLUserAuth::getInstance()->getOptions("initial-outfit", options) && !options.empty()) { LLUserAuth::response_t::iterator it; @@ -1438,7 +1408,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("global-textures", options)) + if(LLUserAuth::getInstance()->getOptions("global-textures", options)) { // Extract sun and moon texture IDs. These are used // in the LLVOSky constructor, but I can't figure out @@ -1553,11 +1523,11 @@ BOOL idle_startup() display_startup(); + // This is where we used to initialize gWorldp. Original comment said: // World initialization must be done after above window init - gWorldp = new LLWorld(region_size, region_scale); // User might have overridden far clip - gWorldp->setLandFarClip( gAgent.mDrawDistance ); + LLWorld::getInstance()->setLandFarClip( gAgent.mDrawDistance ); // Before we create the first region, we need to set the agent's mOriginGlobal // This is necessary because creating objects before this is set will result in a @@ -1565,9 +1535,9 @@ BOOL idle_startup() gAgent.initOriginGlobal(from_region_handle(first_sim_handle)); - gWorldp->addRegion(first_sim_handle, first_sim); + LLWorld::getInstance()->addRegion(first_sim_handle, first_sim); - LLViewerRegion *regionp = gWorldp->getRegionFromHandle(first_sim_handle); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(first_sim_handle); llinfos << "Adding initial simulator " << regionp->getOriginGlobal() << llendl; LLStartUp::setStartupState( STATE_SEED_GRANTED_WAIT ); @@ -1603,7 +1573,7 @@ BOOL idle_startup() { update_texture_fetch(); - if ( gViewerWindow != NULL && gToolMgr != NULL ) + if ( gViewerWindow != NULL) { // This isn't the first logon attempt, so show the UI gViewerWindow->setNormalControlsVisible( TRUE ); } @@ -1659,18 +1629,14 @@ BOOL idle_startup() LLAppViewer::instance()->loadNameCache(); } - // Data storage for map of world. - if ( gWorldMap == NULL ) - { - gWorldMap = new LLWorldMap(); - } + // *Note: this is where gWorldMap used to be initialized. // register null callbacks for audio until the audio system is initialized gMessageSystem->setHandlerFuncFast(_PREHASH_SoundTrigger, null_message_callback, NULL); gMessageSystem->setHandlerFuncFast(_PREHASH_AttachedSound, null_message_callback, NULL); //reset statistics - gViewerStats->resetStats(); + LLViewerStats::getInstance()->resetStats(); if (!gNoRender) { @@ -1700,14 +1666,14 @@ BOOL idle_startup() } // Make sure agent knows correct aspect ratio - gCamera->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); + LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); if (gViewerWindow->mWindow->getFullscreen()) { - gCamera->setAspect(gViewerWindow->getDisplayAspectRatio()); + LLViewerCamera::getInstance()->setAspect(gViewerWindow->getDisplayAspectRatio()); } else { - gCamera->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); + LLViewerCamera::getInstance()->setAspect( (F32) gViewerWindow->getWindowWidth() / (F32) gViewerWindow->getWindowHeight()); } // Move agent to starting location. The position handed to us by @@ -1820,10 +1786,10 @@ BOOL idle_startup() // But not on first login, because you can't see your avatar then if (!gAgent.isFirstLogin()) { - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gHUDManager->sendEffects(); + LLHUDManager::getInstance()->sendEffects(); } LLStartUp::setStartupState( STATE_AGENT_WAIT ); // Go to STATE_AGENT_WAIT @@ -1869,17 +1835,12 @@ BOOL idle_startup() //--------------------------------------------------------------------- if (STATE_INVENTORY_SEND == LLStartUp::getStartupState()) { - if (!gUserAuthp) - { - llerrs << "No userauth in STATE_INVENTORY_SEND!" << llendl; - } - // unpack thin inventory LLUserAuth::options_t options; options.clear(); //bool dump_buffer = false; - if(gUserAuthp->getOptions("inventory-lib-root", options) + if(LLUserAuth::getInstance()->getOptions("inventory-lib-root", options) && !options.empty()) { // should only be one @@ -1891,7 +1852,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-lib-owner", options) + if(LLUserAuth::getInstance()->getOptions("inventory-lib-owner", options) && !options.empty()) { // should only be one @@ -1903,7 +1864,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-skel-lib", options) + if(LLUserAuth::getInstance()->getOptions("inventory-skel-lib", options) && gInventoryLibraryOwner.notNull()) { if(!gInventory.loadSkeleton(options, gInventoryLibraryOwner)) @@ -1912,7 +1873,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("inventory-skeleton", options)) + if(LLUserAuth::getInstance()->getOptions("inventory-skeleton", options)) { if(!gInventory.loadSkeleton(options, gAgent.getID())) { @@ -1922,7 +1883,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("buddy-list", options)) + if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1953,7 +1914,7 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("ui-config", options)) + if(LLUserAuth::getInstance()->getOptions("ui-config", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1971,7 +1932,7 @@ BOOL idle_startup() } } options.clear(); - if(gUserAuthp->getOptions("tutorial_setting", options)) + if(LLUserAuth::getInstance()->getOptions("tutorial_setting", options)) { LLUserAuth::options_t::iterator it = options.begin(); LLUserAuth::options_t::iterator end = options.end(); @@ -1995,16 +1956,16 @@ BOOL idle_startup() } options.clear(); - if(gUserAuthp->getOptions("event_categories", options)) + if(LLUserAuth::getInstance()->getOptions("event_categories", options)) { LLEventInfo::loadCategories(options); } - if(gUserAuthp->getOptions("event_notifications", options)) + if(LLUserAuth::getInstance()->getOptions("event_notifications", options)) { gEventNotifier.load(options); } options.clear(); - if(gUserAuthp->getOptions("classified_categories", options)) + if(LLUserAuth::getInstance()->getOptions("classified_categories", options)) { LLClassifiedInfo::loadCategories(options); } @@ -2019,7 +1980,7 @@ BOOL idle_startup() LLLandmark::registerCallbacks(msg); // request mute list - gMuteListp->requestFromServer(gAgent.getID()); + LLMuteList::getInstance()->requestFromServer(gAgent.getID()); // Get L$ and ownership credit information msg->newMessageFast(_PREHASH_MoneyBalanceRequest); @@ -2057,13 +2018,12 @@ BOOL idle_startup() // We have a region, and just did a big inventory download. // We can estimate the user's connection speed, and set their // max bandwidth accordingly. JC - if (gSavedSettings.getBOOL("FirstLoginThisInstall") - && gUserAuthp) + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) { // This is actually a pessimistic computation, because TCP may not have enough // time to ramp up on the (small) default inventory file to truly measure max // bandwidth. JC - F64 rate_bps = gUserAuthp->getLastTransferRateBPS(); + F64 rate_bps = LLUserAuth::getInstance()->getLastTransferRateBPS(); const F32 FAST_RATE_BPS = 600.f * 1024.f; const F32 FASTER_RATE_BPS = 750.f * 1024.f; F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); @@ -2110,7 +2070,7 @@ BOOL idle_startup() // many gesture downloads, if this is the user's first // time on this machine or -purge has been run. LLUserAuth::options_t gesture_options; - if (gUserAuthp->getOptions("gestures", gesture_options)) + if (LLUserAuth::getInstance()->getOptions("gestures", gesture_options)) { llinfos << "Gesture Manager loading " << gesture_options.size() << llendl; @@ -2274,7 +2234,7 @@ BOOL idle_startup() else if (wearables_time > MAX_WEARABLES_TIME) { gViewerWindow->alertXml("ClothingLoading"); - gViewerStats->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_WEARABLES_TOO_LONG); LLStartUp::setStartupState( STATE_CLEANUP ); } else @@ -2334,13 +2294,9 @@ BOOL idle_startup() // If we've got a startup URL, dispatch it LLStartUp::dispatchURL(); - + // Clean up the userauth stuff. - if (gUserAuthp) - { - delete gUserAuthp; - gUserAuthp = NULL; - } + LLUserAuth::getInstance()->reset(); LLStartUp::setStartupState( STATE_STARTED ); @@ -3073,7 +3029,7 @@ void init_stat_view() stat_viewp = new LLStatView("basic stat view", "Basic", "OpenDebugStatBasic", rect); gDebugView->mFloaterStatsp->addStatView(stat_viewp); - stat_barp = stat_viewp->addStat("FPS", &(gViewerStats->mFPSStat)); + stat_barp = stat_viewp->addStat("FPS", &(LLViewerStats::getInstance()->mFPSStat)); stat_barp->setUnitLabel(" fps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 45.f; @@ -3083,7 +3039,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = TRUE; - stat_barp = stat_viewp->addStat("Bandwidth", &(gViewerStats->mKBitStat)); + stat_barp = stat_viewp->addStat("Bandwidth", &(LLViewerStats::getInstance()->mKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 900.f; @@ -3092,7 +3048,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = stat_viewp->addStat("Packet Loss", &(gViewerStats->mPacketsLostPercentStat)); + stat_barp = stat_viewp->addStat("Packet Loss", &(LLViewerStats::getInstance()->mPacketsLostPercentStat)); stat_barp->setUnitLabel(" %"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 5.f; @@ -3103,7 +3059,7 @@ void init_stat_view() stat_barp->mDisplayMean = TRUE; stat_barp->mPrecision = 1; - stat_barp = stat_viewp->addStat("Ping Sim", &(gViewerStats->mSimPingStat)); + stat_barp = stat_viewp->addStat("Ping Sim", &(LLViewerStats::getInstance()->mSimPingStat)); stat_barp->setUnitLabel(" msec"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1000.f; @@ -3223,31 +3179,31 @@ void init_stat_view() net_statviewp = new LLStatView("network stat view", "Network", "OpenDebugStatNet", rect); stat_viewp->addChildAtEnd(net_statviewp); - stat_barp = net_statviewp->addStat("Packets In", &(gViewerStats->mPacketsInStat)); + stat_barp = net_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mPacketsInStat)); stat_barp->setUnitLabel("/sec"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Packets Out", &(gViewerStats->mPacketsOutStat)); + stat_barp = net_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mPacketsOutStat)); stat_barp->setUnitLabel("/sec"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Objects", &(gViewerStats->mObjectKBitStat)); + stat_barp = net_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mObjectKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Texture", &(gViewerStats->mTextureKBitStat)); + stat_barp = net_statviewp->addStat("Texture", &(LLViewerStats::getInstance()->mTextureKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Asset", &(gViewerStats->mAssetKBitStat)); + stat_barp = net_statviewp->addStat("Asset", &(LLViewerStats::getInstance()->mAssetKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Layers", &(gViewerStats->mLayersKBitStat)); + stat_barp = net_statviewp->addStat("Layers", &(LLViewerStats::getInstance()->mLayersKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mDisplayBar = FALSE; - stat_barp = net_statviewp->addStat("Actual In", &(gViewerStats->mActualInKBitStat)); + stat_barp = net_statviewp->addStat("Actual In", &(LLViewerStats::getInstance()->mActualInKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1024.f; @@ -3256,7 +3212,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = net_statviewp->addStat("Actual Out", &(gViewerStats->mActualOutKBitStat)); + stat_barp = net_statviewp->addStat("Actual Out", &(LLViewerStats::getInstance()->mActualOutKBitStat)); stat_barp->setUnitLabel(" kbps"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 512.f; @@ -3265,7 +3221,7 @@ void init_stat_view() stat_barp->mDisplayBar = TRUE; stat_barp->mDisplayHistory = FALSE; - stat_barp = net_statviewp->addStat("VFS Pending Ops", &(gViewerStats->mVFSPendingOperations)); + stat_barp = net_statviewp->addStat("VFS Pending Ops", &(LLViewerStats::getInstance()->mVFSPendingOperations)); stat_barp->setUnitLabel(" "); stat_barp->mPerSec = FALSE; stat_barp->mDisplayBar = FALSE; @@ -3275,7 +3231,7 @@ void init_stat_view() LLStatView *sim_statviewp = new LLStatView("sim stat view", "Simulator", "OpenDebugStatSim", rect); gDebugView->mFloaterStatsp->addStatView(sim_statviewp); - stat_barp = sim_statviewp->addStat("Time Dilation", &(gViewerStats->mSimTimeDilation)); + stat_barp = sim_statviewp->addStat("Time Dilation", &(LLViewerStats::getInstance()->mSimTimeDilation)); stat_barp->mPrecision = 2; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 1.f; @@ -3285,7 +3241,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Sim FPS", &(gViewerStats->mSimFPS)); + stat_barp = sim_statviewp->addStat("Sim FPS", &(LLViewerStats::getInstance()->mSimFPS)); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 200.f; stat_barp->mTickSpacing = 20.f; @@ -3294,7 +3250,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Physics FPS", &(gViewerStats->mSimPhysicsFPS)); + stat_barp = sim_statviewp->addStat("Physics FPS", &(LLViewerStats::getInstance()->mSimPhysicsFPS)); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 66.f; @@ -3304,7 +3260,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(gViewerStats->mSimAgentUPS)); + stat_barp = sim_statviewp->addStat("Agent Updates/Sec", &(LLViewerStats::getInstance()->mSimAgentUPS)); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 100.f; @@ -3314,7 +3270,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Main Agents", &(gViewerStats->mSimMainAgents)); + stat_barp = sim_statviewp->addStat("Main Agents", &(LLViewerStats::getInstance()->mSimMainAgents)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 80.f; @@ -3324,7 +3280,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Child Agents", &(gViewerStats->mSimChildAgents)); + stat_barp = sim_statviewp->addStat("Child Agents", &(LLViewerStats::getInstance()->mSimChildAgents)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 40.f; @@ -3334,7 +3290,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Objects", &(gViewerStats->mSimObjects)); + stat_barp = sim_statviewp->addStat("Objects", &(LLViewerStats::getInstance()->mSimObjects)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 30000.f; @@ -3344,7 +3300,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Active Objects", &(gViewerStats->mSimActiveObjects)); + stat_barp = sim_statviewp->addStat("Active Objects", &(LLViewerStats::getInstance()->mSimActiveObjects)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3354,7 +3310,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Active Scripts", &(gViewerStats->mSimActiveScripts)); + stat_barp = sim_statviewp->addStat("Active Scripts", &(LLViewerStats::getInstance()->mSimActiveScripts)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3364,7 +3320,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Script Perf", &(gViewerStats->mSimLSLIPS)); + stat_barp = sim_statviewp->addStat("Script Perf", &(LLViewerStats::getInstance()->mSimLSLIPS)); stat_barp->setUnitLabel(" ips"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3375,7 +3331,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Packets In", &(gViewerStats->mSimInPPS)); + stat_barp = sim_statviewp->addStat("Packets In", &(LLViewerStats::getInstance()->mSimInPPS)); stat_barp->setUnitLabel(" pps"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3386,7 +3342,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Packets Out", &(gViewerStats->mSimOutPPS)); + stat_barp = sim_statviewp->addStat("Packets Out", &(LLViewerStats::getInstance()->mSimOutPPS)); stat_barp->setUnitLabel(" pps"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3397,7 +3353,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Pending Downloads", &(gViewerStats->mSimPendingDownloads)); + stat_barp = sim_statviewp->addStat("Pending Downloads", &(LLViewerStats::getInstance()->mSimPendingDownloads)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 800.f; @@ -3407,7 +3363,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Pending Uploads", &(gViewerStats->mSimPendingUploads)); + stat_barp = sim_statviewp->addStat("Pending Uploads", &(LLViewerStats::getInstance()->mSimPendingUploads)); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 100.f; @@ -3417,7 +3373,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(gViewerStats->mSimTotalUnackedBytes)); + stat_barp = sim_statviewp->addStat("Total Unacked Bytes", &(LLViewerStats::getInstance()->mSimTotalUnackedBytes)); stat_barp->setUnitLabel(" kb"); stat_barp->mPrecision = 0; stat_barp->mMinBar = 0.f; @@ -3432,7 +3388,7 @@ void init_stat_view() sim_time_viewp = new LLStatView("sim perf view", "Time (ms)", "", rect); sim_statviewp->addChildAtEnd(sim_time_viewp); - stat_barp = sim_time_viewp->addStat("Total Frame Time", &(gViewerStats->mSimFrameMsec)); + stat_barp = sim_time_viewp->addStat("Total Frame Time", &(LLViewerStats::getInstance()->mSimFrameMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3443,7 +3399,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Net Time", &(gViewerStats->mSimNetMsec)); + stat_barp = sim_time_viewp->addStat("Net Time", &(LLViewerStats::getInstance()->mSimNetMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3454,7 +3410,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(gViewerStats->mSimSimPhysicsMsec)); + stat_barp = sim_time_viewp->addStat("Sim Time (Physics)", &(LLViewerStats::getInstance()->mSimSimPhysicsMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3465,7 +3421,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(gViewerStats->mSimSimOtherMsec)); + stat_barp = sim_time_viewp->addStat("Sim Time (Other)", &(LLViewerStats::getInstance()->mSimSimOtherMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3476,7 +3432,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Agent Time", &(gViewerStats->mSimAgentMsec)); + stat_barp = sim_time_viewp->addStat("Agent Time", &(LLViewerStats::getInstance()->mSimAgentMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3487,7 +3443,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Images Time", &(gViewerStats->mSimImagesMsec)); + stat_barp = sim_time_viewp->addStat("Images Time", &(LLViewerStats::getInstance()->mSimImagesMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; @@ -3498,7 +3454,7 @@ void init_stat_view() stat_barp->mDisplayBar = FALSE; stat_barp->mDisplayMean = FALSE; - stat_barp = sim_time_viewp->addStat("Script Time", &(gViewerStats->mSimScriptMsec)); + stat_barp = sim_time_viewp->addStat("Script Time", &(LLViewerStats::getInstance()->mSimScriptMsec)); stat_barp->setUnitLabel("ms"); stat_barp->mPrecision = 1; stat_barp->mMinBar = 0.f; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 00331a2e23..3546d6c888 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -74,7 +74,7 @@ #include "llviewermenu.h" // for gMenuBarView #include "llviewerparcelmgr.h" #include "llviewerthrottle.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llvoiceclient.h" // for gVoiceClient #include "lltoolmgr.h" @@ -137,7 +137,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) mBalanceTimer = new LLFrameTimer(); mHealthTimer = new LLFrameTimer(); - gUICtrlFactory->buildPanel(this,"panel_status_bar.xml"); + LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml"); // status bar can never get a tab setFocusRoot(FALSE); @@ -145,11 +145,11 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) // build date necessary data (must do after panel built) setupDate(); - mTextParcelName = LLUICtrlFactory::getTextBoxByName( this, "ParcelNameText" ); - mTextBalance = LLUICtrlFactory::getTextBoxByName( this, "BalanceText" ); + mTextParcelName = getChild<LLTextBox>("ParcelNameText" ); + mTextBalance = getChild<LLTextBox>("BalanceText" ); - mTextHealth = LLUICtrlFactory::getTextBoxByName( this, "HealthText" ); - mTextTime = LLUICtrlFactory::getTextBoxByName( this, "TimeText" ); + mTextHealth = getChild<LLTextBox>("HealthText" ); + mTextTime = getChild<LLTextBox>("TimeText" ); childSetAction("scriptout", onClickScriptDebug, this); childSetAction("health", onClickHealth, this); @@ -166,6 +166,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar")); childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar")); + childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar")); childSetActionTextbox("ParcelNameText", onClickParcelInfo ); childSetActionTextbox("BalanceText", onClickBalance ); @@ -177,7 +178,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGBandwidth = new LLStatGraph("BandwidthGraph", r); mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); - mSGBandwidth->setStat(&gViewerStats->mKBitStat); + mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat); LLString text = childGetText("bandwidth_tooltip") + " "; LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven mSGBandwidth->setLabel(bandwidth_tooltip.getString().c_str()); @@ -190,7 +191,7 @@ LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1); mSGPacketLoss = new LLStatGraph("PacketLossPercent", r); mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT); - mSGPacketLoss->setStat(&gViewerStats->mPacketsLostPercentStat); + mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat); text = childGetText("packet_loss_tooltip") + " "; LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven mSGPacketLoss->setLabel(packet_loss_tooltip.getString().c_str()); @@ -220,18 +221,6 @@ LLStatusBar::~LLStatusBar() // LLView destructor cleans up children } -//virtual -EWidgetType LLStatusBar::getWidgetType() const -{ - return WIDGET_TYPE_STATUS_BAR; -} - -//virtual -LLString LLStatusBar::getWidgetTag() const -{ - return LL_STATUS_BAR_TAG; -} - //----------------------------------------------------------------------- // Overrides //----------------------------------------------------------------------- @@ -321,7 +310,7 @@ void LLStatusBar::refresh() } LLViewerRegion *region = gAgent.getRegion(); - LLParcel *parcel = gParcelMgr->getAgentParcel(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); LLRect buttonRect; @@ -464,7 +453,7 @@ void LLStatusBar::refresh() BOOL canBuyLand = parcel && !parcel->isPublic() - && gParcelMgr->canAgentBuyParcel(parcel, false); + && LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false); childSetVisible("buyland", canBuyLand); if (canBuyLand) { @@ -524,7 +513,7 @@ void LLStatusBar::refresh() mRegionDetails.mZ = pos_z; mRegionDetails.mArea = parcel->getArea(); mRegionDetails.mForSale = parcel->getForSale(); - mRegionDetails.mTraffic = gParcelMgr->getDwelling(); + mRegionDetails.mTraffic = LLViewerParcelMgr::getInstance()->getDwelling(); if (parcel->isPublic()) { @@ -599,15 +588,14 @@ void LLStatusBar::refresh() if (search_visible) { childGetRect("search_btn", r); - r.translate( new_right - r.mRight, 0); - childSetRect("search_btn", r); + //r.translate( new_right - r.mRight, 0); + //childSetRect("search_btn", r); new_right -= r.getWidth(); childGetRect("search_editor", r); - r.translate( new_right - r.mRight, 0); - childSetRect("search_editor", r); + //r.translate( new_right - r.mRight, 0); + //childSetRect("search_editor", r); new_right -= r.getWidth() + 6; - } else { @@ -645,6 +633,7 @@ void LLStatusBar::refresh() // Set search bar visibility childSetVisible("search_editor", search_visible); childSetVisible("search_btn", search_visible); + childSetVisible("menubar_search_bevel_bg", search_visible); mSGBandwidth->setVisible(! search_visible); mSGPacketLoss->setVisible(! search_visible); childSetEnabled("stat_btn", ! search_visible); @@ -674,7 +663,7 @@ void LLStatusBar::creditBalance(S32 credit) void LLStatusBar::setBalance(S32 balance) { - LLString money_str = gResMgr->getMonetaryString( balance ); + LLString money_str = LLResMgr::getInstance()->getMonetaryString( balance ); LLString balance_str = "L$"; balance_str += money_str; mTextBalance->setText( balance_str ); @@ -768,7 +757,7 @@ S32 LLStatusBar::getSquareMetersLeft() const static void onClickParcelInfo(void* data) { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); + LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); LLFloaterLand::showInstance(); } @@ -832,8 +821,8 @@ static void onClickScripts(void*) static void onClickBuyLand(void*) { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); - gParcelMgr->startBuyLand(); + LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); + LLViewerParcelMgr::getInstance()->startBuyLand(); } // sets the static variables necessary for the date diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 0605246f16..91bc787485 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -88,9 +88,6 @@ public: LLStatusBar(const std::string& name, const LLRect& rect ); /*virtual*/ ~LLStatusBar(); - /*virtual*/ EWidgetType getWidgetType() const; - /*virtual*/ LLString getWidgetTag() const; - /*virtual*/ void draw(); // MANIPULATORS diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index dc1102eba7..6618e3d631 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -175,7 +175,7 @@ void LLSurface::create(const S32 grids_per_edge, mOriginGlobal.setVec(origin_global); - mPVArray.create(mGridsPerEdge, mGridsPerPatchEdge, gWorldPointer->getRegionScale()); + mPVArray.create(mGridsPerEdge, mGridsPerPatchEdge, LLWorld::getInstance()->getRegionScale()); S32 number_of_grids = mGridsPerEdge * mGridsPerEdge; diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 502ff07b3c..7a475f21ba 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -845,7 +845,7 @@ void LLSurfacePatch::updateVisibility() LLVector3 radius = LLVector3(mRadius, mRadius, mRadius); // sphere in frustum on global coordinates - if (gCamera->AABBInFrustumNoFarClip(center, radius)) + if (LLViewerCamera::getInstance()->AABBInFrustumNoFarClip(center, radius)) { // We now need to calculate the render stride based on patchp's distance // from LLCamera render_stride is governed by a relation something like this... diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 78cb53c2a5..7a2d232de6 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -326,7 +326,7 @@ void LLTexLayerSetBuffer::readBackAndUpload(U8* baked_bump_data) stop_glerror(); llinfos << "Baked " << mTexLayerSet->getBodyRegion() << llendl; - gViewerStats->incStat(LLViewerStats::ST_TEX_BAKES); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_BAKES); llassert( gAgent.getAvatarObject() == mTexLayerSet->getAvatar() ); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index b60ef6c5ac..474d81b77f 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -50,15 +50,6 @@ class LLTextureCacheWorker : public LLWorkerClass friend class LLTextureCache; private: - enum e_state - { - INIT = 0, - LOCAL = 1, - CACHE = 2, - HEADER = 3, - BODY = 4 - }; - class ReadResponder : public LLLFSThread::Responder { public: @@ -97,10 +88,9 @@ public: S32 imagesize, // for writes LLTextureCache::Responder* responder) : LLWorkerClass(cache, "LLTextureCacheWorker"), + mID(id), mCache(cache), mPriority(priority), - mID(id), - mState(INIT), mReadData(NULL), mWriteData(data), mDataSize(datasize), @@ -121,8 +111,10 @@ public: delete[] mReadData; } - bool doRead(); - bool doWrite(); + // override this interface + virtual bool doRead() = 0; + virtual bool doWrite() = 0; + virtual bool doWork(S32 param); // Called from LLWorkerThread::processRequest() handle_t read() { addWork(0, LLWorkerThread::PRIORITY_HIGH | mPriority); return mRequestHandle; } @@ -133,24 +125,23 @@ public: mBytesRead = bytes; setPriority(LLWorkerThread::PRIORITY_HIGH | mPriority); } - + 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) -private: +protected: LLTextureCache* mCache; U32 mPriority; - LLUUID mID; - e_state mState; + LLUUID mID; U8* mReadData; U8* mWriteData; S32 mDataSize; S32 mOffset; S32 mImageSize; - S32 mImageFormat; + EImageCodec mImageFormat; BOOL mImageLocal; LLPointer<LLTextureCache::Responder> mResponder; LLLFSThread::handle_t mFileHandle; @@ -158,19 +149,169 @@ private: LLAtomicS32 mBytesRead; }; +class LLTextureCacheLocalFileWorker : public LLTextureCacheWorker +{ +public: + LLTextureCacheLocalFileWorker(LLTextureCache* cache, U32 priority, const LLString& filename, const LLUUID& id, + U8* data, S32 datasize, S32 offset, + S32 imagesize, // for writes + LLTextureCache::Responder* responder) + : LLTextureCacheWorker(cache, priority, id, data, datasize, offset, imagesize, responder), + mFileName(filename) + + { + } + + virtual bool doRead(); + virtual bool doWrite(); + +private: + LLString mFileName; +}; + +bool LLTextureCacheLocalFileWorker::doRead() +{ + S32 local_size = ll_apr_file_size(mFileName, mCache->getFileAPRPool()); + + if (local_size > 0 && mFileName.size() > 4) + { + mDataSize = local_size; // Only a complete file is valid + + LLString extension = mFileName.substr(mFileName.size() - 3, 3); + + mImageFormat = LLImageBase::getCodecFromExtension(extension); + + if (mImageFormat == IMG_CODEC_INVALID) + { + llwarns << "Unrecognized file extension " << extension << " for local texture " << mFileName << llendl; + mDataSize = 0; // no data + return true; + } + } + else + { + // file doesn't exist + mDataSize = 0; // no data + return true; + } + +#if USE_LFS_READ + if (mFileHandle == LLLFSThread::nullHandle()) + { + mImageLocal = TRUE; + mImageSize = local_size; + if (!mDataSize || mDataSize + mOffset > local_size) + { + mDataSize = local_size - mOffset; + } + if (mDataSize <= 0) + { + // no more data to read + mDataSize = 0; + return true; + } + mReadData = new U8[mDataSize]; + mBytesRead = -1; + mBytesToRead = mDataSize; + setPriority(LLWorkerThread::PRIORITY_LOW | mPriority); + mFileHandle = LLLFSThread::sLocal->read(local_filename, mReadData, mOffset, mDataSize, + new ReadResponder(mCache, mRequestHandle)); + return false; + } + else + { + if (mBytesRead >= 0) + { + if (mBytesRead != mBytesToRead) + { + llwarns << "Error reading file from local cache: " << local_filename + << " Bytes: " << mDataSize << " Offset: " << mOffset + << " / " << mDataSize << llendl; + mDataSize = 0; // failed + delete[] mReadData; + mReadData = NULL; + } + return true; + } + else + { + return false; + } + } +#else + if (!mDataSize || mDataSize > local_size) + { + mDataSize = local_size; + } + mReadData = new U8[mDataSize]; + S32 bytes_read = ll_apr_file_read_ex(mFileName, mCache->getFileAPRPool(), + mReadData, mOffset, mDataSize); + if (bytes_read != mDataSize) + { + llwarns << "Error reading file from local cache: " << mFileName + << " Bytes: " << mDataSize << " Offset: " << mOffset + << " / " << mDataSize << llendl; + mDataSize = 0; + delete[] mReadData; + mReadData = NULL; + } + else + { + mImageSize = local_size; + mImageLocal = TRUE; + } + return true; +#endif +} + +bool LLTextureCacheLocalFileWorker::doWrite() +{ + // no writes for local files + return false; +} + +class LLTextureCacheRemoteWorker : public LLTextureCacheWorker +{ +public: + LLTextureCacheRemoteWorker(LLTextureCache* cache, U32 priority, const LLUUID& id, + U8* data, S32 datasize, S32 offset, + S32 imagesize, // for writes + LLTextureCache::Responder* responder) + : LLTextureCacheWorker(cache, priority, id, data, datasize, offset, imagesize, responder), + mState(INIT) + { + } + + virtual bool doRead(); + virtual bool doWrite(); + +private: + enum e_state + { + INIT = 0, + LOCAL = 1, + CACHE = 2, + HEADER = 3, + BODY = 4 + }; + + e_state mState; +}; + + //virtual void LLTextureCacheWorker::startWork(S32 param) { } -bool LLTextureCacheWorker::doRead() +bool LLTextureCacheRemoteWorker::doRead() { S32 local_size = 0; std::string local_filename; if (mState == INIT) { - std::string filename = mCache->getLocalFileName(mID); + std::string filename = mCache->getLocalFileName(mID); local_filename = filename + ".j2c"; local_size = ll_apr_file_size(local_filename, mCache->getFileAPRPool()); if (local_size == 0) @@ -468,19 +609,13 @@ bool LLTextureCacheWorker::doRead() return false; } -bool LLTextureCacheWorker::doWrite() +bool LLTextureCacheRemoteWorker::doWrite() { S32 idx = -1; - if (mState == INIT) - { - llassert_always(mOffset == 0); // Currently don't support offsets - mState = CACHE; - } - // No LOCAL state for write() - if (mState == CACHE) + if (mState == INIT) { S32 cur_imagesize = 0; S32 offset = mOffset; @@ -1250,13 +1385,27 @@ S32 LLTextureCache::getHeaderCacheEntry(const LLUUID& id, bool touch, S32* image // Calls from texture pipeline thread (i.e. LLTextureFetch) +LLTextureCache::handle_t LLTextureCache::readFromCache(const LLString& filename, const LLUUID& id, U32 priority, + S32 offset, S32 size, ReadResponder* responder) +{ + // Note: checking to see if an entry exists can cause a stall, + // so let the thread handle it + LLMutexLock lock(&mWorkersMutex); + LLTextureCacheWorker* worker = new LLTextureCacheLocalFileWorker(this, priority, filename, id, + NULL, size, offset, 0, + responder); + handle_t handle = worker->read(); + mReaders[handle] = worker; + return handle; +} + LLTextureCache::handle_t LLTextureCache::readFromCache(const LLUUID& id, U32 priority, S32 offset, S32 size, ReadResponder* responder) { // Note: checking to see if an entry exists can cause a stall, // so let the thread handle it LLMutexLock lock(&mWorkersMutex); - LLTextureCacheWorker* worker = new LLTextureCacheWorker(this, priority, id, + LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id, NULL, size, offset, 0, responder); handle_t handle = worker->read(); @@ -1264,6 +1413,7 @@ LLTextureCache::handle_t LLTextureCache::readFromCache(const LLUUID& id, U32 pri return handle; } + bool LLTextureCache::readComplete(handle_t handle, bool abort) { lockWorkers(); @@ -1306,7 +1456,7 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio { LLMutexLock lock(&mWorkersMutex); llassert_always(imagesize > 0); - LLTextureCacheWorker* worker = new LLTextureCacheWorker(this, priority, id, + LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id, data, datasize, 0, imagesize, responder); handle_t handle = worker->write(); diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index e3d3fa3977..28b33d5c4e 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -44,6 +44,8 @@ class LLTextureCacheWorker; class LLTextureCache : public LLWorkerThread { friend class LLTextureCacheWorker; + friend class LLTextureCacheRemoteWorker; + friend class LLTextureCacheLocalFileWorker; public: @@ -81,6 +83,9 @@ public: void purgeCache(ELLPath location); S64 initCache(ELLPath location, S64 maxsize, BOOL read_only); + handle_t readFromCache(const LLString& local_filename, const LLUUID& id, U32 priority, S32 offset, S32 size, + ReadResponder* responder); + handle_t readFromCache(const LLUUID& id, U32 priority, S32 offset, S32 size, ReadResponder* responder); bool readComplete(handle_t handle, bool abort); diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 4f8e562baf..e20cc75b0a 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -64,7 +64,7 @@ #include "llviewerobject.h" #include "llviewercontrol.h" #include "llglheaders.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" static const S32 CLOSE_BTN_WIDTH = 100; @@ -119,7 +119,7 @@ public: EAcceptance *accept, LLString& tooltip_msg); virtual void draw(); - virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent); + virtual BOOL handleKeyHere(KEY key, MASK mask); // LLFloater overrides virtual void onClose(bool app_quitting); @@ -214,11 +214,11 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( mNonImmediateFilterPermMask(non_immediate_filter_perm_mask), mContextConeOpacity(0.f) { - gUICtrlFactory->buildFloater(this,"floater_texture_ctrl.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml"); - mTentativeLabel = LLUICtrlFactory::getTextBoxByName(this,"Multiple"); + mTentativeLabel = getChild<LLTextBox>("Multiple"); - mResolutionLabel = LLUICtrlFactory::getTextBoxByName(this,"unknown"); + mResolutionLabel = getChild<LLTextBox>("unknown"); childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); @@ -229,10 +229,10 @@ LLFloaterTexturePicker::LLFloaterTexturePicker( childSetCommitCallback("show_folders_check", onShowFolders, this); childSetVisible("show_folders_check", FALSE); - mSearchEdit = (LLSearchEditor*)getCtrlByNameAndType("inventory search editor", WIDGET_TYPE_SEARCH_EDITOR); + mSearchEdit = getChild<LLSearchEditor>("inventory search editor"); mSearchEdit->setSearchCallback(onSearchEdit, this); - mInventoryPanel = (LLInventoryPanel*)this->getCtrlByNameAndType("inventory panel", WIDGET_TYPE_INVENTORY_PANEL); + mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); if(mInventoryPanel) { @@ -332,9 +332,9 @@ void LLFloaterTexturePicker::setCanApplyImmediately(BOOL b) void LLFloaterTexturePicker::stopUsingPipette() { - if (gToolMgr && gToolMgr->getCurrentTool() == gToolPipette) + if (LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()) { - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); } } @@ -407,15 +407,15 @@ BOOL LLFloaterTexturePicker::handleDragAndDrop( return handled; } -BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_parent) +BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) { LLFolderView* root_folder = mInventoryPanel->getRootFolder(); if (root_folder && mSearchEdit) { - if (!called_from_parent && mSearchEdit->hasFocus() && - (key == KEY_RETURN || key == KEY_DOWN) && - mask == MASK_NONE) + if (mSearchEdit->hasFocus() + && (key == KEY_RETURN || key == KEY_DOWN) + && mask == MASK_NONE) { if (!root_folder->getCurSelectedItem()) { @@ -442,7 +442,7 @@ BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask, BOOL called_from_ } } - return LLFloater::handleKeyHere(key, mask, called_from_parent); + return LLFloater::handleKeyHere(key, mask); } // virtual @@ -533,14 +533,14 @@ void LLFloaterTexturePicker::draw() // if we're inactive, gray out "apply immediate" checkbox childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected); childSetEnabled("Select", mActive); - childSetEnabled("Pipette", gToolMgr != NULL && mActive); - childSetValue("Pipette", gToolMgr && gToolMgr->getCurrentTool() == gToolPipette); + childSetEnabled("Pipette", mActive); + childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //RN: reset search bar to reflect actual search query (all caps, for example) mSearchEdit->setText(mInventoryPanel->getFilterSubString()); //BOOL allow_copy = FALSE; - if( getVisible() && mOwner) + if( mOwner ) { mTexturep = NULL; if(mImageAssetID.notNull()) @@ -739,18 +739,18 @@ void LLFloaterTexturePicker::onBtnPipette( void* userdata ) { LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - if ( self && gToolMgr) + if ( self) { BOOL pipette_active = self->childGetValue("Pipette").asBoolean(); pipette_active = !pipette_active; if (pipette_active) { - gToolPipette->setSelectCallback(onTextureSelect, self); - gToolMgr->setTransientTool(gToolPipette); + LLToolPipette::getInstance()->setSelectCallback(onTextureSelect, self); + LLToolMgr::getInstance()->setTransientTool(LLToolPipette::getInstance()); } else { - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); } } @@ -859,7 +859,7 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *da LLUUID inventory_item_id = self->findItemID(te.getID(), TRUE); if (self && inventory_item_id.notNull()) { - gToolPipette->setResult(TRUE, ""); + LLToolPipette::getInstance()->setResult(TRUE, ""); self->setImageID(te.getID()); self->mNoCopyTextureSelected = FALSE; @@ -875,13 +875,15 @@ void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te, void *da } else { - gToolPipette->setResult(FALSE, "You do not have a copy this \nof texture in your inventory"); + LLToolPipette::getInstance()->setResult(FALSE, "You do not have a copy this \nof texture in your inventory"); } } /////////////////////////////////////////////////////////////////////// // LLTextureCtrl +static LLRegisterWidget<LLTextureCtrl> r("texture_picker"); + LLTextureCtrl::LLTextureCtrl( const std::string& name, const LLRect &rect, @@ -933,6 +935,7 @@ LLTextureCtrl::LLTextureCtrl( LLRect border_rect(0, getRect().getHeight(), getRect().getWidth(), 0); border_rect.mBottom += BTN_HEIGHT_SMALL; mBorder = new LLViewBorder("border", border_rect, LLViewBorder::BEVEL_IN); + mBorder->setFollowsAll(); addChild(mBorder); setEnabled(TRUE); // for the tooltip @@ -1276,50 +1279,47 @@ BOOL LLTextureCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, void LLTextureCtrl::draw() { - if( getVisible() ) - { - mBorder->setKeyboardFocusHighlight(hasFocus()); + mBorder->setKeyboardFocusHighlight(hasFocus()); - if (mImageAssetID.isNull() || !mValid) - { - mTexturep = NULL; - } - else - { - mTexturep = gImageList.getImage(mImageAssetID, MIPMAP_YES, IMMEDIATE_NO); - mTexturep->setBoostLevel(LLViewerImage::BOOST_PREVIEW); - } - - // Border - LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); - gl_rect_2d( border, mBorderColor, FALSE ); + if (mImageAssetID.isNull() || !mValid) + { + mTexturep = NULL; + } + else + { + mTexturep = gImageList.getImage(mImageAssetID, MIPMAP_YES, IMMEDIATE_NO); + mTexturep->setBoostLevel(LLViewerImage::BOOST_PREVIEW); + } + + // Border + LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); + gl_rect_2d( border, mBorderColor, FALSE ); - // Interior - LLRect interior = border; - interior.stretch( -1 ); + // Interior + LLRect interior = border; + interior.stretch( -1 ); - if( mTexturep ) + if( mTexturep ) + { + if( mTexturep->getComponents() == 4 ) { - if( mTexturep->getComponents() == 4 ) - { - gl_rect_2d_checkerboard( interior ); - } - - gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep); - mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); + gl_rect_2d_checkerboard( interior ); } - else - { - gl_rect_2d( interior, LLColor4::grey, TRUE ); + + gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep); + mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); + } + else + { + gl_rect_2d( interior, LLColor4::grey, TRUE ); - // Draw X - gl_draw_x( interior, LLColor4::black ); - } + // Draw X + gl_draw_x( interior, LLColor4::black ); + } - mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() ); + mTentativeLabel->setVisible( !mTexturep.isNull() && getTentative() ); - LLUICtrl::draw(); - } + LLUICtrl::draw(); } BOOL LLTextureCtrl::allowDrop(LLInventoryItem* item) @@ -1370,14 +1370,14 @@ BOOL LLTextureCtrl::doDrop(LLInventoryItem* item) return TRUE; } -BOOL LLTextureCtrl::handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent) +BOOL LLTextureCtrl::handleUnicodeCharHere(llwchar uni_char) { - if( getVisible() && getEnabled() && !called_from_parent && ' ' == uni_char ) + if( ' ' == uni_char ) { showPicker(TRUE); return TRUE; } - return LLUICtrl::handleUnicodeCharHere(uni_char, called_from_parent); + return LLUICtrl::handleUnicodeCharHere(uni_char); } void LLTextureCtrl::setValue( LLSD value ) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 4a279d4084..5a7b9eede6 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -74,8 +74,6 @@ public: virtual ~LLTextureCtrl(); // LLView interface - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXTURE_PICKER; } - virtual LLString getWidgetTag() const { return LL_TEXTURE_CTRL_TAG; } virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); @@ -85,7 +83,7 @@ public: EAcceptance *accept, LLString& tooltip_msg); virtual BOOL handleHover(S32 x, S32 y, MASK mask); - virtual BOOL handleUnicodeCharHere(llwchar uni_char, BOOL called_from_parent); + virtual BOOL handleUnicodeCharHere(llwchar uni_char); virtual void draw(); virtual void setVisible( BOOL visible ); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index acd64220d9..4635b1b88a 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -52,8 +52,8 @@ //static class LLTextureFetchWorker : public LLWorkerClass { - friend class LLTextureFetch; - +friend class LLTextureFetch; + private: class URLResponder : public LLHTTPClient::Responder { @@ -233,6 +233,7 @@ private: /*virtual*/ void startWork(S32 param); // called from addWork() (MAIN THREAD) /*virtual*/ void endWork(S32 param, bool aborted); // called from doWork() (MAIN THREAD) + virtual LLString getName() { return LLString::null; } void resetFormattedData(); void setImagePriority(F32 priority); @@ -337,6 +338,26 @@ private: U8 mImageCodec; }; +class LLTextureFetchLocalFileWorker : public LLTextureFetchWorker +{ +friend class LLTextureFetch; + +protected: + LLTextureFetchLocalFileWorker(LLTextureFetch* fetcher, const LLString& filename, const LLUUID& id, const LLHost& host, + F32 priority, S32 discard, S32 size) + : LLTextureFetchWorker(fetcher, id, host, priority, discard, size), + mFileName(filename) + {} + +private: + /*virtual*/ LLString getName() { return mFileName; } + + +private: + LLString mFileName; +}; + + //static const char* LLTextureFetchWorker::sStateDescs[] = { "INVALID", @@ -580,9 +601,19 @@ bool LLTextureFetchWorker::doWork(S32 param) mFileSize = 0; mLoaded = FALSE; setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it + CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); - mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, - offset, size, responder); + if (getName().empty()) + { + mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, + offset, size, responder); + } + else + { + // read file from local disk + mCacheReadHandle = mFetcher->mTextureCache->readFromCache(getName(), mID, cache_priority, + offset, size, responder); + } } if (mLoaded) @@ -612,12 +643,17 @@ bool LLTextureFetchWorker::doWork(S32 param) if ((mCachedSize >= mDesiredSize) || mHaveAllData) { // we have enough data, decode it - llassert_always(mFormattedImage->getDataSize() > 0); + llassert_always(mFormattedImage.isNull() || mFormattedImage->getDataSize() > 0); mState = DECODE_IMAGE; // fall through } else { + if (!getName().empty()) + { + // failed to load local file, we're done. + return true; + } // need more data mState = LOAD_FROM_NETWORK; // fall through @@ -821,7 +857,7 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mState == DECODE_IMAGE) { - llassert_always(mFormattedImage->getDataSize() > 0); + llassert_always(mFormattedImage.isNull() || mFormattedImage->getDataSize() > 0); setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it mRawImage = NULL; mAuxImage = NULL; @@ -1273,6 +1309,12 @@ LLTextureFetch::~LLTextureFetch() } bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 priority, + S32 w, S32 h, S32 c, S32 discard, bool needs_aux) +{ + return createRequest(LLString::null, id, host, priority, w, h, c, discard, needs_aux); +} + +bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, const LLHost& host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux) { if (mDebugPause) @@ -1305,13 +1347,13 @@ bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 pri // we really do get it.) desired_size = worker->mFileSize; } - else if ((discard == 0) && worker == NULL) - { - // if we want the entire image, but we don't know its size, then send - // a sentinel value of zero to request the entire contents of the cache. - // patch supplied by resident Sheet Spotter for VWR-2404 - desired_size = 0; - } + //else if ((discard == 0) && worker == NULL) + //{ + // // if we want the entire image, but we don't know its size, then send + // // a sentinel value of zero to request the entire contents of the cache. + // // patch supplied by resident Sheet Spotter for VWR-2404 + // desired_size = 0; + //} else if (w*h*c > 0) { // If the requester knows the dimentions of the image, @@ -1342,7 +1384,16 @@ bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 pri } else { - worker = new LLTextureFetchWorker(this, id, host, priority, discard, desired_size); + if (filename.empty()) + { + // do remote fetch + worker = new LLTextureFetchWorker(this, id, host, priority, discard, desired_size); + } + else + { + // do local file fetch + worker = new LLTextureFetchLocalFileWorker(this, filename, id, host, priority, discard, desired_size); + } mRequestMap[id] = worker; } worker->mActiveCount++; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 8ae4f6d420..9f55a4ee92 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -55,6 +55,8 @@ public: bool createRequest(const LLUUID& id, const LLHost& host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux); + bool createRequest(const LLString& filename, const LLUUID& id, const LLHost& host, F32 priority, + S32 w, S32 h, S32 c, S32 discard, bool needs_aux); void deleteRequest(const LLUUID& id, bool cancel); bool getRequestFinished(const LLUUID& id, S32& discard_level, LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index b5d4818fba..7f571a1205 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -89,9 +89,6 @@ public: { } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXTURE_BAR; } - virtual LLString getWidgetTag() const { return LL_TEXTURE_BAR_TAG; } - virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. @@ -376,9 +373,6 @@ public: setRect(LLRect(0,0,100,line_height * 4)); } - virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEX_MEM_BAR; }; - virtual LLString getWidgetTag() const { return LL_GL_TEX_MEM_BAR_TAG; }; - virtual void draw(); virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual LLRect getRequiredRect(); // Return the height of this object, given the set options. @@ -545,17 +539,6 @@ LLTextureView::~LLTextureView() mGLTexMemBar = 0; } -EWidgetType LLTextureView::getWidgetType() const -{ - return WIDGET_TYPE_TEXTURE_VIEW; -} - -LLString LLTextureView::getWidgetTag() const -{ - return LL_TEXTURE_VIEW_TAG; -} - - typedef std::pair<F32,LLViewerImage*> decode_pair_t; struct compare_decode_pair { @@ -637,7 +620,7 @@ void LLTextureView::draw() if (!mOrderFetch) { #if 1 - if (pri < HIGH_PRIORITY && gSelectMgr) + if (pri < HIGH_PRIORITY && LLSelectMgr::getInstance()) { struct f : public LLSelectedTEFunctor { @@ -649,7 +632,7 @@ void LLTextureView::draw() } } func(imagep); const bool firstonly = true; - bool match = gSelectMgr->getSelection()->applyToTEs(&func, firstonly); + bool match = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func, firstonly); if (match) { pri += 3*HIGH_PRIORITY; diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h index 4c5fb1ce68..e6b7b817bb 100644 --- a/indra/newview/lltextureview.h +++ b/indra/newview/lltextureview.h @@ -46,9 +46,6 @@ public: LLTextureView(const std::string& name, const LLRect& rect); ~LLTextureView(); - virtual EWidgetType getWidgetType() const; - virtual LLString getWidgetTag() const; - /*virtual*/ void draw(); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 48743aeb39..0398b7a0c1 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -162,7 +162,7 @@ LLTool* LLTool::getOverrideTool(MASK mask) { if (mask & MASK_ALT) { - return gToolCamera; + return LLToolCamera::getInstance(); } return NULL; } diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 0fb7fbba4c..606bc75103 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -57,7 +57,7 @@ #include "llviewermenu.h" #include "llfirstuse.h" #include "llviewerparcelmgr.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewerwindow.h" #include "lltoolgrab.h" #include "llcombobox.h" @@ -158,10 +158,10 @@ BOOL LLToolBar::postBuild() child_iter != getChildList()->end(); ++child_iter) { LLView *view = *child_iter; - if(view->getWidgetType() == WIDGET_TYPE_BUTTON) + LLButton* buttonp = dynamic_cast<LLButton*>(view); + if(buttonp) { - LLButton* btn = (LLButton*)view; - btn->setSoundFlags(LLView::SILENT); + buttonp->setSoundFlags(LLView::SILENT); } } @@ -171,6 +171,8 @@ BOOL LLToolBar::postBuild() LLRect rect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT); mResizeHandle = new LLFakeResizeHandle(LLString(""), rect, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT); this->addChildAtEnd(mResizeHandle); + LLLayoutStack* toolbar_stack = getChild<LLLayoutStack>("toolbar_stack"); + toolbar_stack->reshape(toolbar_stack->getRect().getWidth() - RESIZE_HANDLE_WIDTH, toolbar_stack->getRect().getHeight()); } #endif // LL_DARWIN @@ -191,7 +193,7 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EAcceptance* accept, LLString& tooltip_msg) { - LLButton* inventory_btn = LLUICtrlFactory::getButtonByName(this, "inventory_btn"); + LLButton* inventory_btn = getChild<LLButton>("inventory_btn"); if (!inventory_btn) return FALSE; LLInventoryView* active_inventory = LLInventoryView::getActiveInventory(); @@ -238,19 +240,14 @@ BOOL LLToolBar::visible(void*) void LLToolBar::layoutButtons() { - // Always spans whole window. JC +#if LL_DARWIN const S32 FUDGE_WIDTH_OF_SCREEN = 4; - S32 width = gViewerWindow->getWindowWidth() + FUDGE_WIDTH_OF_SCREEN; - S32 count = getChildCount(); + S32 width = gViewerWindow->getWindowWidth() + FUDGE_WIDTH_OF_SCREEN; S32 pad = 2; -#if LL_DARWIN // this function may be called before postBuild(), in which case mResizeHandle won't have been set up yet. if(mResizeHandle != NULL) { - // a resize handle has been added as a child, increasing the count by one. - count--; - if(!gViewerWindow->getWindow()->getFullscreen()) { // Only when running in windowed mode on the Mac, leave room for a resize widget on the right edge of the bar. @@ -270,51 +267,6 @@ void LLToolBar::layoutButtons() } } #endif // LL_DARWIN - - LLButton* chat_button = LLUICtrlFactory::getButtonByName(this, "chat_btn"); - if (chat_button) - { - width -= chat_button->getRect().getWidth() + pad; - } - - // We actually want to extend "pad" pixels off the right edge of the - // screen, such that the rightmost button is aligned. - S32 segment_width = llround((F32)(width) / ((F32)count - 1.f)); // ignore chat button - S32 btn_width = segment_width - pad; - - // Evenly space all views - S32 height = -1; - S32 i = count - 1; - S32 x = pad; - for (child_list_const_reverse_iter_t child_iter = getChildList()->rbegin(); - child_iter != getChildList()->rend(); ++child_iter) - { - LLView *btn_view = *child_iter; - if(btn_view->getWidgetType() == WIDGET_TYPE_BUTTON || btn_view->getWidgetType() == WIDGET_TYPE_FLYOUT_BUTTON) - { - if (height < 0) - { - height = btn_view->getRect().getHeight(); - } - - LLRect r; - - if (btn_view->getName() == "chat_btn") - { - r.setOriginAndSize(x, 0, btn_view->getRect().getWidth(), height); - x += btn_view->getRect().getWidth() + pad; - } - else - { - r.setOriginAndSize(x, 0, btn_width, height); - x += segment_width; - } - - btn_view->setOrigin(r.mLeft, r.mBottom); - btn_view->reshape(r.getWidth(), r.getHeight()); - i--; - } - } } @@ -338,13 +290,13 @@ void LLToolBar::refresh() childSetEnabled("fly_btn", gAgent.canFly() || gAgent.getFlying() ); - childSetEnabled("build_btn", gParcelMgr->agentCanBuild() ); + childSetEnabled("build_btn", LLViewerParcelMgr::getInstance()->agentCanBuild() ); // Check to see if we're in build mode - BOOL build_mode = gToolMgr->inEdit(); + BOOL build_mode = LLToolMgr::getInstance()->inEdit(); // And not just clicking on a scripted object - if (gToolGrab->getHideBuildHighlight()) + if (LLToolGrab::getInstance()->getHideBuildHighlight()) { build_mode = FALSE; } @@ -355,69 +307,66 @@ void LLToolBar::refresh() void LLToolBar::updateCommunicateList() { - LLFlyoutButton* communicate_button = (LLFlyoutButton*)getChildByName("communicate_btn", TRUE); - if (communicate_button) - { - LLSD selected = communicate_button->getValue(); + LLFlyoutButton* communicate_button = getChild<LLFlyoutButton>("communicate_btn"); + LLSD selected = communicate_button->getValue(); - communicate_button->removeall(); + communicate_button->removeall(); - LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); - LLScrollListItem* itemp = NULL; + LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater(); + LLScrollListItem* itemp = NULL; - itemp = communicate_button->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP); - if (LLFloaterMyFriends::getInstance() == frontmost_floater) + itemp = communicate_button->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP); + if (LLFloaterMyFriends::getInstance() == frontmost_floater) + { + ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + // make sure current tab is selected in list + if (selected.isUndefined()) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); - // make sure current tab is selected in list - if (selected.isUndefined()) - { - selected = itemp->getValue(); - } + selected = itemp->getValue(); } - itemp = communicate_button->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP); - if (LLFloaterChat::getInstance() == frontmost_floater) + } + itemp = communicate_button->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP); + if (LLFloaterChat::getInstance() == frontmost_floater) + { + ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + if (selected.isUndefined()) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); - if (selected.isUndefined()) - { - selected = itemp->getValue(); - } + selected = itemp->getValue(); } - communicate_button->addSeparator(ADD_TOP); - communicate_button->add(getUIString("Redock Windows"), LLSD("redock"), ADD_TOP); - communicate_button->addSeparator(ADD_TOP); - communicate_button->add(LLFloaterMute::getInstance()->getShortTitle(), LLSD("mute list"), ADD_TOP); - - std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it; + } + communicate_button->addSeparator(ADD_TOP); + communicate_button->add(getUIString("Redock Windows"), LLSD("redock"), ADD_TOP); + communicate_button->addSeparator(ADD_TOP); + communicate_button->add(LLFloaterMute::getInstance()->getShortTitle(), LLSD("mute list"), ADD_TOP); + + std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it; - if (gIMMgr->getIMFloaterHandles().size() > 0) - { - communicate_button->addSeparator(ADD_TOP); - } + if (gIMMgr->getIMFloaterHandles().size() > 0) + { + communicate_button->addSeparator(ADD_TOP); + } - for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it) + for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it) + { + LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get(); + if (im_floaterp) { - LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get(); - if (im_floaterp) + LLString floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; + floater_title.append(im_floaterp->getShortTitle()); + itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP); + if (im_floaterp == frontmost_floater) { - LLString floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; - floater_title.append(im_floaterp->getShortTitle()); - itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP); - if (im_floaterp == frontmost_floater) + ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); + if (selected.isUndefined()) { - ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD); - if (selected.isUndefined()) - { - selected = itemp->getValue(); - } + selected = itemp->getValue(); } } } - - communicate_button->setToggleState(gSavedSettings.getBOOL("ShowCommunicate")); - communicate_button->setValue(selected); } + + communicate_button->setToggleState(gSavedSettings.getBOOL("ShowCommunicate")); + communicate_button->setValue(selected); } @@ -425,7 +374,7 @@ void LLToolBar::updateCommunicateList() void LLToolBar::onClickCommunicate(LLUICtrl* ctrl, void* user_data) { LLToolBar* toolbar = (LLToolBar*)user_data; - LLFlyoutButton* communicate_button = (LLFlyoutButton*)toolbar->getChildByName("communicate_btn", TRUE); + LLFlyoutButton* communicate_button = toolbar->getChild<LLFlyoutButton>("communicate_btn"); LLSD selected_option = communicate_button->getValue(); diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp index d39ce57e56..a15b01ca04 100644 --- a/indra/newview/lltoolbrush.cpp +++ b/indra/newview/lltoolbrush.cpp @@ -62,8 +62,6 @@ const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terraforming.\n" "You will need to buy land in another part of the world to terraform it."; -// Globals -LLToolBrushLand *gToolLand = NULL; ///============================================================================ /// Local function declarations, constants, enums, and typedefs @@ -182,12 +180,12 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, void LLToolBrushLand::modifyLandInSelectionGlobal() { - if (gParcelMgr->selectionEmpty()) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { return; } - if (gToolMgr->getCurrentTool() == gToolParcel) + if (LLToolMgr::getInstance()->getCurrentTool() == LLToolSelectLand::getInstance()) { // selecting land, don't do anything return; @@ -196,7 +194,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() LLVector3d min; LLVector3d max; - gParcelMgr->getSelection(min, max); + LLViewerParcelMgr::getInstance()->getSelection(min, max); S32 radioAction = gSavedSettings.getS32("RadioLandBrushAction"); @@ -306,8 +304,8 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() msg->addF32Fast(_PREHASH_Seconds, seconds); msg->addF32Fast(_PREHASH_Height, mStartingZ); - BOOL parcel_selected = gParcelMgr->getParcelSelection()->getWholeParcelSelected(); - LLParcel* selected_parcel = gParcelMgr->getParcelSelection()->getParcel(); + BOOL parcel_selected = LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected(); + LLParcel* selected_parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); if (parcel_selected && selected_parcel) { @@ -376,7 +374,7 @@ BOOL LLToolBrushLand::handleMouseDown(S32 x, S32 y, MASK mask) gIdleCallbacks.addFunction( &LLToolBrushLand::onIdle, (void*)this ); setMouseCapture( TRUE ); - gParcelMgr->setSelectionVisible(FALSE); + LLViewerParcelMgr::getInstance()->setSelectionVisible(FALSE); handled = TRUE; } @@ -404,7 +402,7 @@ BOOL LLToolBrushLand::handleMouseUp(S32 x, S32 y, MASK mask) // Release the mouse setMouseCapture( FALSE ); - gParcelMgr->setSelectionVisible(TRUE); + LLViewerParcelMgr::getInstance()->setSelectionVisible(TRUE); gIdleCallbacks.deleteFunction( &LLToolBrushLand::onIdle, (void*)this ); handled = TRUE; @@ -435,7 +433,7 @@ void LLToolBrushLand::handleDeselect() } mLastShowParcelOwners = gSavedSettings.getBOOL("ShowParcelOwners"); gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners); - gParcelMgr->setSelectionVisible(TRUE); + LLViewerParcelMgr::getInstance()->setSelectionVisible(TRUE); mBrushSelected = FALSE; } @@ -506,25 +504,25 @@ void LLToolBrushLand::determineAffectedRegions(region_list_t& regions, corner.mdV[VX] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); corner.mdV[VY] -= (LAND_BRUSH_SIZE[mBrushIndex] / 2); LLViewerRegion* region = NULL; - region = gWorldPointer->getRegionFromPosGlobal(corner); + region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } corner.mdV[VY] += LAND_BRUSH_SIZE[mBrushIndex]; - region = gWorldPointer->getRegionFromPosGlobal(corner); + region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } corner.mdV[VX] += LAND_BRUSH_SIZE[mBrushIndex]; - region = gWorldPointer->getRegionFromPosGlobal(corner); + region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); } corner.mdV[VY] -= LAND_BRUSH_SIZE[mBrushIndex]; - region = gWorldPointer->getRegionFromPosGlobal(corner); + region = LLWorld::getInstance()->getRegionFromPosGlobal(corner); if(region && regions.find(region) == regions.end()) { regions.insert(region); @@ -536,7 +534,7 @@ void LLToolBrushLand::onIdle( void* brush_tool ) { LLToolBrushLand* self = reinterpret_cast<LLToolBrushLand*>(brush_tool); - if( gToolMgr->getCurrentTool() == self ) + if( LLToolMgr::getInstance()->getCurrentTool() == self ) { self->brush(); } diff --git a/indra/newview/lltoolbrush.h b/indra/newview/lltoolbrush.h index c46037a8f7..70e34725af 100644 --- a/indra/newview/lltoolbrush.h +++ b/indra/newview/lltoolbrush.h @@ -46,7 +46,7 @@ class LLViewerRegion; // A toolbrush that modifies the land. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLToolBrushLand : public LLTool, public LLEditMenuHandler +class LLToolBrushLand : public LLTool, public LLEditMenuHandler, public LLSingleton<LLToolBrushLand> { typedef std::set<LLViewerRegion*> region_list_t; @@ -103,6 +103,5 @@ protected: region_list_t mLastAffectedRegions; }; -extern LLToolBrushLand *gToolLand; #endif // LL_LLTOOLBRUSH_H diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index d8f4e55b0e..7865d8efe3 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -46,7 +46,6 @@ #include "lltoolgrab.h" #include "lltoolgun.h" #include "lltoolmgr.h" -#include "lltoolselect.h" #include "lltoolselectrect.h" #include "lltoolplacer.h" #include "llviewermenu.h" @@ -61,14 +60,6 @@ const S32 BUTTON_WIDTH_SMALL = 32; const S32 BUTTON_WIDTH_BIG = 48; const S32 HPAD = 4; -// Globals -LLToolCompInspect *gToolInspect = NULL; -LLToolCompTranslate *gToolTranslate = NULL; -LLToolCompScale *gToolStretch = NULL; -LLToolCompRotate *gToolRotate = NULL; -LLToolCompCreate *gToolCreate = NULL; -LLToolCompGun *gToolGun = NULL; - extern LLControlGroup gSavedSettings; @@ -126,7 +117,7 @@ void LLToolComposite::handleSelect() { if (!gSavedSettings.getBOOL("EditLinkedParts")) { - gSelectMgr->promoteSelectionToRoot(); + LLSelectMgr::getInstance()->promoteSelectionToRoot(); } mCur = mDefault; mCur->handleSelect(); @@ -162,27 +153,27 @@ void LLToolCompInspect::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); - if (!gToolInspect->mMouseDown) + if (!LLToolCompInspect::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolInspect->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompInspect::getInstance()->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } if( hit_obj ) { - if (gSelectMgr->getSelection()->getObjectCount()) + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount()) { - LLEditMenuHandler::gEditMenuHandler = gSelectMgr; + LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } - gToolInspect->setCurrentTool( gToolInspect->mSelectRect ); - gToolInspect->mSelectRect->handleMouseDown( x, y, mask ); + LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect ); + LLToolCompInspect::getInstance()->mSelectRect->handleMouseDown( x, y, mask ); } else { - gToolInspect->setCurrentTool( gToolInspect->mSelectRect ); - gToolInspect->mSelectRect->handleMouseDown( x, y, mask); + LLToolCompInspect::getInstance()->setCurrentTool( LLToolCompInspect::getInstance()->mSelectRect ); + LLToolCompInspect::getInstance()->mSelectRect->handleMouseDown( x, y, mask); } } @@ -235,41 +226,41 @@ void LLToolCompTranslate::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); - gToolTranslate->mManip->highlightManipulators(x, y); - if (!gToolTranslate->mMouseDown) + LLToolCompTranslate::getInstance()->mManip->highlightManipulators(x, y); + if (!LLToolCompTranslate::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolTranslate->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompTranslate::getInstance()->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } - if( hit_obj || gToolTranslate->mManip->getHighlightedPart() != LLManip::LL_NO_PART ) + if( hit_obj || LLToolCompTranslate::getInstance()->mManip->getHighlightedPart() != LLManip::LL_NO_PART ) { - if (gToolTranslate->mManip->getSelection()->getObjectCount()) + if (LLToolCompTranslate::getInstance()->mManip->getSelection()->getObjectCount()) { - LLEditMenuHandler::gEditMenuHandler = gSelectMgr; + LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } - BOOL can_move = gToolTranslate->mManip->canAffectSelection(); + BOOL can_move = LLToolCompTranslate::getInstance()->mManip->canAffectSelection(); - if( LLManip::LL_NO_PART != gToolTranslate->mManip->getHighlightedPart() && can_move) + if( LLManip::LL_NO_PART != LLToolCompTranslate::getInstance()->mManip->getHighlightedPart() && can_move) { - gToolTranslate->setCurrentTool( gToolTranslate->mManip ); - gToolTranslate->mManip->handleMouseDownOnPart( x, y, mask ); + LLToolCompTranslate::getInstance()->setCurrentTool( LLToolCompTranslate::getInstance()->mManip ); + LLToolCompTranslate::getInstance()->mManip->handleMouseDownOnPart( x, y, mask ); } else { - gToolTranslate->setCurrentTool( gToolTranslate->mSelectRect ); - gToolTranslate->mSelectRect->handleMouseDown( x, y, mask ); + LLToolCompTranslate::getInstance()->setCurrentTool( LLToolCompTranslate::getInstance()->mSelectRect ); + LLToolCompTranslate::getInstance()->mSelectRect->handleMouseDown( x, y, mask ); // *TODO: add toggle to trigger old click-drag functionality - // gToolTranslate->mManip->handleMouseDownOnPart( XY_part, x, y, mask); + // LLToolCompTranslate::getInstance()->mManip->handleMouseDownOnPart( XY_part, x, y, mask); } } else { - gToolTranslate->setCurrentTool( gToolTranslate->mSelectRect ); - gToolTranslate->mSelectRect->handleMouseDown( x, y, mask); + LLToolCompTranslate::getInstance()->setCurrentTool( LLToolCompTranslate::getInstance()->mSelectRect ); + LLToolCompTranslate::getInstance()->mSelectRect->handleMouseDown( x, y, mask); } } @@ -283,11 +274,11 @@ LLTool* LLToolCompTranslate::getOverrideTool(MASK mask) { if (mask == MASK_CONTROL) { - return gToolRotate; + return LLToolCompRotate::getInstance(); } else if (mask == (MASK_CONTROL | MASK_SHIFT)) { - return gToolStretch; + return LLToolCompScale::getInstance(); } return LLToolComposite::getOverrideTool(mask); } @@ -359,36 +350,36 @@ void LLToolCompScale::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); - gToolStretch->mManip->highlightManipulators(x, y); - if (!gToolStretch->mMouseDown) + LLToolCompScale::getInstance()->mManip->highlightManipulators(x, y); + if (!LLToolCompScale::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolStretch->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompScale::getInstance()->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } - if( hit_obj || gToolStretch->mManip->getHighlightedPart() != LLManip::LL_NO_PART) + if( hit_obj || LLToolCompScale::getInstance()->mManip->getHighlightedPart() != LLManip::LL_NO_PART) { - if (gToolStretch->mManip->getSelection()->getObjectCount()) + if (LLToolCompScale::getInstance()->mManip->getSelection()->getObjectCount()) { - LLEditMenuHandler::gEditMenuHandler = gSelectMgr; + LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } - if( LLManip::LL_NO_PART != gToolStretch->mManip->getHighlightedPart() ) + if( LLManip::LL_NO_PART != LLToolCompScale::getInstance()->mManip->getHighlightedPart() ) { - gToolStretch->setCurrentTool( gToolStretch->mManip ); - gToolStretch->mManip->handleMouseDownOnPart( x, y, mask ); + LLToolCompScale::getInstance()->setCurrentTool( LLToolCompScale::getInstance()->mManip ); + LLToolCompScale::getInstance()->mManip->handleMouseDownOnPart( x, y, mask ); } else { - gToolStretch->setCurrentTool( gToolStretch->mSelectRect ); - gToolStretch->mSelectRect->handleMouseDown( x, y, mask ); + LLToolCompScale::getInstance()->setCurrentTool( LLToolCompScale::getInstance()->mSelectRect ); + LLToolCompScale::getInstance()->mSelectRect->handleMouseDown( x, y, mask ); } } else { - gToolStretch->setCurrentTool( gToolStretch->mSelectRect ); - gToolStretch->mCur->handleMouseDown( x, y, mask ); + LLToolCompScale::getInstance()->setCurrentTool( LLToolCompScale::getInstance()->mSelectRect ); + LLToolCompScale::getInstance()->mCur->handleMouseDown( x, y, mask ); } } @@ -402,7 +393,7 @@ LLTool* LLToolCompScale::getOverrideTool(MASK mask) { if (mask == MASK_CONTROL) { - return gToolRotate; + return LLToolCompRotate::getInstance(); } return LLToolComposite::getOverrideTool(mask); @@ -489,8 +480,8 @@ void LLToolCompCreate::pickCallback(S32 x, S32 y, MASK mask) mask = (mask & ~MASK_SHIFT); mask = (mask & ~MASK_CONTROL); - gToolCreate->setCurrentTool( gToolCreate->mSelectRect ); - gToolCreate->mSelectRect->handleMouseDown( x, y, mask); + LLToolCompCreate::getInstance()->setCurrentTool( LLToolCompCreate::getInstance()->mSelectRect ); + LLToolCompCreate::getInstance()->mSelectRect->handleMouseDown( x, y, mask); } BOOL LLToolCompCreate::handleDoubleClick(S32 x, S32 y, MASK mask) @@ -560,35 +551,35 @@ void LLToolCompRotate::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); - gToolRotate->mManip->highlightManipulators(x, y); - if (!gToolRotate->mMouseDown) + LLToolCompRotate::getInstance()->mManip->highlightManipulators(x, y); + if (!LLToolCompRotate::getInstance()->mMouseDown) { // fast click on object, but mouse is already up...just do select - gToolRotate->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); + LLToolCompRotate::getInstance()->mSelectRect->handleObjectSelection(hit_obj, mask, gSavedSettings.getBOOL("EditLinkedParts"), FALSE); return; } - if( hit_obj || gToolRotate->mManip->getHighlightedPart() != LLManip::LL_NO_PART) + if( hit_obj || LLToolCompRotate::getInstance()->mManip->getHighlightedPart() != LLManip::LL_NO_PART) { - if (gToolRotate->mManip->getSelection()->getObjectCount()) + if (LLToolCompRotate::getInstance()->mManip->getSelection()->getObjectCount()) { - LLEditMenuHandler::gEditMenuHandler = gSelectMgr; + LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } - if( LLManip::LL_NO_PART != gToolRotate->mManip->getHighlightedPart() ) + if( LLManip::LL_NO_PART != LLToolCompRotate::getInstance()->mManip->getHighlightedPart() ) { - gToolRotate->setCurrentTool( gToolRotate->mManip ); - gToolRotate->mManip->handleMouseDownOnPart( x, y, mask ); + LLToolCompRotate::getInstance()->setCurrentTool( LLToolCompRotate::getInstance()->mManip ); + LLToolCompRotate::getInstance()->mManip->handleMouseDownOnPart( x, y, mask ); } else { - gToolRotate->setCurrentTool( gToolRotate->mSelectRect ); - gToolRotate->mSelectRect->handleMouseDown( x, y, mask ); + LLToolCompRotate::getInstance()->setCurrentTool( LLToolCompRotate::getInstance()->mSelectRect ); + LLToolCompRotate::getInstance()->mSelectRect->handleMouseDown( x, y, mask ); } } else { - gToolRotate->setCurrentTool( gToolRotate->mSelectRect ); - gToolRotate->mCur->handleMouseDown( x, y, mask ); + LLToolCompRotate::getInstance()->setCurrentTool( LLToolCompRotate::getInstance()->mSelectRect ); + LLToolCompRotate::getInstance()->mCur->handleMouseDown( x, y, mask ); } } @@ -602,7 +593,7 @@ LLTool* LLToolCompRotate::getOverrideTool(MASK mask) { if (mask == (MASK_CONTROL | MASK_SHIFT)) { - return gToolStretch; + return LLToolCompScale::getInstance(); } return LLToolComposite::getOverrideTool(mask); } @@ -671,7 +662,7 @@ BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask) // item selected from context menu. if ( mCur == mNull && !gPopupMenuView->getVisible() ) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); setCurrentTool( (LLTool*) mGrab ); } @@ -712,9 +703,9 @@ BOOL LLToolCompGun::handleMouseDown(S32 x, S32 y, MASK mask) // On mousedown, start grabbing gGrabTransientTool = this; - gToolMgr->getCurrentToolset()->selectTool( (LLTool*) mGrab ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab ); - return gToolGrab->handleMouseDown(x, y, mask); + return LLToolGrab::getInstance()->handleMouseDown(x, y, mask); } @@ -729,9 +720,9 @@ BOOL LLToolCompGun::handleDoubleClick(S32 x, S32 y, MASK mask) // On mousedown, start grabbing gGrabTransientTool = this; - gToolMgr->getCurrentToolset()->selectTool( (LLTool*) mGrab ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( (LLTool*) mGrab ); - return gToolGrab->handleDoubleClick(x, y, mask); + return LLToolGrab::getInstance()->handleDoubleClick(x, y, mask); } diff --git a/indra/newview/lltoolcomp.h b/indra/newview/lltoolcomp.h index 5dacfbb7cf..d6ec6032cd 100644 --- a/indra/newview/lltoolcomp.h +++ b/indra/newview/lltoolcomp.h @@ -104,7 +104,7 @@ public: //----------------------------------------------------------------------- // LLToolCompTranslate -class LLToolCompInspect : public LLToolComposite +class LLToolCompInspect : public LLToolComposite, public LLSingleton<LLToolCompInspect> { public: LLToolCompInspect(); @@ -120,7 +120,7 @@ public: //----------------------------------------------------------------------- // LLToolCompTranslate -class LLToolCompTranslate : public LLToolComposite +class LLToolCompTranslate : public LLToolComposite, public LLSingleton<LLToolCompTranslate> { public: LLToolCompTranslate(); @@ -141,7 +141,7 @@ public: //----------------------------------------------------------------------- // LLToolCompScale -class LLToolCompScale : public LLToolComposite +class LLToolCompScale : public LLToolComposite, public LLSingleton<LLToolCompScale> { public: LLToolCompScale(); @@ -163,7 +163,7 @@ public: //----------------------------------------------------------------------- // LLToolCompRotate -class LLToolCompRotate : public LLToolComposite +class LLToolCompRotate : public LLToolComposite, public LLSingleton<LLToolCompRotate> { public: LLToolCompRotate(); @@ -186,7 +186,7 @@ protected: //----------------------------------------------------------------------- // LLToolCompCreate -class LLToolCompCreate : public LLToolComposite +class LLToolCompCreate : public LLToolComposite, public LLSingleton<LLToolCompCreate> { public: LLToolCompCreate(); @@ -211,7 +211,7 @@ class LLToolGun; class LLToolGrab; class LLToolSelect; -class LLToolCompGun : public LLToolComposite +class LLToolCompGun : public LLToolComposite, public LLSingleton<LLToolCompGun> { public: LLToolCompGun(); @@ -234,11 +234,5 @@ protected: LLTool* mNull; }; -extern LLToolCompInspect *gToolInspect; -extern LLToolCompTranslate *gToolTranslate; -extern LLToolCompScale *gToolStretch; -extern LLToolCompRotate *gToolRotate; -extern LLToolCompCreate *gToolCreate; -extern LLToolCompGun *gToolGun; #endif // LL_TOOLCOMP_H diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 6e72426976..2f937822cf 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -64,7 +64,6 @@ #include "llworld.h" #include "object_flags.h" -LLToolDragAndDrop *gToolDragAndDrop = NULL; // MAX ITEMS is based on (sizeof(uuid)+2) * count must be < MTUBYTES // or 18 * count < 1200 => count < 1200/18 => 66. I've cut it down a @@ -78,37 +77,6 @@ const char* FOLDER_INCLUDES_ATTACHMENTS_BEING_WORN = // syntactic sugar #define callMemberFunction(object,ptrToMember) ((object).*(ptrToMember)) -/* -const LLUUID MULTI_CONTAINER_TEXTURE("b2181ea2-1937-2ee1-78b8-bf05c43536b7"); -LLUUID CONTAINER_TEXTURES[LLAssetType::AT_COUNT]; - -const char* CONTAINER_TEXTURE_NAMES[LLAssetType::AT_COUNT] = -{ - "container_texture.tga", - "container_sound.tga", - "container_many_things.tga", - "container_landmark.tga", - "container_script.tga", - "container_clothing.tga", - "container_object.tga", - "container_many_things.tga", - "container_many_things.tga", - "container_many_things.tga", - "container_script.tga", - "container_script.tga", - "container_texture.tga", - "container_bodypart.tga", - "container_many_things.tga", - "container_many_things.tga", - "container_many_things.tga", - "container_sound.tga", - "container_texture.tga", - "container_texture.tga", - "container_animation.tga", - "container_gesture.tga" -}; -*/ - class LLNoPreferredType : public LLInventoryCollectFunctor { public: @@ -610,11 +578,7 @@ LLToolDragAndDrop::LLToolDragAndDrop() mDrop(FALSE), mCurItemIndex(0) { - // setup container texture ids - //for (S32 i = 0; i < LLAssetType::AT_COUNT; i++) - //{ - // CONTAINER_TEXTURES[i].set(gViewerArt.getString(CONTAINER_TEXTURE_NAMES[i])); - //} + } void LLToolDragAndDrop::setDragStart(S32 x, S32 y) @@ -650,7 +614,7 @@ void LLToolDragAndDrop::beginDrag(EDragAndDropType type, mObjectID = object_id; setMouseCapture( TRUE ); - gToolMgr->setTransientTool( this ); + LLToolMgr::getInstance()->setTransientTool( this ); mCursor = UI_CURSOR_NO; if((mCargoTypes[0] == DAD_CATEGORY) && ((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY))) @@ -719,7 +683,7 @@ void LLToolDragAndDrop::beginMultiDrag( mSourceID = source_id; setMouseCapture( TRUE ); - gToolMgr->setTransientTool( this ); + LLToolMgr::getInstance()->setTransientTool( this ); mCursor = UI_CURSOR_NO; if((mSource == SOURCE_AGENT) || (mSource == SOURCE_LIBRARY)) { @@ -766,14 +730,14 @@ void LLToolDragAndDrop::beginMultiDrag( void LLToolDragAndDrop::endDrag() { - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); setMouseCapture(FALSE); } void LLToolDragAndDrop::onMouseCaptureLost() { // Called whenever the drag ends or if mouse captue is simply lost - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); mCargoTypes.clear(); mCargoIDs.clear(); mSource = SOURCE_AGENT; @@ -1045,7 +1009,7 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) S32 hit_face = -1; LLViewerObject* hit_obj = gViewerWindow->lastNonFloraObjectHit(); - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); // Treat attachments as part of the avatar they are attached to. if (hit_obj) @@ -1055,9 +1019,9 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) LLVOAvatar* avatar = LLVOAvatar::findAvatarFromAttachment( hit_obj ); if( !avatar ) { - gToolDragAndDrop->mLastAccept = ACCEPT_NO; - gToolDragAndDrop->mCursor = UI_CURSOR_NO; - gViewerWindow->getWindow()->setCursor( gToolDragAndDrop->mCursor ); + LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_NO; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; + gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); return; } @@ -1083,11 +1047,11 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) hit_face = gLastHitNonFloraObjectFace; // if any item being dragged will be applied to the object under our cursor // highlight that object - for (S32 i = 0; i < (S32)gToolDragAndDrop->mCargoIDs.size(); i++) + for (S32 i = 0; i < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); i++) { - if (gToolDragAndDrop->mCargoTypes[i] != DAD_OBJECT || (mask & MASK_CONTROL)) + if (LLToolDragAndDrop::getInstance()->mCargoTypes[i] != DAD_OBJECT || (mask & MASK_CONTROL)) { - gSelectMgr->highlightObjectAndFamily(hit_obj); + LLSelectMgr::getInstance()->highlightObjectAndFamily(hit_obj); break; } } @@ -1099,78 +1063,78 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) hit_face = -1; } - gToolDragAndDrop->mLastAccept = ACCEPT_YES_MULTI; + LLToolDragAndDrop::getInstance()->mLastAccept = ACCEPT_YES_MULTI; - for (gToolDragAndDrop->mCurItemIndex = 0; gToolDragAndDrop->mCurItemIndex < (S32)gToolDragAndDrop->mCargoIDs.size(); - gToolDragAndDrop->mCurItemIndex++) + for (LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); + LLToolDragAndDrop::getInstance()->mCurItemIndex++) { // Call the right implementation function - gToolDragAndDrop->mLastAccept = (EAcceptance)llmin( - (U32)gToolDragAndDrop->mLastAccept, - (U32)callMemberFunction((*gToolDragAndDrop), - gToolDragAndDrop->sDragAndDrop3d[gToolDragAndDrop->mCargoTypes[gToolDragAndDrop->mCurItemIndex]][target]) + LLToolDragAndDrop::getInstance()->mLastAccept = (EAcceptance)llmin( + (U32)LLToolDragAndDrop::getInstance()->mLastAccept, + (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), + LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) (hit_obj, hit_face, mask, FALSE)); } - if (gToolDragAndDrop->mDrop && (U32)gToolDragAndDrop->mLastAccept >= ACCEPT_YES_COPY_SINGLE) + if (LLToolDragAndDrop::getInstance()->mDrop && (U32)LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_SINGLE) { // if target allows multi-drop, go ahead and start iteration at beginning of cargo list - if (gToolDragAndDrop->mLastAccept >= ACCEPT_YES_COPY_MULTI) + if (LLToolDragAndDrop::getInstance()->mLastAccept >= ACCEPT_YES_COPY_MULTI) { - gToolDragAndDrop->mCurItemIndex = 0; + LLToolDragAndDrop::getInstance()->mCurItemIndex = 0; } // otherwise start at end, to follow selection rules (last selected item is most current) else { - gToolDragAndDrop->mCurItemIndex = gToolDragAndDrop->mCargoIDs.size() - 1; + LLToolDragAndDrop::getInstance()->mCurItemIndex = LLToolDragAndDrop::getInstance()->mCargoIDs.size() - 1; } - for (; gToolDragAndDrop->mCurItemIndex < (S32)gToolDragAndDrop->mCargoIDs.size(); - gToolDragAndDrop->mCurItemIndex++) + for (; LLToolDragAndDrop::getInstance()->mCurItemIndex < (S32)LLToolDragAndDrop::getInstance()->mCargoIDs.size(); + LLToolDragAndDrop::getInstance()->mCurItemIndex++) { // Call the right implementation function - (U32)callMemberFunction((*gToolDragAndDrop), - gToolDragAndDrop->sDragAndDrop3d[gToolDragAndDrop->mCargoTypes[gToolDragAndDrop->mCurItemIndex]][target]) + (U32)callMemberFunction((*LLToolDragAndDrop::getInstance()), + LLToolDragAndDrop::getInstance()->sDragAndDrop3d[LLToolDragAndDrop::getInstance()->mCargoTypes[LLToolDragAndDrop::getInstance()->mCurItemIndex]][target]) (hit_obj, hit_face, mask, TRUE); } } - switch( gToolDragAndDrop->mLastAccept ) + switch( LLToolDragAndDrop::getInstance()->mLastAccept ) { case ACCEPT_YES_MULTI: - if (gToolDragAndDrop->mCargoIDs.size() > 1) + if (LLToolDragAndDrop::getInstance()->mCargoIDs.size() > 1) { - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAGMULTI; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAGMULTI; } else { - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAG; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAG; } break; case ACCEPT_YES_SINGLE: - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWDRAG; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWDRAG; break; case ACCEPT_NO_LOCKED: - gToolDragAndDrop->mCursor = UI_CURSOR_NOLOCKED; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NOLOCKED; break; case ACCEPT_NO: - gToolDragAndDrop->mCursor = UI_CURSOR_NO; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_NO; break; case ACCEPT_YES_COPY_MULTI: - if (gToolDragAndDrop->mCargoIDs.size() > 1) + if (LLToolDragAndDrop::getInstance()->mCargoIDs.size() > 1) { - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPYMULTI; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPYMULTI; } else { - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPY; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPY; } break; case ACCEPT_YES_COPY_SINGLE: - gToolDragAndDrop->mCursor = UI_CURSOR_ARROWCOPY; + LLToolDragAndDrop::getInstance()->mCursor = UI_CURSOR_ARROWCOPY; break; case ACCEPT_POSTPONED: break; @@ -1178,10 +1142,10 @@ void LLToolDragAndDrop::pickCallback(S32 x, S32 y, MASK mask) llassert( FALSE ); } - gToolDragAndDrop->mLastHitPos = gLastHitPosGlobal + gLastHitObjectOffset; - gToolDragAndDrop->mLastCameraPos = gAgent.getCameraPositionGlobal(); + LLToolDragAndDrop::getInstance()->mLastHitPos = gLastHitPosGlobal + gLastHitObjectOffset; + LLToolDragAndDrop::getInstance()->mLastCameraPos = gAgent.getCameraPositionGlobal(); - gViewerWindow->getWindow()->setCursor( gToolDragAndDrop->mCursor ); + gViewerWindow->getWindow()->setCursor( LLToolDragAndDrop::getInstance()->mCursor ); } // static @@ -1294,7 +1258,7 @@ void LLToolDragAndDrop::dropTextureAllFaces(LLViewerObject* hit_obj, return; } LLViewerImage* image = gImageList.getImage(asset_id); - gViewerStats->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); S32 num_faces = hit_obj->getNumTEs(); for( S32 face = 0; face < num_faces; face++ ) { @@ -1337,7 +1301,7 @@ void LLToolDragAndDrop::dropTextureOneFace(LLViewerObject* hit_obj, } // update viewer side image in anticipation of update from simulator LLViewerImage* image = gImageList.getImage(asset_id); - gViewerStats->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT ); hit_obj->setTEImage(hit_face, image); dialog_refresh_all(); @@ -1354,8 +1318,8 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, { // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. - if((SOURCE_WORLD == gToolDragAndDrop->mSource) - || (SOURCE_NOTECARD == gToolDragAndDrop->mSource)) + if((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) + || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) { llwarns << "Call to LLToolDragAndDrop::dropScript() from world" << " or notecard." << llendl; @@ -1394,7 +1358,7 @@ void LLToolDragAndDrop::dropScript(LLViewerObject* hit_obj, gFloaterTools->dirty(); // VEFFECT: SetScript - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(hit_obj); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -1407,7 +1371,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, BOOL from_task_inventory, BOOL remove_from_inventory) { - LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mLastHitPos); + LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mLastHitPos); if (!regionp) { llwarns << "Couldn't find region to rez object" << llendl; @@ -1463,7 +1427,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, LLUUID source_id = from_task_inventory ? mSourceID : LLUUID::null; // Select the object only if we're editing. - BOOL rez_selected = gToolMgr->inEdit(); + BOOL rez_selected = LLToolMgr::getInstance()->inEdit(); LLVector3 ray_start = regionp->getPosRegionFromGlobal(mLastCameraPos); @@ -1542,7 +1506,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, // selected object. if (rez_selected) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); gViewerWindow->getWindow()->incBusyCount(); } @@ -1556,13 +1520,13 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, } // VEFFECT: DropObject - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setPositionGlobal(mLastHitPos); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gViewerStats->incStat(LLViewerStats::ST_REZ_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_REZ_COUNT); } void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, @@ -1572,8 +1536,8 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, { // *HACK: In order to resolve SL-22177, we need to block drags // from notecards and objects onto other objects. - if((SOURCE_WORLD == gToolDragAndDrop->mSource) - || (SOURCE_NOTECARD == gToolDragAndDrop->mSource)) + if((SOURCE_WORLD == LLToolDragAndDrop::getInstance()->mSource) + || (SOURCE_NOTECARD == LLToolDragAndDrop::getInstance()->mSource)) { llwarns << "Call to LLToolDragAndDrop::dropInventory() from world" << " or notecard." << llendl; @@ -1619,7 +1583,7 @@ void LLToolDragAndDrop::dropInventory(LLViewerObject* hit_obj, } // VEFFECT: AddToInventory - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(hit_obj); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -1723,7 +1687,7 @@ void LLToolDragAndDrop::commitGiveInventoryItem(const LLUUID& to_agent, gAgent.sendReliableMessage(); // VEFFECT: giveInventory - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(gObjectList.findObject(to_agent)); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -1925,7 +1889,7 @@ void LLToolDragAndDrop::commitGiveInventoryCategory(const LLUUID& to_agent, delete[] bucket; // VEFFECT: giveInventoryCategory - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(gObjectList.findObject(to_agent)); effectp->setDuration(LL_HUD_DUR_SHORT); @@ -2378,7 +2342,7 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject( } // VEFFECT: SetTexture - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject(gAgent.getAvatarObject()); effectp->setTargetObject(obj); effectp->setDuration(LL_HUD_DUR_SHORT); diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index 5da4e6300a..b5517c29c1 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -46,7 +46,7 @@ class LLToolDragAndDrop; class LLViewerRegion; class LLVOAvatar; -class LLToolDragAndDrop : public LLTool +class LLToolDragAndDrop : public LLTool, public LLSingleton<LLToolDragAndDrop> { public: LLToolDragAndDrop(); @@ -253,9 +253,6 @@ public: LLInventoryCategory* item); }; -// Singleton -extern LLToolDragAndDrop *gToolDragAndDrop; - // utility functions void pack_permissions_slam(LLMessageSystem* msg, U32 flags, const LLPermissions& perms); diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index 195998229d..0783cd14b7 100644 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -47,9 +47,6 @@ #include "llviewerwindow.h" #include "llfloatertools.h" -// Globals -LLToolFace *gToolFace = NULL; - // // Member functions // @@ -65,7 +62,7 @@ LLToolFace::~LLToolFace() BOOL LLToolFace::handleDoubleClick(S32 x, S32 y, MASK mask) { - if (!gSelectMgr->getSelection()->isEmpty()) + if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { // You should already have an object selected from the mousedown. // If so, show its properties @@ -111,17 +108,17 @@ void LLToolFace::pickCallback(S32 x, S32 y, MASK mask) if ( !hit_obj->isSelected() ) { // object wasn't selected so add the object and face - gSelectMgr->selectObjectOnly(hit_obj, hit_face); + LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face); } - else if (!gSelectMgr->getSelection()->contains(hit_obj, hit_face) ) + else if (!LLSelectMgr::getInstance()->getSelection()->contains(hit_obj, hit_face) ) { // object is selected, but not this face, so add it. - gSelectMgr->addAsIndividual(hit_obj, hit_face); + LLSelectMgr::getInstance()->addAsIndividual(hit_obj, hit_face); } else { // object is selected, as is this face, so remove the face. - gSelectMgr->remove(hit_obj, hit_face); + LLSelectMgr::getInstance()->remove(hit_obj, hit_face); // BUG: If you remove the last face, the simulator won't know about it. } @@ -130,15 +127,15 @@ void LLToolFace::pickCallback(S32 x, S32 y, MASK mask) { // clicked without modifiers, select only // this face - gSelectMgr->deselectAll(); - gSelectMgr->selectObjectOnly(hit_obj, hit_face); + LLSelectMgr::getInstance()->deselectAll(); + LLSelectMgr::getInstance()->selectObjectOnly(hit_obj, hit_face); } } else { if (!(mask == MASK_SHIFT)) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } } } @@ -147,14 +144,14 @@ void LLToolFace::pickCallback(S32 x, S32 y, MASK mask) void LLToolFace::handleSelect() { // From now on, draw faces - gSelectMgr->setTEMode(TRUE); + LLSelectMgr::getInstance()->setTEMode(TRUE); } void LLToolFace::handleDeselect() { // Stop drawing faces - gSelectMgr->setTEMode(FALSE); + LLSelectMgr::getInstance()->setTEMode(FALSE); } diff --git a/indra/newview/lltoolface.h b/indra/newview/lltoolface.h index c752498125..f573bfa9c5 100644 --- a/indra/newview/lltoolface.h +++ b/indra/newview/lltoolface.h @@ -37,7 +37,7 @@ class LLViewerObject; class LLToolFace -: public LLTool +: public LLTool, public LLSingleton<LLToolFace> { public: LLToolFace(); @@ -52,6 +52,4 @@ public: static void pickCallback(S32 x, S32 y, MASK mask); }; -extern LLToolFace *gToolFace; - #endif diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp index 6d33a9c2bc..e2985a0141 100644 --- a/indra/newview/lltoolfocus.cpp +++ b/indra/newview/lltoolfocus.cpp @@ -50,7 +50,6 @@ #include "llselectmgr.h" #include "llstatusbar.h" #include "lltoolmgr.h" -#include "lltoolselect.h" #include "llviewercamera.h" #include "llviewerobject.h" #include "llviewerwindow.h" @@ -58,9 +57,9 @@ #include "llmorphview.h" // Globals -LLToolCamera *gToolCamera = NULL; BOOL gCameraBtnOrbit = FALSE; BOOL gCameraBtnPan = FALSE; + const S32 SLOP_RANGE = 4; const F32 FOCUS_OFFSET_FACTOR = 1.f; @@ -133,13 +132,13 @@ BOOL LLToolCamera::handleMouseDown(S32 x, S32 y, MASK mask) void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask) { - if (!gToolCamera->hasMouseCapture()) + if (!LLToolCamera::getInstance()->hasMouseCapture()) { return; } - gToolCamera->mMouseDownX = x; - gToolCamera->mMouseDownY = y; + LLToolCamera::getInstance()->mMouseDownX = x; + LLToolCamera::getInstance()->mMouseDownY = y; gViewerWindow->moveCursorToCenter(); @@ -149,17 +148,17 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask) // Check for hit the sky, or some other invalid point if (!hit_obj && gLastHitPosGlobal.isExactlyZero()) { - gToolCamera->mValidClickPoint = FALSE; + LLToolCamera::getInstance()->mValidClickPoint = FALSE; return; } // check for hud attachments if (hit_obj && hit_obj->isHUDAttachment()) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (!selection->getObjectCount() || selection->getSelectType() != SELECT_TYPE_HUD) { - gToolCamera->mValidClickPoint = FALSE; + LLToolCamera::getInstance()->mValidClickPoint = FALSE; return; } } @@ -185,7 +184,7 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask) if( !good_customize_avatar_hit ) { - gToolCamera->mValidClickPoint = FALSE; + LLToolCamera::getInstance()->mValidClickPoint = FALSE; return; } @@ -196,7 +195,7 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask) } //RN: check to see if this is mouse-driving as opposed to ALT-zoom or Focus tool else if (mask & MASK_ALT || - (gToolMgr->getCurrentTool()->getName() == "Camera")) + (LLToolMgr::getInstance()->getCurrentTool()->getName() == "Camera")) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); if (hit_obj) @@ -224,19 +223,19 @@ void LLToolCamera::pickCallback(S32 x, S32 y, MASK mask) (hit_obj == gAgent.getAvatarObject() || (hit_obj && hit_obj->isAttachment() && LLVOAvatar::findAvatarFromAttachment(hit_obj)->mIsSelf))) { - gToolCamera->mMouseSteering = TRUE; + LLToolCamera::getInstance()->mMouseSteering = TRUE; } } - gToolCamera->mValidClickPoint = TRUE; + LLToolCamera::getInstance()->mValidClickPoint = TRUE; if( CAMERA_MODE_CUSTOMIZE_AVATAR == gAgent.getCameraMode() ) { gAgent.setFocusOnAvatar(FALSE, FALSE); LLVector3d cam_pos = gAgent.getCameraPositionGlobal(); - cam_pos -= LLVector3d(gCamera->getLeftAxis() * gAgent.calcCustomizeAvatarUIOffset( cam_pos )); + cam_pos -= LLVector3d(LLViewerCamera::getInstance()->getLeftAxis() * gAgent.calcCustomizeAvatarUIOffset( cam_pos )); gAgent.setCameraPosAndFocusGlobal( cam_pos, gLastHitObjectOffset + gLastHitPosGlobal, gLastHitObjectID); } @@ -255,7 +254,7 @@ void LLToolCamera::releaseMouse() gViewerWindow->showCursor(); - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); mMouseSteering = FALSE; mValidClickPoint = FALSE; @@ -279,7 +278,7 @@ BOOL LLToolCamera::handleMouseUp(S32 x, S32 y, MASK mask) { LLCoordGL mouse_pos; LLVector3 focus_pos = gAgent.getPosAgentFromGlobal(gAgent.getFocusGlobal()); - BOOL success = gCamera->projectPosAgentToScreen(focus_pos, mouse_pos); + BOOL success = LLViewerCamera::getInstance()->projectPosAgentToScreen(focus_pos, mouse_pos); if (success) { LLUI::setCursorPositionScreen(mouse_pos.mX, mouse_pos.mY); diff --git a/indra/newview/lltoolfocus.h b/indra/newview/lltoolfocus.h index ff2e6905f2..71df8078e6 100644 --- a/indra/newview/lltoolfocus.h +++ b/indra/newview/lltoolfocus.h @@ -35,7 +35,7 @@ #include "lltool.h" class LLToolCamera -: public LLTool +: public LLTool, public LLSingleton<LLToolCamera> { public: LLToolCamera(); @@ -75,8 +75,6 @@ protected: }; -extern LLToolCamera *gToolCamera; - extern BOOL gCameraBtnOrbit; extern BOOL gCameraBtnPan; diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 3f19ed4330..94501507ab 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -69,7 +69,6 @@ const S32 SLOP_DIST_SQ = 4; BOOL gGrabBtnVertical = FALSE; BOOL gGrabBtnSpin = FALSE; LLTool* gGrabTransientTool = NULL; -LLToolGrab *gToolGrab = NULL; extern BOOL gDebugClicks; // @@ -151,26 +150,26 @@ void LLToolGrab::pickCallback(S32 x, S32 y, MASK mask) BOOL extend_select = (mask & MASK_SHIFT); - if (!extend_select && !gSelectMgr->getSelection()->isEmpty()) + if (!extend_select && !LLSelectMgr::getInstance()->getSelection()->isEmpty()) { - gSelectMgr->deselectAll(); - gToolGrab->mDeselectedThisClick = TRUE; + LLSelectMgr::getInstance()->deselectAll(); + LLToolGrab::getInstance()->mDeselectedThisClick = TRUE; } else { - gToolGrab->mDeselectedThisClick = FALSE; + LLToolGrab::getInstance()->mDeselectedThisClick = FALSE; } // if not over object, do nothing if (!objectp) { - gToolGrab->setMouseCapture(TRUE); - gToolGrab->mMode = GRAB_NOOBJECT; - gToolGrab->mHitObjectID.setNull(); + LLToolGrab::getInstance()->setMouseCapture(TRUE); + LLToolGrab::getInstance()->mMode = GRAB_NOOBJECT; + LLToolGrab::getInstance()->mHitObjectID.setNull(); } else { - gToolGrab->handleObjectHit(objectp, x, y, mask); + LLToolGrab::getInstance()->handleObjectHit(objectp, x, y, mask); } } @@ -273,7 +272,7 @@ BOOL LLToolGrab::handleObjectHit(LLViewerObject *objectp, S32 x, S32 y, MASK mas startSpin(); } - gSelectMgr->updateSelectionCenter(); // update selection beam + LLSelectMgr::getInstance()->updateSelectionCenter(); // update selection beam // update point at LLViewerObject *edit_object = gObjectList.findObject(mHitObjectID); @@ -505,7 +504,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) LLQuaternion rotation_around_vertical( dx*RADIANS_PER_PIXEL_X, up ); // y motion maps to rotation around left axis - const LLVector3 &agent_left = gCamera->getLeftAxis(); + const LLVector3 &agent_left = LLViewerCamera::getInstance()->getLeftAxis(); LLQuaternion rotation_around_left( dy*RADIANS_PER_PIXEL_Y, agent_left ); // compose with current rotation @@ -530,14 +529,14 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) //------------------------------------------------------ LLVector3d x_part; - x_part.setVec(gCamera->getLeftAxis()); + x_part.setVec(LLViewerCamera::getInstance()->getLeftAxis()); x_part.mdV[VZ] = 0.0; x_part.normVec(); LLVector3d y_part; if( mVerticalDragging ) { - y_part.setVec(gCamera->getUpAxis()); + y_part.setVec(LLViewerCamera::getInstance()->getUpAxis()); // y_part.setVec(0.f, 0.f, 1.f); } else @@ -579,7 +578,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) */ // Don't let object centers go underground. - F32 land_height = gWorldPointer->resolveLandHeightGlobal(grab_point_global); + F32 land_height = LLWorld::getInstance()->resolveLandHeightGlobal(grab_point_global); if (grab_point_global.mdV[VZ] < land_height) { @@ -592,7 +591,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) grab_point_global.mdV[VZ] = MAX_OBJECT_Z; } - grab_point_global = gWorldp->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global); + grab_point_global = LLWorld::getInstance()->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global); // propagate constrained grab point back to grab offset mGrabHiddenOffsetFromCamera = grab_point_global - gAgent.getCameraPositionGlobal(); @@ -600,7 +599,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) LLVector3 grab_pos_agent = gAgent.getPosAgentFromGlobal( grab_point_global ); LLCoordGL grab_center_gl( gViewerWindow->getWindowWidth() / 2, gViewerWindow->getWindowHeight() / 2); - gCamera->projectPosAgentToScreen(grab_pos_agent, grab_center_gl); + LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_pos_agent, grab_center_gl); const S32 ROTATE_H_MARGIN = gViewerWindow->getWindowWidth() / 20; const F32 ROTATE_ANGLE_PER_SECOND = 30.f * DEG_TO_RAD; @@ -652,7 +651,7 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) gViewerWindow->moveCursorToCenter(); - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); } @@ -804,7 +803,7 @@ void LLToolGrab::onMouseCaptureLost() LLVector3 grab_point_agent = mGrabObject->getRenderPosition(); LLCoordGL gl_point; - if (gCamera->projectPosAgentToScreen(grab_point_agent, gl_point)) + if (LLViewerCamera::getInstance()->projectPosAgentToScreen(grab_point_agent, gl_point)) { LLUI::setCursorPositionScreen(gl_point.mX, gl_point.mY); } @@ -826,7 +825,7 @@ void LLToolGrab::onMouseCaptureLost() mGrabObject = NULL; - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); gAgent.setPointAt(POINTAT_TARGET_CLEAR); gAgent.setLookAt(LOOKAT_TARGET_CLEAR); diff --git a/indra/newview/lltoolgrab.h b/indra/newview/lltoolgrab.h index af0c7ded64..d744c495a5 100644 --- a/indra/newview/lltoolgrab.h +++ b/indra/newview/lltoolgrab.h @@ -42,7 +42,7 @@ class LLView; class LLTextBox; class LLViewerObject; -class LLToolGrab : public LLTool +class LLToolGrab : public LLTool, public LLSingleton<LLToolGrab> { public: LLToolGrab( LLToolComposite* composite = NULL ); @@ -125,8 +125,6 @@ private: BOOL mHideBuildHighlight; }; -extern LLToolGrab *gToolGrab; - extern BOOL gGrabBtnVertical; extern BOOL gGrabBtnSpin; extern LLTool* gGrabTransientTool; diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 9c8bb97343..134188e2f6 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -51,7 +51,6 @@ LLToolGun::LLToolGun( LLToolComposite* composite ) : LLTool( "gun", composite ) { - mCrosshairImg = gImageList.getImage( LLUUID( gSavedSettings.getString("UIImgCrosshairsUUID") ), MIPMAP_FALSE, TRUE ); } void LLToolGun::handleSelect() @@ -71,9 +70,9 @@ void LLToolGun::handleDeselect() BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask) { gGrabTransientTool = this; - gToolMgr->getCurrentToolset()->selectTool( gToolGrab ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); - return gToolGrab->handleMouseDown(x, y, mask); + return LLToolGrab::getInstance()->handleMouseDown(x, y, mask); } BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) @@ -107,9 +106,9 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) if (gSavedSettings.getBOOL("MouseSun")) { - gSky.setSunDirection(gCamera->getAtAxis(), LLVector3(0.f, 0.f, 0.f)); + gSky.setSunDirection(LLViewerCamera::getInstance()->getAtAxis(), LLVector3(0.f, 0.f, 0.f)); gSky.setOverrideSun(TRUE); - gSavedSettings.setVector3("SkySunDefaultPosition", gCamera->getAtAxis()); + gSavedSettings.setVector3("SkySunDefaultPosition", LLViewerCamera::getInstance()->getAtAxis()); } gViewerWindow->moveCursorToCenter(); @@ -133,9 +132,9 @@ void LLToolGun::draw() { if( gSavedSettings.getBOOL("ShowCrosshairs") ) { - gl_draw_image( - ( gViewerWindow->getWindowWidth() - mCrosshairImg->getWidth() ) / 2, - ( gViewerWindow->getWindowHeight() - mCrosshairImg->getHeight() ) / 2, - mCrosshairImg ); + LLUIImagePtr crosshair = LLUI::getUIImage("UIImgCrosshairsUUID"); + crosshair->draw( + ( gViewerWindow->getWindowWidth() - crosshair->getWidth() ) / 2, + ( gViewerWindow->getWindowHeight() - crosshair->getHeight() ) / 2); } } diff --git a/indra/newview/lltoolgun.h b/indra/newview/lltoolgun.h index 14cc502441..19b02a1214 100644 --- a/indra/newview/lltoolgun.h +++ b/indra/newview/lltoolgun.h @@ -33,7 +33,7 @@ #define LL_TOOLGUN_H #include "lltool.h" -#include "llviewerimage.h" +#include "llui.h" class LLToolGun : public LLTool @@ -51,9 +51,6 @@ public: virtual LLTool* getOverrideTool(MASK mask) { return NULL; } virtual BOOL clipMouseWhenDown() { return FALSE; } - -private: - LLPointer<LLViewerImage> mCrosshairImg; }; #endif diff --git a/indra/newview/lltoolindividual.cpp b/indra/newview/lltoolindividual.cpp index 3ec6b7d4d3..0236a5027a 100644 --- a/indra/newview/lltoolindividual.cpp +++ b/indra/newview/lltoolindividual.cpp @@ -49,7 +49,6 @@ /// Globals ///---------------------------------------------------------------------------- -LLToolIndividual* gToolIndividual = NULL; ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -80,16 +79,16 @@ BOOL LLToolIndividual::handleMouseDown(S32 x, S32 y, MASK mask) void LLToolIndividual::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* obj = gViewerWindow->lastObjectHit(); - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); if(obj) { - gSelectMgr->selectObjectOnly(obj); + LLSelectMgr::getInstance()->selectObjectOnly(obj); } } BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask) { - if(!gSelectMgr->getSelection()->isEmpty()) + if(!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { // You should already have an object selected from the mousedown. // If so, show its inventory. @@ -109,11 +108,11 @@ BOOL LLToolIndividual::handleDoubleClick(S32 x, S32 y, MASK mask) void LLToolIndividual::handleSelect() { const BOOL children_ok = TRUE; - LLViewerObject* obj = gSelectMgr->getSelection()->getFirstRootObject(children_ok); - gSelectMgr->deselectAll(); + LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(children_ok); + LLSelectMgr::getInstance()->deselectAll(); if(obj) { - gSelectMgr->selectObjectOnly(obj); + LLSelectMgr::getInstance()->selectObjectOnly(obj); } } diff --git a/indra/newview/lltoolindividual.h b/indra/newview/lltoolindividual.h index e5636dd031..48a2365363 100644 --- a/indra/newview/lltoolindividual.h +++ b/indra/newview/lltoolindividual.h @@ -40,7 +40,7 @@ // A tool to select individual objects rather than linked sets. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLToolIndividual : public LLTool +class LLToolIndividual : public LLTool, public LLSingleton<LLToolIndividual> { public: LLToolIndividual(); @@ -58,7 +58,5 @@ protected: }; -extern LLToolIndividual* gToolIndividual; - #endif // LL_LLTOOLINDIVIDUAL_H diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index c365f14674..b20d4f9d28 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -46,13 +46,10 @@ #include "lltoolmorph.h" #include "lltoolpie.h" #include "lltoolplacer.h" -#include "lltoolselect.h" #include "lltoolselectland.h" #include "lltoolobjpicker.h" #include "lltoolpipette.h" -// Globals (created and destroyed by LLAgent) -LLToolMgr* gToolMgr = NULL; // Used when app not active to avoid processing hover. LLTool* gToolNull = NULL; @@ -87,179 +84,34 @@ LLToolMgr::LLToolMgr() void LLToolMgr::initTools() { - // Initialize all the tools - // Variables that are reused for each tool - LLTool* tool = NULL; - - // - // Pie tool (not visible in UI, implicit) - // - gToolPie = new LLToolPie(); - - gBasicToolset->addTool( gToolPie ); -// gCameraToolset->addTool( gToolPie ); -// gLandToolset->addTool( gToolPie ); - - // Camera tool - gToolCamera = new LLToolCamera(); - gBasicToolset ->addTool( gToolCamera ); - gCameraToolset->addTool( gToolCamera ); - - // - // Grab tool - // - gToolGrab = new LLToolGrab(); - tool = gToolGrab; - - gBasicToolset->addTool( tool ); - - // - // Translation tool - // - gToolTranslate = new LLToolCompTranslate(); - tool = gToolTranslate; - - gBasicToolset->addTool( tool ); - - // - // Scale ("Stretch") tool - // - gToolStretch = new LLToolCompScale(); - tool = gToolStretch; - - - // - // Rotation tool - // - gToolRotate = new LLToolCompRotate(); - tool = gToolRotate; - - - // - // Face tool - // - gToolFace = new LLToolFace(); - tool = gToolFace; - - // - // Pipette tool - // - gToolPipette = new LLToolPipette(); - - // - // Individual object selector - // - gToolIndividual = new LLToolIndividual(); - - - // - // Create object tool - // - gToolCreate = new LLToolCompCreate(); - tool = gToolCreate; - - gBasicToolset->addTool( tool ); - - // - // Land brush tool - // - gToolLand = new LLToolBrushLand(); - tool = gToolLand; - - gBasicToolset->addTool( tool ); - - - // - // Land select tool - // - gToolParcel = new LLToolSelectLand(); - tool = gToolParcel; - - // - // Gun tool - // - gToolGun = new LLToolCompGun(); - gMouselookToolset->addTool( gToolGun ); - - // - // Inspect tool - // - gToolInspect = new LLToolCompInspect(); - gBasicToolset->addTool( gToolInspect ); - - // - // Face edit tool - // -// gToolMorph = new LLToolMorph(); -// gFaceEditToolset->addTool( gToolMorph ); - gFaceEditToolset->addTool( gToolCamera ); - - // Drag and drop tool - gToolDragAndDrop = new LLToolDragAndDrop(); - - gToolObjPicker = new LLToolObjPicker(); + static BOOL initialized = FALSE; + if(initialized) + { + return; + } + initialized = TRUE; + gBasicToolset->addTool( LLToolPie::getInstance() ); + gBasicToolset->addTool( LLToolCamera::getInstance() ); + gCameraToolset->addTool( LLToolCamera::getInstance() ); + gBasicToolset->addTool( LLToolGrab::getInstance() ); + gBasicToolset->addTool( LLToolCompTranslate::getInstance() ); + gBasicToolset->addTool( LLToolCompCreate::getInstance() ); + gBasicToolset->addTool( LLToolBrushLand::getInstance() ); + gMouselookToolset->addTool( LLToolCompGun::getInstance() ); + gBasicToolset->addTool( LLToolCompInspect::getInstance() ); + gFaceEditToolset->addTool( LLToolCamera::getInstance() ); // On startup, use "select" tool setCurrentToolset(gBasicToolset); - gBasicToolset->selectTool( gToolPie ); + + gBasicToolset->selectTool( LLToolPie::getInstance() ); } LLToolMgr::~LLToolMgr() { - delete gToolPie; - gToolPie = NULL; - - delete gToolInspect; - gToolInspect = NULL; - - delete gToolGun; - gToolGun = NULL; - - delete gToolCamera; - gToolCamera = NULL; - -// delete gToolMorph; -// gToolMorph = NULL; - - delete gToolDragAndDrop; - gToolDragAndDrop = NULL; - delete gBasicToolset; gBasicToolset = NULL; - delete gToolGrab; - gToolGrab = NULL; - - delete gToolRotate; - gToolRotate = NULL; - - delete gToolTranslate; - gToolTranslate = NULL; - - delete gToolStretch; - gToolStretch = NULL; - - delete gToolIndividual; - gToolIndividual = NULL; - - delete gToolPipette; - gToolPipette = NULL; - - delete gToolCreate; - gToolCreate = NULL; - - delete gToolFace; - gToolFace = NULL; - - delete gToolLand; - gToolLand = NULL; - - delete gToolParcel; - gToolParcel = NULL; - - delete gToolObjPicker; - gToolObjPicker = NULL; - delete gMouselookToolset; gMouselookToolset = NULL; @@ -372,7 +224,7 @@ void LLToolMgr::updateToolStatus() BOOL LLToolMgr::inEdit() { - return mBaseTool != gToolPie && mBaseTool != gToolNull; + return mBaseTool != LLToolPie::getInstance() && mBaseTool != gToolNull; } void LLToolMgr::setTransientTool(LLTool* tool) @@ -449,7 +301,7 @@ void LLToolset::addTool(LLTool* tool) void LLToolset::selectTool(LLTool* tool) { mSelectedTool = tool; - gToolMgr->setCurrentTool( mSelectedTool ); + LLToolMgr::getInstance()->setCurrentTool( mSelectedTool ); } @@ -459,7 +311,7 @@ void LLToolset::selectToolByIndex( S32 index ) if (tool) { mSelectedTool = tool; - gToolMgr->setCurrentTool( tool ); + LLToolMgr::getInstance()->setCurrentTool( tool ); } } @@ -473,10 +325,7 @@ BOOL LLToolset::isToolSelected( S32 index ) void LLToolset::selectFirstTool() { mSelectedTool = (0 < mToolList.size()) ? mToolList[0] : NULL; - if (gToolMgr) - { - gToolMgr->setCurrentTool( mSelectedTool ); - } + LLToolMgr::getInstance()->setCurrentTool( mSelectedTool ); } @@ -497,7 +346,7 @@ void LLToolset::selectNextTool() if( next ) { mSelectedTool = next; - gToolMgr->setCurrentTool( mSelectedTool ); + LLToolMgr::getInstance()->setCurrentTool( mSelectedTool ); } else { @@ -522,17 +371,16 @@ void LLToolset::selectPrevTool() if( prev ) { mSelectedTool = prev; - gToolMgr->setCurrentTool( mSelectedTool ); + LLToolMgr::getInstance()->setCurrentTool( mSelectedTool ); } else if (mToolList.size() > 0) { selectToolByIndex((S32)mToolList.size()-1); } - } void select_tool( void *tool_pointer ) { LLTool *tool = (LLTool *)tool_pointer; - gToolMgr->getCurrentToolset()->selectTool( tool ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( tool ); } diff --git a/indra/newview/lltoolmgr.h b/indra/newview/lltoolmgr.h index c1e144b252..73b8a38c57 100644 --- a/indra/newview/lltoolmgr.h +++ b/indra/newview/lltoolmgr.h @@ -45,7 +45,7 @@ const MASK MASK_ORBIT = MASK_CONTROL; const MASK MASK_PAN = MASK_CONTROL | MASK_SHIFT; const MASK MASK_COPY = MASK_SHIFT; -class LLToolMgr +class LLToolMgr : public LLSingleton<LLToolMgr> { public: LLToolMgr(); @@ -115,8 +115,7 @@ protected: void select_tool(void *tool); -// Globals (created and destroyed by LLViewerWindow) -extern LLToolMgr* gToolMgr; +// Globals extern LLToolset* gBasicToolset; extern LLToolset *gCameraToolset; diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index 25d20f96aa..265d1082d1 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -64,7 +64,6 @@ #include "llvoavatar.h" #include "pipeline.h" -//LLToolMorph *gToolMorph = NULL; //static LLVisualParamHint::instance_list_t LLVisualParamHint::sInstances; @@ -94,9 +93,7 @@ LLVisualParamHint::LLVisualParamHint( mLastParamWeight(0.f) { LLVisualParamHint::sInstances.insert( this ); - LLUUID id; - id.set( gViewerArt.getString("avatar_thumb_bkgrnd.tga") ); - mBackgroundp = gImageList.getImage(id, FALSE, TRUE); + mBackgroundp = LLUI::getUIImage("avatar_thumb_bkgrnd.j2c"); llassert(width != 0); @@ -180,10 +177,7 @@ BOOL LLVisualParamHint::render() LLGLSUIDefault gls_ui; //LLGLState::verify(TRUE); - LLViewerImage::bindTexture(mBackgroundp); - gGL.color4f(1.f, 1.f, 1.f, 1.f); - gl_rect_2d_simple_tex( mWidth, mHeight ); - mBackgroundp->unbindTexture(0, GL_TEXTURE_2D); + mBackgroundp->draw(0, 0, mWidth, mHeight); glMatrixMode(GL_PROJECTION); glPopMatrix(); @@ -229,13 +223,13 @@ BOOL LLVisualParamHint::render() LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation); gGL.stop(); - gCamera->setAspect((F32)mWidth / (F32)mHeight); - gCamera->setOriginAndLookAt( + LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight); + LLViewerCamera::getInstance()->setOriginAndLookAt( camera_pos, // camera LLVector3(0.f, 0.f, 1.f), // up target_pos ); // point of interest - gCamera->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); + LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); if (avatarp->mDrawable.notNull()) { diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index 4c3489b35f..847518f3c6 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -91,7 +91,7 @@ protected: LLRect mRect; F32 mLastParamWeight; - LLPointer<LLViewerImage> mBackgroundp; + LLUIImagePtr mBackgroundp; typedef std::set<LLVisualParamHint*> instance_list_t; static instance_list_t sInstances; diff --git a/indra/newview/lltoolobjpicker.cpp b/indra/newview/lltoolobjpicker.cpp index a8876da131..8354792e31 100644 --- a/indra/newview/lltoolobjpicker.cpp +++ b/indra/newview/lltoolobjpicker.cpp @@ -48,7 +48,6 @@ #include "llviewerwindow.h" #include "lldrawable.h" -LLToolObjPicker* gToolObjPicker = NULL; LLToolObjPicker::LLToolObjPicker() : LLTool( "ObjPicker", NULL ), @@ -98,8 +97,8 @@ void LLToolObjPicker::pickCallback(S32 x, S32 y, MASK mask) objectp = gObjectList.findObject( gLastHitObjectID ); if (objectp) { - gToolObjPicker->mHitObjectID = objectp->mID; - gToolObjPicker->mPicked = TRUE; + LLToolObjPicker::getInstance()->mHitObjectID = objectp->mID; + LLToolObjPicker::getInstance()->mPicked = TRUE; } } diff --git a/indra/newview/lltoolobjpicker.h b/indra/newview/lltoolobjpicker.h index 985ce14e38..794d035a83 100644 --- a/indra/newview/lltoolobjpicker.h +++ b/indra/newview/lltoolobjpicker.h @@ -36,7 +36,7 @@ #include "v3math.h" #include "lluuid.h" -class LLToolObjPicker : public LLTool +class LLToolObjPicker : public LLTool, public LLSingleton<LLToolObjPicker> { public: LLToolObjPicker(); @@ -63,6 +63,5 @@ protected: void *mExitCallbackData; }; -extern LLToolObjPicker* gToolObjPicker; #endif diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 1bf08d9e22..16ab3c0944 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -67,8 +67,6 @@ #include "llui.h" #include "llweb.h" -LLToolPie *gToolPie = NULL; - LLPointer<LLViewerObject> LLToolPie::sClickActionObject; LLSafeHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL; U8 LLToolPie::sClickAction = 0; @@ -94,8 +92,6 @@ LLToolPie::LLToolPie() BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) { - if (!gCamera) return FALSE; - gPickFaces = TRUE; //left mouse down always picks transparent gViewerWindow->hitObjectOrLandGlobalAsync(x, y, mask, leftMouseCallback, @@ -107,7 +103,7 @@ BOOL LLToolPie::handleMouseDown(S32 x, S32 y, MASK mask) // static void LLToolPie::leftMouseCallback(S32 x, S32 y, MASK mask) { - gToolPie->pickAndShowMenu(x, y, mask, FALSE); + LLToolPie::getInstance()->pickAndShowMenu(x, y, mask, FALSE); } BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -125,7 +121,7 @@ BOOL LLToolPie::handleRightMouseDown(S32 x, S32 y, MASK mask) // static void LLToolPie::rightMouseCallback(S32 x, S32 y, MASK mask) { - gToolPie->pickAndShowMenu(x, y, mask, TRUE); + LLToolPie::getInstance()->pickAndShowMenu(x, y, mask, TRUE); } // True if you selected an object. @@ -133,12 +129,12 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) { if (!always_show && gLastHitParcelWall) { - LLParcel* parcel = gParcelMgr->getCollisionParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getCollisionParcel(); if (parcel) { - gParcelMgr->selectCollisionParcel(); + LLViewerParcelMgr::getInstance()->selectCollisionParcel(); if (parcel->getParcelFlag(PF_USE_PASS_LIST) - && !gParcelMgr->isCollisionBanned()) + && !LLViewerParcelMgr::getInstance()->isCollisionBanned()) { // if selling passes, just buy one void* deselect_when_done = (void*)TRUE; @@ -161,7 +157,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) mHitLand = !object && !gLastHitPosGlobal.isExactlyZero(); if (!mHitLand) { - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); } if (object) @@ -238,8 +234,8 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) !always_show) { gGrabTransientTool = this; - gToolMgr->getCurrentToolset()->selectTool( gToolGrab ); - return gToolGrab->handleObjectHit( object, x, y, mask); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); + return LLToolGrab::getInstance()->handleObjectHit( object, x, y, mask); } if (!object && gLastHitHUDIcon && gLastHitHUDIcon->getSourceObject()) @@ -270,10 +266,10 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) if (object && object == gAgent.getAvatarObject()) { // we left clicked on avatar, switch to focus mode - gToolMgr->setTransientTool(gToolCamera); + LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance()); gViewerWindow->hideCursor(); - gToolCamera->setMouseCapture(TRUE); - gToolCamera->pickCallback(gViewerWindow->getCurrentMouseX(), gViewerWindow->getCurrentMouseY(), mask); + LLToolCamera::getInstance()->setMouseCapture(TRUE); + LLToolCamera::getInstance()->pickCallback(gViewerWindow->getCurrentMouseX(), gViewerWindow->getCurrentMouseY(), mask); gAgent.setFocusOnAvatar(TRUE, TRUE); return TRUE; @@ -297,12 +293,12 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) // Spawn pie menu if (mHitLand) { - LLParcelSelectionHandle selection = gParcelMgr->selectParcelAt( gLastHitPosGlobal ); + LLParcelSelectionHandle selection = LLViewerParcelMgr::getInstance()->selectParcelAt( gLastHitPosGlobal ); gMenuHolder->setParcelSelection(selection); gPieLand->show(x, y, mPieMouseButtonDown); // VEFFECT: ShowPie - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); effectp->setPositionGlobal(gLastHitPosGlobal); effectp->setColor(LLColor4U(gAgent.getEffectColor())); effectp->setDuration(0.25f); @@ -313,7 +309,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) } else if (object) { - gMenuHolder->setObjectSelection(gSelectMgr->getSelection()); + gMenuHolder->setObjectSelection(LLSelectMgr::getInstance()->getSelection()); if (object->isAvatar() || (object->isAttachment() && !object->isHUDAttachment() && !object->permYouOwner())) @@ -327,7 +323,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) // Object is an avatar, so check for mute by id. LLVOAvatar* avatar = (LLVOAvatar*)object; LLString name = avatar->getFullname(); - if (gMuteListp->isMuted(avatar->getID(), name)) + if (LLMuteList::getInstance()->isMuted(avatar->getID(), name)) { gMenuHolder->childSetText("Avatar Mute", LLString("Unmute")); // *TODO:Translate //gMutePieMenu->setLabel("Unmute"); @@ -348,12 +344,12 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) { // BUG: What about chatting child objects? LLString name; - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node) { name = node->mName; } - if (gMuteListp->isMuted(object->getID(), name)) + if (LLMuteList::getInstance()->isMuted(object->getID(), name)) { gMenuHolder->childSetText("Object Mute", LLString("Unmute")); // *TODO:Translate //gMuteObjectPieMenu->setLabel("Unmute"); @@ -369,7 +365,7 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) // VEFFECT: ShowPie object // Don't show when you click on someone else, it freaks them // out. - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_SPHERE, TRUE); effectp->setPositionGlobal(gLastHitPosGlobal); effectp->setColor(LLColor4U(gAgent.getEffectColor())); effectp->setDuration(0.25f); @@ -476,7 +472,7 @@ void LLToolPie::selectionPropertiesReceived() { // Make sure all data has been received. // This function will be called repeatedly as the data comes in. - if (!gSelectMgr->selectGetAllValid()) + if (!LLSelectMgr::getInstance()->selectGetAllValid()) { return; } @@ -594,7 +590,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) } } mGrabMouseButtonDown = FALSE; - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); gAgent.setLookAt(LOOKAT_TARGET_CONVERSATION, obj); // maybe look at object/person clicked on return LLTool::handleMouseUp(x, y, mask); } @@ -602,7 +598,7 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLToolPie::handleRightMouseUp(S32 x, S32 y, MASK mask) { mPieMouseButtonDown = FALSE; - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); return LLTool::handleRightMouseUp(x, y, mask); } @@ -668,18 +664,18 @@ void LLToolPie::handleDeselect() setMouseCapture( FALSE ); // Calls onMouseCaptureLost() indirectly } // remove temporary selection for pie menu - gSelectMgr->validateSelection(); + LLSelectMgr::getInstance()->validateSelection(); } LLTool* LLToolPie::getOverrideTool(MASK mask) { if (mask == MASK_CONTROL) { - return gToolGrab; + return LLToolGrab::getInstance(); } else if (mask == (MASK_CONTROL | MASK_SHIFT)) { - return gToolGrab; + return LLToolGrab::getInstance(); } return LLTool::getOverrideTool(mask); @@ -716,7 +712,7 @@ void LLToolPie::render() static void handle_click_action_play() { - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!parcel) return; LLMediaBase::EStatus status = LLViewerParcelMedia::getStatus(); @@ -739,7 +735,7 @@ static void handle_click_action_play() static void handle_click_action_open_media(LLPointer<LLViewerObject> objectp) { //FIXME: how do we handle object in different parcel than us? - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!parcel) return; // did we hit an object? @@ -781,7 +777,7 @@ static ECursorType cursor_from_parcel_media(U8 click_action) //FIXME: how do we handle object in different parcel than us? ECursorType open_cursor = UI_CURSOR_ARROW; - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!parcel) return open_cursor; std::string media_url = std::string ( parcel->getMediaURL () ); diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 1af4b26a94..4963940840 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -38,8 +38,7 @@ class LLViewerObject; class LLObjectSelection; -class LLToolPie -: public LLTool +class LLToolPie : public LLTool, public LLSingleton<LLToolPie> { public: LLToolPie( ); @@ -81,6 +80,5 @@ protected: static LLSafeHandle<LLObjectSelection> sLeftClickSelection; }; -extern LLToolPie *gToolPie; #endif diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index bcddd58e8b..aa9500fc0a 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -46,9 +46,6 @@ #include "llselectmgr.h" #include "lltoolmgr.h" -// Globals -LLToolPipette *gToolPipette = NULL; - // // Member functions // @@ -79,9 +76,9 @@ BOOL LLToolPipette::handleMouseDown(S32 x, S32 y, MASK mask) BOOL LLToolPipette::handleMouseUp(S32 x, S32 y, MASK mask) { mSuccess = TRUE; - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); // *NOTE: This assumes the pipette tool is a transient tool. - gToolMgr->clearTransientTool(); + LLToolMgr::getInstance()->clearTransientTool(); setMouseCapture(FALSE); return TRUE; } @@ -113,7 +110,7 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, LLString& msg, LLRect *sticky_re void LLToolPipette::pickCallback(S32 x, S32 y, MASK mask) { LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); - gSelectMgr->unhighlightAll(); + LLSelectMgr::getInstance()->unhighlightAll(); // if we clicked on a face of a valid prim, save off texture entry data if (hit_obj && @@ -121,11 +118,11 @@ void LLToolPipette::pickCallback(S32 x, S32 y, MASK mask) gLastHitObjectFace != -1) { //TODO: this should highlight the selected face only - gSelectMgr->highlightObjectOnly(hit_obj); - gToolPipette->mTextureEntry = *hit_obj->getTE(gLastHitObjectFace); - if (gToolPipette->mSelectCallback) + LLSelectMgr::getInstance()->highlightObjectOnly(hit_obj); + LLToolPipette::getInstance()->mTextureEntry = *hit_obj->getTE(gLastHitObjectFace); + if (LLToolPipette::getInstance()->mSelectCallback) { - gToolPipette->mSelectCallback(gToolPipette->mTextureEntry, gToolPipette->mUserData); + LLToolPipette::getInstance()->mSelectCallback(LLToolPipette::getInstance()->mTextureEntry, LLToolPipette::getInstance()->mUserData); } } } diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index 411cb465b9..ef4718bd62 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -43,7 +43,7 @@ class LLViewerObject; class LLToolPipette -: public LLTool +: public LLTool, public LLSingleton<LLToolPipette> { public: LLToolPipette(); @@ -68,6 +68,4 @@ protected: void* mUserData; }; -extern LLToolPipette *gToolPipette; - #endif //LL_LLTOOLPIPETTE_H diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index a27053faa3..062d760322 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -117,7 +117,7 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, } // Find the sim where the surface lives. - LLViewerRegion *regionp = gWorldp->getRegionFromPosGlobal(surface_pos_global); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(surface_pos_global); if (!regionp) { llwarns << "Trying to add object outside of all known regions!" << llendl; @@ -130,8 +130,8 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, *region = regionp; *ray_start_region = regionp->getPosRegionFromGlobal( ray_start_global ); - F32 near_clip = gCamera->getNear() + 0.01f; // Include an epsilon to avoid rounding issues. - *ray_start_region += gCamera->getAtAxis() * near_clip; + F32 near_clip = LLViewerCamera::getInstance()->getNear() + 0.01f; // Include an epsilon to avoid rounding issues. + *ray_start_region += LLViewerCamera::getInstance()->getAtAxis() * near_clip; if( bypass_sim_raycast ) { @@ -415,18 +415,18 @@ BOOL LLToolPlacer::addObject( LLPCode pcode, S32 x, S32 y, U8 use_physics ) // Spawns a message, so must be after above send if (create_selected) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); gViewerWindow->getWindow()->incBusyCount(); } // VEFFECT: AddObject - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM, TRUE); effectp->setSourceObject((LLViewerObject*)gAgent.getAvatarObject()); effectp->setPositionGlobal(regionp->getPosGlobalFromRegion(ray_end_region)); effectp->setDuration(LL_HUD_DUR_SHORT); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gViewerStats->incStat(LLViewerStats::ST_CREATE_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_CREATE_COUNT); return TRUE; } @@ -468,7 +468,7 @@ BOOL LLToolPlacer::addDuplicate(S32 x, S32 y) ray_target_id.setNull(); } - gSelectMgr->selectDuplicateOnRay(ray_start_region, + LLSelectMgr::getInstance()->selectDuplicateOnRay(ray_start_region, ray_end_region, b_hit_land, // suppress raycast FALSE, // intersection @@ -503,7 +503,7 @@ BOOL LLToolPlacer::placeObject(S32 x, S32 y, MASK mask) // ...and go back to the default tool if (added && !gSavedSettings.getBOOL("CreateToolKeepSelected")) { - gToolMgr->getCurrentToolset()->selectTool( gToolTranslate ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompTranslate::getInstance() ); } return added; diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 3f4c823d40..1c19de5571 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -51,7 +51,6 @@ #include "llworld.h" // Globals -LLToolSelect *gToolSelect = NULL; extern BOOL gAllowSelectAvatar; const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; @@ -106,7 +105,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje { gSavedSettings.setBOOL("SelectOwnedOnly", FALSE); gSavedSettings.setBOOL("SelectMovableOnly", FALSE); - gSelectMgr->setForceSelection(TRUE); + LLSelectMgr::getInstance()->setForceSelection(TRUE); } BOOL extend_select = (mask == MASK_SHIFT) || (mask == MASK_CONTROL); @@ -120,7 +119,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje } else if (!extend_select) { - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } } else @@ -133,22 +132,22 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje { if ( ignore_group ) { - gSelectMgr->deselectObjectOnly(object); + LLSelectMgr::getInstance()->deselectObjectOnly(object); } else { - gSelectMgr->deselectObjectAndFamily(object, TRUE, TRUE); + LLSelectMgr::getInstance()->deselectObjectAndFamily(object, TRUE, TRUE); } } else { if ( ignore_group ) { - gSelectMgr->selectObjectOnly(object, SELECT_ALL_TES); + LLSelectMgr::getInstance()->selectObjectOnly(object, SELECT_ALL_TES); } else { - gSelectMgr->selectObjectAndFamily(object); + LLSelectMgr::getInstance()->selectObjectAndFamily(object); } } } @@ -157,27 +156,27 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje // Save the current zoom values because deselect resets them. F32 target_zoom; F32 current_zoom; - gSelectMgr->getAgentHUDZoom(target_zoom, current_zoom); + LLSelectMgr::getInstance()->getAgentHUDZoom(target_zoom, current_zoom); // JC - Change behavior to make it easier to select children // of linked sets. 9/3/2002 if( !already_selected || ignore_group) { // ...lose current selection in favor of just this object - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } if ( ignore_group ) { - gSelectMgr->selectObjectOnly(object, SELECT_ALL_TES); + LLSelectMgr::getInstance()->selectObjectOnly(object, SELECT_ALL_TES); } else { - gSelectMgr->selectObjectAndFamily(object); + LLSelectMgr::getInstance()->selectObjectAndFamily(object); } // restore the zoom to the previously stored values. - gSelectMgr->setAgentHUDZoom(target_zoom, current_zoom); + LLSelectMgr::getInstance()->setAgentHUDZoom(target_zoom, current_zoom); } if (!gAgent.getFocusOnAvatar() && // if camera not glued to avatar @@ -185,7 +184,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje object != gAgent.getAvatarObject()) // and it's not you { // have avatar turn to face the selected object(s) - LLVector3d selection_center = gSelectMgr->getSelectionCenterGlobal(); + LLVector3d selection_center = LLSelectMgr::getInstance()->getSelectionCenterGlobal(); selection_center = selection_center - gAgent.getPositionGlobal(); LLVector3 selection_dir; selection_dir.setVec(selection_center); @@ -204,7 +203,7 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje if (!already_selected) { LLViewerObject* root_object = (LLViewerObject*)object->getRootEdit(); - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); // this is just a temporary selection LLSelectNode* select_node = selection->findNode(root_object); @@ -231,10 +230,10 @@ LLSafeHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObje { gSavedSettings.setBOOL("SelectOwnedOnly", select_owned); gSavedSettings.setBOOL("SelectMovableOnly", select_movable); - gSelectMgr->setForceSelection(FALSE); + LLSelectMgr::getInstance()->setForceSelection(FALSE); } - return gSelectMgr->getSelection(); + return LLSelectMgr::getInstance()->getSelection(); } BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) @@ -268,7 +267,7 @@ void LLToolSelect::onMouseCaptureLost() { // Finish drag - gSelectMgr->enableSilhouette(TRUE); + LLSelectMgr::getInstance()->enableSilhouette(TRUE); // Clean up drag-specific variables mIgnoreGroup = FALSE; diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index cc9168f7cc..c3d10424b1 100644 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -38,7 +38,7 @@ class LLObjectSelection; -class LLToolSelect : public LLTool +class LLToolSelect : public LLTool, public LLSingleton<LLToolSelect> { public: LLToolSelect( LLToolComposite* composite ); @@ -59,6 +59,5 @@ protected: LLUUID mSelectObjectID; }; -extern LLToolSelect *gToolSelect; #endif // LL_TOOLSELECTION_H diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp index bbbda58cf0..28e4227db4 100644 --- a/indra/newview/lltoolselectland.cpp +++ b/indra/newview/lltoolselectland.cpp @@ -46,9 +46,6 @@ #include "llviewerparcelmgr.h" #include "llviewerwindow.h" -// Globals -LLToolSelectLand *gToolParcel = NULL; - // // Member functions // @@ -98,7 +95,7 @@ BOOL LLToolSelectLand::handleMouseDown(S32 x, S32 y, MASK mask) mMouseOutsideSlop = TRUE; //FALSE; - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); } return hit_land; @@ -112,7 +109,7 @@ BOOL LLToolSelectLand::handleDoubleClick(S32 x, S32 y, MASK mask) if (hit_land) { // Auto-select this parcel - gParcelMgr->selectParcelAt( pos_global ); + LLViewerParcelMgr::getInstance()->selectParcelAt( pos_global ); return TRUE; } return FALSE; @@ -140,7 +137,7 @@ BOOL LLToolSelectLand::handleMouseUp(S32 x, S32 y, MASK mask) roundXY(mEastNorthTop); // Don't auto-select entire parcel. - mSelection = gParcelMgr->selectLand( mWestSouthBottom, mEastNorthTop, FALSE ); + mSelection = LLViewerParcelMgr::getInstance()->selectLand( mWestSouthBottom, mEastNorthTop, FALSE ); } mMouseOutsideSlop = FALSE; @@ -212,7 +209,7 @@ void LLToolSelectLand::render() { if( hasMouseCapture() && /*mMouseOutsideSlop &&*/ mDragEndValid) { - gParcelMgr->renderRect( mWestSouthBottom, mEastNorthTop ); + LLViewerParcelMgr::getInstance()->renderRect( mWestSouthBottom, mEastNorthTop ); } } @@ -228,7 +225,7 @@ void LLToolSelectLand::handleDeselect() { mSelection = NULL; mLastShowParcelOwners = gSavedSettings.getBOOL("ShowParcelOwners"); - //gParcelMgr->deselectLand(); + //LLViewerParcelMgr::getInstance()->deselectLand(); gSavedSettings.setBOOL("ShowParcelOwners", mLastShowParcelOwners); } diff --git a/indra/newview/lltoolselectland.h b/indra/newview/lltoolselectland.h index f847967ac8..37d656289b 100644 --- a/indra/newview/lltoolselectland.h +++ b/indra/newview/lltoolselectland.h @@ -38,7 +38,7 @@ class LLParcelSelection; class LLToolSelectLand -: public LLTool +: public LLTool, public LLSingleton<LLToolSelectLand> { public: LLToolSelectLand( ); @@ -78,6 +78,5 @@ protected: LLSafeHandle<LLParcelSelection> mSelection; // hold on to a parcel selection }; -extern LLToolSelectLand *gToolParcel; #endif diff --git a/indra/newview/lltoolselectrect.cpp b/indra/newview/lltoolselectrect.cpp index 3b68751740..5f54d1f3ba 100644 --- a/indra/newview/lltoolselectrect.cpp +++ b/indra/newview/lltoolselectrect.cpp @@ -106,11 +106,11 @@ BOOL LLToolSelectRect::handleMouseUp(S32 x, S32 y, MASK mask) if (mask == MASK_CONTROL) { - gSelectMgr->deselectHighlightedObjects(); + LLSelectMgr::getInstance()->deselectHighlightedObjects(); } else { - gSelectMgr->selectHighlightedObjects(); + LLSelectMgr::getInstance()->selectHighlightedObjects(); } return TRUE; } @@ -130,7 +130,7 @@ BOOL LLToolSelectRect::handleHover(S32 x, S32 y, MASK mask) if (!mMouseOutsideSlop && !(mask & MASK_SHIFT) && !(mask & MASK_CONTROL)) { // just started rect select, and not adding to current selection - gSelectMgr->deselectAll(); + LLSelectMgr::getInstance()->deselectAll(); } mMouseOutsideSlop = TRUE; mDragEndX = x; diff --git a/indra/newview/lltoolview.cpp b/indra/newview/lltoolview.cpp index ad7a980091..23012993a3 100644 --- a/indra/newview/lltoolview.cpp +++ b/indra/newview/lltoolview.cpp @@ -101,7 +101,7 @@ void LLToolView::addTool(const LLString& icon_off, const LLString& icon_on, LLPa mButtonCount++; const S32 LABEL_TOP_SPACING = 0; - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF_SMALL ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF_SMALL ); S32 label_width = font->getWidth( label ); LLRect label_rect; label_rect.setLeftTopAndSize( @@ -153,7 +153,7 @@ void LLToolView::draw() { // turn off highlighting for all containers // and hide all option panels except for the selected one. - LLTool* selected = gToolMgr->getCurrentToolset()->getSelectedTool(); + LLTool* selected = LLToolMgr::getInstance()->getCurrentToolset()->getSelectedTool(); for (contain_list_t::iterator iter = mContainList.begin(); iter != mContainList.end(); ++iter) { @@ -194,7 +194,7 @@ void LLToolView::onClickToolButton(void* userdata) LLToolContainer* clicked = (LLToolContainer*) userdata; // Switch to this one - gToolMgr->getCurrentToolset()->selectTool( clicked->mTool ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( clicked->mTool ); } diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index 6938c62d84..1c328612bc 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -135,18 +135,14 @@ void LLTracker::drawHUDArrow() break; case TRACKING_LOCATION: - if (!gWorldp) - { - break; - } // HACK -- try to keep the location just above the terrain #if 0 // UNHACKED by CRO - keep location where the location is instance()->mTrackedPositionGlobal.mdV[VZ] = 0.9f * instance()->mTrackedPositionGlobal.mdV[VZ] - + 0.1f * (gWorldp->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f); + + 0.1f * (LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f); #endif - instance()->mTrackedPositionGlobal.mdV[VZ] = llclamp((F32)instance()->mTrackedPositionGlobal.mdV[VZ], gWorldp->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f, (F32)instance()->getTrackedPositionGlobal().mdV[VZ]); + instance()->mTrackedPositionGlobal.mdV[VZ] = llclamp((F32)instance()->mTrackedPositionGlobal.mdV[VZ], LLWorld::getInstance()->resolveLandHeightGlobal(getTrackedPositionGlobal()) + 1.5f, (F32)instance()->getTrackedPositionGlobal().mdV[VZ]); instance()->drawMarker( getTrackedPositionGlobal(), gTrackColor ); break; @@ -480,14 +476,14 @@ void LLTracker::renderBeacon(LLVector3d pos_global, F32 dist = (F32)to_vec.magVec(); F32 color_frac = 1.f; - if (dist > 0.99f * gCamera->getFar()) + if (dist > 0.99f * LLViewerCamera::getInstance()->getFar()) { color_frac = 0.4f; - // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(gCamera->getFar()/dist)*to_vec; + // pos_global = gAgent.getCameraPositionGlobal() + 0.99f*(LLViewerCamera::getInstance()->getFar()/dist)*to_vec; } else { - color_frac = 1.f - 0.6f*(dist/gCamera->getFar()); + color_frac = 1.f - 0.6f*(dist/LLViewerCamera::getInstance()->getFar()); } LLColor4 fogged_color = color_frac * color + (1 - color_frac)*gSky.getFogColor(); @@ -512,9 +508,9 @@ void LLTracker::renderBeacon(LLVector3d pos_global, const U32 BEACON_VERTS = 256; const F32 step = 1024.0f/BEACON_VERTS; - LLVector3 x_axis = gCamera->getLeftAxis(); + LLVector3 x_axis = LLViewerCamera::getInstance()->getLeftAxis(); F32 t = gRenderStartTime.getElapsedTimeF32(); - F32 dr = dist/gCamera->getFar(); + F32 dr = dist/LLViewerCamera::getInstance()->getFar(); for (U32 i = 0; i < BEACON_VERTS; i++) { @@ -645,11 +641,6 @@ void LLTracker::clearFocus() void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) { - if (!gCamera) - { - return; - } - // get position LLVector3 pos_local = gAgent.getPosAgentFromGlobal(pos_global); @@ -659,8 +650,8 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) S32 y = 0; const BOOL CLAMP = TRUE; - if (gCamera->projectPosAgentToScreen(pos_local, screen, CLAMP) - || gCamera->projectPosAgentToScreenEdge(pos_local, screen) ) + if (LLViewerCamera::getInstance()->projectPosAgentToScreen(pos_local, screen, CLAMP) + || LLViewerCamera::getInstance()->projectPosAgentToScreenEdge(pos_local, screen) ) { gHUDView->screenPointToLocal(screen.mX, screen.mY, &x, &y); @@ -727,7 +718,7 @@ void LLTracker::drawMarker(const LLVector3d& pos_global, const LLColor4& color) mHUDArrowCenterY - half_arrow_size, HUD_ARROW_SIZE, HUD_ARROW_SIZE, RAD_TO_DEG * angle, - LLWorldMapView::sTrackArrowImage, + LLWorldMapView::sTrackArrowImage->getImage(), color); } } diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index ac41e02744..686e386578 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -74,7 +74,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) } LLUploadDialog::sDialog = this; - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); LLRect msg_rect; for (int line_num=0; line_num<16; ++line_num) { @@ -90,7 +90,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg) void LLUploadDialog::setMessage( const std::string& msg) { - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); const S32 VPAD = 16; const S32 HPAD = 25; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 5f167e62ad..abe0034dc8 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -224,7 +224,7 @@ bool LLURLDispatcherImpl::dispatchRegion(const std::string& url, BOOL right_mous url_displayp->setName(region_name); // Request a region handle by name - gWorldMap->sendNamedRegionRequest(region_name, + LLWorldMap::getInstance()->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionNameCallback, url, false); // don't teleport @@ -263,7 +263,7 @@ void LLURLDispatcherImpl::regionNameCallback(U64 region_handle, const std::strin LLVector3d global_pos = from_region_handle(region_handle) + LLVector3d(local_pos); U64 new_region_handle = to_region_handle(global_pos); - gWorldMap->sendHandleRegionRequest(new_region_handle, + LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, LLURLDispatcherImpl::regionHandleCallback, url, teleport); } @@ -375,7 +375,7 @@ public: { url += tokens[i].asString() + "/"; } - gWorldMap->sendNamedRegionRequest(region_name, + LLWorldMap::getInstance()->sendNamedRegionRequest(region_name, LLURLDispatcherImpl::regionHandleCallback, url, true); // teleport diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index a06d2fca03..11a5384f85 100644 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -65,7 +65,7 @@ void LLViewChildren::enable(const char* id, bool enabled) void LLViewChildren::setText( const char* id, const std::string& text, bool visible) { - LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); + LLTextBox* child = mParent.getChild<LLTextBox>(id); if (child) { child->setVisible(visible); @@ -76,7 +76,7 @@ void LLViewChildren::setText( void LLViewChildren::setWrappedText( const char* id, const std::string& text, bool visible) { - LLTextBox* child = LLUICtrlFactory::getTextBoxByName(&mParent, id); + LLTextBox* child = mParent.getChild<LLTextBox>(id); if (child) { child->setVisible(visible); @@ -86,33 +86,25 @@ void LLViewChildren::setWrappedText( void LLViewChildren::setBadge(const char* id, Badge badge, bool visible) { - static LLUUID badgeOK(gViewerArt.getString("badge_ok.tga")); - static LLUUID badgeNote(gViewerArt.getString("badge_note.tga")); - static LLUUID badgeWarn(gViewerArt.getString("badge_warn.tga")); - static LLUUID badgeError(gViewerArt.getString("badge_error.tga")); - - LLUUID badgeUUID; - switch (badge) - { - default: - case BADGE_OK: badgeUUID = badgeOK; break; - case BADGE_NOTE: badgeUUID = badgeNote; break; - case BADGE_WARN: badgeUUID = badgeWarn; break; - case BADGE_ERROR: badgeUUID = badgeError; break; - } - - LLIconCtrl* child = LLUICtrlFactory::getIconByName(&mParent, id); + LLIconCtrl* child = mParent.getChild<LLIconCtrl>(id); if (child) { child->setVisible(visible); - child->setImage(badgeUUID); + switch (badge) + { + default: + case BADGE_OK: child->setImage("badge_ok.j2c"); break; + case BADGE_NOTE: child->setImage("badge_note.j2c"); break; + case BADGE_WARN: child->setImage("badge_warn.j2c"); break; + case BADGE_ERROR: child->setImage("badge_error.j2c"); break; + } } } void LLViewChildren::setAction(const char* id, void(*function)(void*), void* value) { - LLButton* button = LLUICtrlFactory::getButtonByName(&mParent, id); + LLButton* button = mParent.getChild<LLButton>(id); if (button) { button->setClickedCallback(function, value); diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index fd85ac1bc1..5703a8fdbc 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -57,9 +57,9 @@ void init_audio() lpos_global_f.setVec(lpos_global); gAudiop->setListener(lpos_global_f, - LLVector3::zero, // gCamera->getVelocity(), // !!! BUG need to replace this with smoothed velocity! - gCamera->getUpAxis(), - gCamera->getAtAxis()); + LLVector3::zero, // LLViewerCamera::getInstance()->getVelocity(), // !!! BUG need to replace this with smoothed velocity! + LLViewerCamera::getInstance()->getUpAxis(), + LLViewerCamera::getInstance()->getAtAxis()); // load up our initial set of sounds we'll want so they're in memory and ready to be played @@ -188,11 +188,11 @@ void audio_update_listener() lpos_global_f.setVec(lpos_global); gAudiop->setListener(lpos_global_f, - // gCameraVelocitySmoothed, + // LLViewerCamera::getInstance()VelocitySmoothed, // LLVector3::zero, gAgent.getVelocity(), // !!! *TODO: need to replace this with smoothed velocity! - gCamera->getUpAxis(), - gCamera->getAtAxis()); + LLViewerCamera::getInstance()->getUpAxis(), + LLViewerCamera::getInstance()->getAtAxis()); } } diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index 3e8ceaba1b..517a02b4ad 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -51,8 +51,6 @@ GLfloat gGLZFar; GLfloat gGLZNear; -LLViewerCamera *gCamera = NULL; - //glu pick matrix implementation borrowed from Mesa3D glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) { diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h index c4a0f7ea53..a16f25ff81 100644 --- a/indra/newview/llviewercamera.h +++ b/indra/newview/llviewercamera.h @@ -50,7 +50,7 @@ const F32 OGL_TO_CFR_ROTATION[16] = { 0.f, 0.f, -1.f, 0.f, // -Z becomes X const BOOL FOR_SELECTION = TRUE; const BOOL NOT_FOR_SELECTION = FALSE; -class LLViewerCamera : public LLCamera +class LLViewerCamera : public LLCamera, public LLSingleton<LLViewerCamera> { public: LLViewerCamera(); @@ -111,7 +111,6 @@ protected: public: }; -extern LLViewerCamera *gCamera; extern F64 gGLModelView[16]; extern F64 gGLLastModelView[16]; extern F64 gGLProjection[16]; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 0df04fccfa..2e76fe33a3 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -79,7 +79,6 @@ BOOL gHackGodmode = FALSE; std::map<LLString, LLControlGroup*> gSettings; LLControlGroup gSavedSettings; // saved at end of session LLControlGroup gSavedPerAccountSettings; // saved at end of session -LLControlGroup gViewerArt; // read-only LLControlGroup gColors; // read-only LLControlGroup gCrashSettings; // saved at end of session @@ -101,10 +100,7 @@ static bool handleRenderFarClipChanged(const LLSD& newvalue) { F32 draw_distance = (F32) newvalue.asReal(); gAgent.mDrawDistance = draw_distance; - if (gWorldPointer) - { - gWorldPointer->setLandFarClip(draw_distance); - } + LLWorld::getInstance()->setLandFarClip(draw_distance); return true; } @@ -267,15 +263,14 @@ static bool handleAudioStreamMusicChanged(const LLSD& newvalue) { if ( newvalue.asBoolean() ) { - if (gParcelMgr - && gParcelMgr->getAgentParcel() - && !gParcelMgr->getAgentParcel()->getMusicURL().empty()) + if (LLViewerParcelMgr::getInstance()->getAgentParcel() + && !LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL().empty()) { // if stream is already playing, don't call this // otherwise music will briefly stop - if ( ! gAudiop->isInternetStreamPlaying() ) + if ( !gAudiop->isInternetStreamPlaying() ) { - gAudiop->startInternetStream(gParcelMgr->getAgentParcel()->getMusicURL().c_str()); + gAudiop->startInternetStream(LLViewerParcelMgr::getInstance()->getAgentParcel()->getMusicURL().c_str()); } } } @@ -290,7 +285,7 @@ static bool handleAudioStreamMusicChanged(const LLSD& newvalue) static bool handleUseOcclusionChanged(const LLSD& newvalue) { LLPipeline::sUseOcclusion = (newvalue.asBoolean() && gGLManager.mHasOcclusionQuery - && gFeatureManagerp->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; + && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && !gUseWireframe) ? 2 : 0; return true; } diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index 2727e36b53..4ac544b780 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -56,9 +56,6 @@ extern LLControlGroup gSavedSettings; extern LLControlGroup gSavedPerAccountSettings; // Read-only -extern LLControlGroup gViewerArt; - -// Read-only extern LLControlGroup gColors; // Saved at end of session diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 41a936ca49..82e889f00a 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -173,18 +173,15 @@ void display_update_camera() { final_far *= 0.5f; } - gCamera->setFar(final_far); + LLViewerCamera::getInstance()->setFar(final_far); gViewerWindow->setup3DRender(); // update all the sky/atmospheric/water settings - LLWLParamManager::instance()->update(gCamera); - LLWaterParamManager::instance()->update(gCamera); + LLWLParamManager::instance()->update(LLViewerCamera::getInstance()); + LLWaterParamManager::instance()->update(LLViewerCamera::getInstance()); // Update land visibility too - if (gWorldp) - { - gWorldp->setLandFarClip(final_far); - } + LLWorld::getInstance()->setLandFarClip(final_far); } @@ -425,8 +422,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // // - gCamera->setZoomParameters(zoom_factor, subfield); - gCamera->setNear(MIN_NEAR_PLANE); + LLViewerCamera::getInstance()->setZoomParameters(zoom_factor, subfield); + LLViewerCamera::getInstance()->setNear(MIN_NEAR_PLANE); ////////////////////////// // @@ -500,7 +497,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) stop_glerror(); // *TODO: merge these two methods - gHUDManager->updateEffects(); + LLHUDManager::getInstance()->updateEffects(); LLHUDObject::updateAll(); stop_glerror(); @@ -514,7 +511,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if ((LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_ENVIRONMENT) > 1) && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_WATER)) { - if (gCamera->cameraUnderWater()) + if (LLViewerCamera::getInstance()->cameraUnderWater()) { water_clip = -1; } @@ -529,7 +526,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUseOcclusion = (!gUseWireframe - && gFeatureManagerp->isFeatureAvailable("UseOcclusion") + && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery) ? 2 : 0; LLPipeline::sFastAlpha = gSavedSettings.getBOOL("RenderFastAlpha"); @@ -543,7 +540,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } static LLCullResult result; - gPipeline.updateCull(*gCamera, result, water_clip); + gPipeline.updateCull(*LLViewerCamera::getInstance(), result, water_clip); stop_glerror(); BOOL to_texture = !for_snapshot && @@ -590,8 +587,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) if (!for_snapshot) { - gPipeline.processImagery(*gCamera); - gPipeline.generateWaterReflection(*gCamera); + gPipeline.processImagery(*LLViewerCamera::getInstance()); + gPipeline.generateWaterReflection(*LLViewerCamera::getInstance()); } ////////////////////////////////////// @@ -606,8 +603,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE); - LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(), - gCamera->getAngularVelocityStat()->getMean()); + LLViewerImage::updateClass(LLViewerCamera::getInstance()->getVelocityStat()->getMean(), + LLViewerCamera::getInstance()->getAngularVelocityStat()->getMean()); gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first. @@ -626,7 +623,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // { gFrameStats.start(LLFrameStats::STATE_SORT); - gPipeline.stateSort(*gCamera, result); + gPipeline.stateSort(*LLViewerCamera::getInstance(), result); stop_glerror(); if (rebuild) @@ -677,8 +674,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // (F32)floater_rect.mRight / (F32)gViewerWindow->getWindowWidth(), // (F32)floater_rect.mBottom / (F32)gViewerWindow->getWindowHeight()); // floater_3d_rect.translate(-0.5f, -0.5f); - // glTranslatef(0.f, 0.f, -gCamera->getNear()); - // glScalef(gCamera->getNear() * gCamera->getAspect() / sinf(gCamera->getView()), gCamera->getNear() / sinf(gCamera->getView()), 1.f); + // glTranslatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear()); + // glScalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f); // gGL.color4fv(LLColor4::white.mV); // gGL.begin(GL_QUADS); // { @@ -705,8 +702,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) && !gRestoreGL) { glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); - LLPipeline::sUnderWaterRender = gCamera->cameraUnderWater() ? TRUE : FALSE; - gPipeline.renderGeom(*gCamera, TRUE); + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; + gPipeline.renderGeom(*LLViewerCamera::getInstance(), TRUE); LLPipeline::sUnderWaterRender = FALSE; glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); @@ -760,7 +757,7 @@ void render_hud_attachments() if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices(FALSE)) { - LLCamera hud_cam = *gCamera; + LLCamera hud_cam = *LLViewerCamera::getInstance(); LLVector3 origin = hud_cam.getOrigin(); hud_cam.setOrigin(-1.f,0,0); hud_cam.setAxes(LLVector3(1,0,0), LLVector3(0,1,0), LLVector3(0,0,1)); @@ -843,12 +840,12 @@ BOOL setup_hud_matrices(BOOL for_select) //RN: reset viewport to window extents so ortho screen is calculated with proper reference frame gViewerWindow->setupViewport(); } - glh::matrix4f proj = gl_ortho(-0.5f * gCamera->getAspect(), 0.5f * gCamera->getAspect(), -0.5f, 0.5f, 0.f, hud_depth); + glh::matrix4f proj = gl_ortho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, hud_depth); proj.element(2,2) = -0.01f; - + // apply camera zoom transform (for high res screenshots) - F32 zoom_factor = gCamera->getZoomFactor(); - S16 sub_region = gCamera->getZoomSubRegion(); + F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); + S16 sub_region = LLViewerCamera::getInstance()->getZoomSubRegion(); if (zoom_factor > 1.f) { float offset = zoom_factor - 1.f; @@ -856,7 +853,7 @@ BOOL setup_hud_matrices(BOOL for_select) int pos_x = sub_region - (pos_y*llceil(zoom_factor)); glh::matrix4f mat; mat.set_scale(glh::vec3f(zoom_factor, zoom_factor, 1.f)); - mat.set_translate(glh::vec3f(gCamera->getAspect() * 0.5f * (offset - (F32)pos_x * 2.f), 0.5f * (offset - (F32)pos_y * 2.f), 0.f)); + mat.set_translate(glh::vec3f(LLViewerCamera::getInstance()->getAspect() * 0.5f * (offset - (F32)pos_x * 2.f), 0.5f * (offset - (F32)pos_y * 2.f), 0.f)); proj *= mat; } @@ -1077,8 +1074,8 @@ void render_ui_2d() // Menu overlays, HUD, etc gViewerWindow->setup2DRender(); - F32 zoom_factor = gCamera->getZoomFactor(); - S16 sub_region = gCamera->getZoomSubRegion(); + F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); + S16 sub_region = LLViewerCamera::getInstance()->getZoomSubRegion(); if (zoom_factor > 1.f) { diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 27e71c23c9..a8e898999a 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -87,9 +87,9 @@ void LLViewerJoystick::updateCamera(BOOL reset) if (reset) { - sFlycamPosition = gCamera->getOrigin(); - sFlycamRotation = gCamera->getQuaternion(); - sFlycamZoom = gCamera->getView(); + sFlycamPosition = LLViewerCamera::getInstance()->getOrigin(); + sFlycamRotation = LLViewerCamera::getInstance()->getQuaternion(); + sFlycamZoom = LLViewerCamera::getInstance()->getView(); for (U32 i = 0; i < 7; i++) { @@ -168,11 +168,11 @@ void LLViewerJoystick::updateCamera(BOOL reset) LLMatrix3 mat(sFlycamRotation); - gCamera->setView(sFlycamZoom); - gCamera->setOrigin(sFlycamPosition); - gCamera->mXAxis = LLVector3(mat.mMatrix[0]); - gCamera->mYAxis = LLVector3(mat.mMatrix[1]); - gCamera->mZAxis = LLVector3(mat.mMatrix[2]); + LLViewerCamera::getInstance()->setView(sFlycamZoom); + LLViewerCamera::getInstance()->setOrigin(sFlycamPosition); + LLViewerCamera::getInstance()->mXAxis = LLVector3(mat.mMatrix[0]); + LLViewerCamera::getInstance()->mYAxis = LLVector3(mat.mMatrix[1]); + LLViewerCamera::getInstance()->mZAxis = LLVector3(mat.mMatrix[2]); } diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index db0da19927..b885e4e6b9 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -170,7 +170,7 @@ void agent_slide_right( EKeystate s ) void agent_turn_left( EKeystate s ) { - if (gToolCamera->mouseSteerMode()) + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_left(s); } @@ -185,7 +185,7 @@ void agent_turn_left( EKeystate s ) void agent_turn_right( EKeystate s ) { - if (gToolCamera->mouseSteerMode()) + if (LLToolCamera::getInstance()->mouseSteerMode()) { agent_slide_right(s); } @@ -499,7 +499,7 @@ void start_chat( EKeystate s ) void start_gesture( EKeystate s ) { if (KEYSTATE_UP == s && - !gChatBar->inputEditorHasFocus()) + !(gFocusMgr.getKeyboardFocus() && gFocusMgr.getKeyboardFocus()->acceptsTextInput())) { if (gChatBar->getCurrentChat().empty()) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 77cfd63847..a1181ccf3a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -173,7 +173,7 @@ #include "lltoolpie.h" #include "lltoolplacer.h" #include "lltoolselectland.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "lluploaddialog.h" #include "lluserauth.h" #include "lluuid.h" @@ -571,12 +571,12 @@ static LLLandmarkObserver* gLandmarkObserver = NULL; LLMenuParcelObserver::LLMenuParcelObserver() { - gParcelMgr->addObserver(this); + LLViewerParcelMgr::getInstance()->addObserver(this); } LLMenuParcelObserver::~LLMenuParcelObserver() { - gParcelMgr->removeObserver(this); + LLViewerParcelMgr::getInstance()->removeObserver(this); } void LLMenuParcelObserver::changed() @@ -668,23 +668,23 @@ void init_menus() /// /// Pie menus /// - gPieSelf = gUICtrlFactory->buildPieMenu("menu_pie_self.xml", gMenuHolder); + gPieSelf = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_self.xml", gMenuHolder); // TomY TODO: what shall we do about these? gDetachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach HUD", true); gDetachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach", true); - gPieAvatar = gUICtrlFactory->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); + gPieAvatar = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); - gPieObject = gUICtrlFactory->buildPieMenu("menu_pie_object.xml", gMenuHolder); + gPieObject = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_object.xml", gMenuHolder); gAttachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach HUD"); gAttachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach"); gPieRate = gMenuHolder->getChild<LLPieMenu>("Rate Menu"); - gPieAttachment = gUICtrlFactory->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); + gPieAttachment = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); - gPieLand = gUICtrlFactory->buildPieMenu("menu_pie_land.xml", gMenuHolder); + gPieLand = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_land.xml", gMenuHolder); /// /// set up the colors @@ -710,7 +710,7 @@ void init_menus() { color = gColors.getColor( "MenuNonProductionBgColor" ); } - gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder); + gMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_viewer.xml", gMenuHolder); gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); gMenuBarView->setBackgroundColor( color ); @@ -775,7 +775,7 @@ void init_menus() // show_debug_menus(); - gLoginMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_login.xml", gMenuHolder); + gLoginMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_login.xml", gMenuHolder); LLRect menuBarRect = gLoginMenuBarView->getRect(); gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom)); @@ -832,14 +832,12 @@ void clear_landmark_menu(LLMenuGL* menu) for ( ; it != child_list->end(); ++it) { LLView* view = *it; - if (view->getWidgetType() == WIDGET_TYPE_MENU_ITEM_CALL) + LLMenuItemCallGL* menu_item = dynamic_cast<LLMenuItemCallGL*>(view); + + if (menu_item && menu_item->getMenuCallback() == landmark_menu_action) { - LLMenuItemCallGL* menu_item = (LLMenuItemCallGL*)view; - if (menu_item->getMenuCallback() == landmark_menu_action) - { - void* user_data = menu_item->getUserData(); - delete (LLUUID*)user_data; - } + void* user_data = menu_item->getUserData(); + delete (LLUUID*)user_data; } } @@ -1427,7 +1425,7 @@ void init_debug_rendering_menu(LLMenuGL* menu) LLMenuItemCheckGL* item; item = new LLMenuItemCheckGL("Object-Object Occlusion", menu_toggle_control, NULL, menu_check_control, (void*)"UseOcclusion", 'O', MASK_CONTROL|MASK_SHIFT); - item->setEnabled(gGLManager.mHasOcclusionQuery && gFeatureManagerp->isFeatureAvailable("UseOcclusion")); + item->setEnabled(gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion")); menu->append(item); item = new LLMenuItemCheckGL("Fast Alpha", menu_toggle_control, NULL, menu_check_control, (void*)"RenderFastAlpha"); @@ -1739,7 +1737,7 @@ class LLObjectEnableTouch : public view_listener_t gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); // Update label based on the node touch name if available. - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mTouchName.empty()) { gMenuHolder->childSetText("Object Touch", node->mTouchName); @@ -1755,7 +1753,7 @@ class LLObjectEnableTouch : public view_listener_t void label_touch(LLString& label, void*) { - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mTouchName.empty()) { label.assign(node->mTouchName); @@ -1807,7 +1805,7 @@ class LLViewCheckBuildMode : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = gToolMgr->inEdit(); + bool new_value = LLToolMgr::getInstance()->inEdit(); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -1815,7 +1813,7 @@ class LLViewCheckBuildMode : public view_listener_t bool toggle_build_mode() { - if (gToolMgr->inEdit()) + if (LLToolMgr::getInstance()->inEdit()) { // just reset the view, will pull us out of edit mode handle_reset_view(); @@ -1831,8 +1829,8 @@ bool toggle_build_mode() gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); } - gToolMgr->setCurrentToolset(gBasicToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use LLFirstUse::useBuild(); @@ -1853,7 +1851,7 @@ class LLObjectBuild : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) + if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) { // zoom in if we're looking at the avatar gAgent.setFocusOnAvatar(FALSE, ANIMATE); @@ -1868,8 +1866,8 @@ class LLObjectBuild : public view_listener_t gViewerWindow->moveCursorToCenter(); } - gToolMgr->setCurrentToolset(gBasicToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use LLFirstUse::useBuild(); @@ -1881,11 +1879,11 @@ class LLObjectEdit : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); - if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit()) + if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) { @@ -1907,8 +1905,8 @@ class LLObjectEdit : public view_listener_t gFloaterTools->open(); /* Flawfinder: ignore */ - gToolMgr->setCurrentToolset(gBasicToolset); - gFloaterTools->setEditTool( gToolTranslate ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); // Could be first use LLFirstUse::useBuild(); @@ -1933,9 +1931,9 @@ class LLLandBuild : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); - if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) + if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) { // zoom in if we're looking at the avatar gAgent.setFocusOnAvatar(FALSE, ANIMATE); @@ -1952,8 +1950,8 @@ class LLLandBuild : public view_listener_t } - gToolMgr->setCurrentToolset(gBasicToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); // Could be first use LLFirstUse::useBuild(); @@ -1987,7 +1985,7 @@ BOOL enable_land_build(void*) if (gAgent.inPrelude()) return FALSE; BOOL can_build = FALSE; - LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (agent_parcel) { can_build = agent_parcel->getAllowModify(); @@ -2002,7 +2000,7 @@ BOOL enable_object_build(void*) if (gAgent.inPrelude()) return FALSE; BOOL can_build = FALSE; - LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (agent_parcel) { can_build = agent_parcel->getAllowModify(); @@ -2123,7 +2121,7 @@ class LLObjectMute : public view_listener_t // it's an object id = object->getID(); - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node) { name = node->mName; @@ -2133,13 +2131,13 @@ class LLObjectMute : public view_listener_t } LLMute mute(id, name, type); - if (gMuteListp->isMuted(mute.mID, mute.mName)) + if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName)) { - gMuteListp->remove(mute); + LLMuteList::getInstance()->remove(mute); } else { - gMuteListp->add(mute); + LLMuteList::getInstance()->add(mute); LLFloaterMute::showInstance(); } @@ -2160,7 +2158,7 @@ bool handle_go_to() strings.push_back(val); send_generic_message("autopilot", strings); - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) { @@ -2516,9 +2514,9 @@ BOOL enable_buy(void*) { // In order to buy, there must only be 1 purchaseable object in // the selection manger. - if(gSelectMgr->getSelection()->getRootObjectCount() != 1) return FALSE; + if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return FALSE; LLViewerObject* obj = NULL; - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if(node) { obj = node->getObject(); @@ -2547,7 +2545,7 @@ class LLObjectEnableBuy : public view_listener_t // received by the viewer and cached in the selection manager. void handle_buy_object(LLSaleInfo sale_info) { - if(!gSelectMgr->selectGetAllRootsValid()) + if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) { LLNotifyBox::showXml("UnableToBuyWhileDownloading"); return; @@ -2555,7 +2553,7 @@ void handle_buy_object(LLSaleInfo sale_info) LLUUID owner_id; LLString owner_name; - BOOL owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); + BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); if (!owners_identical) { LLNotifyBox::showXml("CannotBuyObjectsFromDifferentOwners"); @@ -2563,9 +2561,9 @@ void handle_buy_object(LLSaleInfo sale_info) } LLPermissions perm; - BOOL valid = gSelectMgr->selectGetPermissions(perm); + BOOL valid = LLSelectMgr::getInstance()->selectGetPermissions(perm); LLAggregatePermissions ag_perm; - valid &= gSelectMgr->selectGetAggregatePermissions(ag_perm); + valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm); if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID())) { LLNotifyBox::showXml("ObjectNotForSale"); @@ -2702,14 +2700,14 @@ void set_god_level(U8 god_level) U8 old_god_level = gAgent.getGodLevel(); gAgent.setGodLevel( god_level ); gIMMgr->refresh(); - gParcelMgr->notifyObservers(); + LLViewerParcelMgr::getInstance()->notifyObservers(); // Some classifieds change visibility on god mode LLFloaterDirectory::requestClassifieds(); // God mode changes sim visibility - gWorldMap->reset(); - gWorldMap->setCurrentLayer(0); + LLWorldMap::getInstance()->reset(); + LLWorldMap::getInstance()->setCurrentLayer(0); // inventory in items may change in god mode gObjectList.dirtyAllObjectInventory(); @@ -2975,7 +2973,7 @@ class LLLandSit : public view_listener_t bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); - gParcelMgr->deselectLand(); + LLViewerParcelMgr::getInstance()->deselectLand(); LLVector3d posGlobal = gLastHitPosGlobal; @@ -3075,7 +3073,7 @@ void create_new_landmark(void*) llwarns << "No agent region" << llendl; return; } - LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!agent_parcel) { llwarns << "No agent parcel" << llendl; @@ -3115,7 +3113,7 @@ void landmark_menu_action(void* userdata) void reload_ui(void *) { - gUICtrlFactory->rebuild(); + LLUICtrlFactory::getInstance()->rebuild(); } class LLWorldFly : public view_listener_t @@ -3138,7 +3136,7 @@ void handle_agent_stop_moving(void*) void print_packets_lost(void*) { - gWorldPointer->printPacketsLost(); + LLWorld::getInstance()->printPacketsLost(); } @@ -3187,7 +3185,7 @@ void velocity_interpolate( void* data ) void update_fov(S32 increments) { - F32 old_fov = gCamera->getDefaultFOV(); + F32 old_fov = LLViewerCamera::getInstance()->getDefaultFOV(); // for each increment, FoV is 20% bigger F32 new_fov = old_fov * pow(1.2f, increments); @@ -3210,8 +3208,8 @@ void update_fov(S32 increments) gAgent.sendReliableMessage(); // force agent to update dirty patches - gCamera->setDefaultFOV(new_fov); - gCamera->setView(new_fov); + LLViewerCamera::getInstance()->setDefaultFOV(new_fov); + LLViewerCamera::getInstance()->setView(new_fov); } } @@ -3237,7 +3235,7 @@ class LLViewZoomDefault : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - F32 old_fov = gCamera->getView(); + F32 old_fov = LLViewerCamera::getInstance()->getView(); // for each increment, FoV is 20% bigger F32 new_fov = DEFAULT_FIELD_OF_VIEW; @@ -3256,8 +3254,8 @@ class LLViewZoomDefault : public view_listener_t gAgent.sendReliableMessage(); // force agent to update dirty patches - gCamera->setDefaultFOV(new_fov); - gCamera->setView(new_fov); + LLViewerCamera::getInstance()->setDefaultFOV(new_fov); + LLViewerCamera::getInstance()->setView(new_fov); } return true; } @@ -3342,7 +3340,7 @@ void reset_view_final( BOOL proceed, void* ) gViewerWindow->showCursor(); // Switch back to basic toolset - gToolMgr->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); } class LLViewLookAtLastChatter : public view_listener_t @@ -3415,7 +3413,7 @@ class LLEditEnableDuplicate : public view_listener_t void disabled_duplicate(void*) { - if (gSelectMgr->getSelection()->getFirstObject()) + if (LLSelectMgr::getInstance()->getSelection()->getFirstObject()) { LLNotifyBox::showXml("CopyFailed"); } @@ -3426,32 +3424,32 @@ void handle_duplicate_in_place(void*) llinfos << "handle_duplicate_in_place" << llendl; LLVector3 offset(0.f, 0.f, 0.f); - gSelectMgr->selectDuplicate(offset, TRUE); + LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE); } void handle_repeat_duplicate(void*) { - gSelectMgr->repeatDuplicate(); + LLSelectMgr::getInstance()->repeatDuplicate(); } void handle_deed_object_to_group(void*) { LLUUID group_id; - gSelectMgr->selectGetGroup(group_id); - gSelectMgr->sendOwner(LLUUID::null, group_id, FALSE); - gViewerStats->incStat(LLViewerStats::ST_RELEASE_COUNT); + LLSelectMgr::getInstance()->selectGetGroup(group_id); + LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT); } BOOL enable_deed_object_to_group(void*) { - if(gSelectMgr->getSelection()->isEmpty()) return FALSE; + if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) return FALSE; LLPermissions perm; LLUUID group_id; - if (gSelectMgr->selectGetGroup(group_id) && + if (LLSelectMgr::getInstance()->selectGetGroup(group_id) && gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && - gSelectMgr->selectGetPermissions(perm) && + LLSelectMgr::getInstance()->selectGetPermissions(perm) && perm.deedToGroup(gAgent.getID(), group_id)) { return TRUE; @@ -3504,8 +3502,8 @@ void handle_object_owner_permissive(void*) if(gAgent.isGodlike()) { // do the objects. - gSelectMgr->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE); - gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE); + LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE); + LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE); } } @@ -3514,14 +3512,14 @@ void handle_object_owner_self(void*) // only send this if they're a god. if(gAgent.isGodlike()) { - gSelectMgr->sendOwner(gAgent.getID(), gAgent.getGroupID(), TRUE); + LLSelectMgr::getInstance()->sendOwner(gAgent.getID(), gAgent.getGroupID(), TRUE); } } // Shortcut to set owner permissions to not editable. void handle_object_lock(void*) { - gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY); + LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY); } void handle_object_asset_ids(void*) @@ -3529,23 +3527,23 @@ void handle_object_asset_ids(void*) // only send this if they're a god. if (gAgent.isGodlike()) { - gSelectMgr->sendGodlikeRequest("objectinfo", "assetids"); + LLSelectMgr::getInstance()->sendGodlikeRequest("objectinfo", "assetids"); } } void handle_force_parcel_owner_to_me(void*) { - gParcelMgr->sendParcelGodForceOwner( gAgent.getID() ); + LLViewerParcelMgr::getInstance()->sendParcelGodForceOwner( gAgent.getID() ); } void handle_force_parcel_to_content(void*) { - gParcelMgr->sendParcelGodForceToContent(); + LLViewerParcelMgr::getInstance()->sendParcelGodForceToContent(); } void handle_claim_public_land(void*) { - if (gParcelMgr->getSelectionRegion() != gAgent.getRegion()) + if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion()) { LLNotifyBox::showXml("ClaimPublicLand"); return; @@ -3553,7 +3551,7 @@ void handle_claim_public_land(void*) LLVector3d west_south_global; LLVector3d east_north_global; - gParcelMgr->getSelection(west_south_global, east_north_global); + LLViewerParcelMgr::getInstance()->getSelection(west_south_global, east_north_global); LLVector3 west_south = gAgent.getPosAgentFromGlobal(west_south_global); LLVector3 east_north = gAgent.getPosAgentFromGlobal(east_north_global); @@ -3586,7 +3584,7 @@ void handle_god_request_havok(void *) { if (gAgent.isGodlike()) { - gSelectMgr->sendGodlikeRequest("havok", "infoverbose"); + LLSelectMgr::getInstance()->sendGodlikeRequest("havok", "infoverbose"); } } @@ -3594,7 +3592,7 @@ void handle_god_request_havok(void *) //{ // if (gAgent.isGodlike()) // { -// gSelectMgr->sendGodlikeRequest(GOD_WANTS_FOO); +// LLSelectMgr::getInstance()->sendGodlikeRequest(GOD_WANTS_FOO); // } //} @@ -3602,7 +3600,7 @@ void handle_god_request_havok(void *) //{ // if (gAgent.isGodlike()) // { -// gSelectMgr->sendGodlikeRequest("terrain", "save"); +// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "save"); // } //} @@ -3610,7 +3608,7 @@ void handle_god_request_havok(void *) //{ // if (gAgent.isGodlike()) // { -// gSelectMgr->sendGodlikeRequest("terrain", "load"); +// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "load"); // } //} @@ -3620,7 +3618,7 @@ void handle_god_request_avatar_geometry(void *) { if (gAgent.isGodlike()) { - gSelectMgr->sendGodlikeRequest("avatar toggle", NULL); + LLSelectMgr::getInstance()->sendGodlikeRequest("avatar toggle", NULL); } } @@ -3645,8 +3643,8 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) // Check conditions that we can't deal with, building a list of // everything that we'll actually be derezzing. LLViewerRegion* first_region = NULL; - for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); - iter != gSelectMgr->getSelection()->valid_root_end(); iter++) + for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); @@ -3763,7 +3761,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id) msg->nextBlockFast(_PREHASH_ObjectData); msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID()); // VEFFECT: DerezObject - LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(object->getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); } @@ -3788,7 +3786,7 @@ class LLToolsTakeCopy : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if (gSelectMgr->getSelection()->isEmpty()) return true; + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); @@ -3803,9 +3801,9 @@ class LLObjectReturn : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if (gSelectMgr->getSelection()->isEmpty()) return true; + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; - mObjectSelection = gSelectMgr->getEditSelection(); + mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); gViewerWindow->alertXml("ReturnToOwner", onReturnToOwner, @@ -3868,7 +3866,7 @@ class LLObjectEnableReturn : public view_listener_t } } func; const bool firstonly = true; - new_value = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); + new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } } @@ -3880,7 +3878,7 @@ class LLObjectEnableReturn : public view_listener_t void force_take_copy(void*) { - if (gSelectMgr->getSelection()->isEmpty()) return; + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id); } @@ -3889,7 +3887,7 @@ void handle_take() { // we want to use the folder this was derezzed from if it's // available. Otherwise, derez to the normal place. - if(gSelectMgr->getSelection()->isEmpty()) + if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) { return; } @@ -3898,8 +3896,8 @@ void handle_take() BOOL locked_but_takeable_object = FALSE; LLUUID category_id; - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); @@ -4015,8 +4013,8 @@ BOOL enable_take() return FALSE; } - for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); - iter != gSelectMgr->getSelection()->valid_root_end(); iter++) + for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* object = node->getObject(); @@ -4051,7 +4049,7 @@ class LLToolsBuyOrTake : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if (gSelectMgr->getSelection()->isEmpty()) + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) { return true; } @@ -4130,8 +4128,8 @@ class LLToolsEnableBuyOrTake : public view_listener_t // FALSE if selection is a 'take' BOOL is_selection_buy_not_take() { - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* obj = node->getObject(); @@ -4148,8 +4146,8 @@ BOOL is_selection_buy_not_take() S32 selection_price() { S32 total_price = 0; - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* obj = node->getObject(); @@ -4202,10 +4200,10 @@ void handle_buy_currency(void*) void handle_buy(void*) { - if (gSelectMgr->getSelection()->isEmpty()) return; + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; LLSaleInfo sale_info; - BOOL valid = gSelectMgr->selectGetSaleInfo(sale_info); + BOOL valid = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info); if (!valid) return; if (sale_info.getSaleType() == LLSaleInfo::FS_CONTENTS) @@ -4229,7 +4227,7 @@ class LLObjectBuy : public view_listener_t BOOL sitting_on_selection() { - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (!node) { return FALSE; @@ -4272,14 +4270,11 @@ class LLToolsSaveToObjectInventory : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if(gSelectMgr) + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if(node && (node->mValid) && (!node->mFromTaskID.isNull())) { - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); - if(node && (node->mValid) && (!node->mFromTaskID.isNull())) - { - // *TODO: check to see if the fromtaskid object exists. - derez_objects(DRD_SAVE_INTO_TASK_INVENTORY, node->mFromTaskID); - } + // *TODO: check to see if the fromtaskid object exists. + derez_objects(DRD_SAVE_INTO_TASK_INVENTORY, node->mFromTaskID); } return true; } @@ -4292,8 +4287,8 @@ class LLToolsSnapObjectXY : public view_listener_t { F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { LLSelectNode* node = *iter; LLViewerObject* obj = node->getObject(); @@ -4327,7 +4322,7 @@ class LLToolsSnapObjectXY : public view_listener_t obj->setPositionGlobal(pos_global, FALSE); } } - gSelectMgr->sendMultipleUpdate(UPD_POSITION); + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); return true; } }; @@ -4351,7 +4346,7 @@ class LLToolsEnableLink : public view_listener_t // in component mode, can't link if (!gSavedSettings.getBOOL("EditLinkedParts")) { - if(gSelectMgr->selectGetAllRootsValid() && gSelectMgr->getSelection()->getRootObjectCount() >= 2) + if(LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() >= 2) { struct f : public LLSelectedObjectFunctor { @@ -4361,7 +4356,7 @@ class LLToolsEnableLink : public view_listener_t } } func; const bool firstonly = true; - new_value = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); + new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); } } gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); @@ -4373,13 +4368,13 @@ class LLToolsLink : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if(!gSelectMgr->selectGetAllRootsValid()) + if(!LLSelectMgr::getInstance()->selectGetAllRootsValid()) { LLNotifyBox::showXml("UnableToLinkWhileDownloading"); return true; } - S32 object_count = gSelectMgr->getSelection()->getObjectCount(); + S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); if (object_count > MAX_CHILDREN_PER_TASK + 1) { LLStringBase<char>::format_map_t args; @@ -4390,19 +4385,19 @@ class LLToolsLink : public view_listener_t return true; } - if(gSelectMgr->getSelection()->getRootObjectCount() < 2) + if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2) { gViewerWindow->alertXml("CannotLinkIncompleteSet"); return true; } - if(!gSelectMgr->selectGetRootsModify()) + if(!LLSelectMgr::getInstance()->selectGetRootsModify()) { gViewerWindow->alertXml("CannotLinkModify"); return true; } LLUUID owner_id; LLString owner_name; - if(!gSelectMgr->selectGetOwner(owner_id, owner_name)) + if(!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name)) { // we don't actually care if you're the owner, but novices are // the most likely to be stumped by this one, so offer the @@ -4410,7 +4405,7 @@ class LLToolsLink : public view_listener_t gViewerWindow->alertXml("CannotLinkDifferentOwners"); return true; } - gSelectMgr->sendLink(); + LLSelectMgr::getInstance()->sendLink(); return true; } }; @@ -4419,9 +4414,9 @@ class LLToolsEnableUnlink : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = gSelectMgr->selectGetAllRootsValid() && - gSelectMgr->getSelection()->getFirstEditableObject() && - !gSelectMgr->getSelection()->getFirstEditableObject()->isAttachment(); + bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() && + LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() && + !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment(); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -4431,7 +4426,7 @@ class LLToolsUnlink : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - gSelectMgr->sendDelink(); + LLSelectMgr::getInstance()->sendDelink(); return true; } }; @@ -4454,32 +4449,32 @@ class LLToolsStopAllAnimations : public view_listener_t //void handle_hinge(void*) //{ -// gSelectMgr->sendHinge(1); +// LLSelectMgr::getInstance()->sendHinge(1); //} //void handle_ptop(void*) //{ -// gSelectMgr->sendHinge(2); +// LLSelectMgr::getInstance()->sendHinge(2); //} //void handle_lptop(void*) //{ -// gSelectMgr->sendHinge(3); +// LLSelectMgr::getInstance()->sendHinge(3); //} //void handle_wheel(void*) //{ -// gSelectMgr->sendHinge(4); +// LLSelectMgr::getInstance()->sendHinge(4); //} //void handle_dehinge(void*) //{ -// gSelectMgr->sendDehinge(); +// LLSelectMgr::getInstance()->sendDehinge(); //} //BOOL enable_dehinge(void*) //{ -// LLViewerObject* obj = gSelectMgr->getSelection()->getFirstEditableObject(); +// LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject(); // return obj && !obj->isAttachment(); //} @@ -4593,7 +4588,7 @@ class LLObjectEnableDelete : public view_listener_t (!LLAppViewer::instance()->isInProductionGrid() && gAgent.isGodlike()) || # endif - (gSelectMgr && gSelectMgr->canDoDelete()); + LLSelectMgr::getInstance()->canDoDelete(); #endif gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; @@ -4613,9 +4608,9 @@ class LLObjectDelete : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - if (gSelectMgr) + if (LLSelectMgr::getInstance()) { - gSelectMgr->doDelete(); + LLSelectMgr::getInstance()->doDelete(); } // and close any pie/context menus when done @@ -4630,7 +4625,7 @@ class LLObjectDelete : public view_listener_t void handle_force_delete(void*) { - gSelectMgr->selectForceDelete(); + LLSelectMgr::getInstance()->selectForceDelete(); } class LLViewEnableLastChatter : public view_listener_t @@ -4738,7 +4733,7 @@ class LLEditRedo : public view_listener_t void print_object_info(void*) { - gSelectMgr->selectionDump(); + LLSelectMgr::getInstance()->selectionDump(); } void print_agent_nvpairs(void*) @@ -4818,7 +4813,7 @@ LLUploadDialog *gExportDialog = NULL; void handle_export_selected( void * ) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (selection->isEmpty()) { return; @@ -4852,7 +4847,7 @@ void handle_export_selected( void * ) BOOL menu_check_build_tool( void* user_data ) { S32 index = (intptr_t) user_data; - return gToolMgr->getCurrentToolset()->isToolSelected( index ); + return LLToolMgr::getInstance()->getCurrentToolset()->isToolSelected( index ); } void handle_reload_settings(void*) @@ -4965,7 +4960,7 @@ class LLWorldCreateLandmark : public view_listener_t llwarns << "No agent region" << llendl; return true; } - LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); + LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (!agent_parcel) { llwarns << "No agent parcel" << llendl; @@ -5000,24 +4995,24 @@ class LLToolsLookAtSelection : public view_listener_t { const F32 PADDING_FACTOR = 2.f; BOOL zoom = (userdata.asString() == "zoom"); - if (!gSelectMgr->getSelection()->isEmpty()) + if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) { gAgent.setFocusOnAvatar(FALSE, ANIMATE); - LLBBox selection_bbox = gSelectMgr->getBBoxOfSelection(); - F32 angle_of_view = llmax(0.1f, gCamera->getAspect() > 1.f ? gCamera->getView() * gCamera->getAspect() : gCamera->getView()); + LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); + F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView()); F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); - LLVector3 obj_to_cam = gCamera->getOrigin() - selection_bbox.getCenterAgent(); + LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent(); obj_to_cam.normVec(); if (zoom) { - gAgent.setCameraPosAndFocusGlobal(gSelectMgr->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID ); + gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID ); } else { - gAgent.setFocusGlobal( gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID ); + gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID ); } } return true; @@ -5113,7 +5108,7 @@ void complete_give_money(S32 option, void* user_data) bool handle_give_money_dialog() { - LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(gSelectMgr->getSelection()); + LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(LLSelectMgr::getInstance()->getSelection()); if (gAgent.getBusy()) { // warn users of being in busy mode during a transaction @@ -5189,7 +5184,7 @@ class LLObjectEnableSitOrStand : public view_listener_t } else { - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if (node && node->mValid && !node->mSitName.empty()) { label.assign(node->mSitName); @@ -5212,7 +5207,7 @@ void edit_ui(void*) void dump_select_mgr(void*) { - gSelectMgr->dump(); + LLSelectMgr::getInstance()->dump(); } void dump_volume_mgr(void*) @@ -5229,7 +5224,7 @@ void dump_inventory(void*) void handle_force_unlock(void*) { // First, make it public. - gSelectMgr->sendOwner(LLUUID::null, LLUUID::null, TRUE); + LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null, TRUE); // Second, lie to the viewer and mark it editable and unowned @@ -5246,7 +5241,7 @@ void handle_force_unlock(void*) return true; } } func; - gSelectMgr->getSelection()->applyToObjects(&func); + LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func); } void handle_dump_followcam(void*) @@ -5350,21 +5345,21 @@ class LLShowFloater : public view_listener_t } else if (floater_name == "about land") { - if (gParcelMgr->selectionEmpty()) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); + LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); } LLFloaterLand::showInstance(); } else if (floater_name == "buy land") { - if (gParcelMgr->selectionEmpty()) + if (LLViewerParcelMgr::getInstance()->selectionEmpty()) { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); + LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal()); } - gParcelMgr->startBuyLand(); + LLViewerParcelMgr::getInstance()->startBuyLand(); } else if (floater_name == "about region") { @@ -5611,8 +5606,8 @@ void handle_focus(void *) gViewerWindow->moveCursorToCenter(); // Switch to camera toolset -// gToolMgr->setCurrentToolset(gCameraToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolCamera ); +// LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCamera::getInstance() ); } class LLLandEdit : public view_listener_t @@ -5635,13 +5630,13 @@ class LLLandEdit : public view_listener_t } - gParcelMgr->selectParcelAt( gLastHitPosGlobal ); + LLViewerParcelMgr::getInstance()->selectParcelAt( gLastHitPosGlobal ); gFloaterTools->showMore(TRUE); gFloaterView->bringToFront( gFloaterTools ); // Switch to land edit toolset - gToolMgr->getCurrentToolset()->selectTool( gToolParcel ); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolSelectLand::getInstance() ); return true; } }; @@ -5650,10 +5645,10 @@ class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = gParcelMgr->canAgentBuyParcel( - gParcelMgr->selectionEmpty() - ? gParcelMgr->getAgentParcel() - : gParcelMgr->getParcelSelection()->getParcel(), + bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( + LLViewerParcelMgr::getInstance()->selectionEmpty() + ? LLViewerParcelMgr::getInstance()->getAgentParcel() + : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; @@ -5662,8 +5657,8 @@ class LLWorldEnableBuyLand : public view_listener_t BOOL enable_buy_land(void*) { - return gParcelMgr->canAgentBuyParcel( - gParcelMgr->getParcelSelection()->getParcel(), false); + return LLViewerParcelMgr::getInstance()->canAgentBuyParcel( + LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); } @@ -5684,8 +5679,8 @@ void handle_move(void*) gViewerWindow->moveCursorToCenter(); - gToolMgr->setCurrentToolset(gBasicToolset); - gToolMgr->getCurrentToolset()->selectTool( gToolGrab ); + LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); + LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); } class LLObjectAttachToAvatar : public view_listener_t @@ -5696,7 +5691,7 @@ public: private: bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - setObjectSelection(gSelectMgr->getSelection()); + setObjectSelection(LLSelectMgr::getInstance()->getSelection()); LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject(); if (selectedObject) { @@ -5739,7 +5734,7 @@ void near_attach_object(BOOL success, void *user_data) // interpret 0 as "default location" attachment_id = 0; } - gSelectMgr->sendAttach(attachment_id); + LLSelectMgr::getInstance()->sendAttach(attachment_id); } LLObjectAttachToAvatar::setObjectSelection(NULL); } @@ -5748,7 +5743,7 @@ void confirm_replace_attachment(S32 option, void* user_data) { if (option == 0/*YES*/) { - LLViewerObject* selectedObject = gSelectMgr->getSelection()->getFirstRootObject(); + LLViewerObject* selectedObject = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); if (selectedObject) { const F32 MIN_STOP_DISTANCE = 1.f; // meters @@ -5815,7 +5810,7 @@ class LLAttachmentDrop : public view_listener_t // objects. Thus we need to clear the list, make sure it only // contains the object the user clicked, send the message, // then clear the list. - gSelectMgr->sendDropAttachment(); + LLSelectMgr::getInstance()->sendDropAttachment(); return true; } }; @@ -5918,9 +5913,9 @@ class LLAttachmentDetach : public view_listener_t // We use deselectAll to update the simulator's notion of what's // selected, and removeAll just to change things locally. //RN: I thought it was more useful to detach everything that was selected - if (gSelectMgr->getSelection()->isAttachment()) + if (LLSelectMgr::getInstance()->getSelection()->isAttachment()) { - gSelectMgr->sendDetach(); + LLSelectMgr::getInstance()->sendDetach(); } return true; } @@ -5948,7 +5943,7 @@ class LLAttachmentEnableDrop : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - LLParcel* parcel = gParcelMgr->getAgentParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); //Add an inventory observer to only allow dropping the newly attached item @@ -6037,11 +6032,7 @@ class LLAttachmentEnableDetach : public view_listener_t BOOL object_selected_and_point_valid(void *user_data) { //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; - if (gSelectMgr == NULL) - { - return FALSE; - } - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); for (LLObjectSelection::root_iterator iter = selection->root_begin(); iter != selection->root_end(); iter++) { @@ -6074,9 +6065,9 @@ BOOL object_is_wearable() { return FALSE; } - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); - for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); - iter != gSelectMgr->getSelection()->valid_root_end(); iter++) + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++) { LLSelectNode* node = *iter; if (node->mPermissions->getOwner() == gAgent.getID()) @@ -6176,7 +6167,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons // Apply until an object fails QueueObjects func(q); const bool firstonly = true; - bool fail = gSelectMgr->getSelection()->applyToObjects(&func, firstonly); + bool fail = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func, firstonly); if(fail) { if ( !func.scripted ) @@ -6254,8 +6245,8 @@ void handle_set_not_run_selection(void*) void handle_selected_texture_info(void*) { - for (LLObjectSelection::valid_iterator iter = gSelectMgr->getSelection()->valid_begin(); - iter != gSelectMgr->getSelection()->valid_end(); iter++) + for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->valid_end(); iter++) { LLSelectNode* node = *iter; @@ -6423,14 +6414,14 @@ BOOL menu_check_variable( void* user_data) BOOL enable_land_selected( void* ) { - return gParcelMgr && !(gParcelMgr->selectionEmpty()); + return !(LLViewerParcelMgr::getInstance()->selectionEmpty()); } class LLSomethingSelected : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = !(gSelectMgr->getSelection()->isEmpty()); + bool new_value = !(LLSelectMgr::getInstance()->getSelection()->isEmpty()); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -6440,7 +6431,7 @@ class LLSomethingSelectedNoHUD : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; @@ -6449,14 +6440,14 @@ class LLSomethingSelectedNoHUD : public view_listener_t BOOL enable_more_than_one_selected(void* ) { - return (gSelectMgr->getSelection()->getObjectCount() > 1); + return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); } class LLEditableSelected : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = (gSelectMgr->getSelection()->getFirstEditableObject() != NULL); + bool new_value = (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -6467,7 +6458,7 @@ class LLToolsEnableTakeCopy : public view_listener_t bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { bool all_valid = false; - if (gSelectMgr) + if (LLSelectMgr::getInstance()) { all_valid = true; #ifndef HACKED_GODLIKE_VIEWER @@ -6484,7 +6475,7 @@ class LLToolsEnableTakeCopy : public view_listener_t } } func; const bool firstonly = true; - bool any_invalid = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); + bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); all_valid = !any_invalid; } #endif // HACKED_GODLIKE_VIEWER @@ -6497,7 +6488,7 @@ class LLToolsEnableTakeCopy : public view_listener_t BOOL enable_selection_you_own_all(void*) { - if (gSelectMgr) + if (LLSelectMgr::getInstance()) { struct f : public LLSelectedObjectFunctor { @@ -6507,7 +6498,7 @@ BOOL enable_selection_you_own_all(void*) } } func; const bool firstonly = true; - bool no_perms = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); + bool no_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); if (no_perms) { return FALSE; @@ -6518,7 +6509,7 @@ BOOL enable_selection_you_own_all(void*) BOOL enable_selection_you_own_one(void*) { - if (gSelectMgr) + if (LLSelectMgr::getInstance()) { struct f : public LLSelectedObjectFunctor { @@ -6528,7 +6519,7 @@ BOOL enable_selection_you_own_one(void*) } } func; const bool firstonly = true; - bool any_perms = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); + bool any_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); if (!any_perms) { return FALSE; @@ -6563,40 +6554,37 @@ bool LLHasAsset::operator()(LLInventoryCategory* cat, BOOL enable_save_into_inventory(void*) { - if(gSelectMgr) + // *TODO: clean this up + // find the last root + LLSelectNode* last_node = NULL; + for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin(); + iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++) { - // *TODO: clean this up - // find the last root - LLSelectNode* last_node = NULL; - for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); - iter != gSelectMgr->getSelection()->root_end(); iter++) - { - last_node = *iter; - } + last_node = *iter; + } #ifdef HACKED_GODLIKE_VIEWER - return TRUE; + return TRUE; #else # ifdef TOGGLE_HACKED_GODLIKE_VIEWER - if (!LLAppViewer::instance()->isInProductionGrid() - && gAgent.isGodlike()) - { - return TRUE; - } + if (!LLAppViewer::instance()->isInProductionGrid() + && gAgent.isGodlike()) + { + return TRUE; + } # endif - // check all pre-req's for save into inventory. - if(last_node && last_node->mValid && !last_node->mItemID.isNull() - && (last_node->mPermissions->getOwner() == gAgent.getID()) - && (gInventory.getItem(last_node->mItemID) != NULL)) + // check all pre-req's for save into inventory. + if(last_node && last_node->mValid && !last_node->mItemID.isNull() + && (last_node->mPermissions->getOwner() == gAgent.getID()) + && (gInventory.getItem(last_node->mItemID) != NULL)) + { + LLViewerObject* obj = last_node->getObject(); + if( obj && !obj->isAttachment() ) { - LLViewerObject* obj = last_node->getObject(); - if( obj && !obj->isAttachment() ) - { - return TRUE; - } + return TRUE; } -#endif } +#endif return FALSE; } @@ -6612,17 +6600,14 @@ class LLToolsEnableSaveToInventory : public view_listener_t BOOL enable_save_into_task_inventory(void*) { - if(gSelectMgr) + LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); + if(node && (node->mValid) && (!node->mFromTaskID.isNull())) { - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); - if(node && (node->mValid) && (!node->mFromTaskID.isNull())) + // *TODO: check to see if the fromtaskid object exists. + LLViewerObject* obj = node->getObject(); + if( obj && !obj->isAttachment() ) { - // *TODO: check to see if the fromtaskid object exists. - LLViewerObject* obj = node->getObject(); - if( obj && !obj->isAttachment() ) - { - return TRUE; - } + return TRUE; } } return FALSE; @@ -6646,7 +6631,7 @@ BOOL enable_not_thirdperson(void*) BOOL enable_export_selected(void *) { - if (gSelectMgr->getSelection()->isEmpty()) + if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) { return FALSE; } @@ -6677,7 +6662,7 @@ class LLToolsEnableToolNotPie : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = ( gToolMgr->getBaseTool() != gToolPie ); + bool new_value = ( LLToolMgr::getInstance()->getBaseTool() != LLToolPie::getInstance() ); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -6845,11 +6830,11 @@ class LLToolsEditLinkedParts : public view_listener_t BOOL select_individuals = gSavedSettings.getBOOL("EditLinkedParts"); if (select_individuals) { - gSelectMgr->demoteSelectionToIndividuals(); + LLSelectMgr::getInstance()->demoteSelectionToIndividuals(); } else { - gSelectMgr->promoteSelectionToRoot(); + LLSelectMgr::getInstance()->promoteSelectionToRoot(); } return true; } @@ -7069,17 +7054,17 @@ class LLToolsUseSelectionForGrid : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - gSelectMgr->clearGridObjects(); + LLSelectMgr::getInstance()->clearGridObjects(); struct f : public LLSelectedObjectFunctor { virtual bool apply(LLViewerObject* objectp) { - gSelectMgr->addGridObject(objectp); + LLSelectMgr::getInstance()->addGridObject(objectp); return true; } } func; - gSelectMgr->getSelection()->applyToRootObjects(&func); - gSelectMgr->setGridMode(GRID_MODE_REF_OBJECT); + LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func); + LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT); if (gFloaterTools) { gFloaterTools->mComboGridMode->setCurrentByIndex((S32)GRID_MODE_REF_OBJECT); @@ -7157,7 +7142,7 @@ void handle_save_to_xml(void*) if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name.c_str())) { LLString filename = picker.getFirstFile(); - gUICtrlFactory->saveToXML(frontmost, filename); + LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename); } } @@ -7168,7 +7153,7 @@ void handle_load_from_xml(void*) { LLString filename = picker.getFirstFile(); LLFloater* floater = new LLFloater("sample_floater"); - gUICtrlFactory->buildFloater(floater, filename); + LLUICtrlFactory::getInstance()->buildFloater(floater, filename); } } @@ -7547,23 +7532,23 @@ class LLToolsSelectTool : public view_listener_t LLString tool_name = userdata.asString(); if (tool_name == "focus") { - gToolMgr->getCurrentToolset()->selectToolByIndex(1); + LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(1); } else if (tool_name == "move") { - gToolMgr->getCurrentToolset()->selectToolByIndex(2); + LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(2); } else if (tool_name == "edit") { - gToolMgr->getCurrentToolset()->selectToolByIndex(3); + LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(3); } else if (tool_name == "create") { - gToolMgr->getCurrentToolset()->selectToolByIndex(4); + LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(4); } else if (tool_name == "land") { - gToolMgr->getCurrentToolset()->selectToolByIndex(5); + LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(5); } return true; } diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 9248134188..cb2630380c 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -46,7 +46,7 @@ #include "llstatusbar.h" #include "llviewercontrol.h" // gSavedSettings #include "llviewerimagelist.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewermenu.h" // gMenuHolder #include "llviewerregion.h" #include "llviewerstats.h" @@ -86,7 +86,7 @@ class LLFileEnableUpload : public view_listener_t { bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { - bool new_value = gStatusBar && gGlobalEconomy && (gStatusBar->getBalance() >= gGlobalEconomy->getPriceUpload()); + bool new_value = gStatusBar && LLGlobalEconomy::Singleton::getInstance() && (gStatusBar->getBalance() >= LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); return true; } @@ -218,7 +218,7 @@ class LLFileUploadImage : public view_listener_t if (filename) { LLFloaterImagePreview* floaterp = new LLFloaterImagePreview(filename); - gUICtrlFactory->buildFloater(floaterp, "floater_image_preview.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_image_preview.xml"); } return TRUE; } @@ -232,7 +232,7 @@ class LLFileUploadSound : public view_listener_t if (filename) { LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); - gUICtrlFactory->buildFloater(floaterp, "floater_sound_preview.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_sound_preview.xml"); } return true; } @@ -246,7 +246,7 @@ class LLFileUploadAnim : public view_listener_t if (filename) { LLFloaterAnimPreview* floaterp = new LLFloaterAnimPreview(filename); - gUICtrlFactory->buildFloater(floaterp, "floater_animation_preview.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_animation_preview.xml"); } return true; } @@ -441,7 +441,7 @@ void handle_upload(void* data) if (filename) { LLFloaterNameDesc* floaterp = new LLFloaterNameDesc(filename); - gUICtrlFactory->buildFloater(floaterp, "floater_name_description.xml"); + LLUICtrlFactory::getInstance()->buildFloater(floaterp, "floater_name_description.xml"); } } @@ -799,7 +799,7 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt { // Charge the user for the upload. LLViewerRegion* region = gAgent.getRegion(); - S32 upload_cost = gGlobalEconomy->getPriceUpload(); + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); if(!(can_afford_transaction(upload_cost))) { @@ -911,17 +911,17 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty if( LLAssetType::AT_SOUND == asset_type ) { - gViewerStats->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_SOUND_COUNT ); } else if( LLAssetType::AT_TEXTURE == asset_type ) { - gViewerStats->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_TEXTURE_COUNT ); } else if( LLAssetType::AT_ANIMATION == asset_type) { - gViewerStats->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_UPLOAD_ANIM_COUNT ); } if(LLInventoryType::IT_NONE == inv_type) @@ -976,7 +976,7 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty LLAssetType::AT_TEXTURE == asset_type || LLAssetType::AT_ANIMATION == asset_type) { - S32 upload_cost = gGlobalEconomy->getPriceUpload(); + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); S32 balance = gStatusBar->getBalance(); if (balance < upload_cost) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0f478d86d4..938034a009 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -285,8 +285,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) void process_layer_data(LLMessageSystem *mesgsys, void **user_data) { - if(!gWorldp) return; - LLViewerRegion *regionp = gWorldp->getRegion(mesgsys->getSender()); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegion(mesgsys->getSender()); if (!regionp || gNoRender) { @@ -913,10 +912,10 @@ void inventory_offer_mute_callback(const LLUUID& blocked_id, } LLMute mute(blocked_id, from_name, type); - if (gMuteListp->add(mute)) + if (LLMuteList::getInstance()->add(mute)) { LLFloaterMute::showInstance(); - gFloaterMute->selectMute(blocked_id); + LLFloaterMute::getInstance()->selectMute(blocked_id); } // purge the message queue of any previously queued inventory offers from the same source. @@ -1101,7 +1100,7 @@ void inventory_offer_callback(S32 button, void* user_data) log_message = "You decline " + info->mDesc + " from " + info->mFromName + "."; chat.mText = log_message; - if( gMuteListp->isMuted(info->mFromID ) && ! gMuteListp->isLinden(info->mFromName) ) // muting for SL-42269 + if( LLMuteList::getInstance()->isMuted(info->mFromID ) && ! LLMuteList::getInstance()->isLinden(info->mFromName) ) // muting for SL-42269 { chat.mMuted = TRUE; } @@ -1160,7 +1159,7 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) } //If muted, don't even go through the messaging stuff. Just curtail the offer here. - if (gMuteListp->isMuted(info->mFromID, info->mFromName)) + if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName)) { inventory_offer_callback(IOR_MUTE, info); return; @@ -1352,13 +1351,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) time_t timestamp = (time_t)t; BOOL is_busy = gAgent.getBusy(); - BOOL is_muted = gMuteListp->isMuted(from_id, name, LLMute::flagTextChat); - BOOL is_linden = gMuteListp->isLinden(name); + BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat); + BOOL is_linden = LLMuteList::getInstance()->isLinden(name); BOOL is_owned_by_me = FALSE; chat.mMuted = is_muted && !is_linden; chat.mFromID = from_id; chat.mFromName = name; + chat.mSourceType = (from_id.isNull() || !strcmp(name, SYSTEM_FROM)) ? CHAT_SOURCE_SYSTEM : CHAT_SOURCE_AGENT; LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing. if (source) @@ -1449,7 +1449,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else if (from_id.isNull()) { - // Messages from "Second Life" don't go to IM history + // Messages from "Second Life" ID don't go to IM history + // messages which should be routed to IM window come from a user ID with name=SYSTEM_NAME snprintf(buffer, sizeof(buffer), "%s: %s", name, message); /* Flawfinder: ignore */ chat.mText = buffer; LLFloaterChat::addChat(chat, FALSE, FALSE); @@ -2100,7 +2101,7 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) if(!source_name.empty()) { if (gAgent.getBusy() - || gMuteListp->isMuted(source_id, source_name, LLMute::flagTextChat)) + || LLMuteList::getInstance()->isMuted(source_id, source_name, LLMute::flagTextChat)) { // automatically decline offer callingcard_offer_callback(1, (void*)offerdata); @@ -2170,20 +2171,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) BOOL is_self = (from_id == gAgent.getID()); BOOL is_busy = gAgent.getBusy(); - // Apparently you can receive chat before app is fully initialized, hence - // gMuteListp can be null. JC BOOL is_muted = FALSE; BOOL is_linden = FALSE; - if (gMuteListp) - { - is_muted = gMuteListp->isMuted( - from_id, - from_name, - LLMute::flagTextChat) - || gMuteListp->isMuted(owner_id, LLMute::flagTextChat); - is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && - gMuteListp->isLinden(from_name); - } + is_muted = LLMuteList::getInstance()->isMuted( + from_id, + from_name, + LLMute::flagTextChat) + || LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagTextChat); + is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT && + LLMuteList::getInstance()->isLinden(from_name); BOOL is_audible = (CHAT_AUDIBLE_FULLY == chat.mAudible); chatter = gObjectList.findObject(from_id); @@ -2201,7 +2197,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) //We set the particles to be owned by the object's owner, //just in case they should be muted by the mute list psc->setOwnerUUID(owner_id); - gWorldPointer->mPartSim.addPartSource(psc); + LLViewerPartSim::getInstance()->addPartSource(psc); } // record last audible utterance @@ -2243,7 +2239,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // Look for the start of typing so we can put "..." in the bubbles. if (CHAT_TYPE_START == chat.mChatType) { - gLocalSpeakerMgr->setSpeakerTyping(from_id, TRUE); + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, TRUE); // Might not have the avatar constructed yet, eg on login. if (chatter && chatter->isAvatar()) @@ -2254,7 +2250,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) } else if (CHAT_TYPE_STOP == chat.mChatType) { - gLocalSpeakerMgr->setSpeakerTyping(from_id, FALSE); + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); // Might not have the avatar constructed yet, eg on login. if (chatter && chatter->isAvatar()) @@ -2267,7 +2263,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // We have a real utterance now, so can stop showing "..." and proceed. if (chatter && chatter->isAvatar()) { - gLocalSpeakerMgr->setSpeakerTyping(from_id, FALSE); + LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); ((LLVOAvatar*)chatter)->stopTyping(); if (!is_muted && !is_busy) @@ -2559,10 +2555,10 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Do teleport effect for where you're leaving // VEFFECT: TeleportStart - LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + LLHUDEffectSpiral *effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gHUDManager->sendEffects(); + LLHUDManager::getInstance()->sendEffects(); U32 location_id; U32 sim_ip; @@ -2598,8 +2594,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Viewer trusts the simulator. gMessageSystem->enableCircuit(sim_host, TRUE); - if(!gWorldp) return; - LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); /* // send camera update to new region @@ -2643,11 +2638,11 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Now do teleport effect for where you're going. // VEFFECT: TeleportEnd - effectp = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); + effectp = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); effectp->setPositionGlobal(gAgent.getPositionGlobal()); effectp->setColor(LLColor4U(gAgent.getEffectColor())); - gHUDManager->sendEffects(); + LLHUDManager::getInstance()->sendEffects(); // gTeleportDisplay = TRUE; // gTeleportDisplayTimer.reset(); @@ -2713,8 +2708,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) F32 x, y; from_region_handle(region_handle, &x, &y); - if(!gWorldp) return; - LLViewerRegion* regionp = gWorldp->getRegionFromHandle(region_handle); + LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle); if (!regionp) { if (gAgent.getRegion()) @@ -2870,8 +2864,7 @@ void process_crossed_region(LLMessageSystem* msg, void**) send_complete_agent_movement(sim_host); - if(!gWorldp) return; - LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host); + LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); regionp->setSeedCapability(std::string(seedCap)); } @@ -2900,6 +2893,12 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) return; } + // no region to send update to + if(gAgent.getRegion() == NULL) + { + return; + } + const F32 TRANSLATE_THRESHOLD = 0.01f; // NOTA BENE: This is (intentionally?) using the small angle sine approximation to test for rotation @@ -2940,7 +2939,7 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) U8 flag_change = 0; cam_center_chg = last_camera_pos_agent - camera_pos_agent; - cam_rot_chg = last_camera_at - gCamera->getAtAxis(); + cam_rot_chg = last_camera_at - LLViewerCamera::getInstance()->getAtAxis(); // If a modifier key is held down, turn off // LBUTTON and ML_LBUTTON so that using the camera (alt-key) doesn't @@ -3048,9 +3047,9 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // } msg->addVector3Fast(_PREHASH_CameraCenter, camera_pos_agent); - msg->addVector3Fast(_PREHASH_CameraAtAxis, gCamera->getAtAxis()); - msg->addVector3Fast(_PREHASH_CameraLeftAxis, gCamera->getLeftAxis()); - msg->addVector3Fast(_PREHASH_CameraUpAxis, gCamera->getUpAxis()); + msg->addVector3Fast(_PREHASH_CameraAtAxis, LLViewerCamera::getInstance()->getAtAxis()); + msg->addVector3Fast(_PREHASH_CameraLeftAxis, LLViewerCamera::getInstance()->getLeftAxis()); + msg->addVector3Fast(_PREHASH_CameraUpAxis, LLViewerCamera::getInstance()->getUpAxis()); msg->addF32Fast(_PREHASH_Far, gAgent.mDrawDistance); msg->addU32Fast(_PREHASH_ControlFlags, control_flags); @@ -3085,9 +3084,9 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) last_head_rot = head_rotation; last_render_state = render_state; last_camera_pos_agent = camera_pos_agent; - last_camera_at = gCamera->getAtAxis(); - last_camera_left = gCamera->getLeftAxis(); - last_camera_up = gCamera->getUpAxis(); + last_camera_at = LLViewerCamera::getInstance()->getAtAxis(); + last_camera_left = LLViewerCamera::getInstance()->getLeftAxis(); + last_camera_up = LLViewerCamera::getInstance()->getUpAxis(); last_control_flags = control_flags; last_flags = flags; } @@ -3201,7 +3200,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) //llinfos << "Kill message for local " << local_id << llendl; } - gSelectMgr->removeObjectFromSelections(id); + LLSelectMgr::getInstance()->removeObjectFromSelections(id); // ...don't kill the avatar if (!(id == gAgentID)) @@ -3255,8 +3254,7 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunDirection, sun_direction); mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunAngVelocity, sun_ang_velocity); - if(!gWorldp) return; - gWorldp->setSpaceTimeUSec(space_time_usec); + LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec); //lldebugs << "time_synch() - " << sun_direction << ", " << sun_ang_velocity // << ", " << phase << llendl; @@ -3272,8 +3270,6 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) void process_sound_trigger(LLMessageSystem *msg, void **) { if (!gAudiop) return; - if (!gParcelMgr) return; - if (!gMuteListp) return; U64 region_handle = 0; F32 gain = 0; @@ -3299,17 +3295,17 @@ void process_sound_trigger(LLMessageSystem *msg, void **) // Don't play a trigger sound if you can't hear it due // to parcel "local audio only" settings. - if (!gParcelMgr->canHearSound(pos_global)) return; + if (!LLViewerParcelMgr::getInstance()->canHearSound(pos_global)) return; // Don't play sounds triggered by someone you muted. - if (gMuteListp->isMuted(owner_id, LLMute::flagObjectSounds)) return; + if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; // Don't play sounds from an object you muted - if (gMuteListp->isMuted(object_id)) return; + if (LLMuteList::getInstance()->isMuted(object_id)) return; // Don't play sounds from an object whose parent you muted if (parent_id.notNull() - && gMuteListp->isMuted(parent_id)) + && LLMuteList::getInstance()->isMuted(parent_id)) { return; } @@ -3336,8 +3332,8 @@ void process_preload_sound(LLMessageSystem *msg, void **user_data) LLViewerObject *objectp = gObjectList.findObject(object_id); if (!objectp) return; - if (gMuteListp->isMuted(object_id)) return; - if (gMuteListp->isMuted(owner_id, LLMute::flagObjectSounds)) return; + if (LLMuteList::getInstance()->isMuted(object_id)) return; + if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; LLAudioSource *sourcep = objectp->getAudioSource(owner_id); if (!sourcep) return; @@ -3373,9 +3369,9 @@ void process_attached_sound(LLMessageSystem *msg, void **user_data) return; } - if (gMuteListp->isMuted(object_id)) return; + if (LLMuteList::getInstance()->isMuted(object_id)) return; - if (gMuteListp->isMuted(owner_id, LLMute::flagObjectSounds)) return; + if (LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagObjectSounds)) return; objectp->setAttachedSound(sound_id, owner_id, gain, flags); } @@ -3426,73 +3422,73 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) switch (stat_id) { case LL_SIM_STAT_TIME_DILATION: - gViewerStats->mSimTimeDilation.addValue(stat_value); + LLViewerStats::getInstance()->mSimTimeDilation.addValue(stat_value); break; case LL_SIM_STAT_FPS: - gViewerStats->mSimFPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimFPS.addValue(stat_value); break; case LL_SIM_STAT_PHYSFPS: - gViewerStats->mSimPhysicsFPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimPhysicsFPS.addValue(stat_value); break; case LL_SIM_STAT_AGENTUPS: - gViewerStats->mSimAgentUPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimAgentUPS.addValue(stat_value); break; case LL_SIM_STAT_FRAMEMS: - gViewerStats->mSimFrameMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimFrameMsec.addValue(stat_value); break; case LL_SIM_STAT_NETMS: - gViewerStats->mSimNetMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimNetMsec.addValue(stat_value); break; case LL_SIM_STAT_SIMOTHERMS: - gViewerStats->mSimSimOtherMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimSimOtherMsec.addValue(stat_value); break; case LL_SIM_STAT_SIMPHYSICSMS: - gViewerStats->mSimSimPhysicsMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimSimPhysicsMsec.addValue(stat_value); break; case LL_SIM_STAT_AGENTMS: - gViewerStats->mSimAgentMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimAgentMsec.addValue(stat_value); break; case LL_SIM_STAT_IMAGESMS: - gViewerStats->mSimImagesMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimImagesMsec.addValue(stat_value); break; case LL_SIM_STAT_SCRIPTMS: - gViewerStats->mSimScriptMsec.addValue(stat_value); + LLViewerStats::getInstance()->mSimScriptMsec.addValue(stat_value); break; case LL_SIM_STAT_NUMTASKS: - gViewerStats->mSimObjects.addValue(stat_value); + LLViewerStats::getInstance()->mSimObjects.addValue(stat_value); break; case LL_SIM_STAT_NUMTASKSACTIVE: - gViewerStats->mSimActiveObjects.addValue(stat_value); + LLViewerStats::getInstance()->mSimActiveObjects.addValue(stat_value); break; case LL_SIM_STAT_NUMAGENTMAIN: - gViewerStats->mSimMainAgents.addValue(stat_value); + LLViewerStats::getInstance()->mSimMainAgents.addValue(stat_value); break; case LL_SIM_STAT_NUMAGENTCHILD: - gViewerStats->mSimChildAgents.addValue(stat_value); + LLViewerStats::getInstance()->mSimChildAgents.addValue(stat_value); break; case LL_SIM_STAT_NUMSCRIPTSACTIVE: - gViewerStats->mSimActiveScripts.addValue(stat_value); + LLViewerStats::getInstance()->mSimActiveScripts.addValue(stat_value); break; case LL_SIM_STAT_LSLIPS: - gViewerStats->mSimLSLIPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimLSLIPS.addValue(stat_value); break; case LL_SIM_STAT_INPPS: - gViewerStats->mSimInPPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimInPPS.addValue(stat_value); break; case LL_SIM_STAT_OUTPPS: - gViewerStats->mSimOutPPS.addValue(stat_value); + LLViewerStats::getInstance()->mSimOutPPS.addValue(stat_value); break; case LL_SIM_STAT_PENDING_DOWNLOADS: - gViewerStats->mSimPendingDownloads.addValue(stat_value); + LLViewerStats::getInstance()->mSimPendingDownloads.addValue(stat_value); break; case LL_SIM_STAT_PENDING_UPLOADS: - gViewerStats->mSimPendingUploads.addValue(stat_value); + LLViewerStats::getInstance()->mSimPendingUploads.addValue(stat_value); break; case LL_SIM_STAT_PENDING_LOCAL_UPLOADS: - gViewerStats->mSimPendingLocalUploads.addValue(stat_value); + LLViewerStats::getInstance()->mSimPendingLocalUploads.addValue(stat_value); break; case LL_SIM_STAT_TOTAL_UNACKED_BYTES: - gViewerStats->mSimTotalUnackedBytes.addValue(stat_value / 1024.f); + LLViewerStats::getInstance()->mSimTotalUnackedBytes.addValue(stat_value / 1024.f); break; default: // llwarns << "Unknown stat id" << stat_id << llendl; @@ -3502,7 +3498,7 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) /* msg->getF32Fast(_PREHASH_Statistics, _PREHASH_PhysicsTimeDilation, time_dilation); - gViewerStats->mSimTDStat.addValue(time_dilation); + LLViewerStats::getInstance()->mSimTDStat.addValue(time_dilation); // Process information // { CpuUsage F32 } @@ -3517,9 +3513,9 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemTotal, sim_mem_total); msg->getF32Fast(_PREHASH_Statistics, _PREHASH_SimMemRSS, sim_mem_rss); msg->getF32Fast(_PREHASH_Statistics, _PREHASH_ProcessUptime, process_uptime); - gViewerStats->mSimCPUUsageStat.addValue(cpu_usage); - gViewerStats->mSimMemTotalStat.addValue(sim_mem_total); - gViewerStats->mSimMemRSSStat.addValue(sim_mem_rss); + LLViewerStats::getInstance()->mSimCPUUsageStat.addValue(cpu_usage); + LLViewerStats::getInstance()->mSimMemTotalStat.addValue(sim_mem_total); + LLViewerStats::getInstance()->mSimMemRSSStat.addValue(sim_mem_rss); */ // @@ -3947,7 +3943,7 @@ void process_time_dilation(LLMessageSystem *msg, void **user_data) // get the pointer to the right region U32 ip = msg->getSenderIP(); U32 port = msg->getSenderPort(); - LLViewerRegion *regionp = gWorldp->getRegion(ip, port); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegion(ip, port); if (regionp) { regionp->setTimeDilation(time_dilation); @@ -4047,7 +4043,7 @@ void process_alert_core(const std::string& message, BOOL modal) // HACK -- handle callbacks for specific alerts if ( message == "You died and have been teleported to your home location") { - gViewerStats->incStat(LLViewerStats::ST_KILLED_COUNT); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); } else if( message == "Home position set." ) { @@ -4235,9 +4231,9 @@ void process_frozen_message(LLMessageSystem *msgsystem, void **user_data) // do some extra stuff once we get our economy data void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) { - LLGlobalEconomy::processEconomyData(msg, (void**)gGlobalEconomy); + LLGlobalEconomy::processEconomyData(msg, LLGlobalEconomy::Singleton::getInstance()); - S32 upload_cost = gGlobalEconomy->getPriceUpload(); + S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); LLFloaterImagePreview::setUploadAmount(upload_cost); gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); @@ -4411,7 +4407,7 @@ void script_question_cb(S32 option, void* user_data) if ( option == 2 ) // mute { - gMuteListp->add(LLMute(cbdata->mItemID, cbdata->mObjectName, LLMute::OBJECT)); + LLMuteList::getInstance()->add(LLMute(cbdata->mItemID, cbdata->mObjectName, LLMute::OBJECT)); // purge the message queue of any previously queued requests from the same source. DEV-4879 class OfferMatcher : public LLNotifyBoxView::Matcher @@ -4451,7 +4447,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) msg->getS32Fast(_PREHASH_Data, _PREHASH_Questions, questions ); // don't display permission requests if this object is muted - JS. - if (gMuteListp->isMuted(taskid)) return; + if (LLMuteList::getInstance()->isMuted(taskid)) return; // throttle excessive requests from any specific user's scripts LLString throttle_owner_name = owner_name; @@ -5081,7 +5077,7 @@ void callback_load_url_name(const LLUUID& id, const char* first, const char* las } // For legacy name-only mutes. - if (gMuteListp->isMuted(LLUUID::null, owner_name)) + if (LLMuteList::getInstance()->isMuted(LLUUID::null, owner_name)) { delete infop; infop = NULL; @@ -5115,10 +5111,8 @@ void process_load_url(LLMessageSystem* msg, void**) // URL is safety checked in load_url above // Check if object or owner is muted - if (gMuteListp && - (gMuteListp->isMuted(infop->mObjectID, infop->mObjectName) || - gMuteListp->isMuted(infop->mOwnerID)) - ) + if (LLMuteList::getInstance()->isMuted(infop->mObjectID, infop->mObjectName) || + LLMuteList::getInstance()->isMuted(infop->mOwnerID)) { llinfos<<"Ignoring load_url from muted object/owner."<<llendl; delete infop; @@ -5322,10 +5316,7 @@ void onCovenantLoadComplete(LLVFS *vfs, } else { - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e89722fde8..60fc733cb5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -546,9 +546,9 @@ void LLViewerObject::removeChild(LLViewerObject *childp) if (childp->isSelected()) { - gSelectMgr->deselectObjectAndFamily(childp); + LLSelectMgr::getInstance()->deselectObjectAndFamily(childp); BOOL add_to_end = TRUE; - gSelectMgr->selectObjectAndFamily(childp, add_to_end); + LLSelectMgr::getInstance()->selectObjectAndFamily(childp, add_to_end); } } @@ -683,7 +683,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // Coordinates of objects on simulators are region-local. U64 region_handle; mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); - mRegionp = gWorldPointer->getRegionFromHandle(region_handle); + mRegionp = LLWorld::getInstance()->getRegionFromHandle(region_handle); if (!mRegionp) { U32 x, y; @@ -708,9 +708,9 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U16 valswizzle[4]; #endif U16 *val; - const F32 size = gWorldPointer->getRegionWidthInMeters(); - const F32 MAX_HEIGHT = gWorldPointer->getRegionMaxHeight(); - const F32 MIN_HEIGHT = gWorldPointer->getRegionMinHeight(); + const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 MAX_HEIGHT = LLWorld::getInstance()->getRegionMaxHeight(); + const F32 MIN_HEIGHT = LLWorld::getInstance()->getRegionMinHeight(); S32 length; S32 count; S32 this_update_precision = 32; // in bits @@ -1917,7 +1917,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, if (needs_refresh) { - gSelectMgr->updateSelectionCenter(); + LLSelectMgr::getInstance()->updateSelectionCenter(); dialog_refresh_all(); } @@ -2177,7 +2177,7 @@ void LLViewerObject::doUpdateInventory( // make sure that the serial number does not match. deleteInventoryItem(item_id); LLPermissions perm(item->getPermissions()); - LLPermissions* obj_perm = gSelectMgr->findObjectPermissions(this); + LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(this); bool is_atomic = ((S32)LLAssetType::AT_OBJECT == item->getType()) ? false : true; if(obj_perm) { @@ -2714,19 +2714,19 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) if (range < 0.001f || isHUDAttachment()) // range == zero { mAppAngle = 180.f; - mPixelArea = (F32)gCamera->getScreenPixelArea(); + mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); } else { mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; - F32 pixels_per_meter = gCamera->getPixelMeterRatio() / range; + F32 pixels_per_meter = LLViewerCamera::getInstance()->getPixelMeterRatio() / range; mPixelArea = (pixels_per_meter * max_scale) * (pixels_per_meter * mid_scale); - if (mPixelArea > gCamera->getScreenPixelArea()) + if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea()) { mAppAngle = 180.f; - mPixelArea = (F32)gCamera->getScreenPixelArea(); + mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); } } } @@ -4092,7 +4092,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own { LLPointer<LLViewerPartSourceScript> pss = LLViewerPartSourceScript::unpackPSS(this, NULL, block_num); //If the owner is muted, don't create the system - if(gMuteListp->isMuted(owner_id, LLMute::flagParticles)) return; + if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! if (pss) @@ -4100,7 +4100,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own // llinfos << "Making particle system with owner " << owner_id << llendl; pss->setOwnerUUID(owner_id); mPartSourcep = pss; - gWorldPointer->mPartSim.addPartSource(pss); + LLViewerPartSim::getInstance()->addPartSource(pss); } } if (mPartSourcep) @@ -4110,8 +4110,7 @@ void LLViewerObject::unpackParticleSource(const S32 block_num, const LLUUID& own LLViewerImage* image; if (mPartSourcep->mPartSysData.mPartImageID == LLUUID::null) { - LLUUID id(gViewerArt.getString("pixiesmall.tga")); - image = gImageList.getImage(id); + image = gImageList.getImageFromFile("pixiesmall.j2c"); } else { @@ -4141,14 +4140,14 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ { LLPointer<LLViewerPartSourceScript> pss = LLViewerPartSourceScript::unpackPSS(this, NULL, dp); //If the owner is muted, don't create the system - if(gMuteListp->isMuted(owner_id, LLMute::flagParticles)) return; + if(LLMuteList::getInstance()->isMuted(owner_id, LLMute::flagParticles)) return; // We need to be able to deal with a particle source that hasn't changed, but still got an update! if (pss) { // llinfos << "Making particle system with owner " << owner_id << llendl; pss->setOwnerUUID(owner_id); mPartSourcep = pss; - gWorldPointer->mPartSim.addPartSource(pss); + LLViewerPartSim::getInstance()->addPartSource(pss); } } if (mPartSourcep) @@ -4158,8 +4157,7 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_ LLViewerImage* image; if (mPartSourcep->mPartSysData.mPartImageID == LLUUID::null) { - LLUUID id(gViewerArt.getString("pixiesmall.tga")); - image = gImageList.getImage(id); + image = gImageList.getImageFromFile("pixiesmall.j2c"); } else { diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 8d1867cc31..499476e065 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -235,11 +235,11 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, && update_type != OUT_TERSE_IMPROVED && objectp->mCreateSelected) { - if ( gToolMgr->getCurrentTool() != gToolPie ) + if ( LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance() ) { //llinfos << "DEBUG selecting " << objectp->mID << " " // << objectp->mLocalID << llendl; - gSelectMgr->selectObjectAndFamily(objectp); + LLSelectMgr::getInstance()->selectObjectAndFamily(objectp); dialog_refresh_all(); } @@ -302,7 +302,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, U64 region_handle; mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle); - LLViewerRegion *regionp = gWorldPointer->getRegionFromHandle(region_handle); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(region_handle); if (!regionp) { @@ -585,7 +585,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent) return true; } } func; - gSelectMgr->getSelection()->applyToRootObjects(&func); + LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func); // Iterate through some of the objects and lazy update their texture priorities for (i = mCurLazyUpdateIndex; i < max_value; i++) @@ -710,7 +710,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) // don't factor frames that were paused into the stats if (! mWasPaused) { - gViewerStats->updateFrameStats(time_diff); + LLViewerStats::getInstance()->updateFrameStats(time_diff); } /* @@ -996,7 +996,7 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) } gPipeline.shiftObjects(offset); - gWorldp->shiftRegions(offset); + LLWorld::getInstance()->shiftRegions(offset); } void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) @@ -1023,7 +1023,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) const LLVector3& scale = objectp->getScale(); const LLVector3d pos = objectp->getPositionGlobal(); const F64 water_height = F64( objectp->getRegion()->getWaterHeight() ); - // gWorldPointer->getWaterHeight(); + // LLWorld::getInstance()->getWaterHeight(); F32 approx_radius = (scale.mV[VX] + scale.mV[VY]) * 0.5f * 0.5f * 1.3f; // 1.3 is a fudge @@ -1097,8 +1097,8 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce std::vector<LLDrawable*> pick_drawables; - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) @@ -1491,12 +1491,12 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) if (orphans_found && objectp->isSelected()) { - LLSelectNode* nodep = gSelectMgr->getSelection()->findNode(objectp); + LLSelectNode* nodep = LLSelectMgr::getInstance()->getSelection()->findNode(objectp); if (nodep && !nodep->mIndividualSelection) { // rebuild selection with orphans - gSelectMgr->deselectObjectAndFamily(objectp); - gSelectMgr->selectObjectAndFamily(objectp); + LLSelectMgr::getInstance()->deselectObjectAndFamily(objectp); + LLSelectMgr::getInstance()->selectObjectAndFamily(objectp); } } } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 12523f487b..de37ce253e 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -282,7 +282,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg } else { - LLParcel *parcel = gParcelMgr->getAgentParcel(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); play(parcel); } } @@ -308,7 +308,7 @@ void LLViewerParcelMedia::processParcelMediaCommandMessage( LLMessageSystem *msg { if(! LLViewerMedia::hasMedia()) { - LLParcel *parcel = gParcelMgr->getAgentParcel(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); play(parcel); } seek(time); @@ -343,7 +343,7 @@ void LLViewerParcelMedia::processParcelMediaUpdate( LLMessageSystem *msg, void * msg->getS32("DataBlockExtended", "MediaHeight", media_height); } - LLParcel *parcel = gParcelMgr->getAgentParcel(); + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); BOOL same = FALSE; if (parcel) { diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp index e373d7d986..80c22153d4 100644 --- a/indra/newview/llviewerparcelmediaautoplay.cpp +++ b/indra/newview/llviewerparcelmediaautoplay.cpp @@ -84,10 +84,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick() LLUUID this_media_texture_id; S32 this_parcel_id = 0; - if (gParcelMgr) - { - this_parcel = gParcelMgr->getAgentParcel(); - } + this_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (this_parcel) { diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index cc35328887..4a76fe7142 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -74,7 +74,6 @@ const F32 PARCEL_COLLISION_DRAW_SECS = 1.f; // Globals -LLViewerParcelMgr *gParcelMgr = NULL; U8* LLViewerParcelMgr::sPackedOverlay = NULL; @@ -139,11 +138,8 @@ LLViewerParcelMgr::LLViewerParcelMgr() mCollisionSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mCollisionSegments); - mBlockedImageID.set(gViewerArt.getString("noentrylines.tga")); - sBlockedImage = gImageList.getImage(mBlockedImageID, TRUE, TRUE); - - mPassImageID.set(gViewerArt.getString("noentrypasslines.tga")); - sPassImage = gImageList.getImage(mPassImageID, TRUE, TRUE); + mBlockedImage = gImageList.getImageFromFile("noentrylines.j2c"); + mPassImage = gImageList.getImageFromFile("noentrypasslines.j2c"); S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS; sPackedOverlay = new U8[overlay_size]; @@ -217,9 +213,7 @@ void LLViewerParcelMgr::dump() LLViewerRegion* LLViewerParcelMgr::getSelectionRegion() { - if (!gWorldp) return NULL; - - return gWorldp->getRegionFromPosGlobal( mWestSouth ); + return LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); } @@ -436,11 +430,6 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle() void LLViewerParcelMgr::selectCollisionParcel() { - if (!gWorldp) - { - return; - } - // BUG: Claim to be in the agent's region mWestSouth = gAgent.getRegion()->getOriginGlobal(); mEastNorth = mWestSouth; @@ -483,11 +472,6 @@ void LLViewerParcelMgr::selectCollisionParcel() LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, const LLVector3d &corner2, BOOL snap_selection) { - if (!gWorldp) - { - return NULL; - } - sanitize_corners( corner1, corner2, mWestSouth, mEastNorth ); // ...x isn't more than one meter away @@ -515,8 +499,8 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectLand(const LLVector3d &corner1, east_north_region_check.mdV[VX] -= 0.5; east_north_region_check.mdV[VY] -= 0.5; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal(mWestSouth); - LLViewerRegion *region_other = gWorldp->getRegionFromPosGlobal( east_north_region_check ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal(mWestSouth); + LLViewerRegion *region_other = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); if(!region) { @@ -689,8 +673,7 @@ F32 LLViewerParcelMgr::agentDrawDistance() const BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const { - if (!gWorldp) return FALSE; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); if (!region) return FALSE; LLViewerParcelOverlay* overlay = region->getParcelOverlay(); @@ -703,8 +686,7 @@ BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const { - if (!gWorldp) return FALSE; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); if (!region) return FALSE; LLViewerParcelOverlay* overlay = region->getParcelOverlay(); @@ -717,8 +699,7 @@ BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const { - if (!gWorldp) return FALSE; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); if (!region) return FALSE; LLViewerParcelOverlay* overlay = region->getParcelOverlay(); @@ -731,8 +712,7 @@ BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const { - if (!gWorldp) return FALSE; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos_global ); if (!region) return FALSE; LLViewerParcelOverlay* overlay = region->getParcelOverlay(); @@ -754,12 +734,12 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const } else { - if (gParcelMgr->getAgentParcel()->getSoundLocal()) + if (LLViewerParcelMgr::getInstance()->getAgentParcel()->getSoundLocal()) { // Not in same parcel, and agent parcel only has local sound return FALSE; } - else if (gParcelMgr->isSoundLocal(pos_global)) + else if (LLViewerParcelMgr::getInstance()->isSoundLocal(pos_global)) { // Not in same parcel, and target parcel only has local sound return FALSE; @@ -775,8 +755,7 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const { - if (!gWorldp) return FALSE; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(pos_global); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(pos_global); if (region != gAgent.getRegion()) { // Can't be in the agent parcel if you're not in the same region. @@ -833,8 +812,7 @@ void LLViewerParcelMgr::render() { // Rendering is done in agent-coordinates, so need to supply // an appropriate offset to the render code. - if (!gWorldp) return; - LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mWestSouth); + LLViewerRegion* regionp = LLWorld::getInstance()->getRegionFromPosGlobal(mWestSouth); if (!regionp) return; renderHighlightSegments(mHighlightSegments, regionp); @@ -866,8 +844,7 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags) return; } - if(!gWorldp) return; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) return; LLMessageSystem *msg = gMessageSystem; @@ -902,8 +879,7 @@ void LLViewerParcelMgr::sendParcelDwellRequest() return; } - if(!gWorldp) return; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) return; LLMessageSystem *msg = gMessageSystem; @@ -935,8 +911,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) east_north_region_check.mdV[VX] -= 0.5; east_north_region_check.mdV[VY] -= 0.5; - if(!gWorldp) return; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { // TODO: Add a force owner version of this alert. @@ -945,7 +920,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id) } // BUG: Make work for cross-region selections - LLViewerRegion *region2 = gWorldp->getRegionFromPosGlobal( east_north_region_check ); + LLViewerRegion *region2 = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); if (region != region2) { gViewerWindow->alertXml("CannotSetLandOwnerMultipleRegions"); @@ -992,8 +967,7 @@ void LLViewerParcelMgr::sendParcelGodForceToContent() gViewerWindow->alertXml("CannotContentifyNothingSelected"); return; } - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { gViewerWindow->alertXml("CannotContentifyNoRegion"); @@ -1018,8 +992,7 @@ void LLViewerParcelMgr::sendParcelRelease() return; } - if(!gWorldp) return; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { gViewerWindow->alertXml("CannotReleaseLandNoRegion"); @@ -1081,8 +1054,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( return NULL; } - if(!gWorldp) return NULL; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { gViewerWindow->alertXml("CannotBuyLandNoRegion"); @@ -1099,7 +1071,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy( east_north_region_check.mdV[VX] -= 0.5; east_north_region_check.mdV[VY] -= 0.5; - LLViewerRegion *region2 = gWorldp->getRegionFromPosGlobal( east_north_region_check ); + LLViewerRegion *region2 = LLWorld::getInstance()->getRegionFromPosGlobal( east_north_region_check ); if (region != region2) { @@ -1192,8 +1164,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id) gViewerWindow->alertXml("CannotDeedLandNoGroup"); return; } - if(!gWorldp) return; - LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion *region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) { gViewerWindow->alertXml("CannotDeedLandNoRegion"); @@ -1231,7 +1202,7 @@ void LLViewerParcelMgr::makeLandmarkAtSelection() global_center *= 0.5f; LLViewerRegion* region; - region = gWorldp->getRegionFromPosGlobal(global_center); + region = LLWorld::getInstance()->getRegionFromPosGlobal(global_center); LLVector3 west_south_bottom_region = region->getPosRegionFromGlobal( mWestSouth ); LLVector3 east_north_top_region = region->getPosRegionFromGlobal( mEastNorth ); @@ -1260,8 +1231,8 @@ const LLString& LLViewerParcelMgr::getAgentParcelName() const void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region) { if (!parcel) return; - if(!gWorldp) return; - LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : gWorldp->getRegionFromPosGlobal( mWestSouth ); + + LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) return; LLSD body; @@ -1302,8 +1273,7 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) { - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos ); if (!region) { return; @@ -1356,7 +1326,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) return; } - S32 parcels_per_edge = gParcelMgr->mParcelsPerEdge; + S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; if (packed_overlay_size != expected_size) { @@ -1374,7 +1344,7 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) expected_size); LLHost host = msg->getSender(); - LLViewerRegion *region = gWorldp->getRegion(host); + LLViewerRegion *region = LLWorld::getInstance()->getRegion(host); if (region) { region->mParcelOverlay->uncompressLandOverlay( sequence_id, sPackedOverlay ); @@ -1434,31 +1404,31 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (sequence_id == SELECTED_PARCEL_SEQ_ID) { // ...selected parcels report this sequence id - gParcelMgr->mRequestResult = PARCEL_RESULT_SUCCESS; - parcel = gParcelMgr->mCurrentParcel; + LLViewerParcelMgr::getInstance()->mRequestResult = PARCEL_RESULT_SUCCESS; + parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel; } else if (sequence_id == HOVERED_PARCEL_SEQ_ID) { - gParcelMgr->mHoverRequestResult = PARCEL_RESULT_SUCCESS; - parcel = gParcelMgr->mHoverParcel; + LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; + parcel = LLViewerParcelMgr::getInstance()->mHoverParcel; } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID || sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { - gParcelMgr->mHoverRequestResult = PARCEL_RESULT_SUCCESS; - parcel = gParcelMgr->mCollisionParcel; + LLViewerParcelMgr::getInstance()->mHoverRequestResult = PARCEL_RESULT_SUCCESS; + parcel = LLViewerParcelMgr::getInstance()->mCollisionParcel; } - else if (sequence_id == 0 || sequence_id > gParcelMgr->mAgentParcelSequenceID) + else if (sequence_id == 0 || sequence_id > LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID) { // new agent parcel - gParcelMgr->mAgentParcelSequenceID = sequence_id; - parcel = gParcelMgr->mAgentParcel; + LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID = sequence_id; + parcel = LLViewerParcelMgr::getInstance()->mAgentParcel; } else { llinfos << "out of order agent parcel sequence id " << sequence_id - << " last good " << gParcelMgr->mAgentParcelSequenceID + << " last good " << LLViewerParcelMgr::getInstance()->mAgentParcelSequenceID << llendl; return; } @@ -1529,15 +1499,15 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override); parcel->unpackMessage(msg); - if (parcel == gParcelMgr->mAgentParcel) + if (parcel == LLViewerParcelMgr::getInstance()->mAgentParcel) { - S32 bitmap_size = gParcelMgr->mParcelsPerEdge - * gParcelMgr->mParcelsPerEdge + S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge + * LLViewerParcelMgr::getInstance()->mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - gParcelMgr->writeAgentParcelFromBitmap(bitmap); + LLViewerParcelMgr::getInstance()->writeAgentParcelFromBitmap(bitmap); delete[] bitmap; } } @@ -1546,80 +1516,79 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (sequence_id == SELECTED_PARCEL_SEQ_ID) { // Update selected counts - gParcelMgr->mCurrentParcelSelection->mSelectedSelfCount = self_count; - gParcelMgr->mCurrentParcelSelection->mSelectedOtherCount = other_count; - gParcelMgr->mCurrentParcelSelection->mSelectedPublicCount = public_count; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedSelfCount = self_count; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedOtherCount = other_count; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedPublicCount = public_count; - gParcelMgr->mCurrentParcelSelection->mSelectedMultipleOwners = + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mSelectedMultipleOwners = (request_result == PARCEL_RESULT_MULTIPLE); // Select the whole parcel - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegion( msg->getSender() ); + LLViewerRegion* region = LLWorld::getInstance()->getRegion( msg->getSender() ); if (region) { if (!snap_selection) { // don't muck with the westsouth and eastnorth. // just highlight it - LLVector3 west_south = region->getPosRegionFromGlobal(gParcelMgr->mWestSouth); - LLVector3 east_north = region->getPosRegionFromGlobal(gParcelMgr->mEastNorth); + LLVector3 west_south = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mWestSouth); + LLVector3 east_north = region->getPosRegionFromGlobal(LLViewerParcelMgr::getInstance()->mEastNorth); - gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); - gParcelMgr->writeHighlightSegments( + LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); + LLViewerParcelMgr::getInstance()->writeHighlightSegments( west_south.mV[VX], west_south.mV[VY], east_north.mV[VX], east_north.mV[VY] ); - gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = FALSE; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = FALSE; } else if (0 == local_id) { // this is public land, just highlight the selection - gParcelMgr->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); - gParcelMgr->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); + LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); + LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); - gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); - gParcelMgr->writeHighlightSegments( + LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); + LLViewerParcelMgr::getInstance()->writeHighlightSegments( aabb_min.mV[VX], aabb_min.mV[VY], aabb_max.mV[VX], aabb_max.mV[VY] ); - gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; } else { - gParcelMgr->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); - gParcelMgr->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); + LLViewerParcelMgr::getInstance()->mWestSouth = region->getPosGlobalFromRegion( aabb_min ); + LLViewerParcelMgr::getInstance()->mEastNorth = region->getPosGlobalFromRegion( aabb_max ); // Owned land, highlight the boundaries - S32 bitmap_size = gParcelMgr->mParcelsPerEdge - * gParcelMgr->mParcelsPerEdge + S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge + * LLViewerParcelMgr::getInstance()->mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - gParcelMgr->resetSegments(gParcelMgr->mHighlightSegments); - gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mHighlightSegments ); + LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mHighlightSegments); + LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mHighlightSegments ); delete[] bitmap; bitmap = NULL; - gParcelMgr->mCurrentParcelSelection->mWholeParcelSelected = TRUE; + LLViewerParcelMgr::getInstance()->mCurrentParcelSelection->mWholeParcelSelected = TRUE; } // Request access list information for this land - gParcelMgr->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); + LLViewerParcelMgr::getInstance()->sendParcelAccessListRequest(AL_ACCESS | AL_BAN); // Request dwell for this land, if it's not public land. - gParcelMgr->mSelectedDwell = 0.f; + LLViewerParcelMgr::getInstance()->mSelectedDwell = 0.f; if (0 != local_id) { - gParcelMgr->sendParcelDwellRequest(); + LLViewerParcelMgr::getInstance()->sendParcelDwellRequest(); } - gParcelMgr->mSelected = TRUE; - gParcelMgr->notifyObservers(); + LLViewerParcelMgr::getInstance()->mSelected = TRUE; + LLViewerParcelMgr::getInstance()->notifyObservers(); } } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID || @@ -1627,32 +1596,32 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { // We're about to collide with this parcel - gParcelMgr->mRenderCollision = TRUE; - gParcelMgr->mCollisionTimer.reset(); + LLViewerParcelMgr::getInstance()->mRenderCollision = TRUE; + LLViewerParcelMgr::getInstance()->mCollisionTimer.reset(); // Differentiate this parcel if we are banned from it. if (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID) { - gParcelMgr->mCollisionBanned = BA_BANNED; + LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_BANNED; } else if (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) { - gParcelMgr->mCollisionBanned = BA_NOT_IN_GROUP; + LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_IN_GROUP; } else { - gParcelMgr->mCollisionBanned = BA_NOT_ON_LIST; + LLViewerParcelMgr::getInstance()->mCollisionBanned = BA_NOT_ON_LIST; } - S32 bitmap_size = gParcelMgr->mParcelsPerEdge - * gParcelMgr->mParcelsPerEdge + S32 bitmap_size = LLViewerParcelMgr::getInstance()->mParcelsPerEdge + * LLViewerParcelMgr::getInstance()->mParcelsPerEdge / 8; U8* bitmap = new U8[ bitmap_size ]; msg->getBinaryDataFast(_PREHASH_ParcelData, _PREHASH_Bitmap, bitmap, bitmap_size); - gParcelMgr->resetSegments(gParcelMgr->mCollisionSegments); - gParcelMgr->writeSegmentsFromBitmap( bitmap, gParcelMgr->mCollisionSegments ); + LLViewerParcelMgr::getInstance()->resetSegments(LLViewerParcelMgr::getInstance()->mCollisionSegments); + LLViewerParcelMgr::getInstance()->writeSegmentsFromBitmap( bitmap, LLViewerParcelMgr::getInstance()->mCollisionSegments ); delete[] bitmap; bitmap = NULL; @@ -1660,16 +1629,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } else if (sequence_id == HOVERED_PARCEL_SEQ_ID) { - LLViewerRegion *region = gWorldp->getRegion( msg->getSender() ); + LLViewerRegion *region = LLWorld::getInstance()->getRegion( msg->getSender() ); if (region) { - gParcelMgr->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); - gParcelMgr->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); + LLViewerParcelMgr::getInstance()->mHoverWestSouth = region->getPosGlobalFromRegion( aabb_min ); + LLViewerParcelMgr::getInstance()->mHoverEastNorth = region->getPosGlobalFromRegion( aabb_max ); } else { - gParcelMgr->mHoverWestSouth.clearVec(); - gParcelMgr->mHoverEastNorth.clearVec(); + LLViewerParcelMgr::getInstance()->mHoverWestSouth.clearVec(); + LLViewerParcelMgr::getInstance()->mHoverEastNorth.clearVec(); } } else @@ -1738,7 +1707,6 @@ void optionally_start_music(const LLString& music_url) } } - // static void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void **user) { @@ -1752,7 +1720,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void msg->getU32Fast( _PREHASH_Data, _PREHASH_Flags, message_flags); msg->getS32Fast( _PREHASH_Data, _PREHASH_LocalID, parcel_id); - LLParcel* parcel = gParcelMgr->mCurrentParcel; + LLParcel* parcel = LLViewerParcelMgr::getInstance()->mCurrentParcel; if (!parcel) return; if (parcel_id != parcel->getLocalID()) @@ -1775,7 +1743,7 @@ void LLViewerParcelMgr::processParcelAccessListReply(LLMessageSystem *msg, void parcel->unpackAccessEntries(msg, &(parcel->mRenterList) ); }*/ - gParcelMgr->notifyObservers(); + LLViewerParcelMgr::getInstance()->notifyObservers(); } @@ -1794,10 +1762,10 @@ void LLViewerParcelMgr::processParcelDwellReply(LLMessageSystem* msg, void**) F32 dwell; msg->getF32("Data", "Dwell", dwell); - if (local_id == gParcelMgr->mCurrentParcel->getLocalID()) + if (local_id == LLViewerParcelMgr::getInstance()->mCurrentParcel->getLocalID()) { - gParcelMgr->mSelectedDwell = dwell; - gParcelMgr->notifyObservers(); + LLViewerParcelMgr::getInstance()->mSelectedDwell = dwell; + LLViewerParcelMgr::getInstance()->notifyObservers(); } } @@ -1813,8 +1781,7 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which) return; } - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth ); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth ); if (!region) return; LLMessageSystem* msg = gMessageSystem; @@ -1963,13 +1930,13 @@ void LLViewerParcelMgr::deedAlertCB(S32 option, void*) { if (option == 0) { - LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); LLUUID group_id; if(parcel) { group_id = parcel->getGroupID(); } - gParcelMgr->sendParcelDeed(group_id); + LLViewerParcelMgr::getInstance()->sendParcelDeed(group_id); } } @@ -2002,8 +1969,7 @@ void LLViewerParcelMgr::startReleaseLand() } LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { gViewerWindow->alertXml("CannotReleaseLandRegionNotFound"); @@ -2107,8 +2073,7 @@ void LLViewerParcelMgr::callbackDivideLand(S32 option, void* data) LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { gViewerWindow->alertXml("CannotDivideLandNoRegion"); @@ -2166,8 +2131,7 @@ void LLViewerParcelMgr::callbackJoinLand(S32 option, void* data) LLViewerParcelMgr* self = (LLViewerParcelMgr*)data; LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { gViewerWindow->alertXml("CannotJoinLandNoRegion"); @@ -2215,8 +2179,7 @@ void LLViewerParcelMgr::startDeedLandToGroup() } LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal(parcel_center); if (!region) { gViewerWindow->alertXml("CannotDeedLandNoRegion"); @@ -2241,8 +2204,8 @@ void LLViewerParcelMgr::startDeedLandToGroup() } void LLViewerParcelMgr::reclaimParcel() { - LLParcel* parcel = gParcelMgr->getParcelSelection()->getParcel(); - LLViewerRegion* regionp = gParcelMgr->getSelectionRegion(); + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); + LLViewerRegion* regionp = LLViewerParcelMgr::getInstance()->getSelectionRegion(); if(parcel && parcel->getOwnerID().notNull() && (parcel->getOwnerID() != gAgent.getID()) && regionp && (regionp->getOwner() == gAgent.getID())) @@ -2264,7 +2227,7 @@ void LLViewerParcelMgr::releaseAlertCB(S32 option, void *) if (option == 0) { // Send the release message, not a force - gParcelMgr->sendParcelRelease(); + LLViewerParcelMgr::getInstance()->sendParcelRelease(); } } @@ -2367,8 +2330,6 @@ void sanitize_corners(const LLVector3d &corner1, void LLViewerParcelMgr::cleanupGlobals() { - delete gParcelMgr; - gParcelMgr = NULL; LLParcelSelection::sNullSelection = NULL; } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index f86ffe309f..37499e3751 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -37,6 +37,7 @@ #include "llframetimer.h" #include "llmemory.h" #include "llparcelselection.h" +#include "llui.h" class LLUUID; class LLMessageSystem; @@ -73,8 +74,7 @@ public: virtual void changed() = 0; }; - -class LLViewerParcelMgr +class LLViewerParcelMgr : public LLSingleton<LLViewerParcelMgr> { public: @@ -325,15 +325,14 @@ private: BOOL mRenderSelection; S32 mCollisionBanned; LLFrameTimer mCollisionTimer; - LLUUID mBlockedImageID; - LLUUID mPassImageID; + LLImageGL* mBlockedImage; + LLImageGL* mPassImage; // Media S32 mMediaParcelId; U64 mMediaRegionId; }; -extern LLViewerParcelMgr *gParcelMgr; void sanitize_corners(const LLVector3d &corner1, const LLVector3d &corner2, LLVector3d &west_south_bottom, LLVector3d &east_north_top); diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 3dc14caa2d..b105267723 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -58,7 +58,6 @@ LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_ mDirty( FALSE ), mTimeSinceLastUpdate(), mOverlayTextureIdx(-1), - mLineImageID( gViewerArt.getString("propertyline.tga") ), mVertexCount(0), mVertexArray(NULL), mColorArray(NULL) @@ -750,20 +749,15 @@ S32 LLViewerParcelOverlay::renderPropertyLines () LLGLSNoTexture gls_no_texture; LLGLDepthTest mDepthTest(GL_TRUE); - // JC - This doesn't work. - //gGLSUITextureDepth.set(); - //LLViewerImage* image = gImageList.getImage( mLineImageID ); - //image->bindTexture(); - // Find camera height off the ground (not from zero) F32 ground_height_at_camera = land.resolveHeightGlobal( gAgent.getCameraPositionGlobal() ); - F32 camera_z = gCamera->getOrigin().mV[VZ]; + F32 camera_z = LLViewerCamera::getInstance()->getOrigin().mV[VZ]; F32 camera_height = camera_z - ground_height_at_camera; camera_height = llclamp(camera_height, 0.f, 100.f); // Pull lines toward camera by 1 cm per meter off the ground. - const LLVector3& CAMERA_AT = gCamera->getAtAxis(); + const LLVector3& CAMERA_AT = LLViewerCamera::getInstance()->getAtAxis(); F32 pull_toward_camera_scale = 0.01f * camera_height; LLVector3 pull_toward_camera = CAMERA_AT; pull_toward_camera *= -pull_toward_camera_scale; @@ -791,7 +785,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () // Set up a cull plane 2 * PARCEL_GRID_STEP_METERS behind // the camera. The cull plane normal is the camera's at axis. - LLVector3 cull_plane_point = gCamera->getAtAxis(); + LLVector3 cull_plane_point = LLViewerCamera::getInstance()->getAtAxis(); cull_plane_point *= -2.f * PARCEL_GRID_STEP_METERS; cull_plane_point += camera_region; diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index f134795589..7f961b9333 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -111,7 +111,6 @@ private: LLFrameTimer mTimeSinceLastUpdate; S32 mOverlayTextureIdx; - LLUUID mLineImageID; S32 mVertexCount; F32* mVertexArray; U8* mColorArray; diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 93e3ad2919..223078ffe0 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -70,7 +70,7 @@ U32 LLViewerPart::sNextPartID = 1; F32 calc_desired_size(LLVector3 pos, LLVector2 scale) { - F32 desired_size = (pos-gCamera->getOrigin()).magVec(); + F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec(); desired_size /= 4; return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2); } @@ -117,7 +117,7 @@ LLViewerPartGroup::LLViewerPartGroup(const LLVector3 ¢er_agent, const F32 bo mVOPartGroupp = NULL; mUniformParticles = TRUE; - mRegionp = gWorldPointer->getRegionFromPosAgent(center_agent); + mRegionp = LLWorld::getInstance()->getRegionFromPosAgent(center_agent); llassert_always(center_agent.isFinite()); if (!mRegionp) @@ -367,7 +367,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) if (!posInGroup(part.mPosAgent, desired_size)) { // Transfer particles between groups - gWorldPointer->mPartSim.put(&part); + LLViewerPartSim::getInstance()->put(&part); end--; LLPointer<LLViewerPart>::swap(mParticles[i], mParticles[end]); // be sure to process the particle we just swapped-in @@ -441,7 +441,7 @@ LLViewerPartSim::LLViewerPartSim() } -LLViewerPartSim::~LLViewerPartSim() +void LLViewerPartSim::destroyClass() { LLMemType mt(LLMemType::MTYPE_PARTICLES); S32 i; diff --git a/indra/newview/llviewerpartsim.h b/indra/newview/llviewerpartsim.h index 343425f3d4..daccac4e8f 100644 --- a/indra/newview/llviewerpartsim.h +++ b/indra/newview/llviewerpartsim.h @@ -35,12 +35,11 @@ #include "lldarrayptr.h" #include "llframetimer.h" #include "llmemory.h" - #include "llpartdata.h" +#include "llviewerpartsource.h" class LLViewerImage; class LLViewerPart; -class LLViewerPartSource; class LLViewerRegion; class LLViewerImage; class LLVOPartGroup; @@ -126,11 +125,12 @@ protected: LLViewerRegion *mRegionp; }; -class LLViewerPartSim +class LLViewerPartSim : public LLSingleton<LLViewerPartSim> { public: LLViewerPartSim(); - virtual ~LLViewerPartSim(); + virtual ~LLViewerPartSim(){} + void destroyClass(); typedef std::vector<LLViewerPartGroup *> group_list_t; typedef std::vector<LLPointer<LLViewerPartSource> > source_list_t; diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index db356064d4..3c3b1bf3ff 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -97,9 +97,7 @@ LLViewerPartSourceScript::LLViewerPartSourceScript(LLViewerObject *source_objp) llassert(source_objp); mSourceObjectp = source_objp; mPosAgent = mSourceObjectp->getPositionAgent(); - LLUUID id; - id.set( gViewerArt.getString("pixiesmall.tga") ); - mImagep = gImageList.getImage(id); + mImagep = gImageList.getImageFromFile("pixiesmall.j2c"); mImagep->bind(); mImagep->setClamp(TRUE, TRUE); } @@ -122,7 +120,7 @@ void LLViewerPartSourceScript::update(const F32 dt) F32 old_update_time = mLastUpdateTime; mLastUpdateTime += dt; - F32 ref_rate_travelspeed = llmin(gWorldPointer->mPartSim.getRefRate(), 1.f); + F32 ref_rate_travelspeed = llmin(LLViewerPartSim::getInstance()->getRefRate(), 1.f); F32 dt_update = mLastUpdateTime - mLastPartTime; @@ -212,7 +210,7 @@ void LLViewerPartSourceScript::update(const F32 dt) mRotation.setQuat(0, 0, 0); } - if (gWorldPointer->mPartSim.aboveParticleLimit()) + if (LLViewerPartSim::getInstance()->aboveParticleLimit()) { // Don't bother doing any more updates if we're above the particle limit, // just give up. @@ -234,7 +232,7 @@ void LLViewerPartSourceScript::update(const F32 dt) (mPartSysData.mPartData.mStartScale[1] + mPartSysData.mPartData.mEndScale[1])/2)); - F32 pixel_meter_ratio = gCamera->getPixelMeterRatio(); + F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio(); // Maximum distance at which spawned particles will be viewable F32 max_dist = max_short_side * pixel_meter_ratio; @@ -249,7 +247,7 @@ void LLViewerPartSourceScript::update(const F32 dt) } // Distance from camera - F32 dist = (mPosAgent - gCamera->getOrigin()).magVec(); + F32 dist = (mPosAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); // Particle size vs distance vs maxage throttling @@ -273,7 +271,7 @@ void LLViewerPartSourceScript::update(const F32 dt) S32 i; for (i = 0; i < mPartSysData.mBurstPartCount; i++) { - if (ll_frand() < llmax(1.0f - gWorldPointer->mPartSim.getBurstRate(), limited_rate)) + if (ll_frand() < llmax(1.0f - LLViewerPartSim::getInstance()->getBurstRate(), limited_rate)) { // Limit particle generation continue; @@ -384,7 +382,7 @@ void LLViewerPartSourceScript::update(const F32 dt) mPartSysData.mBurstRadius = 0; } - gWorldPointer->mPartSim.addPart(part); + LLViewerPartSim::getInstance()->addPart(part); } mLastPartTime = mLastUpdateTime; @@ -527,9 +525,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt) LLMemType mt(LLMemType::MTYPE_PARTICLES); if (!mImagep) { - LLUUID id; - id.set( gViewerArt.getString("pixiesmall.tga") ); - mImagep = gImageList.getImage(id); + mImagep = gImageList.getImageFromFile("pixiesmall.j2c"); } const F32 RATE = 0.025f; @@ -543,7 +539,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt) if (dt_update > RATE) { mLastPartTime = mLastUpdateTime; - if (!gWorldPointer->mPartSim.shouldAddPart()) + if (!LLViewerPartSim::getInstance()->shouldAddPart()) { // Particle simulation says we have too many particles, skip all this return; @@ -566,7 +562,7 @@ void LLViewerPartSourceSpiral::update(const F32 dt) part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); - gWorldPointer->mPartSim.addPart(part); + LLViewerPartSim::getInstance()->addPart(part); } } @@ -690,7 +686,7 @@ void LLViewerPartSourceBeam::update(const F32 dt) if (dt_update > RATE) { mLastPartTime = mLastUpdateTime; - if (!gWorldPointer->mPartSim.shouldAddPart()) + if (!LLViewerPartSim::getInstance()->shouldAddPart()) { // Particle simulation says we have too many particles, skip all this return; @@ -698,9 +694,7 @@ void LLViewerPartSourceBeam::update(const F32 dt) if (!mImagep) { - LLUUID id; - id.set( gViewerArt.getString("pixiesmall.tga") ); - mImagep = gImageList.getImage(id); + mImagep = gImageList.getImageFromFile("pixiesmall.j2c"); } LLPointer<LLViewerPart> part = new LLViewerPart(); @@ -723,7 +717,7 @@ void LLViewerPartSourceBeam::update(const F32 dt) part->mPosAgent = mPosAgent; part->mVelocity = mTargetPosAgent - mPosAgent; - gWorldPointer->mPartSim.addPart(part); + LLViewerPartSim::getInstance()->addPart(part); } } @@ -786,9 +780,7 @@ void LLViewerPartSourceChat::update(const F32 dt) LLMemType mt(LLMemType::MTYPE_PARTICLES); if (!mImagep) { - LLUUID id; - id.set( gViewerArt.getString("pixiesmall.tga") ); - mImagep = gImageList.getImage(id); + mImagep = gImageList.getImageFromFile("pixiesmall.j2c"); } @@ -812,7 +804,7 @@ void LLViewerPartSourceChat::update(const F32 dt) if (dt_update > RATE) { mLastPartTime = mLastUpdateTime; - if (!gWorldPointer->mPartSim.shouldAddPart()) + if (!LLViewerPartSim::getInstance()->shouldAddPart()) { // Particle simulation says we have too many particles, skip all this return; @@ -835,7 +827,7 @@ void LLViewerPartSourceChat::update(const F32 dt) part->mScale.mV[1] = 0.25f; part->mParameter = ll_frand(F_TWO_PI); - gWorldPointer->mPartSim.addPart(part); + LLViewerPartSim::getInstance()->addPart(part); } } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 12d461d0d7..4b7c849171 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -179,7 +179,7 @@ LLViewerRegion::~LLViewerRegion() // This should be reference counted... disconnectAllNeighbors(); mCloudLayer.destroy(); - gWorldPointer->mPartSim.cleanupRegion(this); + LLViewerPartSim::getInstance()->cleanupRegion(this); gObjectList.killObjects(this); @@ -626,7 +626,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const if (y >= 256) { LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f); - LLViewerRegion *regionp = gWorldPointer->getRegionFromPosGlobal(center); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { // OK, we need to do some hackery here - different simulators no longer use @@ -653,7 +653,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const else { LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f); - LLViewerRegion *regionp = gWorldPointer->getRegionFromPosGlobal(center); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { // OK, we need to do some hackery here - different simulators no longer use @@ -681,7 +681,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const else if (y >= 256) { LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f); - LLViewerRegion *regionp = gWorldPointer->getRegionFromPosGlobal(center); + LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { // OK, we need to do some hackery here - different simulators no longer use @@ -868,9 +868,8 @@ public: const LLSD& context, const LLSD& input) const { - if(!gWorldp) return; LLHost host(input["sender"].asString()); - LLViewerRegion* region = gWorldp->getRegion(host); + LLViewerRegion* region = LLWorld::getInstance()->getRegion(host); if( !region ) { return; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 93919fba05..7c99d5f65c 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -59,7 +59,6 @@ #include "lllcd.h" #endif -LLViewerStats *gViewerStats = NULL; class StatAttributes { @@ -223,17 +222,17 @@ LLViewerStats::~LLViewerStats() void LLViewerStats::resetStats() { - gViewerStats->mKBitStat.reset(); - gViewerStats->mLayersKBitStat.reset(); - gViewerStats->mObjectKBitStat.reset(); - gViewerStats->mTextureKBitStat.reset(); - gViewerStats->mVFSPendingOperations.reset(); - gViewerStats->mAssetKBitStat.reset(); - gViewerStats->mPacketsInStat.reset(); - gViewerStats->mPacketsLostStat.reset(); - gViewerStats->mPacketsOutStat.reset(); - gViewerStats->mFPSStat.reset(); - gViewerStats->mTexturePacketsStat.reset(); + LLViewerStats::getInstance()->mKBitStat.reset(); + LLViewerStats::getInstance()->mLayersKBitStat.reset(); + LLViewerStats::getInstance()->mObjectKBitStat.reset(); + LLViewerStats::getInstance()->mTextureKBitStat.reset(); + LLViewerStats::getInstance()->mVFSPendingOperations.reset(); + LLViewerStats::getInstance()->mAssetKBitStat.reset(); + LLViewerStats::getInstance()->mPacketsInStat.reset(); + LLViewerStats::getInstance()->mPacketsLostStat.reset(); + LLViewerStats::getInstance()->mPacketsOutStat.reset(); + LLViewerStats::getInstance()->mFPSStat.reset(); + LLViewerStats::getInstance()->mTexturePacketsStat.reset(); } @@ -511,54 +510,54 @@ void update_statistics(U32 frame_count) { if (gAgent.getCameraMode() == CAMERA_MODE_MOUSELOOK) { - gViewerStats->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_MOUSELOOK_SECONDS, gFrameIntervalSeconds); } else if (gAgent.getCameraMode() == CAMERA_MODE_CUSTOMIZE_AVATAR) { - gViewerStats->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_AVATAR_EDIT_SECONDS, gFrameIntervalSeconds); } else if (gFloaterTools && gFloaterTools->getVisible()) { - gViewerStats->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TOOLBOX_SECONDS, gFrameIntervalSeconds); } } - gViewerStats->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - gViewerStats->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); - gViewerStats->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); - gViewerStats->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); #if 0 // 1.9.2 - gViewerStats->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); - gViewerStats->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); - gViewerStats->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_OBJECTS, (F64)gSavedSettings.getS32("VertexShaderLevelObject")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_AVATAR, (F64)gSavedSettings.getBOOL("VertexShaderLevelAvatar")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_SHADER_ENVIRONMENT, (F64)gSavedSettings.getBOOL("VertexShaderLevelEnvironment")); #endif - gViewerStats->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME)); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_FRAME_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_FRAME)); F64 idle_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IDLE); F64 network_secs = gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_NETWORK); - gViewerStats->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); - gViewerStats->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); - gViewerStats->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE)); - gViewerStats->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_STATESORT )); - gViewerStats->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY)); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_UPDATE_SECS, idle_secs - network_secs); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_NETWORK_SECS, network_secs); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_IMAGE_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_IMAGE_UPDATE)); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_REBUILD_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_STATESORT )); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_RENDER_SECS, gDebugView->mFastTimerView->getTime(LLFastTimer::FTM_RENDER_GEOMETRY)); LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - gViewerStats->mSimPingStat.addValue(cdp->getPingDelay()); + LLViewerStats::getInstance()->mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - gViewerStats->mSimPingStat.addValue(10000); + LLViewerStats::getInstance()->mSimPingStat.addValue(10000); } - gViewerStats->mFPSStat.addValue(1); + LLViewerStats::getInstance()->mFPSStat.addValue(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - gViewerStats->mLayersKBitStat.addValue(layer_bits/1024.f); - gViewerStats->mObjectKBitStat.addValue(gObjectBits/1024.f); - gViewerStats->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f); - gViewerStats->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); - gViewerStats->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); + LLViewerStats::getInstance()->mLayersKBitStat.addValue(layer_bits/1024.f); + LLViewerStats::getInstance()->mObjectKBitStat.addValue(gObjectBits/1024.f); + LLViewerStats::getInstance()->mTextureKBitStat.addValue(LLViewerImageList::sTextureBits/1024.f); + LLViewerStats::getInstance()->mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); + LLViewerStats::getInstance()->mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); static S32 tex_bits_idle_count = 0; @@ -573,7 +572,7 @@ void update_statistics(U32 frame_count) gDebugTimers[0].unpause(); } - gViewerStats->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); + LLViewerStats::getInstance()->mTexturePacketsStat.addValue(LLViewerImageList::sTexturePackets); { static F32 visible_avatar_frames = 0.f; @@ -584,10 +583,10 @@ void update_statistics(U32 frame_count) visible_avatar_frames = 1.f; avg_visible_avatars = (avg_visible_avatars * (F32)(visible_avatar_frames - 1.f) + visible_avatars) / visible_avatar_frames; } - gViewerStats->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_VISIBLE_AVATARS, (F64)avg_visible_avatars); } - gWorldp->updateNetStats(); - gWorldp->requestCacheMisses(); + LLWorld::getInstance()->updateNetStats(); + LLWorld::getInstance()->requestCacheMisses(); // Reset all of these values. gVLManager.resetBitCounts(); @@ -599,9 +598,9 @@ void update_statistics(U32 frame_count) #if LL_WINDOWS && LL_LCD_COMPILE bool LCDenabled = gLcdScreen->Enabled(); - gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, LCDenabled); #else - gViewerStats->setStat(LLViewerStats::ST_LOGITECH_LCD, false); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LOGITECH_LCD, false); #endif } @@ -704,11 +703,11 @@ void send_stats() std::string gpu_desc = llformat( "%-6s Class %d ", gGLManager.mGLVendorShort.substr(0,6).c_str(), - (S32)gFeatureManagerp->getGPUClass()) - + gFeatureManagerp->getGPUString(); + (S32)LLFeatureManager::getInstance()->getGPUClass()) + + LLFeatureManager::getInstance()->getGPUString(); system["gpu"] = gpu_desc; - system["gpu_class"] = (S32)gFeatureManagerp->getGPUClass(); + system["gpu_class"] = (S32)LLFeatureManager::getInstance()->getGPUClass(); system["gpu_vendor"] = gGLManager.mGLVendorShort; system["gpu_version"] = gGLManager.mDriverVersionVendorString; @@ -754,7 +753,7 @@ void send_stats() misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6 misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6 - gViewerStats->addToMessage(body); + LLViewerStats::getInstance()->addToMessage(body); LLHTTPClient::post(url, body, new ViewerStatsResponder()); } diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 277bf44e48..819438832d 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -34,7 +34,7 @@ #include "llstat.h" -class LLViewerStats +class LLViewerStats : public LLSingleton<LLViewerStats> { public: LLStat mKBitStat; @@ -185,8 +185,6 @@ private: F64 mLastTimeDiff; // used for time stat updates }; -extern LLViewerStats *gViewerStats; - static const F32 SEND_STATS_PERIOD = 300.0f; // The following are from (older?) statistics code found in appviewer. diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 8c8d1fff67..17b79fecdf 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -54,13 +54,15 @@ #include "llviewerimagelist.h" #include "llviewerwindow.h" #include "llviewerinventory.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llnotecard.h" #include "llmemorystream.h" #include "llmenugl.h" #include "llappviewer.h" // for gPacificDaylightTime +static LLRegisterWidget<LLViewerTextEditor> r("text_editor"); + ///---------------------------------------------------------------------------- /// Class LLEmbeddedNotecardOpener ///---------------------------------------------------------------------------- @@ -424,15 +426,15 @@ void LLEmbeddedItems::bindEmbeddedChars( LLFontGL* font ) const break; case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break; case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break; - case LLAssetType::AT_BODYPART: img_name = "inv_item_bodypart.tga"; break; + case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break; case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break; case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break; default: llassert(0); continue; } - LLViewerImage* image = gImageList.getImage(LLUUID(gViewerArt.getString(img_name)), MIPMAP_FALSE, TRUE); + LLUIImagePtr image = LLUI::getUIImage(img_name); - font->addEmbeddedChar( wch, image, item->getName() ); + font->addEmbeddedChar( wch, image->getImage(), item->getName() ); } } @@ -575,7 +577,8 @@ LLViewerTextEditor::LLViewerTextEditor(const LLString& name, // *TODO: Add right click menus for SLURLs // Build the right click menu // make the popup menu available - //LLMenuGL* menu = gUICtrlFactory->buildMenu("menu_slurl.xml", this); + + //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_slurl.xml", this); //if (!menu) //{ // menu = new LLMenuGL(""); @@ -694,7 +697,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) S32 screen_x; S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y ); - gToolDragAndDrop->setDragStart( screen_x, screen_y ); + LLToolDragAndDrop::getInstance()->setDragStart( screen_x, screen_y ); start_select = FALSE; } @@ -779,108 +782,105 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) // leave hover segment active during drag and drop mHoverSegment = NULL; } - if( getVisible() ) + if(hasMouseCapture() ) { - if(hasMouseCapture() ) + if( mIsSelecting ) { - if( mIsSelecting ) + if (x != mLastSelectionX || y != mLastSelectionY) { - if (x != mLastSelectionX || y != mLastSelectionY) - { - mLastSelectionX = x; - mLastSelectionY = y; - } - - if( y > getTextRect().mTop ) - { - mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); - } - else - if( y < getTextRect().mBottom ) - { - mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); - } + mLastSelectionX = x; + mLastSelectionY = y; + } - setCursorAtLocalPos( x, y, TRUE ); - mSelectionEnd = mCursorPos; - - updateScrollFromCursor(); - getWindow()->setCursor(UI_CURSOR_IBEAM); + if( y > getTextRect().mTop ) + { + mScrollbar->setDocPos( mScrollbar->getDocPos() - 1 ); } - else if( mDragItem ) + else + if( y < getTextRect().mBottom ) { - S32 screen_x; - S32 screen_y; - localPointToScreen(x, y, &screen_x, &screen_y ); - if( gToolDragAndDrop->isOverThreshold( screen_x, screen_y ) ) - { - gToolDragAndDrop->beginDrag( - LLAssetType::lookupDragAndDropType( mDragItem->getType() ), - mDragItem->getUUID(), - LLToolDragAndDrop::SOURCE_NOTECARD, - getSourceID(), mObjectID); - - return gToolDragAndDrop->handleHover( x, y, mask ); - } - getWindow()->setCursor(UI_CURSOR_HAND); + mScrollbar->setDocPos( mScrollbar->getDocPos() + 1 ); } - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; - handled = TRUE; - } - - if( !handled ) - { - // Pass to children - handled = LLView::childrenHandleHover(x, y, mask) != NULL; - } - - if( handled ) - { - // Delay cursor flashing - resetKeystrokeTimer(); + setCursorAtLocalPos( x, y, TRUE ); + mSelectionEnd = mCursorPos; + + updateScrollFromCursor(); + getWindow()->setCursor(UI_CURSOR_IBEAM); } - - // Opaque - if( !handled && mTakesNonScrollClicks) + else if( mDragItem ) { - // Check to see if we're over an HTML-style link - if( !mSegments.empty() ) + S32 screen_x; + S32 screen_y; + localPointToScreen(x, y, &screen_x, &screen_y ); + if( LLToolDragAndDrop::getInstance()->isOverThreshold( screen_x, screen_y ) ) { - const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); - if( cur_segment ) - { - if(cur_segment->getStyle().isLink()) - { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; - getWindow()->setCursor(UI_CURSOR_HAND); - handled = TRUE; - } - else - if(cur_segment->getStyle().getIsEmbeddedItem()) - { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; - getWindow()->setCursor(UI_CURSOR_HAND); - //getWindow()->setCursor(UI_CURSOR_ARROW); - handled = TRUE; - } - mHoverSegment = cur_segment; - } + LLToolDragAndDrop::getInstance()->beginDrag( + LLAssetType::lookupDragAndDropType( mDragItem->getType() ), + mDragItem->getUUID(), + LLToolDragAndDrop::SOURCE_NOTECARD, + getSourceID(), mObjectID); + + return LLToolDragAndDrop::getInstance()->handleHover( x, y, mask ); } + getWindow()->setCursor(UI_CURSOR_HAND); + } + + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; + handled = TRUE; + } + + if( !handled ) + { + // Pass to children + handled = LLView::childrenHandleHover(x, y, mask) != NULL; + } + + if( handled ) + { + // Delay cursor flashing + resetKeystrokeTimer(); + } - if( !handled ) + // Opaque + if( !handled && mTakesNonScrollClicks) + { + // Check to see if we're over an HTML-style link + if( !mSegments.empty() ) + { + const LLTextSegment* cur_segment = getSegmentAtLocalPos( x, y ); + if( cur_segment ) { - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; - if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) + if(cur_segment->getStyle().isLink()) { - getWindow()->setCursor(UI_CURSOR_IBEAM); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over link, inactive)" << llendl; + getWindow()->setCursor(UI_CURSOR_HAND); + handled = TRUE; } else + if(cur_segment->getStyle().getIsEmbeddedItem()) { - getWindow()->setCursor(UI_CURSOR_ARROW); + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (over embedded item, inactive)" << llendl; + getWindow()->setCursor(UI_CURSOR_HAND); + //getWindow()->setCursor(UI_CURSOR_ARROW); + handled = TRUE; } - handled = TRUE; + mHoverSegment = cur_segment; + } + } + + if( !handled ) + { + lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (inactive)" << llendl; + if (!mScrollbar->getVisible() || x < getRect().getWidth() - SCROLLBAR_SIZE) + { + getWindow()->setCursor(UI_CURSOR_IBEAM); } + else + { + getWindow()->setCursor(UI_CURSOR_ARROW); + } + handled = TRUE; } } diff --git a/indra/newview/llviewerthrottle.cpp b/indra/newview/llviewerthrottle.cpp index d427cd6ede..9a9fcdd9ac 100644 --- a/indra/newview/llviewerthrottle.cpp +++ b/indra/newview/llviewerthrottle.cpp @@ -307,7 +307,7 @@ void LLViewerThrottle::updateDynamicThrottle() } mUpdateTimer.reset(); - if (gViewerStats->mPacketsLostPercentStat.getMean() > TIGHTEN_THROTTLE_THRESHOLD) + if (LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean() > TIGHTEN_THROTTLE_THRESHOLD) { if (mThrottleFrac <= MIN_FRACTIONAL || mCurrentBandwidth / 1024.0f <= MIN_BANDWIDTH) { @@ -320,7 +320,7 @@ void LLViewerThrottle::updateDynamicThrottle() mCurrent.sendToSim(); llinfos << "Tightening network throttle to " << mCurrentBandwidth << llendl; } - else if (gViewerStats->mPacketsLostPercentStat.getMean() <= EASE_THROTTLE_THRESHOLD) + else if (LLViewerStats::getInstance()->mPacketsLostPercentStat.getMean() <= EASE_THROTTLE_THRESHOLD) { if (mThrottleFrac >= MAX_FRACTIONAL || mCurrentBandwidth / 1024.0f >= MAX_BANDWIDTH) { diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index d48e3cc4f3..afd1e48921 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -102,7 +102,6 @@ #include "llfloaterland.h" #include "llfloaterinspect.h" #include "llfloatermap.h" -#include "llfloatermute.h" #include "llfloaternamedesc.h" #include "llfloaterpreference.h" #include "llfloatersnapshot.h" @@ -155,10 +154,9 @@ #include "lltoolmorph.h" #include "lltoolpie.h" #include "lltoolplacer.h" -#include "lltoolselect.h" #include "lltoolselectland.h" #include "lltoolview.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "lluploaddialog.h" #include "llurldispatcher.h" // SLURL from other app instance #include "llvieweraudio.h" @@ -262,7 +260,6 @@ const S32 PICK_DIAMETER = 2 * PICK_HALF_WIDTH+1; const F32 MIN_DISPLAY_SCALE = 0.85f; const S32 CONSOLE_BOTTOM_PAD = 40; - #ifdef SABINRIG /// ALL RIG STUFF bool rigControl = false; @@ -480,7 +477,7 @@ public: camera_center_text = llformat("CameraCenter %f %f %f", (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); - tvector = LLVector4(gCamera->getAtAxis()); + tvector = LLVector4(LLViewerCamera::getInstance()->getAtAxis()); camera_view_text = llformat("CameraAtAxis %f %f %f", (F32)(tvector.mdV[VX]), (F32)(tvector.mdV[VY]), (F32)(tvector.mdV[VZ])); @@ -514,7 +511,7 @@ public: } if (gDisplayFOV) { - addText(xpos, ypos, llformat("FOV: %2.1f deg", RAD_TO_DEG * gCamera->getView())); + addText(xpos, ypos, llformat("FOV: %2.1f deg", RAD_TO_DEG * LLViewerCamera::getInstance()->getView())); ypos += y_inc; } if (gSavedSettings.getBOOL("DebugShowRenderInfo")) @@ -692,13 +689,10 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask gHoverView->cancelHover(); } - if (gToolMgr) + // Don't let the user move the mouse out of the window until mouse up. + if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) { - // Don't let the user move the mouse out of the window until mouse up. - if( gToolMgr->getCurrentTool()->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(TRUE); - } + mWindow->setMouseClipping(TRUE); } LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); @@ -750,16 +744,13 @@ BOOL LLViewerWindow::handleMouseDown(LLWindow *window, LLCoordGL pos, MASK mask return FALSE; } - if (gToolMgr) + if(LLToolMgr::getInstance()->getCurrentTool()->handleMouseDown( x, y, mask ) ) { - if(gToolMgr->getCurrentTool()->handleMouseDown( x, y, mask ) ) - { - // This is necessary to force clicks in the world to cause edit - // boxes that might have keyboard focus to relinquish it, and hence - // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); - return TRUE; - } + // This is necessary to force clicks in the world to cause edit + // boxes that might have keyboard focus to relinquish it, and hence + // cause a commit to update their value. JC + gFocusMgr.setKeyboardFocus(NULL); + return TRUE; } return FALSE; @@ -836,12 +827,9 @@ BOOL LLViewerWindow::handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK ma return TRUE; } - if (gToolMgr) + if(LLToolMgr::getInstance()->getCurrentTool()->handleDoubleClick( x, y, mask ) ) { - if(gToolMgr->getCurrentTool()->handleDoubleClick( x, y, mask ) ) - { - return TRUE; - } + return TRUE; } // if we got this far and nothing handled a double click, pass a normal mouse down @@ -880,15 +868,11 @@ BOOL LLViewerWindow::handleMouseUp(LLWindow *window, LLCoordGL pos, MASK mask) mWindow->releaseMouse(); - LLTool *tool = NULL; - if (gToolMgr) - { - tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if( tool->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(FALSE); - } + if( tool->clipMouseWhenDown() ) + { + mWindow->setMouseClipping(FALSE); } LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); @@ -980,13 +964,10 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK gHoverView->cancelHover(); } - if (gToolMgr) + // Don't let the user move the mouse out of the window until mouse up. + if( LLToolMgr::getInstance()->getCurrentTool()->clipMouseWhenDown() ) { - // Don't let the user move the mouse out of the window until mouse up. - if( gToolMgr->getCurrentTool()->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(TRUE); - } + mWindow->setMouseClipping(TRUE); } LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); @@ -1030,26 +1011,23 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK llinfos << "Right Mouse Down not handled by view" << llendl; } - if (gToolMgr) + if(LLToolMgr::getInstance()->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) { - if(gToolMgr->getCurrentTool()->handleRightMouseDown( x, y, mask ) ) - { - // This is necessary to force clicks in the world to cause edit - // boxes that might have keyboard focus to relinquish it, and hence - // cause a commit to update their value. JC - gFocusMgr.setKeyboardFocus(NULL); - return TRUE; - } + // This is necessary to force clicks in the world to cause edit + // boxes that might have keyboard focus to relinquish it, and hence + // cause a commit to update their value. JC + gFocusMgr.setKeyboardFocus(NULL); + return TRUE; } // *HACK: this should be rolled into the composite tool logic, not // hardcoded at the top level. - if (gToolPie && (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode()) ) + if (CAMERA_MODE_CUSTOMIZE_AVATAR != gAgent.getCameraMode()) { // If the current tool didn't process the click, we should show // the pie menu. This can be done by passing the event to the pie // menu tool. - gToolPie->handleRightMouseDown(x, y, mask); + LLToolPie::getInstance()->handleRightMouseDown(x, y, mask); // show_context_menu( x, y, mask ); } @@ -1089,15 +1067,11 @@ BOOL LLViewerWindow::handleRightMouseUp(LLWindow *window, LLCoordGL pos, MASK m mWindow->releaseMouse(); - LLTool *tool = NULL; - if (gToolMgr) - { - tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - if( tool->clipMouseWhenDown() ) - { - mWindow->setMouseClipping(FALSE); - } + if( tool->clipMouseWhenDown() ) + { + mWindow->setMouseClipping(FALSE); } LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); @@ -1246,10 +1220,7 @@ void LLViewerWindow::handleFocus(LLWindow *window) LLModalDialog::onAppFocusGained(); gAgent.onAppFocusGained(); - if (gToolMgr) - { - gToolMgr->onAppFocusGained(); - } + LLToolMgr::getInstance()->onAppFocusGained(); gShowTextEditCursor = TRUE; @@ -1269,10 +1240,7 @@ void LLViewerWindow::handleFocusLost(LLWindow *window) { gFocusMgr.setAppHasFocus(FALSE); //LLModalDialog::onAppFocusLost(); - if( gToolMgr ) - { - gToolMgr->onAppFocusLost(); - } + LLToolMgr::getInstance()->onAppFocusLost(); gFocusMgr.setMouseCapture( NULL ); if (gMenuBarView) @@ -1428,9 +1396,9 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S char temp_str[255]; /* Flawfinder: ignore */ snprintf(temp_str, sizeof(temp_str), "%s FPS %3.1f Phy FPS %2.1f Time Dil %1.3f", /* Flawfinder: ignore */ name_str.c_str(), - gViewerStats->mFPSStat.getMeanPerSec(), - gViewerStats->mSimPhysicsFPS.getPrev(0), - gViewerStats->mSimTimeDilation.getPrev(0)); + LLViewerStats::getInstance()->mFPSStat.getMeanPerSec(), + LLViewerStats::getInstance()->mSimPhysicsFPS.getPrev(0), + LLViewerStats::getInstance()->mSimTimeDilation.getPrev(0)); len = strlen(temp_str); /* Flawfinder: ignore */ TextOutA(hdc, 0, 0, temp_str, len); @@ -1567,21 +1535,21 @@ LLViewerWindow::LLViewerWindow( // llinfos << "Loading feature tables." << llendl; - gFeatureManagerp->init(); + LLFeatureManager::getInstance()->init(); // Initialize OpenGL Renderer - if (!gFeatureManagerp->isFeatureAvailable("RenderVBOEnable") || + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || !gGLManager.mHasVertexBufferObject) { gSavedSettings.setBOOL("RenderVBOEnable", FALSE); } LLVertexBuffer::initClass(gSavedSettings.getBOOL("RenderVBOEnable")); - if (gFeatureManagerp->isSafe() - || (gSavedSettings.getS32("LastFeatureVersion") != gFeatureManagerp->getVersion()) + if (LLFeatureManager::getInstance()->isSafe() + || (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion()) || (gSavedSettings.getBOOL("ProbeHardwareOnStartup"))) { - gFeatureManagerp->applyRecommendedSettings(); + LLFeatureManager::getInstance()->applyRecommendedSettings(); gSavedSettings.setBOOL("ProbeHardwareOnStartup", FALSE); } @@ -1589,7 +1557,7 @@ LLViewerWindow::LLViewerWindow( if (gSavedSettings.getBOOL("RenderInitError")) { mInitAlert = "DisplaySettingsNoShaders"; - gFeatureManagerp->setGraphicsLevel(0, false); + LLFeatureManager::getInstance()->setGraphicsLevel(0, false); gSavedSettings.setU32("RenderQualityPerformance", 0); } @@ -1612,9 +1580,6 @@ LLViewerWindow::LLViewerWindow( initFonts(); } - // Init Resource Manager - gResMgr = new LLResMgr(); - // Make avatar head look forward at start mCurrentMousePoint.mX = getWindowWidth() / 2; mCurrentMousePoint.mY = getWindowHeight() / 2; @@ -1918,7 +1883,7 @@ void LLViewerWindow::initWorldUI() mRootView->addChild(gMorphView); gMorphView->setVisible(FALSE); - gFloaterMute = LLFloaterMute::getInstance(); + // *Note: this is where gFloaterMute used to be initialized. LLWorldMapView::initClass(); @@ -1985,8 +1950,6 @@ LLViewerWindow::~LLViewerWindow() gFloaterView = NULL; gMorphView = NULL; - gFloaterMute = NULL; - gFloaterMap = NULL; gHUDView = NULL; @@ -1994,9 +1957,6 @@ LLViewerWindow::~LLViewerWindow() delete mToolTip; mToolTip = NULL; - - delete gResMgr; - gResMgr = NULL; //-------------------------------------------------------- // Shutdown GL cleanly. Order is very important here. @@ -2025,11 +1985,8 @@ LLViewerWindow::~LLViewerWindow() delete[] mPickBuffer; mPickBuffer = NULL; - if (gSelectMgr) - { - llinfos << "Cleaning up select manager" << llendl; - gSelectMgr->cleanup(); - } + llinfos << "Cleaning up select manager" << llendl; + LLSelectMgr::getInstance()->cleanup(); LLVertexBuffer::cleanupClass(); @@ -2103,17 +2060,17 @@ void LLViewerWindow::reshape(S32 width, S32 height) glViewport(0, 0, width, height ); - if (height > 0 && gCamera) + if (height > 0) { - gCamera->setViewHeightInPixels( height ); + LLViewerCamera::getInstance()->setViewHeightInPixels( height ); if (mWindow->getFullscreen()) { // force to 4:3 aspect for odd resolutions - gCamera->setAspect( getDisplayAspectRatio() ); + LLViewerCamera::getInstance()->setAspect( getDisplayAspectRatio() ); } else { - gCamera->setAspect( width / (F32) height); + LLViewerCamera::getInstance()->setAspect( width / (F32) height); } } @@ -2170,8 +2127,8 @@ void LLViewerWindow::reshape(S32 width, S32 height) } } - gViewerStats->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); - gViewerStats->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_WIDTH, (F64)width); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_WINDOW_HEIGHT, (F64)height); gResizeScreenTexture = TRUE; } } @@ -2282,7 +2239,7 @@ void LLViewerWindow::draw() glLoadIdentity(); microsecondsToTimecodeString(gFrameTime,text); - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); font->renderUTF8(text, 0, llround((getWindowWidth()/2)-100.f), llround((getWindowHeight()-60.f)), @@ -2299,30 +2256,24 @@ void LLViewerWindow::draw() glScalef(mDisplayScale.mV[VX], mDisplayScale.mV[VY], 1.f); LLVector2 old_scale_factor = LLUI::sGLScaleFactor; - if (gCamera) + // apply camera zoom transform (for high res screenshots) + F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor(); + S16 sub_region = LLViewerCamera::getInstance()->getZoomSubRegion(); + if (zoom_factor > 1.f) { - // apply camera zoom transform (for high res screenshots) - F32 zoom_factor = gCamera->getZoomFactor(); - S16 sub_region = gCamera->getZoomSubRegion(); - if (zoom_factor > 1.f) - { - //decompose subregion number to x and y values - int pos_y = sub_region / llceil(zoom_factor); - int pos_x = sub_region - (pos_y*llceil(zoom_factor)); - // offset for this tile - glTranslatef((F32)gViewerWindow->getWindowWidth() * -(F32)pos_x, - (F32)gViewerWindow->getWindowHeight() * -(F32)pos_y, - 0.f); - glScalef(zoom_factor, zoom_factor, 1.f); - LLUI::sGLScaleFactor *= zoom_factor; - } + //decompose subregion number to x and y values + int pos_y = sub_region / llceil(zoom_factor); + int pos_x = sub_region - (pos_y*llceil(zoom_factor)); + // offset for this tile + glTranslatef((F32)gViewerWindow->getWindowWidth() * -(F32)pos_x, + (F32)gViewerWindow->getWindowHeight() * -(F32)pos_y, + 0.f); + glScalef(zoom_factor, zoom_factor, 1.f); + LLUI::sGLScaleFactor *= zoom_factor; } - if (gToolMgr) - { - // Draw tool specific overlay on world - gToolMgr->getCurrentTool()->draw(); - } + // Draw tool specific overlay on world + LLToolMgr::getInstance()->getCurrentTool()->draw(); if( gAgent.cameraMouselook() ) { @@ -2398,7 +2349,9 @@ void LLViewerWindow::draw() // Takes a single keydown event, usually when UI is visible BOOL LLViewerWindow::handleKey(KEY key, MASK mask) { - if (gFocusMgr.getKeyboardFocus() && !(mask & (MASK_CONTROL | MASK_ALT))) + if (gFocusMgr.getKeyboardFocus() + && !(mask & (MASK_CONTROL | MASK_ALT)) + && !gFocusMgr.getKeystrokesOnly()) { // We have keyboard focus, and it's not an accelerator @@ -2412,7 +2365,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // HACK look for UI editing keys if (LLView::sEditingUI) { - if (LLFloaterEditUI::handleKey(key, mask)) + if (LLFloaterEditUI::processKeystroke(key, mask)) { return TRUE; } @@ -2544,12 +2497,9 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) } } - if (gToolMgr) + if( LLToolMgr::getInstance()->getCurrentTool()->handleKey(key, mask) ) { - if( gToolMgr->getCurrentTool()->handleKey(key, mask) ) - { - return TRUE; - } + return TRUE; } // Try for a new-format gesture @@ -2567,14 +2517,14 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask) // Topmost view gets a chance before the hierarchy // *FIX: get rid of this? - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl) - { - if( top_ctrl->handleKey( key, mask, TRUE ) ) - { - return TRUE; - } - } + //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + //if (top_ctrl) + //{ + // if( top_ctrl->handleKey( key, mask, TRUE ) ) + // { + // return TRUE; + // } + //} // give floaters first chance to handle TAB key // so frontmost floater gets focus @@ -2648,12 +2598,12 @@ BOOL LLViewerWindow::handleUnicodeChar(llwchar uni_char, MASK mask) return TRUE; } - // Topmost view gets a chance before the hierarchy - LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); - if (top_ctrl && top_ctrl->handleUnicodeChar( uni_char, FALSE ) ) - { - return TRUE; - } + //// Topmost view gets a chance before the hierarchy + //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); + //if (top_ctrl && top_ctrl->handleUnicodeChar( uni_char, FALSE ) ) + //{ + // return TRUE; + //} return TRUE; } @@ -2710,11 +2660,8 @@ void LLViewerWindow::handleScrollWheel(S32 clicks) llinfos << "Scroll Wheel not handled by view" << llendl; } - if (gWorldPointer) - { - // Zoom the camera in and out behavior - gAgent.handleScrollWheel(clicks); - } + // Zoom the camera in and out behavior + gAgent.handleScrollWheel(clicks); return; } @@ -2901,9 +2848,9 @@ BOOL LLViewerWindow::handlePerFrameHover() // *NOTE: sometimes tools handle the mouse as a captor, so this // logic is a little confusing LLTool *tool = NULL; - if (gToolMgr && gHoverView && gCamera) + if (gHoverView) { - tool = gToolMgr->getCurrentTool(); + tool = LLToolMgr::getInstance()->getCurrentTool(); if(!handled && tool) { @@ -2923,8 +2870,8 @@ BOOL LLViewerWindow::handlePerFrameHover() // Suppress the toolbox view if our source tool was the pie tool, // and we've overridden to something else. mSuppressToolbox = - (gToolMgr->getBaseTool() == gToolPie) && - (gToolMgr->getCurrentTool() != gToolPie); + (LLToolMgr::getInstance()->getBaseTool() == LLToolPie::getInstance()) && + (LLToolMgr::getInstance()->getCurrentTool() != LLToolPie::getInstance()); } @@ -2975,19 +2922,19 @@ BOOL LLViewerWindow::handlePerFrameHover() } } - if (tool && tool != gToolNull && tool != gToolInspect && tool != gToolDragAndDrop && !gSavedSettings.getBOOL("FreezeTime")) + if (tool && tool != gToolNull && tool != LLToolCompInspect::getInstance() && tool != LLToolDragAndDrop::getInstance() && !gSavedSettings.getBOOL("FreezeTime")) { LLMouseHandler *captor = gFocusMgr.getMouseCapture(); // With the null, inspect, or drag and drop tool, don't muck // with visibility. if (gFloaterTools->isMinimized() || - (tool != gToolPie // not default tool - && tool != gToolGun // not coming out of mouselook - && !mSuppressToolbox // not override in third person - && gToolMgr->getCurrentToolset() != gFaceEditToolset // not special mode - && gToolMgr->getCurrentToolset() != gMouselookToolset - && (!captor || captor->isView())) // not dragging + (tool != LLToolPie::getInstance() // not default tool + && tool != LLToolCompGun::getInstance() // not coming out of mouselook + && !mSuppressToolbox // not override in third person + && LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset // not special mode + && LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset + && (!captor || captor->isView())) // not dragging ) { // Force floater tools to be visible (unless minimized) @@ -3046,7 +2993,7 @@ BOOL LLViewerWindow::handlePerFrameHover() // snap floaters to top of chat bar/button strip LLView* chatbar_and_buttons = gOverlayBar->getChild<LLView>("chatbar_and_buttons", TRUE); - // find top of chatbar and strate buttons, if either are visible + // find top of chatbar and state buttons, if either are visible if (chatbar_and_buttons && !chatbar_and_buttons->getLocalBoundingRect().isNull()) { // convert top/left corner of chatbar/buttons container to gFloaterView-relative coordinates @@ -3085,9 +3032,9 @@ BOOL LLViewerWindow::handlePerFrameHover() mLastMousePoint = mCurrentMousePoint; // last ditch force of edit menu to selection manager - if (LLEditMenuHandler::gEditMenuHandler == NULL && gSelectMgr && gSelectMgr->getSelection()->getObjectCount()) + if (LLEditMenuHandler::gEditMenuHandler == NULL && LLSelectMgr::getInstance()->getSelection()->getObjectCount()) { - LLEditMenuHandler::gEditMenuHandler = gSelectMgr; + LLEditMenuHandler::gEditMenuHandler = LLSelectMgr::getInstance(); } if (gFloaterView->getCycleMode()) @@ -3116,20 +3063,23 @@ BOOL LLViewerWindow::handlePerFrameHover() gFloaterView->syncFloaterTabOrder(); } - if (gSavedSettings.getBOOL("ChatBarStealsFocus") && gChatBar && gFocusMgr.getKeyboardFocus() == NULL && gChatBar->getVisible()) + if (gSavedSettings.getBOOL("ChatBarStealsFocus") + && gChatBar + && gFocusMgr.getKeyboardFocus() == NULL + && gChatBar->isInVisibleChain()) { gChatBar->startChat(NULL); } // cleanup unused selections when no modal dialogs are open - if (gParcelMgr && LLModalDialog::activeCount() == 0) + if (LLModalDialog::activeCount() == 0) { - gParcelMgr->deselectUnused(); + LLViewerParcelMgr::getInstance()->deselectUnused(); } - if (gSelectMgr && LLModalDialog::activeCount() == 0) + if (LLModalDialog::activeCount() == 0) { - gSelectMgr->deselectUnused(); + LLSelectMgr::getInstance()->deselectUnused(); } return handled; @@ -3176,12 +3126,12 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) // render_hud_elements: FALSE, FALSE, FALSE void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL for_hud ) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (!for_hud && !for_gl_pick) { // Call this once and only once - gSelectMgr->updateSilhouettes(); + LLSelectMgr::getInstance()->updateSilhouettes(); } // Draw fence around land selections @@ -3189,18 +3139,18 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, { if (pick_parcel_walls) { - gParcelMgr->renderParcelCollision(); + LLViewerParcelMgr::getInstance()->renderParcelCollision(); } } else if (( for_hud && selection->getSelectType() == SELECT_TYPE_HUD) || (!for_hud && selection->getSelectType() != SELECT_TYPE_HUD)) { - gSelectMgr->renderSilhouettes(for_hud); + LLSelectMgr::getInstance()->renderSilhouettes(for_hud); stop_glerror(); // setup HUD render - if (selection->getSelectType() == SELECT_TYPE_HUD && gSelectMgr->getSelection()->getObjectCount()) + if (selection->getSelectType() == SELECT_TYPE_HUD && LLSelectMgr::getInstance()->getSelection()->getObjectCount()) { LLBBox hud_bbox = gAgent.getAvatarObject()->getHUDBBox(); @@ -3209,7 +3159,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, glPushMatrix(); glLoadIdentity(); F32 depth = llmax(1.f, hud_bbox.getExtentLocal().mV[VX] * 1.1f); - glOrtho(-0.5f * gCamera->getAspect(), 0.5f * gCamera->getAspect(), -0.5f, 0.5f, 0.f, depth); + glOrtho(-0.5f * LLViewerCamera::getInstance()->getAspect(), 0.5f * LLViewerCamera::getInstance()->getAspect(), -0.5f, 0.5f, 0.f, depth); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -3219,7 +3169,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, } // Render light for editing - if (LLSelectMgr::sRenderLightRadius && gToolMgr->inEdit()) + if (LLSelectMgr::sRenderLightRadius && LLToolMgr::getInstance()->inEdit()) { LLImageGL::unbindTexture(0); LLGLEnable gls_blend(GL_BLEND); @@ -3265,7 +3215,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, return true; } } func; - gSelectMgr->getSelection()->applyToObjects(&func); + LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func); glPopMatrix(); } @@ -3274,7 +3224,7 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, // not be recalculated at this time. If they are, then group rotations will break. // Draw arrows at average center of all selected objects - LLTool* tool = gToolMgr->getCurrentTool(); + LLTool* tool = LLToolMgr::getInstance()->getCurrentTool(); if (tool) { if(tool->isAlwaysRendered()) @@ -3283,15 +3233,15 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, } else { - if( !gSelectMgr->getSelection()->isEmpty() ) + if( !LLSelectMgr::getInstance()->getSelection()->isEmpty() ) { BOOL moveable_object_selected = FALSE; BOOL all_selected_objects_move = TRUE; BOOL all_selected_objects_modify = TRUE; BOOL selecting_linked_set = !gSavedSettings.getBOOL("EditLinkedParts"); - for (LLObjectSelection::iterator iter = gSelectMgr->getSelection()->begin(); - iter != gSelectMgr->getSelection()->end(); iter++) + for (LLObjectSelection::iterator iter = LLSelectMgr::getInstance()->getSelection()->begin(); + iter != LLSelectMgr::getInstance()->getSelection()->end(); iter++) { LLSelectNode* nodep = *iter; LLViewerObject* object = nodep->getObject(); @@ -3307,17 +3257,17 @@ void LLViewerWindow::renderSelections( BOOL for_gl_pick, BOOL pick_parcel_walls, BOOL draw_handles = TRUE; - if (tool == gToolTranslate && (!moveable_object_selected || !all_selected_objects_move)) + if (tool == LLToolCompTranslate::getInstance() && (!moveable_object_selected || !all_selected_objects_move)) { draw_handles = FALSE; } - if (tool == gToolRotate && (!moveable_object_selected || !all_selected_objects_move)) + if (tool == LLToolCompRotate::getInstance() && (!moveable_object_selected || !all_selected_objects_move)) { draw_handles = FALSE; } - if ( !all_selected_objects_modify && tool == gToolStretch ) + if ( !all_selected_objects_modify && tool == LLToolCompScale::getInstance() ) { draw_handles = FALSE; } @@ -3421,13 +3371,13 @@ void LLViewerWindow::hitObjectOrLandGlobalAsync(S32 x, S32 y_from_bot, MASK mask gLastHitParcelWall = FALSE; LLCamera pick_camera; - pick_camera.setOrigin(gCamera->getOrigin()); - pick_camera.setOriginAndLookAt(gCamera->getOrigin(), - gCamera->getUpAxis(), - gCamera->getOrigin() + mouseDirectionGlobal(x, y_from_bot)); + pick_camera.setOrigin(LLViewerCamera::getInstance()->getOrigin()); + pick_camera.setOriginAndLookAt(LLViewerCamera::getInstance()->getOrigin(), + LLViewerCamera::getInstance()->getUpAxis(), + LLViewerCamera::getInstance()->getOrigin() + mouseDirectionGlobal(x, y_from_bot)); pick_camera.setView(0.5f*DEG_TO_RAD); - pick_camera.setNear(gCamera->getNear()); - pick_camera.setFar(gCamera->getFar()); + pick_camera.setNear(LLViewerCamera::getInstance()->getNear()); + pick_camera.setFar(LLViewerCamera::getInstance()->getFar()); pick_camera.setAspect(1.f); // save our drawing state @@ -3444,8 +3394,7 @@ void LLViewerWindow::hitObjectOrLandGlobalAsync(S32 x, S32 y_from_bot, MASK mask // build perspective transform and picking viewport // Perform pick on a PICK_DIAMETER x PICK_DIAMETER pixel region around cursor point. // Don't limit the select distance for this pick. - // make viewport big enough to handle antialiased frame buffers - gCamera->setPerspective(FOR_SELECTION, scaled_x - (PICK_HALF_WIDTH + 2), scaled_y - (PICK_HALF_WIDTH + 2), PICK_DIAMETER + 4, PICK_DIAMETER + 4, FALSE); + LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - (PICK_HALF_WIDTH + 2), scaled_y - (PICK_HALF_WIDTH + 2), PICK_DIAMETER + 4, PICK_DIAMETER + 4, FALSE); // make viewport big enough to handle antialiased frame buffers gGLViewport[0] = scaled_x - (PICK_HALF_WIDTH + 2); gGLViewport[1] = scaled_y - (PICK_HALF_WIDTH + 2); @@ -3516,13 +3465,13 @@ void LLViewerWindow::hitUIElementAsync(S32 x, S32 y_from_bot, MASK mask, void (* gLastHitUIElement = 0; LLCamera pick_camera; - pick_camera.setOrigin(gCamera->getOrigin()); - pick_camera.setOriginAndLookAt(gCamera->getOrigin(), - gCamera->getUpAxis(), - gCamera->getOrigin() + mouseDirectionGlobal(x, y_from_bot)); + pick_camera.setOrigin(LLViewerCamera::getInstance()->getOrigin()); + pick_camera.setOriginAndLookAt(LLViewerCamera::getInstance()->getOrigin(), + LLViewerCamera::getInstance()->getUpAxis(), + LLViewerCamera::getInstance()->getOrigin() + mouseDirectionGlobal(x, y_from_bot)); pick_camera.setView(0.5f*DEG_TO_RAD); - pick_camera.setNear(gCamera->getNear()); - pick_camera.setFar(gCamera->getFar()); + pick_camera.setNear(LLViewerCamera::getInstance()->getNear()); + pick_camera.setFar(LLViewerCamera::getInstance()->getFar()); pick_camera.setAspect(1.f); // save our drawing state @@ -3752,7 +3701,7 @@ LLViewerObject* LLViewerWindow::getObjectUnderCursor(const F32 depth) S32 y = getCurrentMouseY(); LLVector3 mouse_direction_global = mouseDirectionGlobal(x,y); - LLVector3 camera_pos_global = gCamera->getOrigin(); + LLVector3 camera_pos_global = LLViewerCamera::getInstance()->getOrigin(); LLVector3 pick_end = camera_pos_global + mouse_direction_global * depth; LLVector3 collision_point; return gPipeline.pickObject(camera_pos_global, pick_end, collision_point); @@ -3838,7 +3787,7 @@ void LLViewerWindow::analyzeHit( U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4]; S32 pick_face = face; LLFace* facep = objectp->mDrawable->getFace(pick_face); - gCamera->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE); + LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE); glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH); gPipeline.renderFaceForUVSelect(facep); @@ -3872,7 +3821,7 @@ void LLViewerWindow::analyzeHit( LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const { // find vertical field of view - F32 fov = gCamera->getView(); + F32 fov = LLViewerCamera::getInstance()->getView(); // find screen resolution S32 height = getWindowHeight(); @@ -3886,9 +3835,9 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const F32 click_y = y - height / 2.f; // compute mouse vector - LLVector3 mouse_vector = distance * gCamera->getAtAxis() - - click_x * gCamera->getLeftAxis() - + click_y * gCamera->getUpAxis(); + LLVector3 mouse_vector = distance * LLViewerCamera::getInstance()->getAtAxis() + - click_x * LLViewerCamera::getInstance()->getLeftAxis() + + click_y * LLViewerCamera::getInstance()->getUpAxis(); mouse_vector.normVec(); @@ -3901,8 +3850,8 @@ LLVector3 LLViewerWindow::mouseDirectionGlobal(const S32 x, const S32 y) const LLVector3 LLViewerWindow::mouseDirectionCamera(const S32 x, const S32 y) const { // find vertical field of view - F32 fov_height = gCamera->getView(); - F32 fov_width = fov_height * gCamera->getAspect(); + F32 fov_height = LLViewerCamera::getInstance()->getView(); + F32 fov_width = fov_height * LLViewerCamera::getInstance()->getAspect(); // find screen resolution S32 height = getWindowHeight(); @@ -3979,7 +3928,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d mouse_direction_global_d.setVec(mouse_direction_global * mouse_dir_scale); probe_point_global = camera_pos_global + mouse_direction_global_d; - regionp = gWorldPointer->resolveRegionGlobal(probe_point_region, probe_point_global); + regionp = LLWorld::getInstance()->resolveRegionGlobal(probe_point_region, probe_point_global); if (!regionp) { @@ -4026,7 +3975,7 @@ BOOL LLViewerWindow::mousePointOnLandGlobal(const S32 x, const S32 y, LLVector3d mouse_direction_global_d.setVec(mouse_direction_global * mouse_dir_scale); probe_point_global = camera_pos_global + mouse_direction_global_d; - regionp = gWorldPointer->resolveRegionGlobal(probe_point_region, probe_point_global); + regionp = LLWorld::getInstance()->resolveRegionGlobal(probe_point_region, probe_point_global); if (!regionp) { @@ -4245,7 +4194,7 @@ void LLViewerWindow::playSnapshotAnimAndSound() BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, ESnapshotType type) { - if ((!gWorldPointer) || (!raw) || preview_width < 10 || preview_height < 10) + if ((!raw) || preview_width < 10 || preview_height < 10) { return FALSE; } @@ -4293,7 +4242,7 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p if (type == SNAPSHOT_TYPE_OBJECT_ID) { gPickTransparent = FALSE; - gObjectList.renderObjectsForSelect(*gCamera, FALSE, FALSE); + gObjectList.renderObjectsForSelect(*LLViewerCamera::getInstance(), FALSE, FALSE); } else { @@ -4320,8 +4269,9 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p if(SNAPSHOT_TYPE_DEPTH == type) { - F32 depth_conversion_factor_1 = (gCamera->getFar() + gCamera->getNear()) / (2.f * gCamera->getFar() * gCamera->getNear()); - F32 depth_conversion_factor_2 = (gCamera->getFar() - gCamera->getNear()) / (2.f * gCamera->getFar() * gCamera->getNear()); + LLViewerCamera* camerap = LLViewerCamera::getInstance(); + F32 depth_conversion_factor_1 = (camerap->getFar() + camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); + F32 depth_conversion_factor_2 = (camerap->getFar() - camerap->getNear()) / (2.f * camerap->getFar() * camerap->getNear()); //calculate the depth for (S32 y = 0 ; y < h ; y++) @@ -4333,7 +4283,7 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p F32 depth_float_i = *(F32*)(raw->getData() + i); F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float_i * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, gCamera->getNear(), gCamera->getFar()); + U8 depth_byte = F32_to_U8(linear_depth_float, camerap->getNear(), camerap->getFar()); *(raw->getData() + i + 0) = depth_byte; *(raw->getData() + i + 1) = depth_byte; *(raw->getData() + i + 2) = depth_byte; @@ -4382,8 +4332,7 @@ BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 p BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL do_rebuild, ESnapshotType type, S32 max_size) { - if ((!gWorldPointer) || - (!raw)) + if (!raw) { return FALSE; } @@ -4486,8 +4435,8 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei S32 output_buffer_offset_y = 0; - F32 depth_conversion_factor_1 = (gCamera->getFar() + gCamera->getNear()) / (2.f * gCamera->getFar() * gCamera->getNear()); - F32 depth_conversion_factor_2 = (gCamera->getFar() - gCamera->getNear()) / (2.f * gCamera->getFar() * gCamera->getNear()); + F32 depth_conversion_factor_1 = (LLViewerCamera::getInstance()->getFar() + LLViewerCamera::getInstance()->getNear()) / (2.f * LLViewerCamera::getInstance()->getFar() * LLViewerCamera::getInstance()->getNear()); + F32 depth_conversion_factor_2 = (LLViewerCamera::getInstance()->getFar() - LLViewerCamera::getInstance()->getNear()) / (2.f * LLViewerCamera::getInstance()->getFar() * LLViewerCamera::getInstance()->getNear()); for (int subimage_y = 0; subimage_y < scale_factor; ++subimage_y) { @@ -4505,12 +4454,12 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei glClearColor(0.f, 0.f, 0.f, 0.f); glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - gCamera->setZoomParameters(scale_factor, subimage_x+(subimage_y*llceil(scale_factor))); + LLViewerCamera::getInstance()->setZoomParameters(scale_factor, subimage_x+(subimage_y*llceil(scale_factor))); setup3DRender(); setupViewport(); BOOL first_time_through = (subimage_x + subimage_y == 0); gPickTransparent = FALSE; - gObjectList.renderObjectsForSelect(*gCamera, FALSE, !first_time_through); + gObjectList.renderObjectsForSelect(*LLViewerCamera::getInstance(), FALSE, !first_time_through); } else { @@ -4562,7 +4511,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei F32 depth_float = *(F32*)(raw->getData() + i); F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, gCamera->getNear(), gCamera->getFar()); + U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar()); *(raw->getData() + i + 0) = depth_byte; *(raw->getData() + i + 1) = depth_byte; *(raw->getData() + i + 2) = depth_byte; @@ -4650,7 +4599,7 @@ void LLViewerWindow::drawMouselookInstructions() { // Draw instructions for mouselook ("Press ESC to leave Mouselook" in a box at the top of the screen.) const char* instructions = "Press ESC to leave Mouselook."; - const LLFontGL* font = gResMgr->getRes( LLFONT_SANSSERIF ); + const LLFontGL* font = LLResMgr::getInstance()->getRes( LLFONT_SANSSERIF ); const S32 INSTRUCTIONS_PAD = 5; LLRect instructions_rect; @@ -4754,7 +4703,7 @@ void LLViewerWindow::setupViewport(S32 x_offset, S32 y_offset) void LLViewerWindow::setup3DRender() { - gCamera->setPerspective(NOT_FOR_SELECTION, 0, 0, mWindowRect.getWidth(), mWindowRect.getHeight(), FALSE, gCamera->getNear(), MAX_FAR_CLIP*2.f); + LLViewerCamera::getInstance()->setPerspective(NOT_FOR_SELECTION, 0, 0, mWindowRect.getWidth(), mWindowRect.getHeight(), FALSE, LLViewerCamera::getInstance()->getNear(), MAX_FAR_CLIP*2.f); } void LLViewerWindow::setup2DRender() @@ -5394,7 +5343,7 @@ LLBottomPanel::LLBottomPanel(const LLRect &rect) : mFactoryMap["toolbar"] = LLCallbackMap(createToolBar, NULL); mFactoryMap["overlay"] = LLCallbackMap(createOverlayBar, NULL); mFactoryMap["hud"] = LLCallbackMap(createHUD, NULL); - gUICtrlFactory->buildPanel(this, "panel_bars.xml", &getFactoryMap()); + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bars.xml", &getFactoryMap()); setOrigin(rect.mLeft, rect.mBottom); reshape(rect.getWidth(), rect.getHeight()); diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 46085895f6..2ab2db625d 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" #include "llvlcomposition.h" + +#include "imageids.h" #include "llerror.h" #include "v3math.h" #include "llsurface.h" @@ -69,22 +71,10 @@ LLVLComposition::LLVLComposition(LLSurface *surfacep, const U32 width, const F32 mSurfacep = surfacep; // Load Terrain Textures - Original ones - LLUUID id; - // Dirt - id.set( gViewerArt.getString("terrain_dirt_detail.tga") ); - setDetailTextureID(0, id); - - // Grass - id.set( gViewerArt.getString("terrain_grass_detail.tga") ); - setDetailTextureID(1, id); - - // Rock mountain - id.set( gViewerArt.getString("terrain_mountain_detail.tga") ); - setDetailTextureID(2, id); - - // Rock face - id.set( gViewerArt.getString("terrain_rock_detail.tga") ); - setDetailTextureID(3, id); + setDetailTextureID(0, TERRAIN_DIRT_DETAIL); + setDetailTextureID(1, TERRAIN_GRASS_DETAIL); + setDetailTextureID(2, TERRAIN_MOUNTAIN_DETAIL); + setDetailTextureID(3, TERRAIN_ROCK_DETAIL); // Initialize the texture matrix to defaults. for (S32 i = 0; i < CORNER_COUNT; ++i) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 68c5eec9a4..0add3bd9a9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -694,7 +694,7 @@ LLVOAvatar::LLVOAvatar( // mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline bool needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job - mVoiceVisualizer = ( LLVoiceVisualizer *)gHUDManager->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); + mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); lldebugs << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl; @@ -757,8 +757,7 @@ LLVOAvatar::LLVOAvatar( mRippleTimeLast = 0.f; - mShadowImageID = LLUUID( gViewerArt.getString("foot_shadow.tga")); - mShadowImagep = gImageList.getImage(mShadowImageID); + mShadowImagep = gImageList.getImageFromFile("foot_shadow.j2c"); mShadowImagep->bind(); mShadowImagep->setClamp(TRUE, TRUE); @@ -1728,7 +1727,7 @@ BOOL LLVOAvatar::buildSkeleton(LLVOAvatarSkeletonInfo *info) mScreenp = new LLViewerJoint("mScreen", NULL); // for now, put screen at origin, as it is only used during special // HUD rendering mode - F32 aspect = gCamera->getAspect(); + F32 aspect = LLViewerCamera::getInstance()->getAspect(); LLVector3 scale(1.f, aspect, 1.f); mScreenp->setScale(scale); mScreenp->setWorldPosition(LLVector3::zero); @@ -2572,7 +2571,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid()) { // if selecting any attachments, update all of them as non-damped - if (gSelectMgr->getSelection()->getObjectCount() && gSelectMgr->getSelection()->isAttachment()) + if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment()) { gPipeline.updateMoveNormalAsync(attached_object->mDrawable); } @@ -2848,11 +2847,11 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) mNameText->setUsePixelSize(TRUE); LLVector3 pixel_right_vec; LLVector3 pixel_up_vec; - gCamera->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); - LLVector3 camera_to_av = root_pos_last - gCamera->getOrigin(); + LLViewerCamera::getInstance()->getPixelVectors(root_pos_last, pixel_up_vec, pixel_right_vec); + LLVector3 camera_to_av = root_pos_last - LLViewerCamera::getInstance()->getOrigin(); camera_to_av.normVec(); LLVector3 local_camera_at = camera_to_av * ~root_rot; - LLVector3 local_camera_up = camera_to_av % gCamera->getLeftAxis(); + LLVector3 local_camera_up = camera_to_av % LLViewerCamera::getInstance()->getLeftAxis(); local_camera_up.normVec(); local_camera_up = local_camera_up * ~root_rot; @@ -2889,7 +2888,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } else { - is_muted = gMuteListp->isMuted(getID()); + is_muted = LLMuteList::getInstance()->isMuted(getID()); } if (mNameString.empty() || @@ -3088,7 +3087,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) else if (!mBeam || mBeam->isDead()) { // VEFFECT: Tractor Beam - mBeam = (LLHUDEffectSpiral *)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM); + mBeam = (LLHUDEffectSpiral *)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_BEAM); mBeam->setColor(LLColor4U(gAgent.getEffectColor())); mBeam->setSourceObject(this); mBeamTimer.reset(); @@ -3096,7 +3095,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) if (!mBeam.isNull()) { - LLObjectSelectionHandle selection = gSelectMgr->getSelection(); + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); if (gAgent.mPointAt.notNull()) { @@ -3113,7 +3112,7 @@ BOOL LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) else { mBeam->setTargetObject(NULL); - LLTool *tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); if (tool->isEditing()) { if (tool->getEditingObject()) @@ -3172,7 +3171,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (mScreenp) { - F32 aspect = gCamera->getAspect(); + F32 aspect = LLViewerCamera::getInstance()->getAspect(); LLVector3 scale(1.f, aspect, 1.f); mScreenp->setScale(scale); mScreenp->updateWorldMatrixChildren(); @@ -3242,7 +3241,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) if (!mIsSelf && sUseImpostors && !mNeedsAnimUpdate && !sFreezeCounter) { F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f); - if (gMuteListp && gMuteListp->isMuted(getID())) + if (LLMuteList::getInstance()->isMuted(getID())) { mUpdatePeriod = 16; visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE; @@ -3353,7 +3352,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) resolveHeightGlobal(root_pos, ground_under_pelvis, normal); F32 foot_to_ground = (F32) (root_pos.mdV[VZ] - mPelvisToFoot - ground_under_pelvis.mdV[VZ]); - BOOL in_air = ( (!gWorldPointer->getRegionFromPosGlobal(ground_under_pelvis)) || + BOOL in_air = ( (!LLWorld::getInstance()->getRegionFromPosGlobal(ground_under_pelvis)) || foot_to_ground > FOOT_GROUND_COLLISION_TOLERANCE); if (in_air && !mInAir) @@ -3414,11 +3413,11 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // make sure fwdDir stays in same general direction as primdir if (gAgent.getFlying()) { - fwdDir = gCamera->getAtAxis(); + fwdDir = LLViewerCamera::getInstance()->getAtAxis(); } else { - LLVector3 at_axis = gCamera->getAtAxis(); + LLVector3 at_axis = LLViewerCamera::getInstance()->getAtAxis(); LLVector3 up_vector = gAgent.getReferenceUpVector(); at_axis -= up_vector * (at_axis * up_vector); at_axis.normVec(); @@ -3634,8 +3633,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); - if (gParcelMgr && gParcelMgr->canHearSound(foot_pos_global) - && gMuteListp && !gMuteListp->isMuted(getID(), LLMute::flagObjectSounds)) + if (LLViewerParcelMgr::getInstance()->canHearSound(foot_pos_global) + && !LLMuteList::getInstance()->isMuted(getID(), LLMute::flagObjectSounds)) { gAudiop->triggerSound(step_sound_id, getID(), gain, foot_pos_global); } @@ -3694,7 +3693,7 @@ void LLVOAvatar::updateHeadOffset() // since we only care about Z, just grab one of the eyes LLVector3 midEyePt = mEyeLeftp->getWorldPosition(); midEyePt -= mDrawable.notNull() ? mDrawable->getWorldPosition() : mRoot.getWorldPosition(); - midEyePt.mV[VZ] = llmax(-mPelvisToFoot + gCamera->getNear(), midEyePt.mV[VZ]); + midEyePt.mV[VZ] = llmax(-mPelvisToFoot + LLViewerCamera::getInstance()->getNear(), midEyePt.mV[VZ]); if (mDrawable.notNull()) { @@ -3729,7 +3728,7 @@ void LLVOAvatar::updateVisibility() else { // calculate avatar distance wrt head - mDrawable->updateDistance(*gCamera); + mDrawable->updateDistance(*LLViewerCamera::getInstance()); if (!mDrawable->getSpatialGroup() || mDrawable->getSpatialGroup()->isVisible()) { @@ -3783,15 +3782,15 @@ void LLVOAvatar::updateVisibility() llinfos << "Avatar not in frustum" << llendl; }*/ - /*if (gCamera->sphereInFrustum(sel_pos_agent, 2.0f)) + /*if (LLViewerCamera::getInstance()->sphereInFrustum(sel_pos_agent, 2.0f)) { llinfos << "Sel pos visible" << llendl; } - if (gCamera->sphereInFrustum(wrist_right_pos_agent, 0.2f)) + if (LLViewerCamera::getInstance()->sphereInFrustum(wrist_right_pos_agent, 0.2f)) { llinfos << "Wrist pos visible" << llendl; } - if (gCamera->sphereInFrustum(getPositionAgent(), getMaxScale()*2.f)) + if (LLViewerCamera::getInstance()->sphereInFrustum(getPositionAgent(), getMaxScale()*2.f)) { llinfos << "Agent visible" << llendl; }*/ @@ -3857,16 +3856,16 @@ BOOL LLVOAvatar::needsRenderBeam() { return FALSE; } - LLTool *tool = gToolMgr->getCurrentTool(); + LLTool *tool = LLToolMgr::getInstance()->getCurrentTool(); - BOOL is_touching_or_grabbing = (tool == gToolGrab && gToolGrab->isEditing()); - if (gToolGrab->getEditingObject() && - gToolGrab->getEditingObject()->isAttachment()) + BOOL is_touching_or_grabbing = (tool == LLToolGrab::getInstance() && LLToolGrab::getInstance()->isEditing()); + if (LLToolGrab::getInstance()->getEditingObject() && + LLToolGrab::getInstance()->getEditingObject()->isAttachment()) { // don't render selection beam on hud objects is_touching_or_grabbing = FALSE; } - return is_touching_or_grabbing || (mState & AGENT_STATE_EDITING && gSelectMgr->shouldShowSelection()); + return is_touching_or_grabbing || (mState & AGENT_STATE_EDITING && LLSelectMgr::getInstance()->shouldShowSelection()); } //----------------------------------------------------------------------------- @@ -4128,9 +4127,9 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color) } LLVector3 pos(getRenderPosition()+mImpostorOffset); - LLVector3 at = (pos-gCamera->getOrigin()); + LLVector3 at = (pos - LLViewerCamera::getInstance()->getOrigin()); at.normVec(); - LLVector3 left = gCamera->getUpAxis() % at; + LLVector3 left = LLViewerCamera::getInstance()->getUpAxis() % at; LLVector3 up = at%left; left *= mImpostorDim.mV[0]; @@ -4453,7 +4452,7 @@ void LLVOAvatar::resolveHeightAgent(const LLVector3 &in_pos_agent, LLVector3 &ou void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm) { LLViewerObject *obj; - gWorldPointer->resolveStepHeightGlobal(this, start_pt, end_pt, out_pos, out_norm, &obj); + LLWorld::getInstance()->resolveStepHeightGlobal(this, start_pt, end_pt, out_pos, out_norm, &obj); } @@ -4463,7 +4462,7 @@ void LLVOAvatar::resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos LLVector3d p0 = inPos + zVec; LLVector3d p1 = inPos - zVec; LLViewerObject *obj; - gWorldPointer->resolveStepHeightGlobal(this, p0, p1, outPos, outNorm, &obj); + LLWorld::getInstance()->resolveStepHeightGlobal(this, p0, p1, outPos, outNorm, &obj); if (!obj) { mStepOnLand = TRUE; @@ -4614,8 +4613,8 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL if (gAudiop) { LLVector3d char_pos_global = gAgent.getPosGlobalFromAgent(getCharacterPosition()); - if (gParcelMgr && gParcelMgr->canHearSound(char_pos_global) - && gMuteListp && !gMuteListp->isMuted(getID(), LLMute::flagObjectSounds)) + if (LLViewerParcelMgr::getInstance()->canHearSound(char_pos_global) + && !LLMuteList::getInstance()->isMuted(getID(), LLMute::flagObjectSounds)) { // RN: uncomment this to play on typing sound at fixed volume once sound engine is fixed // to support both spatialized and non-spatialized instances of the same sound @@ -4899,7 +4898,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age p1_global = gAgent.getPosGlobalFromAgent(in_pos_agent) - z_vec; LLViewerObject *obj; LLVector3d out_pos_global; - gWorldPointer->resolveStepHeightGlobal(this, p0_global, p1_global, out_pos_global, outNorm, &obj); + LLWorld::getInstance()->resolveStepHeightGlobal(this, p0_global, p1_global, out_pos_global, outNorm, &obj); out_pos_agent = gAgent.getPosAgentFromGlobal(out_pos_global); } @@ -5635,7 +5634,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent) LLVector3 center = (ext[1] + ext[0]) * 0.5f; LLVector3 size = (ext[1]-ext[0])*0.5f; - mPixelArea = LLPipeline::calcPixelArea(center, size, *gCamera); + mPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); F32 range = mDrawable->mDistanceWRTCamera; @@ -5772,7 +5771,7 @@ void LLVOAvatar::updateShadowFaces() return; } - LLSprite sprite(mShadowImageID); + LLSprite sprite(mShadowImagep.notNull() ? mShadowImagep->getID() : LLUUID::null); sprite.setFollow(FALSE); const F32 cos_angle = gSky.getSunDirection().mV[2]; F32 cos_elev = sqrt(1 - cos_angle * cos_angle); @@ -6010,8 +6009,8 @@ BOOL LLVOAvatar::attachObject(LLViewerObject *viewer_object) if (viewer_object->isSelected()) { - gSelectMgr->updateSelectionCenter(); - gSelectMgr->updatePointAt(); + LLSelectMgr::getInstance()->updateSelectionCenter(); + LLSelectMgr::getInstance()->updatePointAt(); } if (mIsSelf) @@ -6318,6 +6317,22 @@ void LLVOAvatar::onLocalTextureLoaded( BOOL success, LLViewerImage *src_vi, LLIm self->updateMeshTextures(); } } + else if (final) + { + LLVOAvatar *self = (LLVOAvatar *)gObjectList.findObject(data->mAvatarID); + LLVOAvatar::ELocTexIndex idx = data->mIndex; + // Failed: asset is missing + if( self && + (!self->mLocalTextureBaked[ idx ]) && + (self->mLocalTexture[ idx ].notNull()) && + (self->mLocalTexture[ idx ]->getID() == src_id)) + { + self->mLocalTextureDiscard[idx] = 0; // we check that it's missing later + self->requestLayerSetUpdate( idx ); + self->updateMeshTextures(); + } + + } if( final || !success ) { @@ -6482,7 +6497,7 @@ void LLVOAvatar::forceBakeAllTextures(bool slam_for_debug) BOOL set_by_user = TRUE; invalidateComposite(layer_set, set_by_user); - gViewerStats->incStat(LLViewerStats::ST_TEX_REBAKES); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } else { @@ -6520,7 +6535,7 @@ void LLVOAvatar::processRebakeAvatarTextures(LLMessageSystem* msg, void**) BOOL set_by_user = TRUE; self->invalidateComposite(layer_set, set_by_user); found = TRUE; - gViewerStats->incStat(LLViewerStats::ST_TEX_REBAKES); + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_TEX_REBAKES); } } } @@ -7369,7 +7384,10 @@ void LLVOAvatar::clearChat() S32 LLVOAvatar::getLocalDiscardLevel( S32 index ) { - if (index >= 0 && mLocalTexture[index].notNull() && mLocalTexture[index]->getID() != IMG_DEFAULT_AVATAR) + if (index >= 0 + && mLocalTexture[index].notNull() + && (mLocalTexture[index]->getID() != IMG_DEFAULT_AVATAR) + && !mLocalTexture[index]->isMissingAsset()) { return mLocalTexture[index]->getDiscardLevel(); } @@ -9374,13 +9392,13 @@ void LLVOAvatar::updateRegion(LLViewerRegion *regionp) { ++mRegionCrossingCount; F64 delta = (F64)mRegionCrossingTimer.getElapsedTimeF32(); - F64 avg = (mRegionCrossingCount == 1) ? 0 : gViewerStats->getStat(LLViewerStats::ST_CROSSING_AVG); + F64 avg = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_AVG); F64 delta_avg = (delta + avg*(mRegionCrossingCount-1)) / mRegionCrossingCount; - gViewerStats->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_AVG, delta_avg); - F64 max = (mRegionCrossingCount == 1) ? 0 : gViewerStats->getStat(LLViewerStats::ST_CROSSING_MAX); + F64 max = (mRegionCrossingCount == 1) ? 0 : LLViewerStats::getInstance()->getStat(LLViewerStats::ST_CROSSING_MAX); max = llmax(delta, max); - gViewerStats->setStat(LLViewerStats::ST_CROSSING_MAX, max); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CROSSING_MAX, max); } mLastRegionHandle = regionp->getHandle(); } @@ -9555,11 +9573,11 @@ void LLVOAvatar::getImpostorValues(LLVector3* extents, LLVector3& angle, F32& di extents[0] = ext[0]; extents[1] = ext[1]; - LLVector3 at = gCamera->getOrigin()-(getRenderPosition()+mImpostorOffset); + LLVector3 at = LLViewerCamera::getInstance()->getOrigin()-(getRenderPosition()+mImpostorOffset); distance = at.normVec(); - F32 da = 1.f - (at*gCamera->getAtAxis()); - angle.mV[0] = gCamera->getYaw()*da; - angle.mV[1] = gCamera->getPitch()*da; + F32 da = 1.f - (at*LLViewerCamera::getInstance()->getAtAxis()); + angle.mV[0] = LLViewerCamera::getInstance()->getYaw()*da; + angle.mV[1] = LLViewerCamera::getInstance()->getPitch()*da; angle.mV[2] = da; } @@ -9694,4 +9712,3 @@ void LLVOAvatar::shame() mText->setColor(LLColor4(red,green,0,1)); } - diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a6731c3e31..b4a35d8e7e 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -694,7 +694,6 @@ public: //-------------------------------------------------------------------- // texture ids and pointers //-------------------------------------------------------------------- - LLUUID mShadowImageID; LLPointer<LLViewerImage> mShadowImagep; LLUUID mLastHeadBakedID; diff --git a/indra/newview/llvoclouds.cpp b/indra/newview/llvoclouds.cpp index 2e0da4727c..e255293617 100644 --- a/indra/newview/llvoclouds.cpp +++ b/indra/newview/llvoclouds.cpp @@ -133,7 +133,7 @@ BOOL LLVOClouds::updateGeometry(LLDrawable *drawable) drawable->setNumFacesFast(num_faces, NULL, getTEImage(0)); } - mDepth = (getPositionAgent()-gCamera->getOrigin())*gCamera->getAtAxis(); + mDepth = (getPositionAgent()-LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis(); S32 face_indx = 0; for ( ; face_indx < num_faces; face_indx++) @@ -224,7 +224,7 @@ void LLVOClouds::getGeometry(S32 te, LLVector3 vtx[4]; - at = gCamera->getAtAxis(); + at = LLViewerCamera::getInstance()->getAtAxis(); right = at % LLVector3(0.f, 0.f, 1.f); right.normVec(); up = right % at; diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 833fe4b464..54dabe5615 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -176,7 +176,8 @@ void LLVOGrass::initClass() static LLStdStringHandle texture_name_string = LLXmlTree::addAttributeString("texture_name"); success &= grass_def->getFastAttributeString(texture_name_string, textureName); - newGrass->mTextureID.set( gViewerArt.getString(textureName) ); + LLViewerImage* grass_image = gImageList.getImageFromFile(textureName); + newGrass->mTextureID = grass_image->getID(); } static LLStdStringHandle blade_sizex_string = LLXmlTree::addAttributeString("blade_size_x"); @@ -330,7 +331,7 @@ void LLVOGrass::setPixelAreaAndAngle(LLAgent &agent) mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; // Compute pixels per meter at the given range - F32 pixels_per_meter = gCamera->getViewHeightInPixels() / (tan(gCamera->getView()) * range); + F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / (tan(LLViewerCamera::getInstance()->getView()) * range); // Assume grass texture is a 5 meter by 5 meter sprite at the grass object's center mPixelArea = (pixels_per_meter) * (pixels_per_meter) * 25.f; @@ -430,7 +431,7 @@ void LLVOGrass::plantBlades() face->setTEOffset(0); face->mCenterLocal = mPosition + mRegionp->getOriginAgent(); - mDepth = (face->mCenterLocal - gCamera->getOrigin())*gCamera->getAtAxis(); + mDepth = (face->mCenterLocal - LLViewerCamera::getInstance()->getOrigin())*LLViewerCamera::getInstance()->getAtAxis(); mDrawable->setPosition(face->mCenterLocal); mDrawable->movePartition(); LLPipeline::sCompiles++; diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index fd4956113d..361f2ebf50 100644 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -122,13 +122,13 @@ BOOL LLVOGround::updateGeometry(LLDrawable *drawable) // // // - LLVector3 at_dir = gCamera->getAtAxis(); + LLVector3 at_dir = LLViewerCamera::getInstance()->getAtAxis(); at_dir.mV[VZ] = 0.f; if (at_dir.normVec() < 0.01) { // We really don't care, as we're not looking anywhere near the horizon. } - LLVector3 left_dir = gCamera->getLeftAxis(); + LLVector3 left_dir = LLViewerCamera::getInstance()->getLeftAxis(); left_dir.mV[VZ] = 0.f; left_dir.normVec(); diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index e2ea6e6ecf..56e5062820 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1204,12 +1204,7 @@ void LLVoiceClient::stateMachine() // Check for parcel boundary crossing { LLViewerRegion *region = gAgent.getRegion(); - LLParcel *parcel = NULL; - - if(gParcelMgr) - { - parcel = gParcelMgr->getAgentParcel(); - } + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if(region && parcel) { @@ -1626,9 +1621,9 @@ void LLVoiceClient::stateMachine() notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_LOGGED_IN); // Set up the mute list observer if it hasn't been set up already. - if((!sMuteListListener_listening) && (gMuteListp)) + if((!sMuteListListener_listening)) { - gMuteListp->addObserver(&mutelist_listener); + LLMuteList::getInstance()->addObserver(&mutelist_listener); sMuteListListener_listening = true; } @@ -3068,7 +3063,7 @@ void LLVoiceClient::updateMuteState(participantState *p) { if(p->mAvatarIDValid) { - bool isMuted = gMuteListp->isMuted(p->mAvatarID, LLMute::flagVoiceChat); + bool isMuted = LLMuteList::getInstance()->isMuted(p->mAvatarID, LLMute::flagVoiceChat); if(p->mOnMuteList != isMuted) { p->mOnMuteList = isMuted; diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 8d813f47aa..a7e1915171 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -98,21 +98,21 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) mTimer.reset(); - LLUUID sound_level_img[] = + const char* sound_level_img[] = { - LLUUID(gSavedSettings.getString("VoiceImageLevel0")), - LLUUID(gSavedSettings.getString("VoiceImageLevel1")), - LLUUID(gSavedSettings.getString("VoiceImageLevel2")), - LLUUID(gSavedSettings.getString("VoiceImageLevel3")), - LLUUID(gSavedSettings.getString("VoiceImageLevel4")), - LLUUID(gSavedSettings.getString("VoiceImageLevel5")), - LLUUID(gSavedSettings.getString("VoiceImageLevel6")) + "041ee5a0-cb6a-9ac5-6e49-41e9320507d5.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", + "29de489d-0491-fb00-7dab-f9e686d31e83.j2c" }; for (int i=0; i<NUM_VOICE_SYMBOL_WAVES; i++) { mSoundSymbol.mWaveFadeOutStartTime [i] = mCurrentTime; - mSoundSymbol.mTexture [i] = gImageList.getImageByID(sound_level_img[i]); + mSoundSymbol.mTexture [i] = gImageList.getImageFromFile(sound_level_img[i], FALSE, TRUE); mSoundSymbol.mWaveActive [i] = false; mSoundSymbol.mWaveOpacity [i] = 1.0f; mSoundSymbol.mWaveExpansion [i] = 1.0f; @@ -203,8 +203,8 @@ void LLVoiceVisualizer::render() //------------------------------------------------------------- // create coordinates of the geometry for the dot //------------------------------------------------------------- - LLVector3 l = gCamera->getLeftAxis() * DOT_SIZE; - LLVector3 u = gCamera->getUpAxis() * DOT_SIZE; + LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * DOT_SIZE; + LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * DOT_SIZE; LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u; LLVector3 bottomRight = mSoundSymbol.mPosition - l - u; @@ -330,8 +330,8 @@ void LLVoiceVisualizer::render() F32 width = i * WAVE_WIDTH_SCALE * mSoundSymbol.mWaveExpansion[i]; F32 height = i * WAVE_HEIGHT_SCALE * mSoundSymbol.mWaveExpansion[i]; - LLVector3 l = gCamera->getLeftAxis() * width; - LLVector3 u = gCamera->getUpAxis() * height; + LLVector3 l = LLViewerCamera::getInstance()->getLeftAxis() * width; + LLVector3 u = LLViewerCamera::getInstance()->getUpAxis() * height; LLVector3 bottomLeft = mSoundSymbol.mPosition + l - u; LLVector3 bottomRight = mSoundSymbol.mPosition - l - u; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 14e503d2d1..412e4660c8 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -95,7 +95,7 @@ void LLVOPartGroup::setPixelAreaAndAngle(LLAgent &agent) { // mPixelArea is calculated during render F32 mid_scale = getMidScale(); - F32 range = (getRenderPosition()-gCamera->getOrigin()).magVec(); + F32 range = (getRenderPosition()-LLViewerCamera::getInstance()->getOrigin()).magVec(); if (range < 0.001f || isHUDAttachment()) // range == zero { @@ -141,7 +141,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) LLVector3 at; LLVector3 position_agent; - LLVector3 camera_agent = gCamera->getOrigin(); + LLVector3 camera_agent = LLViewerCamera::getInstance()->getOrigin(); S32 num_parts = mViewerPartGroupp->getCount(); LLFace *facep; @@ -176,7 +176,7 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) F32 tot_area = 0; F32 max_area = LLViewerPartSim::getMaxPartCount() * MAX_PARTICLE_AREA_SCALE; - F32 pixel_meter_ratio = gCamera->getPixelMeterRatio(); + F32 pixel_meter_ratio = LLViewerCamera::getInstance()->getPixelMeterRatio(); pixel_meter_ratio *= pixel_meter_ratio; S32 count=0; @@ -309,7 +309,7 @@ void LLVOPartGroup::getGeometry(S32 idx, right *= 0.5f*part.mScale.mV[0]; up *= 0.5f*part.mScale.mV[1]; - const LLVector3& normal = -gCamera->getXAxis(); + const LLVector3& normal = -LLViewerCamera::getInstance()->getXAxis(); *verticesp++ = part_pos_agent + up - right; *verticesp++ = part_pos_agent - up - right; @@ -391,7 +391,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co } count++; - facep->mDistance = (facep->mCenterLocal - gCamera->getOrigin()) * gCamera->getAtAxis(); + facep->mDistance = (facep->mCenterLocal - LLViewerCamera::getInstance()->getOrigin()) * LLViewerCamera::getInstance()->getAtAxis(); obj->mDepth += facep->mDistance; mFaceList.push_back(facep); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index ba06083fd3..07fc1ece73 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -439,7 +439,7 @@ void LLVOSky::initCubeMap() { mCubeMap->init(images); } - else if (gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap && gFeatureManagerp->isFeatureAvailable("RenderCubeMap")) + else if (gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")) { mCubeMap = new LLCubeMap(); mCubeMap->init(images); @@ -477,7 +477,7 @@ void LLVOSky::restoreGL() calcAtmospherics(); if (gSavedSettings.getBOOL("RenderWater") && gGLManager.mHasCubeMap - && gFeatureManagerp->isFeatureAvailable("RenderCubeMap")) + && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")) { LLCubeMap* cube_map = getCubeMap(); @@ -1102,7 +1102,7 @@ BOOL LLVOSky::updateSky() { if (mForceUpdate) { - updateFog(gCamera->getFar()); + updateFog(LLViewerCamera::getInstance()->getFar()); for (int side = 0; side < 6; side++) { for (int tile = 0; tile < NUM_TILES; tile++) @@ -1331,7 +1331,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) } } - const LLVector3 &look_at = gCamera->getAtAxis(); + const LLVector3 &look_at = LLViewerCamera::getInstance()->getAtAxis(); LLVector3 right = look_at % LLVector3::z_axis; LLVector3 up = right % look_at; right.normVec(); @@ -1343,7 +1343,7 @@ BOOL LLVOSky::updateGeometry(LLDrawable *drawable) mMoon.setDraw(updateHeavenlyBodyGeometry(drawable, FACE_MOON, FALSE, mMoon, cos_max_angle, up, right)); const F32 water_height = gAgent.getRegion()->getWaterHeight() + 0.01f; - // gWorldPointer->getWaterHeight() + 0.01f; + // LLWorld::getInstance()->getWaterHeight() + 0.01f; const F32 camera_height = mCameraPosAgent.mV[2]; const F32 height_above_water = camera_height - water_height; @@ -1691,9 +1691,9 @@ F32 dtClip(const LLVector3& v0, const LLVector3& v1, F32 far_clip2) void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, const LLHeavenBody& HB) { - const LLVector3 &look_at = gCamera->getAtAxis(); + const LLVector3 &look_at = LLViewerCamera::getInstance()->getAtAxis(); // const F32 water_height = gAgent.getRegion()->getWaterHeight() + 0.001f; - // gWorldPointer->getWaterHeight() + 0.001f; + // LLWorld::getInstance()->getWaterHeight() + 0.001f; LLVector3 to_dir = HB.getDirection(); LLVector3 hb_pos = to_dir * (HORIZON_DIST - 10); @@ -1824,7 +1824,7 @@ void LLVOSky::updateReflectionGeometry(LLDrawable *drawable, F32 H, side = 2; } - //const F32 far_clip = (gCamera->getFar() - 0.01) / far_clip_factor; + //const F32 far_clip = (LLViewerCamera::getInstance()->getFar() - 0.01) / far_clip_factor; const F32 far_clip = 512; const F32 far_clip2 = far_clip*far_clip; @@ -2022,10 +2022,10 @@ void LLVOSky::updateFog(const F32 distance) LLColor4 target_fog(0.f, 0.2f, 0.5f, 0.f); const F32 water_height = gAgent.getRegion()->getWaterHeight(); - // gWorldPointer->getWaterHeight(); + // LLWorld::getInstance()->getWaterHeight(); F32 camera_height = gAgent.getCameraPositionAgent().mV[2]; - F32 near_clip_height = gCamera->getAtAxis().mV[VZ] * gCamera->getNear(); + F32 near_clip_height = LLViewerCamera::getInstance()->getAtAxis().mV[VZ] * LLViewerCamera::getInstance()->getNear(); camera_height += near_clip_height; F32 fog_distance = 0.f; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 2f81ae84ba..16555fdc9a 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -399,8 +399,8 @@ void LLVOTree::setPixelAreaAndAngle(LLAgent &agent) F32 area = max_scale * (max_scale*mBillboardRatio); // Compute pixels per meter at the given range - F32 pixels_per_meter = gCamera->getViewHeightInPixels() / - (tan(gCamera->getView()) * range); + F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / + (tan(LLViewerCamera::getInstance()->getView()) * range); mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area; #if 0 diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 58f94120d0..37353cf7ec 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -452,7 +452,7 @@ void LLVOVolume::updateTextures() if (isHUDAttachment()) { - F32 area = (F32) gCamera->getScreenPixelArea(); + F32 area = (F32) LLViewerCamera::getInstance()->getScreenPixelArea(); vsize = area; imagep->setBoostLevel(LLViewerImage::BOOST_HUD); face->setPixelArea(area); // treat as full screen @@ -557,7 +557,7 @@ F32 LLVOVolume::getTextureVirtualSize(LLFace* face) LLVector3 center = face->getPositionAgent(); LLVector3 size = (face->mExtents[1] - face->mExtents[0]) * 0.5f; - F32 face_area = LLPipeline::calcPixelArea(center, size, *gCamera); + F32 face_area = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); face->setPixelArea(face_area); @@ -651,7 +651,7 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline) } updateRadius(); - mDrawable->updateDistance(*gCamera); + mDrawable->updateDistance(*LLViewerCamera::getInstance()); return mDrawable; } diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 901dc6de21..8755a5ae4a 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -133,7 +133,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline) } else { - mDrawable->setNumFaces(1, pool, gWorldp->getDefaultWaterTexture()); + mDrawable->setNumFaces(1, pool, LLWorld::getInstance()->getDefaultWaterTexture()); } return mDrawable; diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index d81cbf832f..1697717609 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -39,7 +39,7 @@ #include "llsliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewercontrol.h" #include "llviewercamera.h" #include "llcombobox.h" @@ -227,7 +227,7 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader) if (shader->mShaderGroup == LLGLSLShader::SG_WATER) { shader->uniform4fv(LLShaderMgr::LIGHTNORM, 1, LLWLParamManager::instance()->getRotatedLightDir().mV); - shader->uniform3fv("camPosLocal", 1, gCamera->getOrigin().mV); + shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); shader->uniform4fv("waterFogColor", 1, LLDrawPoolWater::sWaterFogColor.mV); shader->uniform4fv("waterPlane", 1, mWaterPlane.mV); shader->uniform1f("waterFogDensity", getFogDensity()); diff --git a/indra/newview/llwaterparamset.cpp b/indra/newview/llwaterparamset.cpp index 78baae8db6..78797eecce 100644 --- a/indra/newview/llwaterparamset.cpp +++ b/indra/newview/llwaterparamset.cpp @@ -72,8 +72,6 @@ LLWaterParamSet::LLWaterParamSet(void) : wave2.append(0.58f); wave2.append(-.67f); - LLUUID normalMap = LLUUID(gViewerArt.getString("water_normal.tga")); - mParamValues.insert("waterFogColor", vec4); mParamValues.insert("waterFogDensity", 16.0f); mParamValues.insert("underWaterFogMod", 0.25f); @@ -85,7 +83,7 @@ LLWaterParamSet::LLWaterParamSet(void) : mParamValues.insert("blurMultiplier", 0.01f); mParamValues.insert("wave1Dir", wave1); mParamValues.insert("wave2Dir", wave2); - mParamValues.insert("normalMap", normalMap); + mParamValues.insert("normalMap", DEFAULT_WATER_NORMAL); } diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 4e030c7abc..29021aa54c 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -160,10 +160,7 @@ void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID { LLFile::remove(filename); } - if( gViewerStats ) - { - gViewerStats->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - } + LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); llwarns << "Wearable download failed: " << LLAssetStorage::getErrorString( status ) << " " << uuid << llendl; switch( status ) diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 96a985f694..a362f76a2c 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -237,7 +237,7 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = gWorldPointer->getRegionWidthInMeters(); + F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); if (pos_clamped_region.mV[VX] < 0.f) { @@ -299,7 +299,7 @@ LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = gWorldPointer->getRegionWidthInMeters(); + F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); if (pos_clamped_region.mV[VX] < 0.f) { diff --git a/indra/newview/llwlparammanager.cpp b/indra/newview/llwlparammanager.cpp index b1c1f5e2d0..68e402abdb 100644 --- a/indra/newview/llwlparammanager.cpp +++ b/indra/newview/llwlparammanager.cpp @@ -39,7 +39,7 @@ #include "llsliderctrl.h" #include "llspinctrl.h" #include "llcheckboxctrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewercamera.h" #include "llcombobox.h" #include "lllineeditor.h" @@ -280,7 +280,7 @@ void LLWLParamManager::updateShaderUniforms(LLGLSLShader * shader) if (shader->mShaderGroup == LLGLSLShader::SG_DEFAULT) { shader->uniform4fv(LLShaderMgr::LIGHTNORM, 1, mRotatedLightDir.mV); - shader->uniform3fv("camPosLocal", 1, gCamera->getOrigin().mV); + shader->uniform3fv("camPosLocal", 1, LLViewerCamera::getInstance()->getOrigin().mV); } else if (shader->mShaderGroup == LLGLSLShader::SG_SKY) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 6551361739..923b45fc5a 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -61,7 +61,6 @@ // // Globals // -LLWorld* gWorldp = NULL; U32 gAgentPauseSerialNum = 0; // @@ -72,15 +71,19 @@ const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; +const U32 LLWorld::mWidth = 256; + +// meters/point, therefore mWidth * mScale = meters per edge +const F32 LLWorld::mScale = 1.f; + +const F32 LLWorld::mWidthInMeters = mWidth * mScale; + // // Functions // // allocate the stack -LLWorld::LLWorld(const U32 grids_per_region, const F32 meters_per_grid) -: mWidth(grids_per_region), - mScale(meters_per_grid), - mWidthInMeters( grids_per_region * meters_per_grid ) +LLWorld::LLWorld() { mSpaceTimeUSec = 0; mLastPacketsIn = 0; @@ -112,10 +115,11 @@ LLWorld::LLWorld(const U32 grids_per_region, const F32 meters_per_grid) } -LLWorld::~LLWorld() +void LLWorld::destroyClass() { - gObjectList.killAllObjects(); + gObjectList.destroy(); for_each(mRegionList.begin(), mRegionList.end(), DeletePointer()); + LLViewerPartSim::getInstance()->destroyClass(); } @@ -556,9 +560,9 @@ LLVector3 LLWorld::resolveLandNormalGlobal(const LLVector3d &pos_global) void LLWorld::updateVisibilities() { - F32 cur_far_clip = gCamera->getFar(); + F32 cur_far_clip = LLViewerCamera::getInstance()->getFar(); - gCamera->setFar(mLandFarClip); + LLViewerCamera::getInstance()->setFar(mLandFarClip); F32 diagonal_squared = F_SQRT2 * F_SQRT2 * mWidth * mWidth; // Go through the culled list and check for visible regions @@ -570,7 +574,7 @@ void LLWorld::updateVisibilities() F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); F32 radius = 0.5f*fsqrtf(height * height + diagonal_squared); if (!regionp->getLand().hasZData() - || gCamera->sphereInFrustum(regionp->getCenterAgent(), radius)) + || LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) { mCulledRegionList.erase(curiter); mVisibleRegionList.push_back(regionp); @@ -590,7 +594,7 @@ void LLWorld::updateVisibilities() F32 height = regionp->getLand().getMaxZ() - regionp->getLand().getMinZ(); F32 radius = 0.5f*fsqrtf(height * height + diagonal_squared); - if (gCamera->sphereInFrustum(regionp->getCenterAgent(), radius)) + if (LLViewerCamera::getInstance()->sphereInFrustum(regionp->getCenterAgent(), radius)) { regionp->calculateCameraDistance(); if (!gNoRender) @@ -608,7 +612,7 @@ void LLWorld::updateVisibilities() // Sort visible regions mVisibleRegionList.sort(LLViewerRegion::CompareDistance()); - gCamera->setFar(cur_far_clip); + LLViewerCamera::getInstance()->setFar(cur_far_clip); } void LLWorld::updateRegions(F32 max_update_time) @@ -631,7 +635,7 @@ void LLWorld::updateRegions(F32 max_update_time) void LLWorld::updateParticles() { - mPartSim.updateSimulation(); + LLViewerPartSim::getInstance()->updateSimulation(); } void LLWorld::updateClouds(const F32 dt) @@ -727,19 +731,19 @@ void LLWorld::updateNetStats() S32 actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); S32 actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); - gViewerStats->mActualInKBitStat.addValue(actual_in_bits/1024.f); - gViewerStats->mActualOutKBitStat.addValue(actual_out_bits/1024.f); - gViewerStats->mKBitStat.addValue(bits/1024.f); - gViewerStats->mPacketsInStat.addValue(packets_in); - gViewerStats->mPacketsOutStat.addValue(packets_out); - gViewerStats->mPacketsLostStat.addValue(gMessageSystem->mDroppedPackets); + LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f); + LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f); + LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f); + LLViewerStats::getInstance()->mPacketsInStat.addValue(packets_in); + LLViewerStats::getInstance()->mPacketsOutStat.addValue(packets_out); + LLViewerStats::getInstance()->mPacketsLostStat.addValue(gMessageSystem->mDroppedPackets); if (packets_in) { - gViewerStats->mPacketsLostPercentStat.addValue(100.f*((F32)packets_lost/(F32)packets_in)); + LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(100.f*((F32)packets_lost/(F32)packets_in)); } else { - gViewerStats->mPacketsLostPercentStat.addValue(0.f); + LLViewerStats::getInstance()->mPacketsLostPercentStat.addValue(0.f); } mLastPacketsIn = gMessageSystem->mPacketsIn; @@ -771,8 +775,7 @@ void LLWorld::printPacketsLost() void LLWorld::processCoarseUpdate(LLMessageSystem* msg, void** user_data) { - if(!gWorldp) return; - LLViewerRegion* region = gWorldp->getRegion(msg->getSender()); + LLViewerRegion* region = LLWorld::getInstance()->getRegion(msg->getSender()); if( region ) { region->updateCoarseLocations(msg); @@ -812,7 +815,7 @@ void LLWorld::updateWaterObjects() S32 rwidth = 256; // We only want to fill in water for stuff that's near us, say, within 256 or 512m - S32 range = gCamera->getFar() > 256.f ? 512 : 256; + S32 range = LLViewerCamera::getInstance()->getFar() > 256.f ? 512 : 256; LLViewerRegion* regionp = gAgent.getRegion(); from_region_handle(regionp->getHandle(), ®ion_x, ®ion_y); @@ -940,7 +943,7 @@ void LLWorld::shiftRegions(const LLVector3& offset) region->updateRenderMatrix(); } - mPartSim.shift(offset); + LLViewerPartSim::getInstance()->shift(offset); } LLViewerImage* LLWorld::getDefaultWaterTexture() @@ -1022,8 +1025,7 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) // Viewer trusts the simulator. msg->enableCircuit(sim, TRUE); - if(!gWorldp) return; - gWorldp->addRegion(handle, sim); + LLWorld::getInstance()->addRegion(handle, sim); // give the simulator a message it can use to get ip and port llinfos << "simulator_enable() Enabling " << sim << " with code " << msg->getOurCircuitCode() << llendl; @@ -1060,8 +1062,7 @@ public: LLHost sim(input["body"]["sim-ip-and-port"].asString()); - if(!gWorldp) return; - LLViewerRegion* regionp = gWorldp->getRegion(sim); + LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(sim); if (!regionp) { llwarns << "Got EstablishAgentCommunication for unknown region " @@ -1079,8 +1080,7 @@ void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data) LLHost host = mesgsys->getSender(); //llinfos << "Disabling simulator with message from " << host << llendl; - if(!gWorldp) return; - gWorldp->removeRegion(host); + LLWorld::getInstance()->removeRegion(host); mesgsys->disableCircuit(host); } @@ -1089,8 +1089,7 @@ void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data) void process_region_handshake(LLMessageSystem* msg, void** user_data) { LLHost host = msg->getSender(); - if(!gWorldp) return; - LLViewerRegion* regionp = gWorldp->getRegion(host); + LLViewerRegion* regionp = LLWorld::getInstance()->getRegion(host); if (!regionp) { llwarns << "Got region handshake for unknown region " @@ -1104,8 +1103,10 @@ void process_region_handshake(LLMessageSystem* msg, void** user_data) void send_agent_pause() { - // world not initialized yet - if (!gWorldp) + // Note: used to check for LLWorld initialization before it became a singleton. + // Rather than just remove this check I'm changing it to assure that the message + // system has been initialized. -MG + if (!gMessageSystem) { return; } @@ -1118,8 +1119,8 @@ void send_agent_pause() gAgentPauseSerialNum++; gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum); - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; gMessageSystem->sendReliable(regionp->getHost()); @@ -1131,8 +1132,13 @@ void send_agent_pause() void send_agent_resume() { - // world not initialized yet - if (!gWorldp) return; + // Note: used to check for LLWorld initialization before it became a singleton. + // Rather than just remove this check I'm changing it to assure that the message + // system has been initialized. -MG + if (!gMessageSystem) + { + return; + } gMessageSystem->newMessageFast(_PREHASH_AgentResume); gMessageSystem->nextBlockFast(_PREHASH_AgentData); @@ -1143,15 +1149,15 @@ void send_agent_resume() gMessageSystem->addU32Fast(_PREHASH_SerialNum, gAgentPauseSerialNum); - for (LLWorld::region_list_t::iterator iter = gWorldp->mActiveRegionList.begin(); - iter != gWorldp->mActiveRegionList.end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->mActiveRegionList.begin(); + iter != LLWorld::getInstance()->mActiveRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; gMessageSystem->sendReliable(regionp->getHost()); } // Reset the FPS counter to avoid an invalid fps - gViewerStats->mFPSStat.start(); + LLViewerStats::getInstance()->mFPSStat.start(); } diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index a3cf874cfa..cb6102268e 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -35,12 +35,12 @@ #include "llpatchvertexarray.h" #include "llmath.h" -//#include "vmath.h" #include "v3math.h" #include "llmemory.h" #include "llstring.h" #include "llviewerpartsim.h" #include "llviewerimage.h" +#include "llvowater.h" class LLViewerRegion; class LLVector3d; @@ -49,7 +49,6 @@ class LLNetMap; class LLHost; class LLViewerObject; -class LLVOWater; class LLSurfacePatch; class LLCloudPuff; @@ -60,11 +59,11 @@ class LLVOAvatar; // as simulators are connected to, viewer_regions are popped off the stack and connected as required // as simulators are removed, they are pushed back onto the stack -class LLWorld +class LLWorld : public LLSingleton<LLWorld> { public: - LLWorld(const U32 grids_per_region, const F32 meters_per_grid); - ~LLWorld(); + LLWorld(); + void destroyClass(); LLViewerRegion* addRegion(const U64 ®ion_handle, const LLHost &host); // safe to call if already present, does the "right thing" if @@ -149,7 +148,6 @@ public: typedef std::list<LLViewerRegion*> region_list_t; region_list_t mActiveRegionList; - LLViewerPartSim mPartSim; region_list_t& getRegionList() { return mActiveRegionList; } @@ -159,12 +157,12 @@ private: region_list_t mCulledRegionList; // Number of points on edge - const U32 mWidth; + static const U32 mWidth; // meters/point, therefore mWidth * mScale = meters per edge - const F32 mScale; + static const F32 mScale; - const F32 mWidthInMeters; + static const F32 mWidthInMeters; F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; @@ -190,8 +188,6 @@ private: U64 mSpaceTimeUSec; }; -extern LLWorld *gWorldp; -#define gWorldPointer gWorldp void process_enable_simulator(LLMessageSystem *mesgsys, void **user_data); void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 6d0853a6dc..6c5118ed9d 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -46,8 +46,6 @@ #include "llviewerregion.h" #include "llregionflags.h" -LLWorldMap* gWorldMap = NULL; - const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // 10 minutes LLItemInfo::LLItemInfo(F32 global_x, F32 global_y, @@ -485,7 +483,7 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**) U32 agent_flags; msg->getU32Fast(_PREHASH_AgentData, _PREHASH_Flags, agent_flags); - if (agent_flags != (U32)gWorldMap->mCurrentMap) + if (agent_flags != (U32)LLWorldMap::getInstance()->mCurrentMap) { llwarns << "Invalid or out of date map image type returned!" << llendl; return; @@ -496,7 +494,7 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**) S32 num_blocks = msg->getNumberOfBlocksFast(_PREHASH_LayerData); - gWorldMap->mMapLayers[agent_flags].clear(); + LLWorldMap::getInstance()->mMapLayers[agent_flags].clear(); BOOL adjust = FALSE; for (S32 block=0; block<num_blocks; ++block) @@ -521,14 +519,14 @@ void LLWorldMap::processMapLayerReply(LLMessageSystem* msg, void**) F32 x_meters = F32(left*REGION_WIDTH_UNITS); F32 y_meters = F32(bottom*REGION_WIDTH_UNITS); - adjust = gWorldMap->extendAABB(U32(x_meters), U32(y_meters), + adjust = LLWorldMap::getInstance()->extendAABB(U32(x_meters), U32(y_meters), U32(x_meters+REGION_WIDTH_UNITS*new_layer.LayerExtents.getWidth()), U32(y_meters+REGION_WIDTH_UNITS*new_layer.LayerExtents.getHeight())) || adjust; - gWorldMap->mMapLayers[agent_flags].push_back(new_layer); + LLWorldMap::getInstance()->mMapLayers[agent_flags].push_back(new_layer); } - gWorldMap->mMapLoaded[agent_flags] = TRUE; + LLWorldMap::getInstance()->mMapLoaded[agent_flags] = TRUE; if(adjust) gFloaterWorldMap->adjustZoomSliderBounds(); } @@ -576,21 +574,21 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) if (access == 255) { // This region doesn't exist - if (gWorldMap->mIsTrackingUnknownLocation && - gWorldMap->mUnknownLocation.mdV[0] >= x_meters && - gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 && - gWorldMap->mUnknownLocation.mdV[1] >= y_meters && - gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256) + if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation && + LLWorldMap::getInstance()->mUnknownLocation.mdV[0] >= x_meters && + LLWorldMap::getInstance()->mUnknownLocation.mdV[0] < x_meters + 256 && + LLWorldMap::getInstance()->mUnknownLocation.mdV[1] >= y_meters && + LLWorldMap::getInstance()->mUnknownLocation.mdV[1] < y_meters + 256) { // We were tracking this location, but it doesn't exist - gWorldMap->mInvalidLocation = TRUE; + LLWorldMap::getInstance()->mInvalidLocation = TRUE; } found_null_sim = true; } else { - adjust = gWorldMap->extendAABB(x_meters, + adjust = LLWorldMap::getInstance()->extendAABB(x_meters, y_meters, x_meters+REGION_WIDTH_UNITS, y_meters+REGION_WIDTH_UNITS) || adjust; @@ -598,8 +596,8 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) // llinfos << "Map sim " << name << " image layer " << agent_flags << " ID " << image_id.getString() << llendl; LLSimInfo* siminfo = new LLSimInfo(); - sim_info_map_t::iterator iter = gWorldMap->mSimInfoMap.find(handle); - if (iter != gWorldMap->mSimInfoMap.end()) + sim_info_map_t::iterator iter = LLWorldMap::getInstance()->mSimInfoMap.find(handle); + if (iter != LLWorldMap::getInstance()->mSimInfoMap.end()) { LLSimInfo* oldinfo = iter->second; for (S32 image=0; image<MAP_SIM_IMAGE_TYPES; ++image) @@ -608,7 +606,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) } delete oldinfo; } - gWorldMap->mSimInfoMap[handle] = siminfo; + LLWorldMap::getInstance()->mSimInfoMap[handle] = siminfo; siminfo->mHandle = handle; siminfo->mName.assign( name ); @@ -616,7 +614,7 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) siminfo->mRegionFlags = region_flags; siminfo->mWaterHeight = (F32) water_height; siminfo->mMapImageID[agent_flags] = image_id; - siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[gWorldMap->mCurrentMap], MIPMAP_TRUE, FALSE); + siminfo->mCurrentImage = gImageList.getImage(siminfo->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); siminfo->mCurrentImage->bindTexture(0); siminfo->mCurrentImage->setClamp(TRUE, TRUE); @@ -629,22 +627,22 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) siminfo->mOverlayImage = NULL; } - if (gWorldMap->mIsTrackingUnknownLocation && - gWorldMap->mUnknownLocation.mdV[0] >= x_meters && - gWorldMap->mUnknownLocation.mdV[0] < x_meters + 256 && - gWorldMap->mUnknownLocation.mdV[1] >= y_meters && - gWorldMap->mUnknownLocation.mdV[1] < y_meters + 256) + if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation && + LLWorldMap::getInstance()->mUnknownLocation.mdV[0] >= x_meters && + LLWorldMap::getInstance()->mUnknownLocation.mdV[0] < x_meters + 256 && + LLWorldMap::getInstance()->mUnknownLocation.mdV[1] >= y_meters && + LLWorldMap::getInstance()->mUnknownLocation.mdV[1] < y_meters + 256) { if (siminfo->mAccess == SIM_ACCESS_DOWN) { // We were tracking this location, but it doesn't exist - gWorldMap->mInvalidLocation = true; + LLWorldMap::getInstance()->mInvalidLocation = true; } else { // We were tracking this location, and it does exist - bool is_tracking_dbl = gWorldMap->mIsTrackingDoubleClick == TRUE; - gFloaterWorldMap->trackLocation(gWorldMap->mUnknownLocation); + bool is_tracking_dbl = LLWorldMap::getInstance()->mIsTrackingDoubleClick == TRUE; + gFloaterWorldMap->trackLocation(LLWorldMap::getInstance()->mUnknownLocation); if (is_tracking_dbl) { LLVector3d pos_global = LLTracker::getTrackedPositionGlobal(); @@ -654,19 +652,19 @@ void LLWorldMap::processMapBlockReply(LLMessageSystem* msg, void**) } } - if(gWorldMap->mSLURLCallback != NULL) + if(LLWorldMap::getInstance()->mSLURLCallback != NULL) { // Server returns definitive capitalization, SLURL might // not have that. - if (!stricmp(gWorldMap->mSLURLRegionName.c_str(), name) || (gWorldMap->mSLURLRegionHandle == handle)) + if (!stricmp(LLWorldMap::getInstance()->mSLURLRegionName.c_str(), name) || (LLWorldMap::getInstance()->mSLURLRegionHandle == handle)) { - url_callback_t callback = gWorldMap->mSLURLCallback; + url_callback_t callback = LLWorldMap::getInstance()->mSLURLCallback; - gWorldMap->mSLURLCallback = NULL; - gWorldMap->mSLURLRegionName.clear(); - gWorldMap->mSLURLRegionHandle = 0; + LLWorldMap::getInstance()->mSLURLCallback = NULL; + LLWorldMap::getInstance()->mSLURLRegionName.clear(); + LLWorldMap::getInstance()->mSLURLRegionHandle = 0; - callback(handle, gWorldMap->mSLURL, image_id, gWorldMap->mSLURLTeleport); + callback(handle, LLWorldMap::getInstance()->mSLURL, image_id, LLWorldMap::getInstance()->mSLURLTeleport); } } } @@ -702,7 +700,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**) Y /= REGION_WIDTH_UNITS; LLItemInfo new_item(world_x, world_y, name, uuid, extra, extra2); - LLSimInfo* siminfo = gWorldMap->simInfoFromHandle(new_item.mRegionHandle); + LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(new_item.mRegionHandle); switch (type) { @@ -724,11 +722,11 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**) // extra2 specifies whether this is an infohub or a telehub. if (extra2) { - gWorldMap->mInfohubs.push_back(new_item); + LLWorldMap::getInstance()->mInfohubs.push_back(new_item); } else { - gWorldMap->mTelehubs.push_back(new_item); + LLWorldMap::getInstance()->mTelehubs.push_back(new_item); } break; @@ -755,31 +753,31 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**) new_item.mPosGlobal.mdV[VZ] = (F64)extra2; if (type == MAP_ITEM_PG_EVENT) { - gWorldMap->mPGEvents.push_back(new_item); + LLWorldMap::getInstance()->mPGEvents.push_back(new_item); } else { - gWorldMap->mMatureEvents.push_back(new_item); + LLWorldMap::getInstance()->mMatureEvents.push_back(new_item); } break; } case MAP_ITEM_POPULAR: // popular { new_item.mPosGlobal.mdV[VZ] = (F64)extra2; - gWorldMap->mPopular.push_back(new_item); + LLWorldMap::getInstance()->mPopular.push_back(new_item); break; } case MAP_ITEM_LAND_FOR_SALE: // land for sale { new_item.mToolTip = llformat("%d sq. m. L$%d", new_item.mExtra, new_item.mExtra2); - gWorldMap->mLandForSale.push_back(new_item); + LLWorldMap::getInstance()->mLandForSale.push_back(new_item); break; } case MAP_ITEM_CLASSIFIED: // classifieds { // HACK: Z-height is in Extra2 field. new_item.mPosGlobal.mdV[VZ] = (F64)extra2; - gWorldMap->mClassifieds.push_back(new_item); + LLWorldMap::getInstance()->mClassifieds.push_back(new_item); break; } case MAP_ITEM_AGENT_LOCATIONS: // agent locations @@ -791,7 +789,7 @@ void LLWorldMap::processMapItemReply(LLMessageSystem* msg, void**) } // llinfos << "New Location " << new_item.mName << llendl; - item_info_list_t& agentcounts = gWorldMap->mAgentLocationsMap[new_item.mRegionHandle]; + item_info_list_t& agentcounts = LLWorldMap::getInstance()->mAgentLocationsMap[new_item.mRegionHandle]; // Find the last item in the list with a different name and erase them item_info_list_t::iterator lastiter; diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index 3c9dc781fa..6b01946bdb 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -110,7 +110,7 @@ struct LLWorldMapLayer }; -class LLWorldMap +class LLWorldMap : public LLSingleton<LLWorldMap> { public: typedef void(*url_callback_t)(U64 region_handle, const std::string& url, const LLUUID& snapshot_id, bool teleport); @@ -227,6 +227,4 @@ private: bool mSLURLTeleport; }; -extern LLWorldMap* gWorldMap; - #endif diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 1664515f58..124e865637 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -59,7 +59,6 @@ #include "llviewerparceloverlay.h" #include "llviewerregion.h" #include "llviewerwindow.h" -#include "llworld.h" #include "llworldmap.h" #include "llappviewer.h" // Only for constants! @@ -70,24 +69,24 @@ const S32 SCROLL_HINT_WIDTH = 65; const F32 BIG_DOT_RADIUS = 5.f; BOOL LLWorldMapView::sHandledLastClick = FALSE; -LLPointer<LLViewerImage> LLWorldMapView::sAvatarYouSmallImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sAvatarSmallImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sAvatarLargeImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sAvatarAboveImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sAvatarBelowImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarYouSmallImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarSmallImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarLargeImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarAboveImage = NULL; +LLUIImagePtr LLWorldMapView::sAvatarBelowImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sTelehubImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sInfohubImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sHomeImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sEventImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sEventMatureImage = NULL; +LLUIImagePtr LLWorldMapView::sTelehubImage = NULL; +LLUIImagePtr LLWorldMapView::sInfohubImage = NULL; +LLUIImagePtr LLWorldMapView::sHomeImage = NULL; +LLUIImagePtr LLWorldMapView::sEventImage = NULL; +LLUIImagePtr LLWorldMapView::sEventMatureImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sTrackCircleImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sTrackArrowImage = NULL; +LLUIImagePtr LLWorldMapView::sTrackCircleImage = NULL; +LLUIImagePtr LLWorldMapView::sTrackArrowImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sClassifiedsImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sPopularImage = NULL; -LLPointer<LLViewerImage> LLWorldMapView::sForSaleImage = NULL; +LLUIImagePtr LLWorldMapView::sClassifiedsImage = NULL; +LLUIImagePtr LLWorldMapView::sPopularImage = NULL; +LLUIImagePtr LLWorldMapView::sForSaleImage = NULL; F32 LLWorldMapView::sThresholdA = 48.f; F32 LLWorldMapView::sThresholdB = 96.f; @@ -114,53 +113,21 @@ void LLWorldMapView::initClass() { LLUUID image_id; - image_id.set( gViewerArt.getString("map_avatar_you_8.tga") ); - sAvatarYouSmallImage = gImageList.getImage( image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_avatar_8.tga") ); - sAvatarSmallImage = gImageList.getImage( image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_avatar_16.tga") ); - sAvatarLargeImage = gImageList.getImage( image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_avatar_above_8.tga") ); - sAvatarAboveImage = gImageList.getImage( image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_avatar_below_8.tga") ); - sAvatarBelowImage = gImageList.getImage( image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_home.tga") ); - sHomeImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_telehub.tga") ); - sTelehubImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_infohub.tga") ); - sInfohubImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_event.tga") ); - sEventImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_event_mature.tga") ); - sEventMatureImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("map_track_16.tga") ); - sTrackCircleImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("direction_arrow.tga") ); - sTrackArrowImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - // Make sure tracker arrow doesn't wrap - sTrackArrowImage->bindTexture(0); - sTrackArrowImage->setClamp(TRUE, TRUE); - - image_id.set( gViewerArt.getString("icon_top_pick.tga") ); - sClassifiedsImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("icon_popular.tga") ); - sPopularImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); - - image_id.set( gViewerArt.getString("icon_for_sale.tga") ); - sForSaleImage = gImageList.getImage(image_id, MIPMAP_FALSE, TRUE); + sAvatarYouSmallImage = LLUI::getUIImage("map_avatar_you_8.tga"); + sAvatarSmallImage = LLUI::getUIImage("map_avatar_8.tga"); + sAvatarLargeImage = LLUI::getUIImage("map_avatar_16.tga"); + sAvatarAboveImage = LLUI::getUIImage("map_avatar_above_8.tga"); + sAvatarBelowImage = LLUI::getUIImage("map_avatar_below_8.tga"); + sHomeImage = LLUI::getUIImage("map_home.tga"); + sTelehubImage = LLUI::getUIImage("map_telehub.tga"); + sInfohubImage = LLUI::getUIImage("map_infohub.tga"); + sEventImage = LLUI::getUIImage("map_event.tga"); + sEventMatureImage = LLUI::getUIImage("map_event_mature.tga"); + sTrackCircleImage = LLUI::getUIImage("map_track_16.tga"); + sTrackArrowImage = LLUI::getUIImage("direction_arrow.tga"); + sClassifiedsImage = LLUI::getUIImage("icon_top_pick.tga"); + sPopularImage = LLUI::getUIImage("icon_popular.tga"); + sForSaleImage = LLUI::getUIImage("icon_for_sale.tga"); } // static @@ -312,11 +279,6 @@ BOOL is_agent_in_region(LLViewerRegion* region, LLSimInfo* info) void LLWorldMapView::draw() { - if (!getVisible() || !gWorldPointer) - { - return; - } - LLTextureView::clearDebugImages(); F64 current_time = LLTimer::getElapsedSeconds(); @@ -356,13 +318,13 @@ void LLWorldMapView::draw() F32 layer_alpha = 1.f; // Draw one image per layer - for (U32 layer_idx=0; layer_idx<gWorldMap->mMapLayers[gWorldMap->mCurrentMap].size(); ++layer_idx) + for (U32 layer_idx=0; layer_idx<LLWorldMap::getInstance()->mMapLayers[LLWorldMap::getInstance()->mCurrentMap].size(); ++layer_idx) { - if (!gWorldMap->mMapLayers[gWorldMap->mCurrentMap][layer_idx].LayerDefined) + if (!LLWorldMap::getInstance()->mMapLayers[LLWorldMap::getInstance()->mCurrentMap][layer_idx].LayerDefined) { continue; } - LLWorldMapLayer *layer = &gWorldMap->mMapLayers[gWorldMap->mCurrentMap][layer_idx]; + LLWorldMapLayer *layer = &LLWorldMap::getInstance()->mMapLayers[LLWorldMap::getInstance()->mCurrentMap][layer_idx]; LLViewerImage *current_image = layer->LayerImage; #if 1 || LL_RELEASE_FOR_DOWNLOAD if (current_image->isMissingAsset()) @@ -400,7 +362,7 @@ void LLWorldMapView::draw() } current_image->setBoostLevel(LLViewerImage::BOOST_MAP_LAYER); - current_image->setKnownDrawSize(llround(pix_width), llround(pix_height)); + current_image->setKnownDrawSize(llround(pix_width * LLUI::sGLScaleFactor.mV[VX]), llround(pix_height * LLUI::sGLScaleFactor.mV[VY])); if (!current_image->getHasGLTexture()) { @@ -455,15 +417,15 @@ void LLWorldMapView::draw() F32 sim_alpha = 1.f; // Draw one image per region, centered on the camera position. - for (LLWorldMap::sim_info_map_t::iterator it = gWorldMap->mSimInfoMap.begin(); - it != gWorldMap->mSimInfoMap.end(); ++it) + for (LLWorldMap::sim_info_map_t::iterator it = LLWorldMap::getInstance()->mSimInfoMap.begin(); + it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) { U64 handle = (*it).first; LLSimInfo* info = (*it).second; if (info->mCurrentImage.isNull()) { - info->mCurrentImage = gImageList.getImage(info->mMapImageID[gWorldMap->mCurrentMap], MIPMAP_TRUE, FALSE); + info->mCurrentImage = gImageList.getImage(info->mMapImageID[LLWorldMap::getInstance()->mCurrentMap], MIPMAP_TRUE, FALSE); } if (info->mOverlayImage.isNull() && info->mMapImageID[2].notNull()) { @@ -544,7 +506,7 @@ void LLWorldMapView::draw() // See if the agents need updating if (current_time - info->mAgentsUpdateTime > AGENTS_UPDATE_TIME) { - gWorldMap->sendItemRequest(MAP_ITEM_AGENT_LOCATIONS, info->mHandle); + LLWorldMap::getInstance()->sendItemRequest(MAP_ITEM_AGENT_LOCATIONS, info->mHandle); info->mAgentsUpdateTime = current_time; } @@ -555,12 +517,12 @@ void LLWorldMapView::draw() S32 draw_size = llround(gMapScale); simimage->setBoostLevel(LLViewerImage::BOOST_MAP); - simimage->setKnownDrawSize(draw_size, draw_size); + simimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); if (overlayimage) { overlayimage->setBoostLevel(LLViewerImage::BOOST_MAP); - overlayimage->setKnownDrawSize(draw_size, draw_size); + overlayimage->setKnownDrawSize(llround(draw_size * LLUI::sGLScaleFactor.mV[VX]), llround(draw_size * LLUI::sGLScaleFactor.mV[VY])); } // LLTextureView::addDebugImage(simimage); @@ -717,13 +679,13 @@ void LLWorldMapView::draw() // Infohubs if (gSavedSettings.getBOOL("MapShowInfohubs")) //(gMapScale >= sThresholdB) { - drawGenericItems(gWorldMap->mInfohubs, sInfohubImage); + drawGenericItems(LLWorldMap::getInstance()->mInfohubs, sInfohubImage); } // Telehubs if (gSavedSettings.getBOOL("MapShowTelehubs")) //(gMapScale >= sThresholdB) { - drawGenericItems(gWorldMap->mTelehubs, sTelehubImage); + drawGenericItems(LLWorldMap::getInstance()->mTelehubs, sTelehubImage); } // Home Sweet Home @@ -735,17 +697,17 @@ void LLWorldMapView::draw() if (gSavedSettings.getBOOL("MapShowLandForSale")) { - drawGenericItems(gWorldMap->mLandForSale, sForSaleImage); + drawGenericItems(LLWorldMap::getInstance()->mLandForSale, sForSaleImage); } if (gSavedSettings.getBOOL("MapShowClassifieds")) { - drawGenericItems(gWorldMap->mClassifieds, sClassifiedsImage); + drawGenericItems(LLWorldMap::getInstance()->mClassifieds, sClassifiedsImage); } if (gSavedSettings.getBOOL("MapShowPopular")) { - drawGenericItems(gWorldMap->mPopular, sPopularImage); + drawGenericItems(LLWorldMap::getInstance()->mPopular, sPopularImage); } if (gSavedSettings.getBOOL("MapShowEvents")) @@ -795,20 +757,20 @@ void LLWorldMapView::draw() drawTracking( pos_global, gTrackColor, TRUE, LLTracker::getLabel(), LLTracker::getToolTip() ); } } - else if (gWorldMap->mIsTrackingUnknownLocation) + else if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation) { - if (gWorldMap->mInvalidLocation) + if (LLWorldMap::getInstance()->mInvalidLocation) { // We know this location to be invalid LLColor4 loading_color(0.0, 0.5, 1.0, 1.0); - drawTracking( gWorldMap->mUnknownLocation, loading_color, TRUE, "Invalid Location", ""); + drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, "Invalid Location", ""); } else { double value = fmod(current_time, 2); value = 0.5 + 0.5*cos(value * 3.14159f); LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0); - drawTracking( gWorldMap->mUnknownLocation, loading_color, TRUE, "Loading...", ""); + drawTracking( LLWorldMap::getInstance()->mUnknownLocation, loading_color, TRUE, "Loading...", ""); } } #endif @@ -828,21 +790,21 @@ void LLWorldMapView::draw() void LLWorldMapView::setVisible(BOOL visible) { LLPanel::setVisible(visible); - if (!visible && gWorldMap) + if (!visible) { for (S32 map = 0; map < MAP_SIM_IMAGE_TYPES; map++) { - for (U32 layer_idx=0; layer_idx<gWorldMap->mMapLayers[map].size(); ++layer_idx) + for (U32 layer_idx=0; layer_idx<LLWorldMap::getInstance()->mMapLayers[map].size(); ++layer_idx) { - if (gWorldMap->mMapLayers[map][layer_idx].LayerDefined) + if (LLWorldMap::getInstance()->mMapLayers[map][layer_idx].LayerDefined) { - LLWorldMapLayer *layer = &gWorldMap->mMapLayers[map][layer_idx]; + LLWorldMapLayer *layer = &LLWorldMap::getInstance()->mMapLayers[map][layer_idx]; layer->LayerImage->setBoostLevel(0); } } } - for (LLWorldMap::sim_info_map_t::iterator it = gWorldMap->mSimInfoMap.begin(); - it != gWorldMap->mSimInfoMap.end(); ++it) + for (LLWorldMap::sim_info_map_t::iterator it = LLWorldMap::getInstance()->mSimInfoMap.begin(); + it != LLWorldMap::getInstance()->mSimInfoMap.end(); ++it) { LLSimInfo* info = (*it).second; if (info->mCurrentImage.notNull()) @@ -857,7 +819,7 @@ void LLWorldMapView::setVisible(BOOL visible) } } -void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image) +void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, LLUIImagePtr image) { LLWorldMap::item_info_list_t::const_iterator e; for (e = items.begin(); e != items.end(); ++e) @@ -866,30 +828,28 @@ void LLWorldMapView::drawGenericItems(const LLWorldMap::item_info_list_t& items, } } -void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLPointer<LLViewerImage> image) +void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image) { drawImage(item.mPosGlobal, image); } -void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLPointer<LLViewerImage> image, const LLColor4& color) +void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color) { LLVector3 pos_map = globalPosToView( global_pos ); - gl_draw_image(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f), - image, - color); + image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), + llround(pos_map.mV[VY] - image->getHeight()/2.f), + color); } -void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLPointer<LLViewerImage> image, U32 count, F32 offset, const LLColor4& color) +void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color) { LLVector3 pos_map = globalPosToView( global_pos ); for(U32 i=0; i<count; i++) { - gl_draw_image(llround(pos_map.mV[VX] - image->getWidth() /2.f), - llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), - image, - color); + image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f), + llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset), + color); } } @@ -901,13 +861,13 @@ void LLWorldMapView::drawAgents() for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) { U64 handle = *iter; - LLSimInfo* siminfo = gWorldMap->simInfoFromHandle(handle); + LLSimInfo* siminfo = LLWorldMap::getInstance()->simInfoFromHandle(handle); if (siminfo && (siminfo->mAccess == SIM_ACCESS_DOWN)) { continue; } - LLWorldMap::agent_list_map_t::iterator counts_iter = gWorldMap->mAgentLocationsMap.find(handle); - if (siminfo && siminfo->mShowAgentLocations && counts_iter != gWorldMap->mAgentLocationsMap.end()) + LLWorldMap::agent_list_map_t::iterator counts_iter = LLWorldMap::getInstance()->mAgentLocationsMap.find(handle); + if (siminfo && siminfo->mShowAgentLocations && counts_iter != LLWorldMap::getInstance()->mAgentLocationsMap.end()) { // Show Individual agents (or little stacks where real agents are) LLWorldMap::item_info_list_t& agentcounts = counts_iter->second; @@ -922,12 +882,12 @@ void LLWorldMapView::drawAgents() //LLColor4 color = (agent_count == 1 && is_agent_friend(info.mID)) ? gFriendMapColor : gAvatarMapColor; drawImageStack(info.mPosGlobal, sAvatarSmallImage, agent_count, 3.f, gAvatarMapColor); } - gWorldMap->mNumAgents[handle] = sim_agent_count; // override mNumAgents for this sim + LLWorldMap::getInstance()->mNumAgents[handle] = sim_agent_count; // override mNumAgents for this sim } else { // Show agent 'stack' at center of sim - S32 num_agents = gWorldMap->mNumAgents[handle]; + S32 num_agents = LLWorldMap::getInstance()->mNumAgents[handle]; if (num_agents > 0) { LLVector3d region_center = from_region_handle(handle); @@ -948,7 +908,7 @@ void LLWorldMapView::drawEvents() // First the non-selected events LLWorldMap::item_info_list_t::const_iterator e; - for (e = gWorldMap->mPGEvents.begin(); e != gWorldMap->mPGEvents.end(); ++e) + for (e = LLWorldMap::getInstance()->mPGEvents.begin(); e != LLWorldMap::getInstance()->mPGEvents.end(); ++e) { if (!e->mSelected) { @@ -957,7 +917,7 @@ void LLWorldMapView::drawEvents() } if (show_mature) { - for (e = gWorldMap->mMatureEvents.begin(); e != gWorldMap->mMatureEvents.end(); ++e) + for (e = LLWorldMap::getInstance()->mMatureEvents.begin(); e != LLWorldMap::getInstance()->mMatureEvents.end(); ++e) { if (!e->mSelected) { @@ -967,7 +927,7 @@ void LLWorldMapView::drawEvents() } // Then the selected events - for (e = gWorldMap->mPGEvents.begin(); e != gWorldMap->mPGEvents.end(); ++e) + for (e = LLWorldMap::getInstance()->mPGEvents.begin(); e != LLWorldMap::getInstance()->mPGEvents.end(); ++e) { if (e->mSelected) { @@ -976,7 +936,7 @@ void LLWorldMapView::drawEvents() } if (show_mature) { - for (e = gWorldMap->mMatureEvents.begin(); e != gWorldMap->mMatureEvents.end(); ++e) + for (e = LLWorldMap::getInstance()->mMatureEvents.begin(); e != LLWorldMap::getInstance()->mMatureEvents.end(); ++e) { if (e->mSelected) { @@ -992,8 +952,8 @@ void LLWorldMapView::drawFrustum() // Draw frustum F32 meters_to_pixels = gMapScale/ REGION_WIDTH_METERS; - F32 horiz_fov = gCamera->getView() * gCamera->getAspect(); - F32 far_clip_meters = gCamera->getFar(); + F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); + F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); F32 far_clip_pixels = far_clip_meters * meters_to_pixels; F32 half_width_meters = far_clip_meters * tan( horiz_fov / 2 ); @@ -1007,7 +967,7 @@ void LLWorldMapView::drawFrustum() // Since we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); gGL.translatef( ctr_x, ctr_y, 0 ); - glRotatef( atan2( gCamera->getAtAxis().mV[VX], gCamera->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); + glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); // Draw triangle with more alpha in far pixels to make it // fade out in distance. @@ -1138,7 +1098,7 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_ { LLVector3d pos_global = viewPosToGlobal(x, y); - LLSimInfo* info = gWorldMap->simInfoFromPosGlobal(pos_global); + LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if (info) { LLViewerRegion *region = gAgent.getRegion(); @@ -1150,7 +1110,7 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, LLString& msg, LLRect* sticky_ if (info->mAccess != SIM_ACCESS_DOWN) { - S32 agent_count = gWorldMap->mNumAgents[info->mHandle]; + S32 agent_count = LLWorldMap::getInstance()->mNumAgents[info->mHandle]; if (region && region->getHandle() == info->mHandle) { ++agent_count; // Bump by 1 if we're here @@ -1199,15 +1159,14 @@ static void drawDot(F32 x_pixels, F32 y_pixels, const LLColor4& color, F32 relative_z, F32 dot_radius, - LLPointer<LLViewerImage> dot_image) + LLUIImagePtr dot_image) { const F32 HEIGHT_THRESHOLD = 7.f; if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD) { - gl_draw_image( llround(x_pixels) - dot_image->getWidth()/2, + dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2, llround(y_pixels) - dot_image->getHeight()/2, - dot_image, color); } else @@ -1241,7 +1200,7 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, F32 dot_radius) { const F32 HEIGHT_THRESHOLD = 7.f; - LLViewerImage* dot_image = sAvatarSmallImage; + LLUIImagePtr dot_image = sAvatarSmallImage; if(relative_z < -HEIGHT_THRESHOLD) { dot_image = sAvatarBelowImage; @@ -1250,10 +1209,10 @@ void LLWorldMapView::drawAvatar(F32 x_pixels, { dot_image = sAvatarAboveImage; } - gl_draw_image( + dot_image->draw( llround(x_pixels) - dot_image->getWidth()/2, llround(y_pixels) - dot_image->getHeight()/2, - dot_image, color); + color); } // Pass relative Z of 0 to draw at same level. @@ -1447,7 +1406,7 @@ void LLWorldMapView::drawTrackingArrow(const LLRect& rect, S32 x, S32 y, sTrackingArrowY, arrow_size, arrow_size, RAD_TO_DEG * angle, - sTrackArrowImage, + sTrackArrowImage->getImage(), color); } @@ -1521,7 +1480,7 @@ bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bo if (y < item_y - BIG_DOT_RADIUS) return false; if (y > item_y + BIG_DOT_RADIUS) return false; - LLSimInfo* sim_info = gWorldMap->simInfoFromHandle(item.mRegionHandle); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromHandle(item.mRegionHandle); if (sim_info) { if (track) @@ -1551,7 +1510,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, // *HACK: Adjust Z values automatically for liaisons & gods so // we swoop down when they click on the map. Sadly, the P2P // branch does not pay attention to this value; however, the - // Distributed Messaging branch honors kt. + // Distributed Messaging branch honors it. if(gAgent.isGodlike()) { pos_global.mdV[VZ] = 200.0; @@ -1559,30 +1518,30 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, *hit_type = 0; // hit nothing - gWorldMap->mIsTrackingUnknownLocation = FALSE; - gWorldMap->mIsTrackingDoubleClick = FALSE; - gWorldMap->mIsTrackingCommit = FALSE; + LLWorldMap::getInstance()->mIsTrackingUnknownLocation = FALSE; + LLWorldMap::getInstance()->mIsTrackingDoubleClick = FALSE; + LLWorldMap::getInstance()->mIsTrackingCommit = FALSE; LLWorldMap::item_info_list_t::iterator it; // clear old selected stuff - for (it = gWorldMap->mPGEvents.begin(); it != gWorldMap->mPGEvents.end(); ++it) + for (it = LLWorldMap::getInstance()->mPGEvents.begin(); it != LLWorldMap::getInstance()->mPGEvents.end(); ++it) { (*it).mSelected = FALSE; } - for (it = gWorldMap->mMatureEvents.begin(); it != gWorldMap->mMatureEvents.end(); ++it) + for (it = LLWorldMap::getInstance()->mMatureEvents.begin(); it != LLWorldMap::getInstance()->mMatureEvents.end(); ++it) { (*it).mSelected = FALSE; } - for (it = gWorldMap->mPopular.begin(); it != gWorldMap->mPopular.end(); ++it) + for (it = LLWorldMap::getInstance()->mPopular.begin(); it != LLWorldMap::getInstance()->mPopular.end(); ++it) { (*it).mSelected = FALSE; } - for (it = gWorldMap->mLandForSale.begin(); it != gWorldMap->mLandForSale.end(); ++it) + for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) { (*it).mSelected = FALSE; } - for (it = gWorldMap->mClassifieds.begin(); it != gWorldMap->mClassifieds.end(); ++it) + for (it = LLWorldMap::getInstance()->mClassifieds.begin(); it != LLWorldMap::getInstance()->mClassifieds.end(); ++it) { (*it).mSelected = FALSE; } @@ -1590,7 +1549,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, // Select event you clicked on if (gSavedSettings.getBOOL("MapShowEvents")) { - for (it = gWorldMap->mPGEvents.begin(); it != gWorldMap->mPGEvents.end(); ++it) + for (it = LLWorldMap::getInstance()->mPGEvents.begin(); it != LLWorldMap::getInstance()->mPGEvents.end(); ++it) { LLItemInfo& event = *it; @@ -1604,7 +1563,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, } if (gSavedSettings.getBOOL("ShowMatureEvents")) { - for (it = gWorldMap->mMatureEvents.begin(); it != gWorldMap->mMatureEvents.end(); ++it) + for (it = LLWorldMap::getInstance()->mMatureEvents.begin(); it != LLWorldMap::getInstance()->mMatureEvents.end(); ++it) { LLItemInfo& event = *it; @@ -1621,7 +1580,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, if (gSavedSettings.getBOOL("MapShowPopular")) { - for (it = gWorldMap->mPopular.begin(); it != gWorldMap->mPopular.end(); ++it) + for (it = LLWorldMap::getInstance()->mPopular.begin(); it != LLWorldMap::getInstance()->mPopular.end(); ++it) { LLItemInfo& popular = *it; @@ -1636,7 +1595,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, if (gSavedSettings.getBOOL("MapShowLandForSale")) { - for (it = gWorldMap->mLandForSale.begin(); it != gWorldMap->mLandForSale.end(); ++it) + for (it = LLWorldMap::getInstance()->mLandForSale.begin(); it != LLWorldMap::getInstance()->mLandForSale.end(); ++it) { LLItemInfo& land = *it; @@ -1651,7 +1610,7 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, if (gSavedSettings.getBOOL("MapShowClassifieds")) { - for (it = gWorldMap->mClassifieds.begin(); it != gWorldMap->mClassifieds.end(); ++it) + for (it = LLWorldMap::getInstance()->mClassifieds.begin(); it != LLWorldMap::getInstance()->mClassifieds.end(); ++it) { LLItemInfo& classified = *it; @@ -1732,11 +1691,11 @@ BOOL LLWorldMapView::handleMouseUp( S32 x, S32 y, MASK mask ) void LLWorldMapView::updateBlock(S32 block_x, S32 block_y) { S32 offset = block_x | (block_y * MAP_BLOCK_RES); - if (!gWorldMap->mMapBlockLoaded[gWorldMap->mCurrentMap][offset]) + if (!LLWorldMap::getInstance()->mMapBlockLoaded[LLWorldMap::getInstance()->mCurrentMap][offset]) { // llinfos << "Loading Block (" << block_x << "," << block_y << ")" << llendl; - gWorldMap->sendMapBlockRequest(block_x << 3, block_y << 3, (block_x << 3) + 7, (block_y << 3) + 7); - gWorldMap->mMapBlockLoaded[gWorldMap->mCurrentMap][offset] = TRUE; + LLWorldMap::getInstance()->sendMapBlockRequest(block_x << 3, block_y << 3, (block_x << 3) + 7, (block_y << 3) + 7); + LLWorldMap::getInstance()->mMapBlockLoaded[LLWorldMap::getInstance()->mCurrentMap][offset] = TRUE; } } @@ -1857,15 +1816,15 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) } default: { - if (gWorldMap->mIsTrackingUnknownLocation) + if (LLWorldMap::getInstance()->mIsTrackingUnknownLocation) { - gWorldMap->mIsTrackingDoubleClick = TRUE; + LLWorldMap::getInstance()->mIsTrackingDoubleClick = TRUE; } else { // Teleport if we got a valid location LLVector3d pos_global = viewPosToGlobal(x,y); - LLSimInfo* sim_info = gWorldMap->simInfoFromPosGlobal(pos_global); + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); if (sim_info && sim_info->mAccess != SIM_ACCESS_DOWN) { gAgent.teleportViaLocation( pos_global ); diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index f3c5d654b6..02fc7b7e33 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -83,10 +83,10 @@ public: LLVector3d viewPosToGlobal(S32 x,S32 y); virtual void draw(); - void drawGenericItems(const LLWorldMap::item_info_list_t& items, LLPointer<LLViewerImage> image); - void drawGenericItem(const LLItemInfo& item, LLPointer<LLViewerImage> image); - void drawImage(const LLVector3d& global_pos, LLPointer<LLViewerImage> image, const LLColor4& color = LLColor4::white); - void drawImageStack(const LLVector3d& global_pos, LLPointer<LLViewerImage> image, U32 count, F32 offset, const LLColor4& color); + void drawGenericItems(const LLWorldMap::item_info_list_t& items, LLUIImagePtr image); + void drawGenericItem(const LLItemInfo& item, LLUIImagePtr image); + void drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color = LLColor4::white); + void drawImageStack(const LLVector3d& global_pos, LLUIImagePtr image, U32 count, F32 offset, const LLColor4& color); void drawAgents(); void drawEvents(); void drawFrustum(); @@ -136,21 +136,21 @@ protected: public: LLColor4 mBackgroundColor; - static LLPointer<LLViewerImage> sAvatarYouSmallImage; - static LLPointer<LLViewerImage> sAvatarSmallImage; - static LLPointer<LLViewerImage> sAvatarLargeImage; - static LLPointer<LLViewerImage> sAvatarAboveImage; - static LLPointer<LLViewerImage> sAvatarBelowImage; - static LLPointer<LLViewerImage> sTelehubImage; - static LLPointer<LLViewerImage> sInfohubImage; - static LLPointer<LLViewerImage> sHomeImage; - static LLPointer<LLViewerImage> sEventImage; - static LLPointer<LLViewerImage> sEventMatureImage; - static LLPointer<LLViewerImage> sTrackCircleImage; - static LLPointer<LLViewerImage> sTrackArrowImage; - static LLPointer<LLViewerImage> sClassifiedsImage; - static LLPointer<LLViewerImage> sPopularImage; - static LLPointer<LLViewerImage> sForSaleImage; + static LLUIImagePtr sAvatarYouSmallImage; + static LLUIImagePtr sAvatarSmallImage; + static LLUIImagePtr sAvatarLargeImage; + static LLUIImagePtr sAvatarAboveImage; + static LLUIImagePtr sAvatarBelowImage; + static LLUIImagePtr sTelehubImage; + static LLUIImagePtr sInfohubImage; + static LLUIImagePtr sHomeImage; + static LLUIImagePtr sEventImage; + static LLUIImagePtr sEventMatureImage; + static LLUIImagePtr sTrackCircleImage; + static LLUIImagePtr sTrackArrowImage; + static LLUIImagePtr sClassifiedsImage; + static LLUIImagePtr sPopularImage; + static LLUIImagePtr sForSaleImage; static F32 sThresholdA; static F32 sThresholdB; diff --git a/indra/newview/macview_Prefix.h b/indra/newview/macview_Prefix.h index 08c59bcedd..eb394dc557 100644 --- a/indra/newview/macview_Prefix.h +++ b/indra/newview/macview_Prefix.h @@ -117,7 +117,7 @@ #include "llresmgr.h" #include "llui.h" #include "llviewborder.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" /////////////////// From lldrawpool.cpp @@ -172,7 +172,7 @@ #include "llviewerwindow.h" #include "llcontrol.h" #include "lluictrl.h" -#include "llvieweruictrlfactory.h" +#include "lluictrlfactory.h" #include "llviewborder.h" #include "llviewerimagelist.h" #include "llbutton.h" diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 448bda1857..74576492a2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -374,7 +374,6 @@ void LLPipeline::cleanup() mBloomImagep = NULL; mBloomImage2p = NULL; mFaceSelectImagep = NULL; - mAlphaSizzleImagep = NULL; mMovedBridge.clear(); @@ -573,19 +572,16 @@ void LLPipeline::restoreGL() LLShaderMgr::setShaders(); } - if (gWorldp) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + LLViewerRegion* region = *iter; + for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) { - LLViewerRegion* region = *iter; - for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) + LLSpatialPartition* part = region->getSpatialPartition(i); + if (part) { - LLSpatialPartition* part = region->getSpatialPartition(i); - if (part) - { - part->restoreGL(); - } + part->restoreGL(); } } } @@ -596,7 +592,7 @@ BOOL LLPipeline::canUseVertexShaders() { if (!gGLManager.mHasVertexShader || !gGLManager.mHasFragmentShader || - !gFeatureManagerp->isFeatureAvailable("VertexShaderEnable") || + !LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") || (assertInitialized() && mVertexShadersLoaded != 1) ) { return FALSE; @@ -725,20 +721,17 @@ void LLPipeline::dirtyPoolObjectTextures(const std::set<LLViewerImage*>& texture } } - if (gWorldp) + LLOctreeDirtyTexture dirty(textures); + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { - LLOctreeDirtyTexture dirty(textures); - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + LLViewerRegion* region = *iter; + for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) { - LLViewerRegion* region = *iter; - for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) + LLSpatialPartition* part = region->getSpatialPartition(i); + if (part) { - LLSpatialPartition* part = region->getSpatialPartition(i); - if (part) - { - dirty.traverse(part->mOctree); - } + dirty.traverse(part->mOctree); } } } @@ -1111,8 +1104,8 @@ void LLPipeline::updateMove() { LLFastTimer ot(LLFastTimer::FTM_OCTREE_BALANCE); - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) @@ -1189,8 +1182,8 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); LLGLDepthTest depth(GL_TRUE, GL_FALSE); - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; if (water_clip != 0) @@ -1574,8 +1567,8 @@ void LLPipeline::shiftObjects(const LLVector3 &offset) } mShiftList.resize(0); - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) @@ -2106,7 +2099,7 @@ void LLPipeline::postSort(LLCamera& camera) mSelectedFaces.clear(); // Draw face highlights for selected faces. - if (gSelectMgr->getTEMode()) + if (LLSelectMgr::getInstance()->getTEMode()) { struct f : public LLSelectedTEFunctor { @@ -2119,7 +2112,7 @@ void LLPipeline::postSort(LLCamera& camera) return true; } } func; - gSelectMgr->getSelection()->applyToTEs(&func); + LLSelectMgr::getInstance()->getSelection()->applyToTEs(&func); } } @@ -2146,15 +2139,9 @@ void render_hud_elements() LLTracker::render3D(); // Show the property lines - if (gWorldp) - { - gWorldp->renderPropertyLines(); - } - if (gParcelMgr) - { - gParcelMgr->render(); - gParcelMgr->renderParcelCollision(); - } + LLWorld::getInstance()->renderPropertyLines(); + LLViewerParcelMgr::getInstance()->render(); + LLViewerParcelMgr::getInstance()->renderParcelCollision(); // Render debugging beacons. gObjectList.renderObjectBeacons(); @@ -2164,7 +2151,7 @@ void render_hud_elements() else if (gForceRenderLandFence) { // This is only set when not rendering the UI, for parcel snapshots - gParcelMgr->render(); + LLViewerParcelMgr::getInstance()->render(); } else if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { @@ -2260,11 +2247,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } - if (!mAlphaSizzleImagep) - { - mAlphaSizzleImagep = gImageList.getImage(LLUUID(gViewerArt.getString("alpha_sizzle.tga")), MIPMAP_TRUE, TRUE); - } - /////////////////////////////////////////// // // Sync and verify GL state @@ -2534,8 +2516,8 @@ void LLPipeline::renderDebug() glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); // Debug stuff. - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) @@ -2607,7 +2589,7 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects) for (std::set<LLViewerObject*>::iterator iter = objects.begin(); iter != objects.end(); ++iter) { - stateSort((*iter)->mDrawable, *gCamera); + stateSort((*iter)->mDrawable, *LLViewerCamera::getInstance()); } LLMemType mt(LLMemType::MTYPE_PIPELINE); @@ -3077,7 +3059,7 @@ void LLPipeline::setupAvatarLights(BOOL for_edit) { LLColor4 diffuse(0.8f, 0.8f, 0.8f, 0.f); LLVector4 light_pos_cam(-8.f, 0.25f, 10.f, 0.f); // w==0 => directional light - LLMatrix4 camera_mat = gCamera->getModelview(); + LLMatrix4 camera_mat = LLViewerCamera::getInstance()->getModelview(); LLMatrix4 camera_rot(camera_mat.getMat3()); camera_rot.invert(); LLVector4 light_pos = light_pos_cam * camera_rot; @@ -3419,7 +3401,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLColor4 light_color = LLColor4::white; light_color.mV[3] = 0.0f; - LLVector3 light_pos(gCamera->getOrigin()); + LLVector3 light_pos(LLViewerCamera::getInstance()->getOrigin()); LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; @@ -3980,8 +3962,8 @@ LLViewerObject* LLPipeline::pickObject(const LLVector3 &start, const LLVector3 & { LLDrawable* drawable = NULL; - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME); @@ -4035,19 +4017,16 @@ void LLPipeline::resetVertexBuffers() { sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - if (gWorldp) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + LLViewerRegion* region = *iter; + for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) { - LLViewerRegion* region = *iter; - for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) + LLSpatialPartition* part = region->getSpatialPartition(i); + if (part) { - LLSpatialPartition* part = region->getSpatialPartition(i); - if (part) - { - part->resetVertexBuffers(); - } + part->resetVertexBuffers(); } } } @@ -4239,7 +4218,7 @@ void LLPipeline::generateReflectionMap(LLCubeMap* cube_map, LLCamera& cube_cam) glTranslatef(-origin.mV[0], -origin.mV[1], -origin.mV[2]); cube_cam.setOrigin(origin); LLViewerCamera::updateFrustumPlanes(cube_cam); - cube_cam.setOrigin(gCamera->getOrigin()); + cube_cam.setOrigin(LLViewerCamera::getInstance()->getOrigin()); static LLCullResult result; gPipeline.updateCull(cube_cam, result); gPipeline.stateSort(cube_cam, result); @@ -4863,8 +4842,8 @@ void LLPipeline::renderBloom(BOOL for_snapshot) void LLPipeline::processImagery(LLCamera& camera) { - for (LLWorld::region_list_t::iterator iter = gWorldp->getRegionList().begin(); - iter != gWorldp->getRegionList().end(); ++iter) + for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* region = *iter; LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME); @@ -4909,7 +4888,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) F32 pd; S32 water_clip = 0; - if (!gCamera->cameraUnderWater()) + if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //camera is above water, clip plane points up pnorm.setVec(0,0,1); pd = -height; @@ -4926,7 +4905,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) - if (!gCamera->cameraUnderWater()) + if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map LLViewerImage::unbindTexture(0, GL_TEXTURE_2D); glClearColor(0,0,0,0); @@ -5022,7 +5001,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) (1<<LLPipeline::RENDER_TYPE_GROUND)); stop_glerror(); - LLPipeline::sUnderWaterRender = gCamera->cameraUnderWater() ? FALSE : TRUE; + LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? FALSE : TRUE; if (LLPipeline::sUnderWaterRender) { @@ -5071,14 +5050,14 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) mRenderTypeMask = type_mask; LLDrawPoolWater::sNeedsReflectionUpdate = FALSE; LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; - gCamera->setUserClipPlane(LLPlane(-pnorm, -pd)); + LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); LLPipeline::sUseOcclusion = occlusion; } } LLCubeMap* LLPipeline::findReflectionMap(const LLVector3& location) { - LLViewerRegion* region = gWorldp->getRegionFromPosAgent(location); + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosAgent(location); if (region) { LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME); @@ -5125,7 +5104,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); U32 mask; - BOOL muted = gMuteListp && gMuteListp->isMuted(avatar->getID()); + BOOL muted = LLMuteList::getInstance()->isMuted(avatar->getID()); if (muted) { @@ -5151,7 +5130,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) sReflectionRender = TRUE; sImpostorRender = TRUE; - markVisible(avatar->mDrawable, *gCamera); + markVisible(avatar->mDrawable, *LLViewerCamera::getInstance()); LLVOAvatar::sUseImpostors = FALSE; LLVOAvatar::attachment_map_t::iterator iter; @@ -5162,18 +5141,18 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLViewerObject* object = iter->second->getObject(); if (object) { - markVisible(object->mDrawable->getSpatialBridge(), *gCamera); + markVisible(object->mDrawable->getSpatialBridge(), *LLViewerCamera::getInstance()); } } - stateSort(*gCamera, result); + stateSort(*LLViewerCamera::getInstance(), result); const LLVector3* ext = avatar->mDrawable->getSpatialExtents(); LLVector3 pos(avatar->getRenderPosition()+avatar->getImpostorOffset()); - LLCamera camera = *gCamera; + LLCamera camera = *LLViewerCamera::getInstance(); - camera.lookAt(gCamera->getOrigin(), pos, gCamera->getUpAxis()); + camera.lookAt(LLViewerCamera::getInstance()->getOrigin(), pos, LLViewerCamera::getInstance()->getUpAxis()); LLVector2 tdim; @@ -5216,7 +5195,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) glClearStencil(0); // get the number of pixels per angle - F32 pa = gViewerWindow->getWindowDisplayHeight()/(RAD_TO_DEG*gCamera->getView()); + F32 pa = gViewerWindow->getWindowDisplayHeight() / (RAD_TO_DEG * LLViewerCamera::getInstance()->getView()); //get resolution based on angle width and height of impostor (double desired resolution to prevent aliasing) U32 resY = llmin(nhpo2((U32) (fov*pa)), (U32) 512); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9c64ccdbe3..6e02b55daf 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -334,8 +334,6 @@ public: RENDER_DEBUG_SHAME = 0x400000, }; - LLPointer<LLViewerImage> mAlphaSizzleImagep; - public: LLSpatialPartition* getSpatialPartition(LLViewerObject* vobj); diff --git a/indra/test/llmessagetemplateparser_tut.cpp b/indra/test/llmessagetemplateparser_tut.cpp index e9988be68f..e2680e315f 100644 --- a/indra/test/llmessagetemplateparser_tut.cpp +++ b/indra/test/llmessagetemplateparser_tut.cpp @@ -56,7 +56,7 @@ namespace tut char * prehash(const char * name) { - return gMessageStringTable.getString(name); + return LLMessageStringTable::getInstance()->getString(name); } void ensure_block_attributes(std::string identifier, diff --git a/indra/test/llsdmessagereader_tut.cpp b/indra/test/llsdmessagereader_tut.cpp index 646b875324..67287d55e2 100755 --- a/indra/test/llsdmessagereader_tut.cpp +++ b/indra/test/llsdmessagereader_tut.cpp @@ -46,7 +46,7 @@ namespace tut const std::string& expected_name) { LLSDMessageReader msg; - msg.setMessage(gMessageStringTable.getString(msg_name.c_str()), msg_data); + msg.setMessage(LLMessageStringTable::getInstance()->getString(msg_name.c_str()), msg_data); ensure_equals("Ensure name", std::string(msg.getMessageName()), expected_name); } diff --git a/indra/test/lltemplatemessagebuilder_tut.cpp b/indra/test/lltemplatemessagebuilder_tut.cpp index 31e9c718ab..a9d515dfdc 100644 --- a/indra/test/lltemplatemessagebuilder_tut.cpp +++ b/indra/test/lltemplatemessagebuilder_tut.cpp @@ -65,7 +65,7 @@ namespace tut LL_VERSION_PATCH, FALSE, "notasharedsecret"); - init_prehash_data(); + //init_prehash_data(); init = true; } return LLMessageTemplate(_PREHASH_TestMessage, 1, MFT_HIGH); diff --git a/indra/test/message_tut.cpp b/indra/test/message_tut.cpp index 5d9f6ee65e..ca0452a9f3 100644 --- a/indra/test/message_tut.cpp +++ b/indra/test/message_tut.cpp @@ -62,7 +62,7 @@ namespace tut if(! init) { ll_init_apr(); - init_prehash_data(); + //init_prehash_data(); init = true; } |