diff options
author | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:50 -0500 |
commit | 2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch) | |
tree | 95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/newview/llstylemap.cpp | |
parent | Second Life viewer sources 1.20.6 (diff) | |
download | meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2 meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz |
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/newview/llstylemap.cpp')
-rw-r--r-- | linden/indra/newview/llstylemap.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/linden/indra/newview/llstylemap.cpp b/linden/indra/newview/llstylemap.cpp new file mode 100644 index 0000000..a8c8bf7 --- /dev/null +++ b/linden/indra/newview/llstylemap.cpp | |||
@@ -0,0 +1,75 @@ | |||
1 | /** | ||
2 | * @file llstylemap.cpp | ||
3 | * @brief LLStyleMap class implementation | ||
4 | * | ||
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | ||
6 | * | ||
7 | * Copyright (c) 2002-2008, Linden Research, Inc. | ||
8 | * | ||
9 | * Second Life Viewer Source Code | ||
10 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
11 | * to you under the terms of the GNU General Public License, version 2.0 | ||
12 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
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 | ||
15 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
16 | * | ||
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 | ||
19 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
21 | * | ||
22 | * By copying, modifying or distributing this software, you acknowledge | ||
23 | * that you have read and understood your obligations described above, | ||
24 | * and agree to abide by those obligations. | ||
25 | * | ||
26 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
27 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
28 | * COMPLETENESS OR PERFORMANCE. | ||
29 | * $/LicenseInfo$ | ||
30 | */ | ||
31 | |||
32 | #include "llviewerprecompiledheaders.h" | ||
33 | |||
34 | #include "llstylemap.h" | ||
35 | #include "llstring.h" | ||
36 | #include "llui.h" | ||
37 | #include "llviewercontrol.h" | ||
38 | #include "llagent.h" | ||
39 | |||
40 | LLStyleMap::LLStyleMap() | ||
41 | { | ||
42 | } | ||
43 | |||
44 | LLStyleMap::~LLStyleMap() | ||
45 | { | ||
46 | } | ||
47 | |||
48 | LLStyleMap &LLStyleMap::instance() | ||
49 | { | ||
50 | static LLStyleMap mStyleMap; | ||
51 | return mStyleMap; | ||
52 | } | ||
53 | |||
54 | // This is similar to the [] accessor except that if the entry doesn't already exist, | ||
55 | // then this will create the entry. | ||
56 | const LLStyleSP &LLStyleMap::lookup(const LLUUID &source) | ||
57 | { | ||
58 | // Find this style in the map or add it if not. This map holds links to residents' profiles. | ||
59 | if (find(source) == end()) | ||
60 | { | ||
61 | LLStyleSP style(new LLStyle); | ||
62 | style->setVisible(true); | ||
63 | style->setFontName(LLString::null); | ||
64 | if (source != gAgent.getID() && source != LLUUID::null) | ||
65 | { | ||
66 | style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); | ||
67 | LLString link = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); | ||
68 | style->setLinkHREF(link); | ||
69 | } | ||
70 | else | ||
71 | style->setColor(LLColor4::white); | ||
72 | (*this)[source] = style; | ||
73 | } | ||
74 | return (*this)[source]; | ||
75 | } | ||