示例#1
0
			// Note on event recording - QUIT is a known special case and we are choosing NOT to record it for the record and playback feature 
			// it is handled at a very low-level
const char* cursorIDToName(int id)
{
	switch (id)
	{
		case UI_CURSOR_ARROW:							return "UI_CURSOR_ARROW";
		case UI_CURSOR_WAIT:							return "UI_CURSOR_WAIT";
		case UI_CURSOR_HAND:							return "UI_CURSOR_HAND";
		case UI_CURSOR_IBEAM:							return "UI_CURSOR_IBEAM";
		case UI_CURSOR_CROSS:							return "UI_CURSOR_CROSS";
		case UI_CURSOR_SIZENWSE:						return "UI_CURSOR_SIZENWSE";
		case UI_CURSOR_SIZENESW:						return "UI_CURSOR_SIZENESW";
		case UI_CURSOR_SIZEWE:							return "UI_CURSOR_SIZEWE";
		case UI_CURSOR_SIZENS:							return "UI_CURSOR_SIZENS";
		case UI_CURSOR_NO:								return "UI_CURSOR_NO";
		case UI_CURSOR_WORKING:							return "UI_CURSOR_WORKING";
		case UI_CURSOR_TOOLGRAB:						return "UI_CURSOR_TOOLGRAB";
		case UI_CURSOR_TOOLLAND:						return "UI_CURSOR_TOOLLAND";
		case UI_CURSOR_TOOLFOCUS:						return "UI_CURSOR_TOOLFOCUS";
		case UI_CURSOR_TOOLCREATE:						return "UI_CURSOR_TOOLCREATE";
		case UI_CURSOR_ARROWDRAG:						return "UI_CURSOR_ARROWDRAG";
		case UI_CURSOR_ARROWCOPY:						return "UI_CURSOR_ARROWCOPY";
		case UI_CURSOR_ARROWDRAGMULTI:					return "UI_CURSOR_ARROWDRAGMULTI";
		case UI_CURSOR_ARROWCOPYMULTI:					return "UI_CURSOR_ARROWCOPYMULTI";
		case UI_CURSOR_NOLOCKED:						return "UI_CURSOR_NOLOCKED";
		case UI_CURSOR_ARROWLOCKED:						return "UI_CURSOR_ARROWLOCKED";
		case UI_CURSOR_GRABLOCKED:						return "UI_CURSOR_GRABLOCKED";
		case UI_CURSOR_TOOLTRANSLATE:					return "UI_CURSOR_TOOLTRANSLATE";
		case UI_CURSOR_TOOLROTATE:						return "UI_CURSOR_TOOLROTATE";
		case UI_CURSOR_TOOLSCALE:						return "UI_CURSOR_TOOLSCALE";
		case UI_CURSOR_TOOLCAMERA:						return "UI_CURSOR_TOOLCAMERA";
		case UI_CURSOR_TOOLPAN:							return "UI_CURSOR_TOOLPAN";
		case UI_CURSOR_TOOLZOOMIN:						return "UI_CURSOR_TOOLZOOMIN";
		case UI_CURSOR_TOOLPICKOBJECT3:					return "UI_CURSOR_TOOLPICKOBJECT3";
		case UI_CURSOR_TOOLPLAY:						return "UI_CURSOR_TOOLPLAY";
		case UI_CURSOR_TOOLPAUSE:						return "UI_CURSOR_TOOLPAUSE";
		case UI_CURSOR_TOOLMEDIAOPEN:					return "UI_CURSOR_TOOLMEDIAOPEN";
		case UI_CURSOR_PIPETTE:							return "UI_CURSOR_PIPETTE";
		/* <FS:LO> Legacy cursor setting from main program
		case UI_CURSOR_TOOLSIT:							return "UI_CURSOR_TOOLSIT";
		case UI_CURSOR_TOOLBUY:							return "UI_CURSOR_TOOLBUY";
		case UI_CURSOR_TOOLOPEN:						return "UI_CURSOR_TOOLOPEN";*/
 		case UI_CURSOR_TOOLSIT:							if (gWindowImplementation->mUseLegacyCursors) return "UI_CURSOR_TOOLSIT_LEGACY"; else return "UI_CURSOR_TOOLSIT";
 		case UI_CURSOR_TOOLBUY:							if (gWindowImplementation->mUseLegacyCursors) return "UI_CURSOR_TOOLBUY_LEGACY"; else return "UI_CURSOR_TOOLBUY";
 		case UI_CURSOR_TOOLOPEN:						if (gWindowImplementation->mUseLegacyCursors) return "UI_CURSOR_TOOLOPEN_LEGACY"; else return "UI_CURSOR_TOOLOPEN";
 		case UI_CURSOR_TOOLPAY:							if (gWindowImplementation->mUseLegacyCursors) return "UI_CURSOR_TOOLPAY_LEGACY"; else return "UI_CURSOR_TOOLBUY";
		// </FS:LO>
		case UI_CURSOR_TOOLPATHFINDING:					return "UI_CURSOR_PATHFINDING";
		case UI_CURSOR_TOOLPATHFINDING_PATH_START:		return "UI_CURSOR_PATHFINDING_START";
		case UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD:	return "UI_CURSOR_PATHFINDING_START_ADD";
		case UI_CURSOR_TOOLPATHFINDING_PATH_END:		return "UI_CURSOR_PATHFINDING_END";
		case UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD:	return "UI_CURSOR_PATHFINDING_END_ADD";
		case UI_CURSOR_TOOLNO:							return "UI_CURSOR_NO";
	}

	LL_ERRS() << "cursorIDToName: unknown cursor id" << id << LL_ENDL;

	return "UI_CURSOR_ARROW";
}
示例#2
0
void LLDrawable::makeActive()
{		
#if !LL_RELEASE_FOR_DOWNLOAD
	if (mVObjp.notNull())
	{
		U32 pcode = mVObjp->getPCode();
		if (pcode == LLViewerObject::LL_VO_WATER ||
			pcode == LLViewerObject::LL_VO_VOID_WATER ||
			pcode == LLViewerObject::LL_VO_SURFACE_PATCH ||
			pcode == LLViewerObject::LL_VO_PART_GROUP ||
			pcode == LLViewerObject::LL_VO_HUD_PART_GROUP ||
#if ENABLE_CLASSIC_CLOUDS
			pcode == LLViewerObject::LL_VO_CLOUDS ||
#endif
			pcode == LLViewerObject::LL_VO_GROUND ||
			pcode == LLViewerObject::LL_VO_SKY)
		{
			LL_ERRS() << "Static viewer object has active drawable!" << LL_ENDL;
		}
	}
#endif

	if (!isState(ACTIVE)) // && mGeneration > 0)
	{
		setState(ACTIVE);
		
		//parent must be made active first
		if (!isRoot() && !mParent->isActive())
		{
			mParent->makeActive();
			//NOTE: linked set will now NEVER become static
			mParent->setState(LLDrawable::ACTIVE_CHILD);
		}

		//all child objects must also be active
		llassert_always(mVObjp);
		
		LLViewerObject::const_child_list_t& child_list = mVObjp->getChildren();
		for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
			 iter != child_list.end(); iter++)
		{
			LLViewerObject* child = *iter;
			LLDrawable* drawable = child->mDrawable;
			if (drawable)
			{
				drawable->makeActive();
			}
		}

		if (mVObjp->getPCode() == LL_PCODE_VOLUME)
		{
			gPipeline.markRebuild(this, LLDrawable::REBUILD_VOLUME, TRUE);
		}
		updatePartition();
	}

	llassert(isAvatar() || isRoot() || mParent->isActive());
}
示例#3
0
LLDrawPool* LLRenderPass::instancePool()
{
#if LL_RELEASE_FOR_DOWNLOAD
	LL_WARNS() << "Attempting to instance a render pass.  Invalid operation." << LL_ENDL;
#else
	LL_ERRS() << "Attempting to instance a render pass.  Invalid operation." << LL_ENDL;
#endif
	return NULL;
}
void LLThreadLocalPointerBase::initStorage( )
{
	apr_status_t result = apr_threadkey_private_create(&mThreadKey, NULL, gAPRPoolp);
	if (result != APR_SUCCESS)
	{
		ll_apr_warn_status(result);
		LL_ERRS() << "Failed to allocate thread local data" << LL_ENDL;
	}
}
示例#5
0
//static
std::string LLKeyboard::stringFromAccelerator( MASK accel_mask, KEY key )
{
	std::string res;
	
	// break early if this is a silly thing to do.
	if( KEY_NONE == key )
	{
		return res;
	}
	
	LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator;
	
	if( trans == NULL )
	{
		LL_ERRS() << "No mKeyStringTranslator" << LL_ENDL;
		return res;
	}
	
	// Append any masks
#ifdef LL_DARWIN
	// Standard Mac names for modifier keys in menu equivalents
	// We could use the symbol characters, but they only exist in certain fonts.
	if( accel_mask & MASK_CONTROL )
	{
		if ( accel_mask & MASK_MAC_CONTROL )
		{
			res.append( trans("accel-mac-control") );
		}
		else
		{
			res.append( trans("accel-mac-command") );		// Symbol would be "\xE2\x8C\x98"
		}
	}
	if( accel_mask & MASK_ALT )
		res.append( trans("accel-mac-option") );		// Symbol would be "\xE2\x8C\xA5"
	if( accel_mask & MASK_SHIFT )
		res.append( trans("accel-mac-shift") );		// Symbol would be "\xE2\x8C\xA7"
#else
	if( accel_mask & MASK_CONTROL )
		res.append( trans("accel-win-control") );
	if( accel_mask & MASK_ALT )
		res.append( trans("accel-win-alt") );
	if( accel_mask & MASK_SHIFT )
		res.append( trans("accel-win-shift") );
#endif
	std::string key_string = LLKeyboard::stringFromKey(key);
	if ((accel_mask & MASK_NORMALKEYS) &&
		(key_string[0] == '-' || key_string[0] == '=' || key_string[0] == '+'))
	{
		res.append( " " );
	}

	std::string keystr = stringFromKey( key );
	res.append( keystr );
	
	return res;
}
bool LLMenuOptionPathfindingRebakeNavmesh::canRebakeRegion() const
{
	if (!mIsInitialized)
	{
		LL_ERRS("navmeshRebaking") << "LLMenuOptionPathfindingRebakeNavmesh class has not been initialized "
			<< "when the ability to rebake navmesh is being requested." << LL_ENDL;
	}
	return mCanRebakeRegion;
}
LLMenuOptionPathfindingRebakeNavmesh::ERebakeNavMeshMode LLMenuOptionPathfindingRebakeNavmesh::getMode() const
{
	if (!mIsInitialized)
	{
		LL_ERRS("navmeshRebaking") << "LLMenuOptionPathfindingRebakeNavmesh class has not been initialized "
			<< "when the mode is being requested." << LL_ENDL;
	}
	return mRebakeNavMeshMode;
}
LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelName)
{
	ChannelMap::iterator p = mChannels.find(channelName);
	if(p == mChannels.end())
	{
		LL_ERRS() << "Did not find channel named " << channelName << LL_ENDL;
		return LLNotificationChannelPtr();
	}
	return p->second;
}
示例#9
0
void test_cached_control()
{
#define TEST_LLCC(T, V) if((T)mySetting_##T != V) LL_ERRS() << "Fail "#T << LL_ENDL
	TEST_LLCC(U32, 666);
	TEST_LLCC(S32, (S32)-666);
	TEST_LLCC(F32, (F32)-666.666);
	TEST_LLCC(bool, true);
	TEST_LLCC(BOOL, FALSE);
	if((std::string)mySetting_string != "Default String Value") LL_ERRS() << "Fail string" << LL_ENDL;
	TEST_LLCC(LLVector3, LLVector3(1.0f, 2.0f, 3.0f));
	TEST_LLCC(LLVector3d, LLVector3d(6.0f, 5.0f, 4.0f));
	TEST_LLCC(LLRect, LLRect(0, 0, 100, 500));
	TEST_LLCC(LLColor4, LLColor4(0.0f, 0.5f, 1.0f));
	TEST_LLCC(LLColor3, LLColor3(1.0f, 0.f, 0.5f));
	TEST_LLCC(LLColor4U, LLColor4U(255, 200, 100, 255));
//There's no LLSD comparsion for LLCC yet. TEST_LLCC(LLSD, test_llsd); 

	if((std::string)test_BrowserHomePage != "http://www.secondlife.com") LL_ERRS() << "Fail BrowserHomePage" << LL_ENDL;
}
bool LLNotificationTemplates::loadTemplates()
{
	LL_INFOS() << "Reading notifications template" << LL_ENDL;
	// Passing findSkinnedFilenames(constraint=LLDir::ALL_SKINS) makes it
	// output all relevant pathnames instead of just the ones from the most
	// specific skin.
	std::vector<std::string> search_paths =
		gDirUtilp->findSkinnedFilenames(LLDir::XUI, "notifications.xml", LLDir::ALL_SKINS);

	std::string base_filename = search_paths.front();
	LLXMLNodePtr root;
	BOOL success  = LLXMLNode::getLayeredXMLNode(root, search_paths);
	
	if (!success || root.isNull() || !root->hasName( "notifications" ))
	{
		LL_ERRS() << "Problem reading XML from UI Notifications file: " << base_filename << LL_ENDL;
		return false;
	}
	
	clearTemplates();
	
	for (LLXMLNodePtr item = root->getFirstChild();
		 item.notNull(); item = item->getNextSibling())
	{
		if (item->hasName("global"))
		{
			std::string global_name;
			if (item->getAttributeString("name", global_name))
			{
				mGlobalStrings[global_name] = item->getTextContents();
			}
			continue;
		}
		
		if (item->hasName("template"))
		{
			// store an xml template; templates must have a single node (can contain
			// other nodes)
			std::string name;
			item->getAttributeString("name", name);
			LLXMLNodePtr ptr = item->getFirstChild();
			mXmlTemplates[name] = ptr;
			continue;
		}
		
		if (!item->hasName("notification"))
		{
            LL_WARNS() << "Unexpected entity " << item->getName()->mString << 
                       " found in notifications.xml [language=]" << LLUI::getLanguage() << LL_ENDL;
			continue;
		}
	}

	return true;
}
bool LLLFSThread::Request::processRequest()
{
    bool complete = false;
    if (mOperation ==  FILE_READ)
    {
        llassert(mOffset >= 0);
        LLAPRFile infile(mFileName, LL_APR_RB);
        if (!infile.getFileHandle())
        {
            LL_WARNS() << "LLLFS: Unable to read file: " << mFileName << LL_ENDL;
            mBytesRead = 0; // fail
            return true;
        }
        S32 off;
        if (mOffset < 0)
            off = infile.seek(APR_END, 0);
        else
            off = infile.seek(APR_SET, mOffset);
        llassert_always(off >= 0);
        mBytesRead = infile.read(mBuffer, mBytes );
        complete = true;
// 		LL_INFOS() << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << LL_ENDL;
    }
    else if (mOperation ==  FILE_WRITE)
    {
        apr_int32_t flags = APR_CREATE|APR_WRITE|APR_BINARY;
        if (mOffset < 0)
            flags |= APR_APPEND;
        LLAPRFile outfile(mFileName, flags);
        if (!outfile.getFileHandle())
        {
            LL_WARNS() << "LLLFS: Unable to write file: " << mFileName << LL_ENDL;
            mBytesRead = 0; // fail
            return true;
        }
        if (mOffset >= 0)
        {
            S32 seek = outfile.seek(APR_SET, mOffset);
            if (seek < 0)
            {
                LL_WARNS() << "LLLFS: Unable to write file (seek failed): " << mFileName << LL_ENDL;
                mBytesRead = 0; // fail
                return true;
            }
        }
        mBytesRead = outfile.write(mBuffer, mBytes );
        complete = true;
// 		LL_INFOS() << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << LL_ENDL;
    }
    else
    {
        LL_ERRS() << "LLLFSThread::unknown operation: " << (S32)mOperation << LL_ENDL;
    }
    return complete;
}
LLFontManager::LLFontManager()
{
	int error;
	error = FT_Init_FreeType(&gFTLibrary);
	if (error)
	{
		// Clean up freetype libs.
		LL_ERRS() << "Freetype initialization failure!" << LL_ENDL;
		FT_Done_FreeType(gFTLibrary);
	}
}
/// Extract the @a key value from the incoming @a event, and call the
/// callable whose name is specified by that map @a key. If no such
/// callable exists, die with LL_ERRS.
void LLEventDispatcher::operator()(const LLSD& event) const
{
    // This could/should be implemented in terms of the two-arg overload.
    // However -- we can produce a more informative error message.
    std::string name(event[mKey]);
    if (! attemptCall(name, event))
    {
        LL_ERRS("LLEventDispatcher") << "LLEventDispatcher(" << mDesc << "): bad " << mKey
                                     << " value '" << name << "'" << LL_ENDL;
    }
}
BOOL LLDriverParamInfo::parseXml(LLXmlTreeNode* node)
{
	llassert( node->hasName( "param" ) && node->getChildByName( "param_driver" ) );

	if( !LLViewerVisualParamInfo::parseXml( node ))
		return FALSE;

	LLXmlTreeNode* param_driver_node = node->getChildByName( "param_driver" );
	if( !param_driver_node )
		return FALSE;

	for (LLXmlTreeNode* child = param_driver_node->getChildByName( "driven" );
		 child;
		 child = param_driver_node->getNextNamedChild())
	{
		S32 driven_id;
		static LLStdStringHandle id_string = LLXmlTree::addAttributeString("id");
		if( child->getFastAttributeS32( id_string, driven_id ) )
		{
			F32 min1 = mMinWeight;
			F32 max1 = mMaxWeight;
			F32 max2 = max1;
			F32 min2 = max1;

			//	driven    ________							//
			//	^        /|       |\						//
			//	|       / |       | \						//
			//	|      /  |       |  \						//
			//	|     /   |       |   \						//
			//	|    /    |       |    \					//
			//-------|----|-------|----|-------> driver		//
			//  | min1   max1    max2  min2

			static LLStdStringHandle min1_string = LLXmlTree::addAttributeString("min1");
			child->getFastAttributeF32( min1_string, min1 ); // optional
			static LLStdStringHandle max1_string = LLXmlTree::addAttributeString("max1");
			child->getFastAttributeF32( max1_string, max1 ); // optional
			static LLStdStringHandle max2_string = LLXmlTree::addAttributeString("max2");
			child->getFastAttributeF32( max2_string, max2 ); // optional
			static LLStdStringHandle min2_string = LLXmlTree::addAttributeString("min2");
			child->getFastAttributeF32( min2_string, min2 ); // optional

			// Push these on the front of the deque, so that we can construct
			// them in order later (faster)
			mDrivenInfoList.push_front( LLDrivenEntryInfo( driven_id, min1, max1, max2, min2 ) );
		}
		else
		{
			LL_ERRS() << "<driven> Unable to resolve driven parameter: " << driven_id << LL_ENDL;
			return FALSE;
		}
	}
	return TRUE;
}
示例#15
0
void LLThreadLocalPointerBase::set( void* value )
{
	llassert(sInitialized && mThreadKey);

	apr_status_t result = apr_threadkey_private_set((void*)value, mThreadKey);
	if (result != APR_SUCCESS)
	{
		ll_apr_warn_status(result);
		LL_ERRS() << "Failed to set thread local data" << LL_ENDL;
	}
}
示例#16
0
void LLScrollListItem::setColumn( S32 column, LLScrollListCell *cell )
{
	if (column < (S32)mColumns.size())
	{
		delete mColumns[column];
		mColumns[column] = cell;
	}
	else
	{
		LL_ERRS() << "LLScrollListItem::setColumn: bad column: " << column << LL_ENDL;
	}
}
void LLFontFreetype::renderGlyph(const U32 glyph_index) const
{
	if (mFTFace == NULL)
		return;

	FT_Error error = FT_Load_Glyph(mFTFace, glyph_index, FT_LOAD_DEFAULT);
#ifdef SHOW_ASSERT
	if (error)
	{
		LL_ERRS() << "FT_Load_Glyph returned " << error << LL_ENDL;
	}
#endif
	error = FT_Render_Glyph(mFTFace->glyph, gFontRenderMode);
#ifdef SHOW_ASSERT
	if (error)
	{
		LL_ERRS() << "FT_Render_Glyph returned " << error << LL_ENDL;
	}
#endif
	mRenderGlyphCount++;
}
void LLNotifications::cancel(LLNotificationPtr pNotif)
{
	if (pNotif == NULL || pNotif->isCancelled()) return;

	AILOCK_mItems;
	LLNotificationSet::iterator it=mItems.find(pNotif);
	if (it == mItems.end())
	{
		LL_ERRS() << "Attempted to delete nonexistent notification " << pNotif->getName() << LL_ENDL;
	}
	UpdateItemSM::add(UpdateItem("delete", pNotif));
}
void LLUI::initClass(const settings_map_t& settings,
					 LLImageProviderInterface* image_provider,
					 LLUIAudioCallback audio_callback,
					 LLUIAudioCallback deferred_audio_callback,
					 const LLVector2* scale_factor,
					 const std::string& language)
{
	LLRender2D::initClass(image_provider,scale_factor);
	sSettingGroups = settings;

	if ((get_ptr_in_map(sSettingGroups, std::string("config")) == NULL) ||
		(get_ptr_in_map(sSettingGroups, std::string("floater")) == NULL) ||
		(get_ptr_in_map(sSettingGroups, std::string("ignores")) == NULL))
	{
		LL_ERRS() << "Failure to initialize configuration groups" << LL_ENDL;
	}

	sAudioCallback = audio_callback;
	sDeferredAudioCallback = deferred_audio_callback;
	sWindow = NULL; // set later in startup
	LLFontGL::sShadowColor = LLUIColorTable::instance().getColor("ColorDropShadow");

	LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar();

	// Callbacks for associating controls with floater visibility:
	reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD()));
	reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD()));
	reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), FALSE));
	reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD()));
	
	// Button initialization callback for toggle buttons
	reg.add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2));
	
	// Button initialization callback for toggle buttons on dockable floaters
	reg.add("Button.SetDockableFloaterToggle", boost::bind(&LLButton::setDockableFloaterToggle, _1, _2));

	// Display the help topic for the current context
	reg.add("Button.ShowHelp", boost::bind(&LLButton::showHelp, _1, _2));

	// Currently unused, but kept for reference:
	reg.add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2));
	
	// Used by menus along with Floater.Toggle to display visibility as a check-mark
	LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
	LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
	LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.CanShow", boost::bind(&LLFloaterReg::canShowInstance, _2, LLSD()));
// [/RLVa:KB]

	// Parse the master list of commands
	LLCommandManager::load();
}
示例#20
0
void LLEventDetail::storeToLLSDPath(LLSD& dest, const LLSD& rawPath, const LLSD& value)
{
    if (rawPath.isUndefined())
    {
        // no-op case
        return;
    }

    // Arrange to treat rawPath uniformly as an array. If it's not already an
    // array, store it as the only entry in one.
    LLSD path;
    if (rawPath.isArray())
    {
        path = rawPath;
    }
    else
    {
        path.append(rawPath);
    }

    // Need to indicate a current destination -- but that current destination
    // needs to change as we step through the path array. Where normally we'd
    // use an LLSD& to capture a subscripted LLSD lvalue, this time we must
    // instead use a pointer -- since it must be reassigned.
    LLSD* pdest = &dest;

    // Now loop through that array
    for (LLSD::Integer i = 0; i < path.size(); ++i)
    {
        if (path[i].isString())
        {
            // *pdest is an LLSD map
            pdest = &((*pdest)[path[i].asString()]);
        }
        else if (path[i].isInteger())
        {
            // *pdest is an LLSD array
            pdest = &((*pdest)[path[i].asInteger()]);
        }
        else
        {
            // What do we do with Real or Array or Map or ...?
            // As it's a coder error -- not a user error -- rub the coder's
            // face in it so it gets fixed.
            LL_ERRS("lleventcoro") << "storeToLLSDPath(" << dest << ", " << rawPath << ", " << value
                                   << "): path[" << i << "] bad type " << path[i].type() << LL_ENDL;
        }
    }

    // Here *pdest is where we should store value.
    *pdest = value;
}
示例#21
0
bool LLTransUtil::parseLanguageStrings(const std::string& xml_filename)
{
	LLXMLNodePtr root;
	BOOL success  = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
	
	if (!success)
	{
		LL_ERRS() << "Couldn't load localization table " << xml_filename << LL_ENDL;
		return false;
	}
	
	return LLTrans::parseLanguageStrings(root);
}
void LLLFSThread::Request::deleteRequest()
{
    if (getStatus() == STATUS_QUEUED)
    {
        LL_ERRS() << "Attempt to delete a queued LLLFSThread::Request!" << LL_ENDL;
    }
    if (mResponder.notNull())
    {
        mResponder->completed(0);
        mResponder = NULL;
    }
    LLQueuedThread::QueuedRequest::deleteRequest();
}
bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
{
	const LLFolderViewModelItemInventory* listener = dynamic_cast<const LLFolderViewModelItemInventory*>(item);
	if (!listener)
	{
		LL_ERRS() << "Folder view event listener not found." << LL_ENDL;
		return false;
	}

	const LLUUID folder_id = listener->getUUID();

	return checkFolder(folder_id);
}
示例#24
0
void* LLThreadLocalPointerBase::get() const
{
	// llassert(sInitialized);
	void* ptr;
	apr_status_t result =
		apr_threadkey_private_get(&ptr, mThreadKey);
	if (result != APR_SUCCESS)
	{
		ll_apr_warn_status(result);
		LL_ERRS() << "Failed to get thread local data" << LL_ENDL;
	}
	return ptr;
}
S32 LLTemplateMessageReader::getSize(const char *blockname, S32 blocknum, const char *varname)
{
	// is there a message ready to go?
	if (mReceiveSize == -1)
	{	// This is a serious error - crash
		LL_ERRS() << "No message waiting for decode 5!" << LL_ENDL;
		return LL_MESSAGE_ERROR;
	}

	if (!mCurrentRMessageData)
	{	// This is a serious error - crash
		LL_ERRS() << "Invalid mCurrentRMessageData in getData!" << LL_ENDL;
		return LL_MESSAGE_ERROR;
	}

	char *bnamep = (char *)blockname + blocknum; 
	char *vnamep = (char *)varname; 

	LLMsgData::msg_blk_data_map_t::const_iterator iter = mCurrentRMessageData->mMemberBlocks.find(bnamep);
	
	if (iter == mCurrentRMessageData->mMemberBlocks.end())
	{	// don't crash
		LL_INFOS() << "Block " << bnamep << " not in message " 
			<< mCurrentRMessageData->mName << LL_ENDL;
		return LL_BLOCK_NOT_IN_MESSAGE;
	}

	LLMsgBlkData* msg_data = iter->second;
	LLMsgVarData& vardata = msg_data->mMemberVarData[vnamep];
	
	if (!vardata.getName())
	{	// don't crash
		LL_INFOS() << "Variable " << vnamep << " not in message "
			<<  mCurrentRMessageData->mName << " block " << bnamep << LL_ENDL;
		return LL_VARIABLE_NOT_IN_BLOCK;
	}

	return vardata.getSize();
}
// add data to variable in current block - fails if variable isn't MVT_FIXED
void LLTemplateMessageBuilder::addData(const char *varname, const void *data, EMsgVariableType type)
{
	char *vnamep = (char *)varname; 

	// do we have a current message?
	if (!mCurrentSMessageTemplate)
	{
		LL_ERRS() << "newMessage not called prior to addData" << LL_ENDL;
		return;
	}

	// do we have a current block?
	if (!mCurrentSDataBlock)
	{
		LL_ERRS() << "setBlock not called prior to addData" << LL_ENDL;
		return;
	}

	// kewl, add the data if it exists
	const LLMessageVariable* var_data = mCurrentSMessageTemplate->getBlock(mCurrentSBlockName)->getVariable(vnamep);
	if (!var_data->getName())
	{
		LL_ERRS() << vnamep << " not a variable in block " << mCurrentSBlockName << " of " << mCurrentSMessageTemplate->mName << LL_ENDL;
		return;
	}

	// ok, it seems ok. . . are we MVT_VARIABLE?
	if (var_data->getType() == MVT_VARIABLE)
	{
		// nope
		LL_ERRS() << vnamep << " is type MVT_VARIABLE. Call using addData(name, data, size)" << LL_ENDL;
		return;
	}
	else
	{
		mCurrentSDataBlock->addData(vnamep, data, var_data->getSize(), type);
		mCurrentSendTotal += var_data->getSize();
	}
}
示例#27
0
LLSD errorLog(const LLEventWithID& result, const std::string& desc)
{
    // If the result arrived on the error pump (pump 1), log it as a fatal
    // error.
    if (result.second)
    {
        LL_ERRS("errorLog") << desc << ":" << std::endl;
        LLSDSerialize::toPrettyXML(result.first, LL_CONT);
        LL_CONT << LL_ENDL;
    }
    // A simple return must therefore be from the reply pump (pump 0).
    return result.first;
}
示例#28
0
LLViewerStatsRecorder::LLViewerStatsRecorder() :
	mObjectCacheFile(NULL),
	mTimer(),
	mStartTime(0.0),
	mLastSnapshotTime(0.0)
{
	if (NULL != sInstance)
	{
		LL_ERRS() << "Attempted to create multiple instances of LLViewerStatsRecorder!" << LL_ENDL;
	}
	sInstance = this;
	clearStats();
}
void LLNotifications::add(const LLNotificationPtr pNotif)
{
	if (pNotif == NULL) return;

	// first see if we already have it -- if so, that's a problem
	AILOCK_mItems;
	LLNotificationSet::iterator it=mItems.find(pNotif);
	if (it != mItems.end())
	{
		LL_ERRS() << "Notification added a second time to the master notification channel." << LL_ENDL;
	}

	UpdateItemSM::add(UpdateItem("add", pNotif));
}
// virtual
void LLViewerTexLayerSet::createComposite()
{
	if(!mComposite)
	{
		S32 width = mInfo->getWidth();
		S32 height = mInfo->getHeight();
		// Composite other avatars at reduced resolution
		if( !mAvatarAppearance->isSelf() )
		{
			LL_ERRS() << "composites should not be created for non-self avatars!" << LL_ENDL;
		}
		mComposite = new LLViewerTexLayerSetBuffer( this, width, height );
	}
}