本文整理汇总了C++中LLDynamicArray::size方法的典型用法代码示例。如果您正苦于以下问题:C++ LLDynamicArray::size方法的具体用法?C++ LLDynamicArray::size怎么用?C++ LLDynamicArray::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLDynamicArray
的用法示例。
在下文中一共展示了LLDynamicArray::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onClickIM
// static
void LLPanelFriends::onClickIM(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickIM()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
{
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
std::string fullname;
if(info && gCacheName->getFullName(agent_id, fullname))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(fullname, IM_NOTHING_SPECIAL, agent_id);
}
}
else
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Friends Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
make_ui_sound("UISndStartIM");
}
}
示例2: onClickIM
// static
void LLFloaterAvatarList::onClickIM(void* userdata)
{
//llinfos << "LLFloaterFriends::onClickIM()" << llendl;
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
if (ids.size() == 1)
{
// Single avatar
LLUUID agent_id = ids[0];
char buffer[MAX_STRING];
// [Ansariel: Display name support]
// snprintf(buffer, MAX_STRING, "%s", avlist->mAvatars[agent_id].getName().c_str());
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
snprintf(buffer, MAX_STRING, "%s", avatar_name.getLegacyName().c_str());
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(buffer,IM_NOTHING_SPECIAL,agent_id);
}
// [Ansariel: Display name support]
}
else
{
// Group IM
LLUUID session_id;
session_id.generate();
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
}
}
示例3: onClickRemove
// static
void LLFloaterFriends::onClickRemove(void* user_data)
{
//llinfos << "LLFloaterFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = getSelectedIDs();
LLStringBase<char>::format_map_t args;
if(ids.size() > 0)
{
LLString msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
if(gCacheName->getName(agent_id, first, last))
{
args["[FIRST_NAME]"] = first;
args["[LAST_NAME]"] = last;
}
}
else
{
msgType = "RemoveMultipleFromFriends";
}
gViewerWindow->alertXml(msgType,
args,
&handleRemove,
(void*)new LLDynamicArray<LLUUID>(ids));
}
}
示例4: onClickIM
void FloaterAvatarList::onClickIM(void *userdata)
{
//llinfos << "LLFloaterFriends::onClickIM()" << llendl;
FloaterAvatarList *avlist = (FloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = avlist->mAvatarList->getSelectedIDs();
if(ids.size() > 0)
{
if(ids.size() == 1)
{
// Single avatar
LLUUID agent_id = ids[0];
//char buffer[MAX_STRING];
//snprintf(buffer, MAX_STRING, "%s", avlist->mAvatars[agent_id].getName().c_str());
//std::string name;
//gCacheName->getFullName(agent_id,&name);
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(
keyasname(agent_id),
IM_NOTHING_SPECIAL,
agent_id);
}
else
{
// Group IM
LLUUID session_id;
session_id.generate();
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
}
}
示例5: onClickIM
// static
void LLFloaterFriends::onClickIM(void* user_data)
{
//llinfos << "LLFloaterFriends::onClickIM()" << llendl;
LLDynamicArray<LLUUID> ids = getSelectedIDs();
if(ids.size() > 0)
{
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(agent_id);
char first[DB_FIRST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
char last[DB_LAST_NAME_BUF_SIZE]; /* Flawfinder: ignore */
if(info && gCacheName->getName(agent_id, first, last))
{
char buffer[MAX_STRING]; /* Flawfinder: ignore */
snprintf(buffer, MAX_STRING, "%s %s", first, last); /* Flawfinder: ignore */
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(
buffer,
IM_NOTHING_SPECIAL,
agent_id);
}
}
else
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Friends Conference",
IM_SESSION_CONFERENCE_START,
ids[0],
ids);
}
make_ui_sound("UISndStartIM");
}
}
示例6: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
std::string first, last;
if(gCacheName->getName(agent_id, first, last))
{
if (LLAvatarNameCache::useDisplayNames() && !gSavedSettings.getBOOL("LegacyNamesForFriends"))
{
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
// Always show "Display Name [Legacy Name]" for security reasons
first = avatar_name.getNames();
size_t i = first.find(" ");
if (i != std::string::npos)
{
last = first.substr(i + 1);
first = first.substr(0, i);
}
else
{
last = "";
}
}
}
args["FIRST_NAME"] = first;
args["LAST_NAME"] = last;
}
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例7: onClickRemove
// static
void LLPanelFriends::onClickRemove(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
//llinfos << "LLPanelFriends::onClickRemove()" << llendl;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
LLSD args;
if(ids.size() > 0)
{
std::string msgType = "RemoveFromFriends";
if(ids.size() == 1)
{
LLUUID agent_id = ids[0];
// [Ansariel: Display name support]
//std::string first, last;
//if(gCacheName->getName(agent_id, first, last))
//{
// args["FIRST_NAME"] = first;
// args["LAST_NAME"] = last;
//}
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
std::string fullname;
static const LLCachedControl<S32> phoenix_name_system("PhoenixNameSystem", 0);
switch (phoenix_name_system)
{
case 0 : fullname = avatar_name.getLegacyName(); break;
case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break;
case 2 : fullname = avatar_name.mDisplayName; break;
default : fullname = avatar_name.getCompleteName(); break;
}
args["NAME"] = fullname;
}
// [/Ansariel: Display name support]
}
else
{
msgType = "RemoveMultipleFromFriends";
}
LLSD payload;
for (LLDynamicArray<LLUUID>::iterator it = ids.begin();
it != ids.end();
++it)
{
payload["ids"].append(*it);
}
LLNotifications::instance().add(msgType,
args,
payload,
&handleRemove);
}
}
示例8: handleKeyHere
BOOL LLFloaterAvatarList::handleKeyHere(KEY key, MASK mask)
{
LLFloaterAvatarList* self = getInstance();
LLScrollListItem* item = self->mAvatarList->getFirstSelected();
if(item)
{
LLUUID agent_id = item->getUUID();
if (( KEY_RETURN == key ) && (MASK_NONE == mask))
{
self->mFocusedAvatar = agent_id;
self->focusOnCurrent();
return TRUE;
}
else if (( KEY_RETURN == key ) && (MASK_CONTROL == mask))
{
LLAvatarListEntry* entry = self->getAvatarEntry(agent_id);
if (entry)
{
// llinfos << "Trying to teleport to " << entry->getName() << " at " << entry->getPosition() << llendl;
gAgent.teleportViaLocation(entry->getPosition());
}
return TRUE;
}
}
if (( KEY_RETURN == key ) && (MASK_SHIFT == mask))
{
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
if (ids.size() == 1)
{
// Single avatar
LLUUID agent_id = ids[0];
// [Ansariel: Display name support]
LLAvatarName avatar_name;
if (LLAvatarNameCache::get(agent_id, &avatar_name))
{
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession(LLCacheName::cleanFullName(avatar_name.getLegacyName()),IM_NOTHING_SPECIAL,agent_id);
}
// [Ansariel: Display name support]
}
else
{
// Group IM
LLUUID session_id;
session_id.generate();
gIMMgr->setFloaterOpen(TRUE);
gIMMgr->addSession("Avatars Conference", IM_SESSION_CONFERENCE_START, ids[0], ids);
}
}
}
return LLPanel::handleKeyHere(key, mask);
}
示例9: onClickMute
//static
void LLFloaterAvatarList::onClickMute(void *userdata)
{
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
for (LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
{
LLUUID agent_id = *itr;
std::string agent_name;
if (gCacheName->getFullName(agent_id, agent_name))
{
if (LLMuteList::getInstance()->isMuted(agent_id))
{
LLMute mute(agent_id, agent_name, LLMute::AGENT);
LLMuteList::getInstance()->remove(mute);
}
else
{
LLMute mute(agent_id, agent_name, LLMute::AGENT);
LLMuteList::getInstance()->add(mute);
}
}
}
}
}
示例10: onClickOfferTeleport
// static
void LLFloaterFriends::onClickOfferTeleport(void*)
{
LLDynamicArray<LLUUID> ids = getSelectedIDs();
if(ids.size() > 0)
{
handle_lure(ids);
}
}
示例11: onClickPay
// static
void LLFloaterFriends::onClickPay(void*)
{
LLDynamicArray<LLUUID> ids = getSelectedIDs();
if(ids.size() == 1)
{
handle_pay_by_id(ids[0]);
}
}
示例12: refreshRightsChangeList
void LLFloaterFriends::refreshRightsChangeList()
{
if (!sInstance) return;
LLDynamicArray<LLUUID> friends = getSelectedIDs();
S32 num_selected = friends.size();
bool can_offer_teleport = num_selected >= 1;
bool selected_friends_online = true;
LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label");
if(!mAllowRightsChange)
{
if(processing_label)
{
processing_label->setVisible(true);
// ignore selection for now
friends.clear();
num_selected = 0;
}
}
else if(processing_label)
{
processing_label->setVisible(false);
}
const LLRelationship* friend_status = NULL;
for(LLDynamicArray<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr)
{
friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr);
if (friend_status)
{
if(!friend_status->isOnline())
{
can_offer_teleport = false;
selected_friends_online = false;
}
}
else // missing buddy info, don't allow any operations
{
can_offer_teleport = false;
}
}
if (num_selected == 0) // nothing selected
{
childSetEnabled("im_btn", FALSE);
childSetEnabled("offer_teleport_btn", FALSE);
}
else // we have at least one friend selected...
{
// only allow IMs to groups when everyone in the group is online
// to be consistent with context menus in inventory and because otherwise
// offline friends would be silently dropped from the session
childSetEnabled("im_btn", selected_friends_online || num_selected == 1);
childSetEnabled("offer_teleport_btn", can_offer_teleport);
}
}
示例13: onClickTeleportOffer
void LLFloaterAvatarList::onClickTeleportOffer(void *userdata)
{
LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
LLDynamicArray<LLUUID> ids = self->mAvatarList->getSelectedIDs();
if (ids.size() > 0)
{
handle_lure(ids);
}
}
示例14: onClickOfferTeleport
// static
void LLPanelFriends::onClickOfferTeleport(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() > 0)
{
handle_lure(ids);
}
}
示例15: onClickPay
// static
void LLPanelFriends::onClickPay(void* user_data)
{
LLPanelFriends* panelp = (LLPanelFriends*)user_data;
LLDynamicArray<LLUUID> ids = panelp->getSelectedIDs();
if(ids.size() == 1)
{
handle_pay_by_id(ids[0]);
}
}