summaryrefslogtreecommitdiff
path: root/indra/newview/lljoystickbutton.h
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-05-08 07:43:08 +0000
commita4000c3744e42fcbb638e742f3b63fa31a0dee15 (patch)
tree7f472c30e65bbfa04ee9bc06631a1af305cc31fb /indra/newview/lljoystickbutton.h
parent6c4cadbb04d633ad7b762058bdeba6e1f650dafd (diff)
merge trunk@116587 skinning-7@119389 -> viewer-2.0.0-skinning-7
Diffstat (limited to 'indra/newview/lljoystickbutton.h')
-rw-r--r--indra/newview/lljoystickbutton.h74
1 files changed, 53 insertions, 21 deletions
diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h
index 076a506f14..954a8c481d 100644
--- a/indra/newview/lljoystickbutton.h
+++ b/indra/newview/lljoystickbutton.h
@@ -46,11 +46,27 @@ typedef enum e_joystick_quadrant
JQ_RIGHT
} EJoystickQuadrant;
+struct QuadrantNames : public LLInitParam::TypeValuesHelper<EJoystickQuadrant, QuadrantNames>
+{
+ static void declareValues();
+};
+
class LLJoystick
: public LLButton
{
public:
- LLJoystick(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial);
+ struct Params
+ : public LLInitParam::Block<Params, LLButton::Params>
+ {
+ Optional<EJoystickQuadrant, QuadrantNames> quadrant;
+
+ Params()
+ : quadrant("quadrant", JQ_ORIGIN)
+ {
+ label("");
+ }
+ };
+ LLJoystick(const Params&);
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
@@ -60,10 +76,9 @@ public:
virtual void onHeldDown() = 0;
F32 getElapsedHeldDownTime();
- static void onHeldDown(void *userdata); // called by llbutton callback handler
+ static void onBtnHeldDown(void *userdata); // called by llbutton callback handler
void setInitialQuadrant(EJoystickQuadrant initial) { mInitialQuadrant = initial; };
- virtual LLXMLNodePtr getXML(bool save_children = true) const;
static std::string nameFromQuadrant(const EJoystickQuadrant quadrant);
static EJoystickQuadrant quadrantFromName(const std::string& name);
static EJoystickQuadrant selectQuadrant(LLXMLNodePtr node);
@@ -91,14 +106,9 @@ class LLJoystickAgentTurn
: public LLJoystick
{
public:
- LLJoystickAgentTurn(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial)
- : LLJoystick(name, rect, default_image, selected_image, initial)
- { }
-
+ struct Params : public LLJoystick::Params {};
+ LLJoystickAgentTurn(const Params& p) : LLJoystick(p) {}
virtual void onHeldDown();
-
- static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
-
};
@@ -107,14 +117,11 @@ class LLJoystickAgentSlide
: public LLJoystick
{
public:
- LLJoystickAgentSlide(const std::string& name, LLRect rect, const std::string &default_image, const std::string &selected_image, EJoystickQuadrant initial)
- : LLJoystick(name, rect, default_image, selected_image, initial)
- { }
-
+ struct Params : public LLJoystick::Params {};
+ LLJoystickAgentSlide(const Params& p) : LLJoystick(p) {}
+
virtual void onHeldDown();
virtual void onMouseUp();
-
- static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
};
@@ -123,7 +130,16 @@ class LLJoystickCameraRotate
: public LLJoystick
{
public:
- LLJoystickCameraRotate(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img);
+ struct Params
+ : public LLInitParam::Block<Params, LLJoystick::Params>
+ {
+ Params()
+ {
+ held_down_delay.seconds(0.0);
+ }
+ };
+
+ LLJoystickCameraRotate(const LLJoystickCameraRotate::Params&);
virtual void setToggleState( BOOL left, BOOL top, BOOL right, BOOL bottom );
@@ -149,10 +165,13 @@ class LLJoystickCameraTrack
: public LLJoystickCameraRotate
{
public:
- LLJoystickCameraTrack(const std::string& name, LLRect rect, const std::string &out_img, const std::string &in_img)
- : LLJoystickCameraRotate(name, rect, out_img, in_img)
- { }
+ struct Params
+ : public LLInitParam::Block<Params, LLJoystickCameraRotate::Params>
+ {
+ Params();
+ };
+ LLJoystickCameraTrack(const LLJoystickCameraTrack::Params&);
virtual void onHeldDown();
};
@@ -162,7 +181,20 @@ class LLJoystickCameraZoom
: public LLJoystick
{
public:
- LLJoystickCameraZoom(const std::string& name, LLRect rect, const std::string &out_img, const std::string &plus_in_img, const std::string &minus_in_img);
+ struct Params
+ : public LLInitParam::Block<Params, LLJoystick::Params>
+ {
+ Optional<LLUIImage*> plus_image;
+ Optional<LLUIImage*> minus_image;
+
+ Params()
+ : plus_image ("plus_image", NULL),
+ minus_image ("minus_image", NULL)
+ {
+ held_down_delay.seconds(0.0);
+ }
+ };
+ LLJoystickCameraZoom(const Params&);
virtual void setToggleState( BOOL top, BOOL bottom );