aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lljoystickbutton.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/newview/lljoystickbutton.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/newview/lljoystickbutton.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/linden/indra/newview/lljoystickbutton.cpp b/linden/indra/newview/lljoystickbutton.cpp
index 3957b0a..773c57e 100644
--- a/linden/indra/newview/lljoystickbutton.cpp
+++ b/linden/indra/newview/lljoystickbutton.cpp
@@ -59,13 +59,13 @@ const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
59// Public Methods 59// Public Methods
60// 60//
61LLJoystick::LLJoystick( 61LLJoystick::LLJoystick(
62 const LLString& name, 62 const std::string& name,
63 LLRect rect, 63 LLRect rect,
64 const LLString &default_image, 64 const std::string &default_image,
65 const LLString &selected_image, 65 const std::string &selected_image,
66 EJoystickQuadrant initial_quadrant ) 66 EJoystickQuadrant initial_quadrant )
67 : 67 :
68 LLButton(name, rect, default_image, selected_image, NULL, NULL), 68 LLButton(name, rect, default_image, selected_image, LLStringUtil::null, NULL, NULL),
69 mInitialQuadrant(initial_quadrant), 69 mInitialQuadrant(initial_quadrant),
70 mInitialOffset(0, 0), 70 mInitialOffset(0, 0),
71 mLastMouse(0, 0), 71 mLastMouse(0, 0),
@@ -196,27 +196,27 @@ EJoystickQuadrant LLJoystick::selectQuadrant(LLXMLNodePtr node)
196 196
197 if (node->hasAttribute("quadrant")) 197 if (node->hasAttribute("quadrant"))
198 { 198 {
199 LLString quadrant_name; 199 std::string quadrant_name;
200 node->getAttributeString("quadrant", quadrant_name); 200 node->getAttributeString("quadrant", quadrant_name);
201 201
202 quadrant = quadrantFromName(quadrant_name.c_str()); 202 quadrant = quadrantFromName(quadrant_name);
203 } 203 }
204 return quadrant; 204 return quadrant;
205} 205}
206 206
207 207
208LLString LLJoystick::nameFromQuadrant(EJoystickQuadrant quadrant) 208std::string LLJoystick::nameFromQuadrant(EJoystickQuadrant quadrant)
209{ 209{
210 if (quadrant == JQ_ORIGIN) return LLString("origin"); 210 if (quadrant == JQ_ORIGIN) return std::string("origin");
211 else if (quadrant == JQ_UP) return LLString("up"); 211 else if (quadrant == JQ_UP) return std::string("up");
212 else if (quadrant == JQ_DOWN) return LLString("down"); 212 else if (quadrant == JQ_DOWN) return std::string("down");
213 else if (quadrant == JQ_LEFT) return LLString("left"); 213 else if (quadrant == JQ_LEFT) return std::string("left");
214 else if (quadrant == JQ_RIGHT) return LLString("right"); 214 else if (quadrant == JQ_RIGHT) return std::string("right");
215 else return LLString(); 215 else return std::string();
216} 216}
217 217
218 218
219EJoystickQuadrant LLJoystick::quadrantFromName(const LLString& sQuadrant) 219EJoystickQuadrant LLJoystick::quadrantFromName(const std::string& sQuadrant)
220{ 220{
221 EJoystickQuadrant quadrant = JQ_RIGHT; 221 EJoystickQuadrant quadrant = JQ_RIGHT;
222 222
@@ -252,8 +252,8 @@ LLXMLNodePtr LLJoystick::getXML(bool save_children) const
252 node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(getHAlign())); 252 node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(getHAlign()));
253 node->createChild("quadrant", TRUE)->setStringValue(nameFromQuadrant(mInitialQuadrant)); 253 node->createChild("quadrant", TRUE)->setStringValue(nameFromQuadrant(mInitialQuadrant));
254 254
255 addImageAttributeToXML(node,getImageUnselectedName(),getImageUnselectedID(),"image_unselected"); 255 addImageAttributeToXML(node,getImageUnselectedName(),getImageUnselectedID(),std::string("image_unselected"));
256 addImageAttributeToXML(node,getImageSelectedName(),getImageSelectedID(),"image_selected"); 256 addImageAttributeToXML(node,getImageSelectedName(),getImageSelectedID(),std::string("image_selected"));
257 257
258 node->createChild("scale_image", TRUE)->setBoolValue(getScaleImage()); 258 node->createChild("scale_image", TRUE)->setBoolValue(getScaleImage());
259 259
@@ -328,13 +328,13 @@ void LLJoystickAgentTurn::onHeldDown()
328 328
329LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) 329LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
330{ 330{
331 LLString name("button"); 331 std::string name("button");
332 node->getAttributeString("name", name); 332 node->getAttributeString("name", name);
333 333
334 LLString image_unselected; 334 std::string image_unselected;
335 if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); 335 if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected);
336 336
337 LLString image_selected; 337 std::string image_selected;
338 if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); 338 if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected);
339 339
340 EJoystickQuadrant quad = JQ_ORIGIN; 340 EJoystickQuadrant quad = JQ_ORIGIN;
@@ -437,13 +437,13 @@ void LLJoystickAgentSlide::onHeldDown()
437// static 437// static
438LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) 438LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
439{ 439{
440 LLString name("button"); 440 std::string name("button");
441 node->getAttributeString("name", name); 441 node->getAttributeString("name", name);
442 442
443 LLString image_unselected; 443 std::string image_unselected;
444 if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected); 444 if (node->hasAttribute("image_unselected")) node->getAttributeString("image_unselected",image_unselected);
445 445
446 LLString image_selected; 446 std::string image_selected;
447 if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected); 447 if (node->hasAttribute("image_selected")) node->getAttributeString("image_selected",image_selected);
448 448
449 449
@@ -479,7 +479,7 @@ LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtr
479// LLJoystickCameraRotate 479// LLJoystickCameraRotate
480//------------------------------------------------------------------------------- 480//-------------------------------------------------------------------------------
481 481
482LLJoystickCameraRotate::LLJoystickCameraRotate(const LLString& name, LLRect rect, const LLString &out_img, const LLString &in_img) 482LLJoystickCameraRotate::LLJoystickCameraRotate(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img)
483 : 483 :
484 LLJoystick(name, rect, out_img, in_img, JQ_ORIGIN), 484 LLJoystick(name, rect, out_img, in_img, JQ_ORIGIN),
485 mInLeft( FALSE ), 485 mInLeft( FALSE ),
@@ -716,9 +716,9 @@ void LLJoystickCameraTrack::onHeldDown()
716// LLJoystickCameraZoom 716// LLJoystickCameraZoom
717//------------------------------------------------------------------------------- 717//-------------------------------------------------------------------------------
718 718
719LLJoystickCameraZoom::LLJoystickCameraZoom(const LLString& name, LLRect rect, const LLString &out_img, const LLString &plus_in_img, const LLString &minus_in_img) 719LLJoystickCameraZoom::LLJoystickCameraZoom(const std::string& name, LLRect rect, const std::string &out_img, const std::string &plus_in_img, const std::string &minus_in_img)
720 : 720 :
721 LLJoystick(name, rect, out_img, "", JQ_ORIGIN), 721 LLJoystick(name, rect, out_img, LLStringUtil::null, JQ_ORIGIN),
722 mInTop( FALSE ), 722 mInTop( FALSE ),
723 mInBottom( FALSE ) 723 mInBottom( FALSE )
724{ 724{