PageRenderTime 28ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lltoolpie.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 123 lines | 80 code | 17 blank | 26 comment | 0 complexity | 986d9f656fbb95e090232a16da559c71 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lltoolpie.h
  3. * @brief LLToolPie class header file
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_TOOLPIE_H
  27. #define LL_TOOLPIE_H
  28. #include "lltool.h"
  29. #include "lluuid.h"
  30. #include "llviewerwindow.h" // for LLPickInfo
  31. #include "llhudeffectblob.h" // for LLPointer<LLHudEffectBlob>, apparently
  32. class LLViewerObject;
  33. class LLObjectSelection;
  34. class LLToolPie : public LLTool, public LLSingleton<LLToolPie>
  35. {
  36. LOG_CLASS(LLToolPie);
  37. public:
  38. LLToolPie( );
  39. // Virtual functions inherited from LLMouseHandler
  40. virtual BOOL handleAnyMouseClick(S32 x, S32 y, MASK mask, EClickType clicktype, BOOL down);
  41. virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
  42. virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
  43. virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
  44. virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask);
  45. virtual BOOL handleHover(S32 x, S32 y, MASK mask);
  46. virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
  47. virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
  48. virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);
  49. virtual void render();
  50. virtual void stopEditing();
  51. virtual void onMouseCaptureLost();
  52. virtual void handleSelect();
  53. virtual void handleDeselect();
  54. virtual LLTool* getOverrideTool(MASK mask);
  55. LLPickInfo& getPick() { return mPick; }
  56. U8 getClickAction() { return mClickAction; }
  57. LLViewerObject* getClickActionObject() { return mClickActionObject; }
  58. LLObjectSelection* getLeftClickSelection() { return (LLObjectSelection*)mLeftClickSelection; }
  59. void resetSelection();
  60. void walkToClickedLocation();
  61. void blockClickToWalk() { mBlockClickToWalk = true; }
  62. void stopClickToWalk();
  63. static void selectionPropertiesReceived();
  64. static void showAvatarInspector(const LLUUID& avatar_id);
  65. static void showObjectInspector(const LLUUID& object_id);
  66. static void showObjectInspector(const LLUUID& object_id, const S32& object_face);
  67. static void playCurrentMedia(const LLPickInfo& info);
  68. static void VisitHomePage(const LLPickInfo& info);
  69. private:
  70. BOOL outsideSlop (S32 x, S32 y, S32 start_x, S32 start_y);
  71. BOOL handleLeftClickPick();
  72. BOOL handleRightClickPick();
  73. BOOL useClickAction (MASK mask, LLViewerObject* object,LLViewerObject* parent);
  74. void showVisualContextMenuEffect();
  75. ECursorType cursorFromObject(LLViewerObject* object);
  76. bool handleMediaClick(const LLPickInfo& info);
  77. bool handleMediaHover(const LLPickInfo& info);
  78. bool handleMediaMouseUp();
  79. BOOL handleTooltipLand(std::string line, std::string tooltip_msg);
  80. BOOL handleTooltipObject( LLViewerObject* hover_object, std::string line, std::string tooltip_msg);
  81. void steerCameraWithMouse(S32 x, S32 y);
  82. void startCameraSteering();
  83. void stopCameraSteering();
  84. bool inCameraSteerMode();
  85. private:
  86. bool mMouseButtonDown;
  87. bool mMouseOutsideSlop; // for this drag, has mouse moved outside slop region
  88. S32 mMouseDownX;
  89. S32 mMouseDownY;
  90. S32 mMouseSteerX;
  91. S32 mMouseSteerY;
  92. LLPointer<LLHUDEffectBlob> mAutoPilotDestination;
  93. LLPointer<LLHUDEffectBlob> mMouseSteerGrabPoint;
  94. bool mClockwise;
  95. bool mBlockClickToWalk;
  96. LLUUID mMediaMouseCaptureID;
  97. LLPickInfo mPick;
  98. LLPickInfo mHoverPick;
  99. LLPickInfo mSteerPick;
  100. LLPointer<LLViewerObject> mClickActionObject;
  101. U8 mClickAction;
  102. LLSafeHandle<LLObjectSelection> mLeftClickSelection;
  103. BOOL mClickActionBuyEnabled;
  104. BOOL mClickActionPayEnabled;
  105. };
  106. #endif