diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-06-21 08:04:56 +0000 |
commit | 9ec432034dc3c45d7ce763eb02dae4cc7f6b8da8 (patch) | |
tree | 4a505c1e0919af52800b3ffb3eaf135e7d6f9ce6 /indra/newview/lljoystickbutton.h | |
parent | 351ebe9fcb76f3b99c2957004bb8493a904869ee (diff) |
merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3
ignore-dead-branch
Diffstat (limited to 'indra/newview/lljoystickbutton.h')
-rw-r--r-- | indra/newview/lljoystickbutton.h | 74 |
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 ); |