summaryrefslogtreecommitdiff
path: root/indra/llui/llbadge.h
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-15 16:35:49 +0300
committerGitHub <noreply@github.com>2024-05-15 16:35:49 +0300
commite49dcb8d0c9f539997effb640e350d9d0689aae6 (patch)
tree1bf99eaccce6de17c62f13c6595f7f497548dc5c /indra/llui/llbadge.h
parent531cd34f670170ade57f8813fe48012b61a1d3c2 (diff)
parent5f8a7374b9f18e0112d6749a9c845bd077a81acb (diff)
Merge pull request #1476 from secondlife/marchcat/x-b-merge
Maint X -> Maint B merge
Diffstat (limited to 'indra/llui/llbadge.h')
-rw-r--r--indra/llui/llbadge.h186
1 files changed, 93 insertions, 93 deletions
diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h
index 55f92e6e34..59296ffe86 100644
--- a/indra/llui/llbadge.h
+++ b/indra/llui/llbadge.h
@@ -1,25 +1,25 @@
-/**
+/**
* @file llbadge.h
* @brief Header for badges
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -49,38 +49,38 @@ class LLUICtrlFactory;
namespace LLRelPos
{
- enum Location
- {
- CENTER = 0,
+ enum Location
+ {
+ CENTER = 0,
- LEFT = (1 << 0),
- RIGHT = (1 << 1),
+ LEFT = (1 << 0),
+ RIGHT = (1 << 1),
- TOP = (1 << 2),
- BOTTOM = (1 << 3),
+ TOP = (1 << 2),
+ BOTTOM = (1 << 3),
- BOTTOM_LEFT = (BOTTOM | LEFT),
- BOTTOM_RIGHT = (BOTTOM | RIGHT),
+ BOTTOM_LEFT = (BOTTOM | LEFT),
+ BOTTOM_RIGHT = (BOTTOM | RIGHT),
- TOP_LEFT = (TOP | LEFT),
- TOP_RIGHT = (TOP | RIGHT),
- };
+ TOP_LEFT = (TOP | LEFT),
+ TOP_RIGHT = (TOP | RIGHT),
+ };
- inline bool IsBottom(Location relPos) { return (relPos & BOTTOM) == BOTTOM; }
- inline bool IsCenter(Location relPos) { return (relPos == CENTER); }
- inline bool IsLeft(Location relPos) { return (relPos & LEFT) == LEFT; }
- inline bool IsRight(Location relPos) { return (relPos & RIGHT) == RIGHT; }
- inline bool IsTop(Location relPos) { return (relPos & TOP) == TOP; }
+ inline bool IsBottom(Location relPos) { return (relPos & BOTTOM) == BOTTOM; }
+ inline bool IsCenter(Location relPos) { return (relPos == CENTER); }
+ inline bool IsLeft(Location relPos) { return (relPos & LEFT) == LEFT; }
+ inline bool IsRight(Location relPos) { return (relPos & RIGHT) == RIGHT; }
+ inline bool IsTop(Location relPos) { return (relPos & TOP) == TOP; }
}
// NOTE: This needs to occur before Optional<LLRelPos::Location> declaration for proper compilation.
namespace LLInitParam
{
- template<>
- struct TypeValues<LLRelPos::Location> : public TypeValuesHelper<LLRelPos::Location>
- {
- static void declareValues();
- };
+ template<>
+ struct TypeValues<LLRelPos::Location> : public TypeValuesHelper<LLRelPos::Location>
+ {
+ static void declareValues();
+ };
}
//
@@ -91,82 +91,82 @@ class LLBadge
: public LLUICtrl
{
public:
- struct Params
- : public LLInitParam::Block<Params, LLUICtrl::Params>
- {
- Optional< LLHandle<LLView> > owner; // Mandatory in code but not in xml
-
- Optional< LLUIImage* > border_image;
- Optional< LLUIColor > border_color;
-
- Optional< LLUIImage* > image;
- Optional< LLUIColor > image_color;
-
- Optional< std::string > label;
- Optional< LLUIColor > label_color;
-
- Optional< S32 > label_offset_horiz;
- Optional< S32 > label_offset_vert;
-
- Optional< LLRelPos::Location > location;
- Optional< S32 > location_offset_hcenter;
- Optional< S32 > location_offset_vcenter;
- Optional< U32 > location_percent_hcenter;
- Optional< U32 > location_percent_vcenter;
-
- Optional< F32 > padding_horiz;
- Optional< F32 > padding_vert;
-
- Params();
-
- bool equals(const Params&) const;
- };
-
+ struct Params
+ : public LLInitParam::Block<Params, LLUICtrl::Params>
+ {
+ Optional< LLHandle<LLView> > owner; // Mandatory in code but not in xml
+
+ Optional< LLUIImage* > border_image;
+ Optional< LLUIColor > border_color;
+
+ Optional< LLUIImage* > image;
+ Optional< LLUIColor > image_color;
+
+ Optional< std::string > label;
+ Optional< LLUIColor > label_color;
+
+ Optional< S32 > label_offset_horiz;
+ Optional< S32 > label_offset_vert;
+
+ Optional< LLRelPos::Location > location;
+ Optional< S32 > location_offset_hcenter;
+ Optional< S32 > location_offset_vcenter;
+ Optional< U32 > location_percent_hcenter;
+ Optional< U32 > location_percent_vcenter;
+
+ Optional< F32 > padding_horiz;
+ Optional< F32 > padding_vert;
+
+ Params();
+
+ bool equals(const Params&) const;
+ };
+
protected:
- friend class LLUICtrlFactory;
- LLBadge(const Params& p);
+ friend class LLUICtrlFactory;
+ LLBadge(const Params& p);
public:
- ~LLBadge();
+ ~LLBadge();
- bool addToView(LLView * view);
+ bool addToView(LLView * view);
- virtual void draw();
+ virtual void draw();
- const std::string getLabel() const { return wstring_to_utf8str(mLabel); }
- void setLabel( const LLStringExplicit& label);
+ const std::string getLabel() const { return wstring_to_utf8str(mLabel); }
+ void setLabel( const LLStringExplicit& label);
- void setDrawAtParentTop(bool draw_at_top) { mDrawAtParentTop = draw_at_top;}
+ void setDrawAtParentTop(bool draw_at_top) { mDrawAtParentTop = draw_at_top;}
private:
- LLPointer< LLUIImage > mBorderImage;
- LLUIColor mBorderColor;
-
- const LLFontGL* mGLFont;
-
- LLPointer< LLUIImage > mImage;
- LLUIColor mImageColor;
-
- LLUIString mLabel;
- LLUIColor mLabelColor;
-
- S32 mLabelOffsetHoriz;
- S32 mLabelOffsetVert;
-
- LLRelPos::Location mLocation;
- S32 mLocationOffsetHCenter;
- S32 mLocationOffsetVCenter;
- F32 mLocationPercentHCenter;
- F32 mLocationPercentVCenter;
-
- LLHandle< LLView > mOwner;
-
- F32 mPaddingHoriz;
- F32 mPaddingVert;
-
- LLScrollContainer* mParentScroller;
- bool mDrawAtParentTop;
+ LLPointer< LLUIImage > mBorderImage;
+ LLUIColor mBorderColor;
+
+ const LLFontGL* mGLFont;
+
+ LLPointer< LLUIImage > mImage;
+ LLUIColor mImageColor;
+
+ LLUIString mLabel;
+ LLUIColor mLabelColor;
+
+ S32 mLabelOffsetHoriz;
+ S32 mLabelOffsetVert;
+
+ LLRelPos::Location mLocation;
+ S32 mLocationOffsetHCenter;
+ S32 mLocationOffsetVCenter;
+ F32 mLocationPercentHCenter;
+ F32 mLocationPercentVCenter;
+
+ LLHandle< LLView > mOwner;
+
+ F32 mPaddingHoriz;
+ F32 mPaddingVert;
+
+ LLScrollContainer* mParentScroller;
+ bool mDrawAtParentTop;
};
// Build time optimization, generate once in .cpp file