PageRenderTime 43ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llxuixml/lluicolor.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 71 lines | 34 code | 12 blank | 25 comment | 0 complexity | c42c65388972286fe43332b9e07a6485 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lluicolor.h
  3. * @brief brief LLUIColor class header file
  4. *
  5. * $LicenseInfo:firstyear=2009&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_LLUICOLOR_H_
  27. #define LL_LLUICOLOR_H_
  28. #include "v4color.h"
  29. namespace LLInitParam
  30. {
  31. template<typename T, bool>
  32. struct ParamCompare;
  33. }
  34. class LLUIColor
  35. {
  36. public:
  37. LLUIColor();
  38. LLUIColor(const LLColor4& color);
  39. LLUIColor(const LLUIColor* color);
  40. void set(const LLColor4& color);
  41. void set(const LLUIColor* color);
  42. const LLColor4& get() const;
  43. operator const LLColor4& () const;
  44. const LLColor4& operator()() const;
  45. bool isReference() const;
  46. private:
  47. friend struct LLInitParam::ParamCompare<LLUIColor, false>;
  48. const LLUIColor* mColorPtr;
  49. LLColor4 mColor;
  50. };
  51. namespace LLInitParam
  52. {
  53. template<>
  54. struct ParamCompare<LLUIColor, false>
  55. {
  56. static bool equals(const LLUIColor& a, const LLUIColor& b);
  57. };
  58. }
  59. #endif