aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/lluictrlfactory.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llui/lluictrlfactory.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llui/lluictrlfactory.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp
index 212c1c5..bcd4876 100644
--- a/linden/indra/llui/lluictrlfactory.cpp
+++ b/linden/indra/llui/lluictrlfactory.cpp
@@ -76,18 +76,18 @@ const S32 VPAD = 4;
76const S32 FLOATER_H_MARGIN = 15; 76const S32 FLOATER_H_MARGIN = 15;
77const S32 MIN_WIDGET_HEIGHT = 10; 77const S32 MIN_WIDGET_HEIGHT = 10;
78 78
79std::vector<LLString> LLUICtrlFactory::sXUIPaths; 79std::vector<std::string> LLUICtrlFactory::sXUIPaths;
80 80
81// UI Ctrl class for padding 81// UI Ctrl class for padding
82class LLUICtrlLocate : public LLUICtrl 82class LLUICtrlLocate : public LLUICtrl
83{ 83{
84public: 84public:
85 LLUICtrlLocate() : LLUICtrl("locate", LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } 85 LLUICtrlLocate() : LLUICtrl(std::string("locate"), LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); }
86 virtual void draw() { } 86 virtual void draw() { }
87 87
88 static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) 88 static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
89 { 89 {
90 LLString name("pad"); 90 std::string name("pad");
91 node->getAttributeString("name", name); 91 node->getAttributeString("name", name);
92 92
93 LLUICtrlLocate *new_ctrl = new LLUICtrlLocate(); 93 LLUICtrlLocate *new_ctrl = new LLUICtrlLocate();
@@ -117,7 +117,7 @@ LLUICtrlFactory::~LLUICtrlFactory()
117 117
118void LLUICtrlFactory::setupPaths() 118void LLUICtrlFactory::setupPaths()
119{ 119{
120 LLString filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml"); 120 std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "paths.xml");
121 121
122 LLXMLNodePtr root; 122 LLXMLNodePtr root;
123 BOOL success = LLXMLNode::parseFile(filename, root, NULL); 123 BOOL success = LLXMLNode::parseFile(filename, root, NULL);
@@ -130,7 +130,7 @@ void LLUICtrlFactory::setupPaths()
130 for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling()) 130 for (path = root->getFirstChild(); path.notNull(); path = path->getNextSibling())
131 { 131 {
132 LLUIString path_val_ui(path->getValue()); 132 LLUIString path_val_ui(path->getValue());
133 LLString language = "en-us"; 133 std::string language = "en-us";
134 if (LLUI::sConfigGroup) 134 if (LLUI::sConfigGroup)
135 { 135 {
136 language = LLUI::sConfigGroup->getString("Language"); 136 language = LLUI::sConfigGroup->getString("Language");
@@ -149,8 +149,8 @@ void LLUICtrlFactory::setupPaths()
149 } 149 }
150 else // parsing failed 150 else // parsing failed
151 { 151 {
152 LLString slash = gDirUtilp->getDirDelimiter(); 152 std::string slash = gDirUtilp->getDirDelimiter();
153 LLString dir = "xui" + slash + "en-us"; 153 std::string dir = "xui" + slash + "en-us";
154 llwarns << "XUI::config file unable to open: " << filename << llendl; 154 llwarns << "XUI::config file unable to open: " << filename << llendl;
155 sXUIPaths.push_back(dir); 155 sXUIPaths.push_back(dir);
156 } 156 }
@@ -161,7 +161,7 @@ void LLUICtrlFactory::setupPaths()
161//----------------------------------------------------------------------------- 161//-----------------------------------------------------------------------------
162// getLayeredXMLNode() 162// getLayeredXMLNode()
163//----------------------------------------------------------------------------- 163//-----------------------------------------------------------------------------
164bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodePtr& root) 164bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNodePtr& root)
165{ 165{
166 std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename); 166 std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename);
167 if (full_filename.empty()) 167 if (full_filename.empty())
@@ -182,12 +182,12 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodeP
182 182
183 LLXMLNodePtr updateRoot; 183 LLXMLNodePtr updateRoot;
184 184
185 std::vector<LLString>::const_iterator itor; 185 std::vector<std::string>::const_iterator itor;
186 186
187 for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor) 187 for (itor = sXUIPaths.begin(), ++itor; itor != sXUIPaths.end(); ++itor)
188 { 188 {
189 LLString nodeName; 189 std::string nodeName;
190 LLString updateName; 190 std::string updateName;
191 191
192 std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename); 192 std::string layer_filename = gDirUtilp->findSkinnedFilename((*itor), xui_filename);
193 if(layer_filename.empty()) 193 if(layer_filename.empty())
@@ -218,7 +218,7 @@ bool LLUICtrlFactory::getLayeredXMLNode(const LLString &xui_filename, LLXMLNodeP
218//----------------------------------------------------------------------------- 218//-----------------------------------------------------------------------------
219// buildFloater() 219// buildFloater()
220//----------------------------------------------------------------------------- 220//-----------------------------------------------------------------------------
221void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename, 221void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filename,
222 const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */ 222 const LLCallbackMap::map_t* factory_map, BOOL open) /* Flawfinder: ignore */
223{ 223{
224 LLXMLNodePtr root; 224 LLXMLNodePtr root;
@@ -259,9 +259,9 @@ void LLUICtrlFactory::buildFloater(LLFloater* floaterp, const LLString &filename
259//----------------------------------------------------------------------------- 259//-----------------------------------------------------------------------------
260// saveToXML() 260// saveToXML()
261//----------------------------------------------------------------------------- 261//-----------------------------------------------------------------------------
262S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename) 262S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename)
263{ 263{
264 llofstream out(filename.c_str()); 264 llofstream out(filename);
265 if (!out.good()) 265 if (!out.good())
266 { 266 {
267 llwarns << "Unable to open " << filename << " for output." << llendl; 267 llwarns << "Unable to open " << filename << " for output." << llendl;
@@ -281,7 +281,7 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const LLString& filename)
281//----------------------------------------------------------------------------- 281//-----------------------------------------------------------------------------
282// buildPanel() 282// buildPanel()
283//----------------------------------------------------------------------------- 283//-----------------------------------------------------------------------------
284BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename, 284BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename,
285 const LLCallbackMap::map_t* factory_map) 285 const LLCallbackMap::map_t* factory_map)
286{ 286{
287 BOOL didPost = FALSE; 287 BOOL didPost = FALSE;
@@ -325,7 +325,7 @@ BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const LLString &filename,
325//----------------------------------------------------------------------------- 325//-----------------------------------------------------------------------------
326// buildMenu() 326// buildMenu()
327//----------------------------------------------------------------------------- 327//-----------------------------------------------------------------------------
328LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp) 328LLMenuGL *LLUICtrlFactory::buildMenu(const std::string &filename, LLView* parentp)
329{ 329{
330 // TomY TODO: Break this function into buildMenu and buildMenuBar 330 // TomY TODO: Break this function into buildMenu and buildMenuBar
331 LLXMLNodePtr root; 331 LLXMLNodePtr root;
@@ -363,7 +363,7 @@ LLMenuGL *LLUICtrlFactory::buildMenu(const LLString &filename, LLView* parentp)
363//----------------------------------------------------------------------------- 363//-----------------------------------------------------------------------------
364// buildMenu() 364// buildMenu()
365//----------------------------------------------------------------------------- 365//-----------------------------------------------------------------------------
366LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* parentp) 366LLPieMenu *LLUICtrlFactory::buildPieMenu(const std::string &filename, LLView* parentp)
367{ 367{
368 LLXMLNodePtr root; 368 LLXMLNodePtr root;
369 369
@@ -379,7 +379,7 @@ LLPieMenu *LLUICtrlFactory::buildPieMenu(const LLString &filename, LLView* paren
379 return NULL; 379 return NULL;
380 } 380 }
381 381
382 LLString name("menu"); 382 std::string name("menu");
383 root->getAttributeString("name", name); 383 root->getAttributeString("name", name);
384 384
385 LLPieMenu *menu = new LLPieMenu(name); 385 LLPieMenu *menu = new LLPieMenu(name);
@@ -404,7 +404,7 @@ void LLUICtrlFactory::rebuild()
404 built_panel_it != mBuiltPanels.end(); 404 built_panel_it != mBuiltPanels.end();
405 ++built_panel_it) 405 ++built_panel_it)
406 { 406 {
407 LLString filename = built_panel_it->second; 407 std::string filename = built_panel_it->second;
408 LLPanel* panelp = built_panel_it->first.get(); 408 LLPanel* panelp = built_panel_it->first.get();
409 if (!panelp) 409 if (!panelp)
410 { 410 {
@@ -432,7 +432,7 @@ void LLUICtrlFactory::rebuild()
432 { 432 {
433 continue; 433 continue;
434 } 434 }
435 LLString filename = built_floater_it->second; 435 std::string filename = built_floater_it->second;
436 llinfos << "Rebuilding UI floater " << floaterp->getName() 436 llinfos << "Rebuilding UI floater " << floaterp->getName()
437 << " from " << filename 437 << " from " << filename
438 << llendl; 438 << llendl;
@@ -452,8 +452,8 @@ void LLUICtrlFactory::rebuild()
452 452
453LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node) 453LLView *LLUICtrlFactory::createCtrlWidget(LLPanel *parent, LLXMLNodePtr node)
454{ 454{
455 LLString ctrl_type = node->getName()->mString; 455 std::string ctrl_type = node->getName()->mString;
456 LLString::toLower(ctrl_type); 456 LLStringUtil::toLower(ctrl_type);
457 457
458 LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type); 458 LLWidgetClassRegistry::factory_func_t func = LLWidgetClassRegistry::getInstance()->getCreatorFunc(ctrl_type);
459 459
@@ -494,7 +494,7 @@ LLView* LLUICtrlFactory::createWidget(LLPanel *parent, LLXMLNodePtr node)
494//----------------------------------------------------------------------------- 494//-----------------------------------------------------------------------------
495// createFactoryPanel() 495// createFactoryPanel()
496//----------------------------------------------------------------------------- 496//-----------------------------------------------------------------------------
497LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name) 497LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name)
498{ 498{
499 std::deque<const LLCallbackMap::map_t*>::iterator itor; 499 std::deque<const LLCallbackMap::map_t*>::iterator itor;
500 for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor) 500 for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor)
@@ -516,10 +516,10 @@ LLPanel* LLUICtrlFactory::createFactoryPanel(LLString name)
516//----------------------------------------------------------------------------- 516//-----------------------------------------------------------------------------
517 517
518//static 518//static
519BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name, LLColor4& color) 519BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color)
520{ 520{
521 LLString colorstring; 521 std::string colorstring;
522 BOOL res = node->getAttributeString(name, colorstring); 522 BOOL res = node->getAttributeString(name.c_str(), colorstring);
523 if (res && LLUI::sColorsGroup) 523 if (res && LLUI::sColorsGroup)
524 { 524 {
525 if (LLUI::sColorsGroup->controlExists(colorstring)) 525 if (LLUI::sColorsGroup->controlExists(colorstring))
@@ -533,11 +533,11 @@ BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const LLString& name,
533 } 533 }
534 if (!res) 534 if (!res)
535 { 535 {
536 res = LLColor4::parseColor(colorstring.c_str(), &color); 536 res = LLColor4::parseColor(colorstring, &color);
537 } 537 }
538 if (!res) 538 if (!res)
539 { 539 {
540 res = node->getAttributeColor(name, color); 540 res = node->getAttributeColor(name.c_str(), color);
541 } 541 }
542 return res; 542 return res;
543} 543}