PageRenderTime 16ms CodeModel.GetById 8ms app.highlight 5ms RepoModel.GetById 2ms 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
 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
27#ifndef LL_LLUICOLOR_H_
28#define LL_LLUICOLOR_H_
29
30#include "v4color.h"
31
32namespace LLInitParam
33{
34	template<typename T, bool>
35	struct ParamCompare;
36}
37
38class LLUIColor
39{
40public:
41	LLUIColor();
42	LLUIColor(const LLColor4& color);
43	LLUIColor(const LLUIColor* color);
44
45	void set(const LLColor4& color);
46	void set(const LLUIColor* color);
47
48	const LLColor4& get() const;
49
50	operator const LLColor4& () const;
51	const LLColor4& operator()() const;
52
53	bool isReference() const;
54
55private:
56	friend struct LLInitParam::ParamCompare<LLUIColor, false>;
57
58	const LLUIColor* mColorPtr;
59	LLColor4 mColor;
60};
61
62namespace LLInitParam
63{
64	template<>
65	struct ParamCompare<LLUIColor, false>
66	{
67		static bool equals(const LLUIColor& a, const LLUIColor& b);
68	};
69}
70
71#endif