00001 00032 #ifndef LL_LLHOVERVIEW_H 00033 #define LL_LLHOVERVIEW_H 00034 00035 // Library includes 00036 #include "lluuid.h" 00037 #include "llview.h" 00038 #include "llframetimer.h" 00039 #include "llstring.h" 00040 #include "llcoord.h" 00041 #include "v3dmath.h" 00042 00043 #include "lldarray.h" 00044 #include "llviewerobject.h" 00045 00046 class LLTool; 00047 00048 00049 // 00050 // Classes 00051 // 00052 class LLHoverView : public LLView 00053 { 00054 public: 00055 LLHoverView(const std::string& name, const LLRect& rect); 00056 ~LLHoverView(); 00057 00058 /*virtual*/ void draw(); 00059 00060 void updateHover(LLTool* current_tool); 00061 void cancelHover(); 00062 00063 // The last hovered object is retained even after the hover is 00064 // cancelled, so allow it to be specifically reset. JC 00065 void resetLastHoverObject(); 00066 00067 void setHoverActive(const BOOL active); 00068 00069 // We don't do hover picks while the user is typing. In fact, we stop 00070 // until the mouse is moved. 00071 void setTyping(BOOL b); 00072 00073 BOOL isHovering() const 00074 { return isHoveringLand() || isHoveringObject(); } 00075 00076 BOOL isHoveringObject() const; 00077 BOOL isHoveringLand() const; 00078 00079 LLViewerObject* getLastHoverObject() const; 00080 00081 static void pickCallback(S32 x, S32 y, MASK mask); 00082 00083 protected: 00084 void updateText(); 00085 00086 protected: 00087 LLFrameTimer mStartHoverTimer; 00088 BOOL mStartHoverPickTimer; 00089 BOOL mDoneHoverPick; 00090 00091 BOOL mHoverActive; 00092 LLCoordGL mHoverPos; 00093 00094 // How long has the hover popup been visible? 00095 LLFrameTimer mHoverTimer; 00096 00097 typedef std::list<std::string> text_list_t; 00098 text_list_t mText; 00099 00100 BOOL mUseHover; 00101 00102 // If not null and not dead, we're over an object. 00103 LLPointer<LLViewerObject> mLastHoverObject; 00104 00105 // If not LLVector3d::ZERO, we're over land. 00106 LLVector3d mHoverLandGlobal; 00107 LLVector3d mHoverOffset; 00108 00109 BOOL mTyping; 00110 00111 public: 00112 // Show in-world hover tips. Allow to turn off for movie making, game playing. 00113 // Public so menu can directly toggle. 00114 static BOOL sShowHoverTips; 00115 }; 00116 00117 00118 // 00119 // Globals 00120 // 00121 00122 extern LLHoverView *gHoverView; 00123 00124 00125 #endif