diff options
author | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:27 -0500 |
commit | a8a62201ba762e98dff92cf49033e577fc34d8d4 (patch) | |
tree | 11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/llui/llview.h | |
parent | Second Life viewer sources 1.18.6.4-RC (diff) | |
download | meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2 meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz |
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/llui/llview.h')
-rw-r--r-- | linden/indra/llui/llview.h | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/linden/indra/llui/llview.h b/linden/indra/llui/llview.h index bd99a13..67a4d56 100644 --- a/linden/indra/llui/llview.h +++ b/linden/indra/llui/llview.h | |||
@@ -12,12 +12,12 @@ | |||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
13 | * ("Other License"), formally executed by you and Linden Lab. Terms of | 13 | * ("Other License"), formally executed by you and Linden Lab. Terms of |
14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | 14 | * the GPL can be found in doc/GPL-license.txt in this distribution, or |
15 | * online at http://secondlife.com/developers/opensource/gplv2 | 15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 |
16 | * | 16 | * |
17 | * There are special exceptions to the terms and conditions of the GPL as | 17 | * There are special exceptions to the terms and conditions of the GPL as |
18 | * it is applied to this Source Code. View the full text of the exception | 18 | * it is applied to this Source Code. View the full text of the exception |
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 19 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
20 | * online at http://secondlife.com/developers/opensource/flossexception | 20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception |
21 | * | 21 | * |
22 | * By copying, modifying or distributing this software, you acknowledge | 22 | * By copying, modifying or distributing this software, you acknowledge |
23 | * that you have read and understood your obligations described above, | 23 | * that you have read and understood your obligations described above, |
@@ -50,6 +50,7 @@ | |||
50 | #include "llviewquery.h" | 50 | #include "llviewquery.h" |
51 | #include "llxmlnode.h" | 51 | #include "llxmlnode.h" |
52 | #include "stdenums.h" | 52 | #include "stdenums.h" |
53 | #include "lluistring.h" | ||
53 | 54 | ||
54 | class LLColor4; | 55 | class LLColor4; |
55 | class LLWindow; | 56 | class LLWindow; |
@@ -146,6 +147,7 @@ protected: | |||
146 | LLString mName; | 147 | LLString mName; |
147 | // location in pixels, relative to surrounding structure, bottom,left=0,0 | 148 | // location in pixels, relative to surrounding structure, bottom,left=0,0 |
148 | LLRect mRect; | 149 | LLRect mRect; |
150 | LLRect mBoundingRect; | ||
149 | 151 | ||
150 | U32 mReshapeFlags; | 152 | U32 mReshapeFlags; |
151 | 153 | ||
@@ -161,11 +163,11 @@ protected: | |||
161 | BOOL mSaveToXML; | 163 | BOOL mSaveToXML; |
162 | 164 | ||
163 | BOOL mIsFocusRoot; | 165 | BOOL mIsFocusRoot; |
166 | BOOL mUseBoundingRect; // hit test against bounding rectangle that includes all child elements | ||
164 | 167 | ||
165 | public: | 168 | public: |
166 | LLViewHandle mViewHandle; | 169 | LLViewHandle mViewHandle; |
167 | BOOL mLastVisible; | 170 | BOOL mLastVisible; |
168 | BOOL mSpanChildren; | ||
169 | 171 | ||
170 | private: | 172 | private: |
171 | BOOL mVisible; | 173 | BOOL mVisible; |
@@ -217,6 +219,7 @@ public: | |||
217 | void setMouseOpaque( BOOL b ); | 219 | void setMouseOpaque( BOOL b ); |
218 | void setToolTip( const LLStringExplicit& msg ); | 220 | void setToolTip( const LLStringExplicit& msg ); |
219 | BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); | 221 | BOOL setToolTipArg( const LLStringExplicit& key, const LLStringExplicit& text ); |
222 | void setToolTipArgs( const LLString::format_map_t& args ); | ||
220 | 223 | ||
221 | virtual void setRect(const LLRect &rect); | 224 | virtual void setRect(const LLRect &rect); |
222 | void setFollows(U32 flags); | 225 | void setFollows(U32 flags); |
@@ -231,13 +234,15 @@ public: | |||
231 | 234 | ||
232 | void setSoundFlags(U8 flags); | 235 | void setSoundFlags(U8 flags); |
233 | void setName(LLString name); | 236 | void setName(LLString name); |
234 | void setSpanChildren( BOOL span_children ); | 237 | void setUseBoundingRect( BOOL use_bounding_rect ); |
238 | BOOL getUseBoundingRect(); | ||
235 | 239 | ||
236 | const LLString& getToolTip(); | 240 | const LLString& getToolTip(); |
237 | 241 | ||
238 | void sendChildToFront(LLView* child); | 242 | void sendChildToFront(LLView* child); |
239 | void sendChildToBack(LLView* child); | 243 | void sendChildToBack(LLView* child); |
240 | void moveChildToFrontOfTabGroup(LLUICtrl* child); | 244 | void moveChildToFrontOfTabGroup(LLUICtrl* child); |
245 | void moveChildToBackOfTabGroup(LLUICtrl* child); | ||
241 | 246 | ||
242 | void addChild(LLView* view, S32 tab_group = 0); | 247 | void addChild(LLView* view, S32 tab_group = 0); |
243 | void addChildAtEnd(LLView* view, S32 tab_group = 0); | 248 | void addChildAtEnd(LLView* view, S32 tab_group = 0); |
@@ -264,7 +269,7 @@ public: | |||
264 | { | 269 | { |
265 | /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const | 270 | /*virtual*/ filterResult_t operator() (const LLView* const view, const viewList_t & children) const |
266 | { | 271 | { |
267 | return filterResult_t(view->isCtrl() && view->isFocusRoot(), !view->isFocusRoot()); | 272 | return filterResult_t(view->isCtrl() && view->isFocusRoot(), TRUE); |
268 | } | 273 | } |
269 | }; | 274 | }; |
270 | 275 | ||
@@ -312,20 +317,22 @@ public: | |||
312 | BOOL followsAll() const { return mReshapeFlags & FOLLOWS_ALL; } | 317 | BOOL followsAll() const { return mReshapeFlags & FOLLOWS_ALL; } |
313 | 318 | ||
314 | const LLRect& getRect() const { return mRect; } | 319 | const LLRect& getRect() const { return mRect; } |
320 | const LLRect& getBoundingRect() const { return mBoundingRect; } | ||
321 | const LLRect getLocalBoundingRect() const; | ||
315 | const LLRect getScreenRect() const; | 322 | const LLRect getScreenRect() const; |
316 | const LLRect getLocalRect() const; | 323 | const LLRect getLocalRect() const; |
317 | virtual const LLRect getSnapRect() const { return mRect; } | 324 | virtual const LLRect getSnapRect() const { return mRect; } |
318 | virtual const LLRect getLocalSnapRect() const; | 325 | virtual const LLRect getLocalSnapRect() const; |
319 | 326 | ||
320 | virtual LLRect getRequiredRect(); // Get required size for this object. 0 for width/height means don't care. | 327 | virtual LLRect getRequiredRect(); // Get required size for this object. 0 for width/height means don't care. |
321 | virtual void updateRect(); // apply procedural updates to own rectangle | 328 | void updateBoundingRect(); |
322 | 329 | ||
323 | LLView* getRootView(); | 330 | LLView* getRootView(); |
324 | LLView* getParent() const { return mParentView; } | 331 | LLView* getParent() const { return mParentView; } |
325 | LLView* getFirstChild() { return (mChildList.empty()) ? NULL : *(mChildList.begin()); } | 332 | LLView* getFirstChild() { return (mChildList.empty()) ? NULL : *(mChildList.begin()); } |
326 | S32 getChildCount() const { return (S32)mChildList.size(); } | 333 | S32 getChildCount() const { return (S32)mChildList.size(); } |
327 | template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } | 334 | template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); } |
328 | BOOL hasAncestor(LLView* parentp); | 335 | BOOL hasAncestor(const LLView* parentp); |
329 | 336 | ||
330 | BOOL hasChild(const LLString& childname, BOOL recurse = FALSE) const; | 337 | BOOL hasChild(const LLString& childname, BOOL recurse = FALSE) const; |
331 | 338 | ||
@@ -390,6 +397,7 @@ public: | |||
390 | 397 | ||
391 | static U32 createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect = LLRect()); | 398 | static U32 createRect(LLXMLNodePtr node, LLRect &rect, LLView* parent_view, const LLRect &required_rect = LLRect()); |
392 | virtual void initFromXML(LLXMLNodePtr node, LLView* parent); | 399 | virtual void initFromXML(LLXMLNodePtr node, LLView* parent); |
400 | void parseFollowsFlags(LLXMLNodePtr node); | ||
393 | 401 | ||
394 | static LLFontGL* selectFont(LLXMLNodePtr node); | 402 | static LLFontGL* selectFont(LLXMLNodePtr node); |
395 | static LLFontGL::HAlign selectFontHAlign(LLXMLNodePtr node); | 403 | static LLFontGL::HAlign selectFontHAlign(LLXMLNodePtr node); |
@@ -428,12 +436,16 @@ public: | |||
428 | BOOL getVisible() const { return mVisible && !mHidden; } | 436 | BOOL getVisible() const { return mVisible && !mHidden; } |
429 | U8 getSoundFlags() const { return mSoundFlags; } | 437 | U8 getSoundFlags() const { return mSoundFlags; } |
430 | 438 | ||
431 | // Default to no action | 439 | typedef enum e_hit_test_type |
432 | virtual void onFocusLost(); | 440 | { |
433 | virtual void onFocusReceived(); | 441 | HIT_TEST_USE_BOUNDING_RECT, |
442 | HIT_TEST_IGNORE_BOUNDING_RECT | ||
443 | }EHitTestType; | ||
444 | |||
445 | BOOL parentPointInView(S32 x, S32 y, EHitTestType type = HIT_TEST_USE_BOUNDING_RECT) const; | ||
446 | BOOL pointInView(S32 x, S32 y, EHitTestType type = HIT_TEST_USE_BOUNDING_RECT) const; | ||
447 | BOOL blockMouseEvent(S32 x, S32 y) const; | ||
434 | 448 | ||
435 | BOOL parentPointInView(S32 x, S32 y) const { return mRect.pointInRect( x, y ); } | ||
436 | BOOL pointInView(S32 x, S32 y) const { return mRect.localPointInRect( x, y ); } | ||
437 | virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; | 449 | virtual void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const; |
438 | virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; | 450 | virtual void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const; |
439 | virtual BOOL localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, LLView* other_view); | 451 | virtual BOOL localPointToOtherView( S32 x, S32 y, S32 *other_x, S32 *other_y, LLView* other_view); |