diff --git a/.hgpatchinfo/.RLVa.dep b/.hgpatchinfo/.RLVa.dep
index db9f1b03b0..5898e71ba3 100644
--- a/.hgpatchinfo/.RLVa.dep
+++ b/.hgpatchinfo/.RLVa.dep
@@ -1,2 +1,2 @@
-d2202f2501db50084ca884bcb97a03c7b1c2ec4e
-f501c2356b74bc8c5a48bdf42621a2d4f5bea808
\ No newline at end of file
+a52aa93d9772c677a4594b22411e99d3ca7cb7c3
+c0b22ce8586c399ea4201ef08036782e06a78d13
\ No newline at end of file
diff --git a/.hgpatchinfo/Appearance-Misc.dep b/.hgpatchinfo/Appearance-Misc.dep
index a8722be32b..0056f0bc00 100644
--- a/.hgpatchinfo/Appearance-Misc.dep
+++ b/.hgpatchinfo/Appearance-Misc.dep
@@ -1 +1 @@
-336854c58a54210c0b5046e4dd8af49acc1a9159
\ No newline at end of file
+23a6fee23f1d6a2432201906d41e80f3471e8700
\ No newline at end of file
diff --git a/.hgpatchinfo/Appearance-MixedViewers.dep b/.hgpatchinfo/Appearance-MixedViewers.dep
index a8722be32b..0056f0bc00 100644
--- a/.hgpatchinfo/Appearance-MixedViewers.dep
+++ b/.hgpatchinfo/Appearance-MixedViewers.dep
@@ -1 +1 @@
-336854c58a54210c0b5046e4dd8af49acc1a9159
\ No newline at end of file
+23a6fee23f1d6a2432201906d41e80f3471e8700
\ No newline at end of file
diff --git a/.hgpatchinfo/RLVa.dep b/.hgpatchinfo/RLVa.dep
index 060eb10921..eecca8f76a 100644
--- a/.hgpatchinfo/RLVa.dep
+++ b/.hgpatchinfo/RLVa.dep
@@ -1 +1 @@
-9ea58fa9198ff25fa7ff9446a1bbe52b01076f16
\ No newline at end of file
+ff000086493c960ef83586482bbcd3fd78cda094
\ No newline at end of file
diff --git a/.hgpatchinfo/Viewer-Build.dep b/.hgpatchinfo/Viewer-Build.dep
index 830028baa8..c69b7ad4e9 100644
--- a/.hgpatchinfo/Viewer-Build.dep
+++ b/.hgpatchinfo/Viewer-Build.dep
@@ -1 +1 @@
-230637f9ff30c055fed20e05cbcfb2420cdecef0
\ No newline at end of file
+13149a524874b608aeb76325b35faff113a5ea53
\ No newline at end of file
diff --git a/.hgtags b/.hgtags
index 156166d868..02fa2bd659 100644
--- a/.hgtags
+++ b/.hgtags
@@ -453,475 +453,3 @@ b23419a2748483c98f3b84b630468a21c88feba5 DRTVWR-292
0a5d409161ef2a89b28c9a741051dd2dedc707d6 DRTVWR-297
852b69ef0b5fe6b13b69cc2217282cc64de6afab 3.4.5-beta5
a49c715243a36a8a380504d14cb7416b3039c956 3.4.5-release
-0000000000000000000000000000000000000000 alpha-3
-0000000000000000000000000000000000000000 fork to viewer-2-0
-0000000000000000000000000000000000000000 alpha-4
-0000000000000000000000000000000000000000 fork to viewer-20qa
-0000000000000000000000000000000000000000 alpha-5
-0000000000000000000000000000000000000000 howard-demo
-0000000000000000000000000000000000000000 alpha-6
-0000000000000000000000000000000000000000 beta-3-5
-0000000000000000000000000000000000000000 beta-4
-0000000000000000000000000000000000000000 beta-5
-0000000000000000000000000000000000000000 viewer-2-0-0
-0000000000000000000000000000000000000000 viewer-2-0-1
-0000000000000000000000000000000000000000 2-1rn1
-0000000000000000000000000000000000000000 viewer-2-0-2-start
-0000000000000000000000000000000000000000 viewer-2-1-0-start
-0000000000000000000000000000000000000000 2-1-beta-1
-0000000000000000000000000000000000000000 2-1-beta-2
-0000000000000000000000000000000000000000 2-1-beta-3
-0000000000000000000000000000000000000000 2-1-beta-4
-0000000000000000000000000000000000000000 2-1-release
-0000000000000000000000000000000000000000 2-1-1-beta-1
-0000000000000000000000000000000000000000 2-1-1-beta-2
-0000000000000000000000000000000000000000 2-1-1-release
-0000000000000000000000000000000000000000 2.1.1-release
-0000000000000000000000000000000000000000 last_sprint
-0000000000000000000000000000000000000000 2.2.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-5_2.2.0-beta1
-0000000000000000000000000000000000000000 beta_2.1.3
-0000000000000000000000000000000000000000 2.2.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-3_2.2.0-beta2
-0000000000000000000000000000000000000000 2.2.0-beta3
-0000000000000000000000000000000000000000 DRTVWR-7_2.2.0-beta3
-0000000000000000000000000000000000000000 2.2.0-beta4
-0000000000000000000000000000000000000000 2.2.0-release
-0000000000000000000000000000000000000000 DRTVWR-8_2.2.0-release
-0000000000000000000000000000000000000000 2.3.0-start
-0000000000000000000000000000000000000000 2.3.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-14_2.3.0-beta1
-0000000000000000000000000000000000000000 2.3.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-17_2.3.0-beta2
-0000000000000000000000000000000000000000 2.3.0-beta3
-0000000000000000000000000000000000000000 2.3.0-release
-0000000000000000000000000000000000000000 DRTVWR-13_2.3.0-release
-0000000000000000000000000000000000000000 DRTVWR-20_2.3.0-beta3
-0000000000000000000000000000000000000000 2.4.0-start
-0000000000000000000000000000000000000000 2.4.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-26_2.4.0-beta1
-0000000000000000000000000000000000000000 2.4.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-27_2.4.0-beta2
-0000000000000000000000000000000000000000 2.4.0-release
-0000000000000000000000000000000000000000 DRTVWR-25_2.4.0-release
-0000000000000000000000000000000000000000 2.5.0-start
-0000000000000000000000000000000000000000 2.5.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-32_2.5.0-beta1
-0000000000000000000000000000000000000000 2.5.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-33--2.5.0beta2
-0000000000000000000000000000000000000000 DRTVWR-33_2.5.0-beta2
-0000000000000000000000000000000000000000 2.5.0-beta3
-0000000000000000000000000000000000000000 2.5.0-release
-0000000000000000000000000000000000000000 DRTVWR-31_2.5.0-release
-0000000000000000000000000000000000000000 DRTVWR-34_2.5.0-beta3
-0000000000000000000000000000000000000000 nat-eventapi2-base
-0000000000000000000000000000000000000000 2.5.1-start
-0000000000000000000000000000000000000000 2.5.1-release
-0000000000000000000000000000000000000000 DRTVWR-37_2.5.1-release
-0000000000000000000000000000000000000000 2.5.2-release
-0000000000000000000000000000000000000000 DRTVWR-38_2.5.2-release
-0000000000000000000000000000000000000000 2.6.0-start
-0000000000000000000000000000000000000000 2.6.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-40_2.6.0-beta1
-0000000000000000000000000000000000000000 2.6.0-beta1-tip
-0000000000000000000000000000000000000000 2.6.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-41_2.6.0-beta2
-0000000000000000000000000000000000000000 2.6.1-beta1
-0000000000000000000000000000000000000000 2.6.1-start
-0000000000000000000000000000000000000000 DRTVWR-43_2.6.1-beta1
-0000000000000000000000000000000000000000 2.6.2-start
-0000000000000000000000000000000000000000 2.6.2-beta1
-0000000000000000000000000000000000000000 DRTVWR-45_2.6.2-beta1
-0000000000000000000000000000000000000000 2.6.0-release
-0000000000000000000000000000000000000000 DRTVWR-39_2.6.0-release
-0000000000000000000000000000000000000000 2.6.1-release
-0000000000000000000000000000000000000000 DRTVWR-42_2.6.1-release
-0000000000000000000000000000000000000000 end-of-develop.py
-0000000000000000000000000000000000000000 2.6.3-start
-0000000000000000000000000000000000000000 2.6.3-beta1
-0000000000000000000000000000000000000000 DRTVWR-47_2.6.3-beta1
-0000000000000000000000000000000000000000 2.6.3-beta2
-0000000000000000000000000000000000000000 DRTVWR-48_2.6.3-beta2
-0000000000000000000000000000000000000000 dons-headless-hackathon-work
-0000000000000000000000000000000000000000 2.6.2-release
-0000000000000000000000000000000000000000 DRTVWR-44_2.6.2-release
-0000000000000000000000000000000000000000 2.6.5-beta1
-0000000000000000000000000000000000000000 DRTVWR-50_2.6.5-beta1
-0000000000000000000000000000000000000000 2.6.3-release
-0000000000000000000000000000000000000000 DRTVWR-46_2.6.3-release
-0000000000000000000000000000000000000000 2.6.6-start
-0000000000000000000000000000000000000000 2.6.6-beta1
-0000000000000000000000000000000000000000 DRTVWR-52_2.6.6-beta1
-0000000000000000000000000000000000000000 2.6.8-start
-0000000000000000000000000000000000000000 2.6.6-release
-0000000000000000000000000000000000000000 DRTVWR-51_2.6.6-release
-0000000000000000000000000000000000000000 2.6.8-beta1
-0000000000000000000000000000000000000000 DRTVWR-55_2.6.8-beta1
-0000000000000000000000000000000000000000 2.6.8-release
-0000000000000000000000000000000000000000 DRTVWR-54_2.6.8-release
-0000000000000000000000000000000000000000 2.6.9-start
-0000000000000000000000000000000000000000 2.6.9-beta1
-0000000000000000000000000000000000000000 2.6.9-release
-0000000000000000000000000000000000000000 DRTVWR-56_2.6.9-release
-0000000000000000000000000000000000000000 DRTVWR-57_2.6.9-beta1
-0000000000000000000000000000000000000000 2.7.0-start
-0000000000000000000000000000000000000000 2.7.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-59_2.7.0-beta1
-0000000000000000000000000000000000000000 2.7.1-start
-0000000000000000000000000000000000000000 2.7.1-beta1
-0000000000000000000000000000000000000000 DRTVWR-61_2.7.1-beta1
-0000000000000000000000000000000000000000 2.7.2-start
-0000000000000000000000000000000000000000 2.7.2-beta1
-0000000000000000000000000000000000000000 DRTVWR-63_2.7.2-beta1
-0000000000000000000000000000000000000000 2.7.3-start
-0000000000000000000000000000000000000000 2.7.1-release
-0000000000000000000000000000000000000000 2.7.2-release
-0000000000000000000000000000000000000000 DRTVWR-60_2.7.1-release
-0000000000000000000000000000000000000000 DRTVWR-62_2.7.2-release
-0000000000000000000000000000000000000000 2.7.4-start
-0000000000000000000000000000000000000000 2.7.4-beta1
-0000000000000000000000000000000000000000 DRTVWR-67_2.7.4-beta1
-0000000000000000000000000000000000000000 2.7.5-start
-0000000000000000000000000000000000000000 2.7.5-beta1
-0000000000000000000000000000000000000000 DRTVWR-69_2.7.5-beta1
-0000000000000000000000000000000000000000 2.8.0-beta1
-0000000000000000000000000000000000000000 2.8.0-start
-0000000000000000000000000000000000000000 DRTVWR-71_2.8.0-beta1
-0000000000000000000000000000000000000000 2.7.4-release
-0000000000000000000000000000000000000000 DRTVWR-66_2.7.4-release
-0000000000000000000000000000000000000000 2.7.5-release
-0000000000000000000000000000000000000000 DRTVWR-68_2.7.5-release
-0000000000000000000000000000000000000000 2.8.1-start
-0000000000000000000000000000000000000000 2.8.1-beta1
-0000000000000000000000000000000000000000 DRTVWR-73_2.8.1-beta1
-0000000000000000000000000000000000000000 2.8.0-release
-0000000000000000000000000000000000000000 DRTVWR-70_2.8.0-release
-0000000000000000000000000000000000000000 2.8.2-start
-0000000000000000000000000000000000000000 2.8.3-start
-0000000000000000000000000000000000000000 2.8.1-release
-0000000000000000000000000000000000000000 DRTVWR-72_2.8.1-release
-0000000000000000000000000000000000000000 2.8.1-hotfix
-0000000000000000000000000000000000000000 DRTVWR-76_2.8.1-hotfix
-0000000000000000000000000000000000000000 2.8.3-beta1
-0000000000000000000000000000000000000000 DRTVWR-75_2.8.3-beta1
-0000000000000000000000000000000000000000 3.0.0-start
-0000000000000000000000000000000000000000 3.0.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-78_3.0.0-beta1
-0000000000000000000000000000000000000000 2.8.3-release
-0000000000000000000000000000000000000000 DRTVWR-74_2.8.3-release
-0000000000000000000000000000000000000000 3.0.1-start
-0000000000000000000000000000000000000000 3.0.1-beta1
-0000000000000000000000000000000000000000 DRTVWR-81_3.0.1-beta1
-0000000000000000000000000000000000000000 3.0.2-start
-0000000000000000000000000000000000000000 3.0.2-beta1
-0000000000000000000000000000000000000000 DRTVWR-83_3.0.2-beta1
-0000000000000000000000000000000000000000 3.0.0-release
-0000000000000000000000000000000000000000 DRTVWR-77_3.0.0-release
-0000000000000000000000000000000000000000 3.0.2-beta2
-0000000000000000000000000000000000000000 DRTVWR-86_3.0.2-beta2
-0000000000000000000000000000000000000000 3.0.3-start
-0000000000000000000000000000000000000000 3.0.3-beta1
-0000000000000000000000000000000000000000 DRTVWR-85_3.0.3-beta1
-0000000000000000000000000000000000000000 3.0.3-beta2
-0000000000000000000000000000000000000000 DRTVWR-89_3.0.3-beta2
-0000000000000000000000000000000000000000 3.0.4-start
-0000000000000000000000000000000000000000 3.0.3-release
-0000000000000000000000000000000000000000 DRTVWR-84_3.0.3-release
-0000000000000000000000000000000000000000 3.0.5-start
-0000000000000000000000000000000000000000 3.1.0-start
-0000000000000000000000000000000000000000 3.1.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-93_3.1.0-beta1
-0000000000000000000000000000000000000000 3.1.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-96_3.1.0-beta2
-0000000000000000000000000000000000000000 3.1.0-release
-0000000000000000000000000000000000000000 DRTVWR-92_3.1.0-release
-0000000000000000000000000000000000000000 3.2.0-start
-0000000000000000000000000000000000000000 3.2.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-95_3.2.0-beta1
-0000000000000000000000000000000000000000 3.2.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-97_3.2.0-beta2
-0000000000000000000000000000000000000000 3.2.0-beta3
-0000000000000000000000000000000000000000 DRTVWR-98_3.2.0-beta3
-0000000000000000000000000000000000000000 3.2.0-release
-0000000000000000000000000000000000000000 DRTVWR-94_3.2.0-release
-0000000000000000000000000000000000000000 3.2.1-start
-0000000000000000000000000000000000000000 3.2.1-beta1
-0000000000000000000000000000000000000000 DRTVWR-100_3.2.1-beta1
-0000000000000000000000000000000000000000 3.2.2-start
-0000000000000000000000000000000000000000 3.2.2-beta1
-0000000000000000000000000000000000000000 DRTVWR-102_3.2.2-beta1
-0000000000000000000000000000000000000000 3.2.1-release
-0000000000000000000000000000000000000000 DRTVWR-99_3.2.1-release
-0000000000000000000000000000000000000000 3.2.3-start
-0000000000000000000000000000000000000000 3.2.4-beta1
-0000000000000000000000000000000000000000 3.2.4-start
-0000000000000000000000000000000000000000 DRTVWR-104_3.2.4-beta1
-0000000000000000000000000000000000000000 3.2.4-release
-0000000000000000000000000000000000000000 DRTVWR-103_3.2.4-release
-0000000000000000000000000000000000000000 3.2.5-start
-0000000000000000000000000000000000000000 3.2.5-beta1
-0000000000000000000000000000000000000000 DRTVWR-106_3.2.5-beta1
-0000000000000000000000000000000000000000 3.2.5-beta2
-0000000000000000000000000000000000000000 DRTVWR-107_3.2.5-beta2
-0000000000000000000000000000000000000000 3.2.5-release
-0000000000000000000000000000000000000000 DRTVWR-105_3.2.5-release
-0000000000000000000000000000000000000000 3.2.6-start
-0000000000000000000000000000000000000000 3.2.6-beta1
-0000000000000000000000000000000000000000 DRTVWR-109_3.2.6-beta1
-0000000000000000000000000000000000000000 3.2.7-start
-0000000000000000000000000000000000000000 3.2.7-beta1
-0000000000000000000000000000000000000000 DRTVWR-111_3.2.7-beta1
-0000000000000000000000000000000000000000 3.2.8-start
-0000000000000000000000000000000000000000 3.2.8-beta1
-0000000000000000000000000000000000000000 DRTVWR-114_3.2.8-beta1
-0000000000000000000000000000000000000000 3.2.8-beta2
-0000000000000000000000000000000000000000 DRTVWR-115_3.2.8-beta2
-0000000000000000000000000000000000000000 3.2.8-release
-0000000000000000000000000000000000000000 DRTVWR-113_3.2.8-release
-0000000000000000000000000000000000000000 3.2.9-start
-0000000000000000000000000000000000000000 3.2.9-beta1
-0000000000000000000000000000000000000000 DRTVWR-117_3.2.9-beta1
-0000000000000000000000000000000000000000 3.2.9-beta2
-0000000000000000000000000000000000000000 DRTVWR-118_3.2.9-beta2
-0000000000000000000000000000000000000000 3.3.0-beta1
-0000000000000000000000000000000000000000 3.3.0-start
-0000000000000000000000000000000000000000 DRTVWR-119
-0000000000000000000000000000000000000000 3.3.0-release
-0000000000000000000000000000000000000000 3.3.1-start
-0000000000000000000000000000000000000000 DRTVWR-125
-0000000000000000000000000000000000000000 3.3.1-beta1
-0000000000000000000000000000000000000000 3.3.1-beta2
-0000000000000000000000000000000000000000 DRTVWR-139
-0000000000000000000000000000000000000000 viewer-beta-candidate
-0000000000000000000000000000000000000000 3.3.1-release
-0000000000000000000000000000000000000000 3.3.2-beta1
-0000000000000000000000000000000000000000 3.3.2-beta2
-0000000000000000000000000000000000000000 3.3.2-release
-0000000000000000000000000000000000000000 viewer-release-candidate
-0000000000000000000000000000000000000000 DRTVWR-156
-0000000000000000000000000000000000000000 DRTVWR-148
-0000000000000000000000000000000000000000 DRTVWR-155
-0000000000000000000000000000000000000000 DRTVWR-153
-0000000000000000000000000000000000000000 DRTVWR-160
-0000000000000000000000000000000000000000 3.3.3-beta1
-0000000000000000000000000000000000000000 DRTVWR-144
-0000000000000000000000000000000000000000 DRTVWR-164
-0000000000000000000000000000000000000000 DRTVWR-162
-0000000000000000000000000000000000000000 DRTVWR-165
-0000000000000000000000000000000000000000 3.3.3-beta2
-0000000000000000000000000000000000000000 DRTVWR-169
-0000000000000000000000000000000000000000 3.3.3-beta3
-0000000000000000000000000000000000000000 3.3.3-release
-0000000000000000000000000000000000000000 DRTVWR-159
-0000000000000000000000000000000000000000 DRTVWR-157
-0000000000000000000000000000000000000000 DRTVWR-161
-0000000000000000000000000000000000000000 DRTVWR-163
-0000000000000000000000000000000000000000 DRTVWR-171
-0000000000000000000000000000000000000000 DRTVWR-168
-0000000000000000000000000000000000000000 DRTVWR-170
-0000000000000000000000000000000000000000 DRTVWR-158
-0000000000000000000000000000000000000000 3.3.4-beta1
-0000000000000000000000000000000000000000 DRTVWR-173
-0000000000000000000000000000000000000000 DRTVWR-174
-0000000000000000000000000000000000000000 3.3.4-beta2
-0000000000000000000000000000000000000000 DRTVWR-176
-0000000000000000000000000000000000000000 DRTVWR-177
-0000000000000000000000000000000000000000 3.3.4-beta3
-0000000000000000000000000000000000000000 DRTVWR-180
-0000000000000000000000000000000000000000 DRTVWR-183
-0000000000000000000000000000000000000000 3.3.4-beta4
-0000000000000000000000000000000000000000 DRTVWR-184
-0000000000000000000000000000000000000000 3.3.4-beta5
-0000000000000000000000000000000000000000 3.3.4-release
-0000000000000000000000000000000000000000 DRTVWR-167
-0000000000000000000000000000000000000000 DRTVWR-175
-0000000000000000000000000000000000000000 DRTVWR-182
-0000000000000000000000000000000000000000 3.4.0-beta1
-0000000000000000000000000000000000000000 DRTVWR-189
-0000000000000000000000000000000000000000 DRTVWR-190
-0000000000000000000000000000000000000000 DRTVWR-192
-0000000000000000000000000000000000000000 DRTVWR-195
-0000000000000000000000000000000000000000 DRTVWR-193
-0000000000000000000000000000000000000000 DRTVWR-196
-0000000000000000000000000000000000000000 DRTVWR-198
-0000000000000000000000000000000000000000 DRTVWR-197
-0000000000000000000000000000000000000000 3.4.0-beta2
-0000000000000000000000000000000000000000 DRTVWR-200
-0000000000000000000000000000000000000000 3.4.0-beta3
-0000000000000000000000000000000000000000 DRTVWR-199
-0000000000000000000000000000000000000000 3.3.4-release2
-0000000000000000000000000000000000000000 DRTVWR-201
-0000000000000000000000000000000000000000 3.4.0-beta4
-0000000000000000000000000000000000000000 3.4.0-beta5
-0000000000000000000000000000000000000000 DRTVWR-207
-0000000000000000000000000000000000000000 3.3.4-release3
-0000000000000000000000000000000000000000 DRTVWR-212
-0000000000000000000000000000000000000000 DRTVWR-213
-0000000000000000000000000000000000000000 3.3.4-beta6
-0000000000000000000000000000000000000000 DRTVWR-215
-0000000000000000000000000000000000000000 3.4.0-beta7
-0000000000000000000000000000000000000000 3.4.0-release
-0000000000000000000000000000000000000000 3.4.1-beta1
-0000000000000000000000000000000000000000 3.4.1-beta1a
-0000000000000000000000000000000000000000 DRTVWR-220
-0000000000000000000000000000000000000000 DRTVWR-221
-0000000000000000000000000000000000000000 3.4.1-beta3
-0000000000000000000000000000000000000000 DRTVWR-222
-0000000000000000000000000000000000000000 3.4.1-beta4
-0000000000000000000000000000000000000000 DRTVWR-224
-0000000000000000000000000000000000000000 3.4.1-beta5
-0000000000000000000000000000000000000000 DRTVWR-226
-0000000000000000000000000000000000000000 DRTVWR-179
-0000000000000000000000000000000000000000 3.4.1-beta6
-0000000000000000000000000000000000000000 DRTVWR-227
-0000000000000000000000000000000000000000 3.4.1-beta7
-0000000000000000000000000000000000000000 DRTVWR-228
-0000000000000000000000000000000000000000 3.4.1-beta8
-0000000000000000000000000000000000000000 DRTVWR-231
-0000000000000000000000000000000000000000 DRTVWR-233
-0000000000000000000000000000000000000000 3.4.1-beta9
-0000000000000000000000000000000000000000 3.4.1-beta10
-0000000000000000000000000000000000000000 DRTVWR-235
-0000000000000000000000000000000000000000 DRTVWR-236
-0000000000000000000000000000000000000000 3.4.1-beta11
-0000000000000000000000000000000000000000 DRTVWR-237
-0000000000000000000000000000000000000000 3.4.1-beta12
-0000000000000000000000000000000000000000 3.4.1-release
-0000000000000000000000000000000000000000 DRTVWR-186
-0000000000000000000000000000000000000000 DRTVWR-181
-0000000000000000000000000000000000000000 DRTVWR-188
-0000000000000000000000000000000000000000 DRTVWR-191
-0000000000000000000000000000000000000000 DRTVWR-194
-0000000000000000000000000000000000000000 DRTVWR-203
-0000000000000000000000000000000000000000 DRTVWR-202
-0000000000000000000000000000000000000000 oz-build-test-tag
-0000000000000000000000000000000000000000 DRTVWR-205
-0000000000000000000000000000000000000000 DRTVWR-206
-0000000000000000000000000000000000000000 DRTVWR-219
-0000000000000000000000000000000000000000 DRTVWR-217
-0000000000000000000000000000000000000000 3.4.2-beta1
-0000000000000000000000000000000000000000 DRTVWR-216
-0000000000000000000000000000000000000000 3.4.2-beta2
-0000000000000000000000000000000000000000 DRTVWR-242
-0000000000000000000000000000000000000000 3.4.2-beta3
-0000000000000000000000000000000000000000 DRTVWR-243
-0000000000000000000000000000000000000000 3.4.2-beta4
-0000000000000000000000000000000000000000 3.4.2-release
-0000000000000000000000000000000000000000 DRTVWR-208
-0000000000000000000000000000000000000000 DRTVWR-223
-0000000000000000000000000000000000000000 DRTVWR-240
-0000000000000000000000000000000000000000 DRTVWR-209
-0000000000000000000000000000000000000000 DRTVWR-238
-0000000000000000000000000000000000000000 DRTVWR-210
-0000000000000000000000000000000000000000 DRTVWR-241
-0000000000000000000000000000000000000000 DRTVWR-232
-0000000000000000000000000000000000000000 DRTVWR-245
-0000000000000000000000000000000000000000 3.4.3-beta1
-0000000000000000000000000000000000000000 DRTVWR-252
-0000000000000000000000000000000000000000 DRTVWR-251
-0000000000000000000000000000000000000000 DRTVWR-253
-0000000000000000000000000000000000000000 DRTVWR-254
-0000000000000000000000000000000000000000 DRTVWR-256
-0000000000000000000000000000000000000000 DRTVWR-258
-0000000000000000000000000000000000000000 DRTVWR-257
-0000000000000000000000000000000000000000 DRTVWR-259
-0000000000000000000000000000000000000000 DRTVWR-265
-0000000000000000000000000000000000000000 DRTVWR-266
-0000000000000000000000000000000000000000 DRTVWR-267
-0000000000000000000000000000000000000000 3.4.3-beta3
-0000000000000000000000000000000000000000 3.4.3-release
-0000000000000000000000000000000000000000 DRTVWR-229
-0000000000000000000000000000000000000000 DRTVWR-246
-0000000000000000000000000000000000000000 DRTVWR-247
-0000000000000000000000000000000000000000 DRTVWR-249
-0000000000000000000000000000000000000000 DRTVWR-230
-0000000000000000000000000000000000000000 DRTVWR-255
-0000000000000000000000000000000000000000 DRTVWR-260
-0000000000000000000000000000000000000000 DRTVWR-244
-0000000000000000000000000000000000000000 3.4.4-beta1
-0000000000000000000000000000000000000000 DRTVWR-270
-0000000000000000000000000000000000000000 3.4.4-beta2
-0000000000000000000000000000000000000000 DRTVWR-271
-0000000000000000000000000000000000000000 3.4.4-beta3
-0000000000000000000000000000000000000000 DRTVWR-273
-0000000000000000000000000000000000000000 DRTVWR-275
-0000000000000000000000000000000000000000 3.4.4-beta4
-0000000000000000000000000000000000000000 3.4.4-release
-0000000000000000000000000000000000000000 DRTVWR-268
-0000000000000000000000000000000000000000 DRTVWR-272
-0000000000000000000000000000000000000000 DRTVWR-269
-0000000000000000000000000000000000000000 DRTVWR-250
-0000000000000000000000000000000000000000 DRTVWR-277
-0000000000000000000000000000000000000000 DRTVWR-276
-0000000000000000000000000000000000000000 DRTVWR-279
-0000000000000000000000000000000000000000 DRTVWR-280
-0000000000000000000000000000000000000000 3.4.5-beta1
-0000000000000000000000000000000000000000 DRTVWR-281
-0000000000000000000000000000000000000000 DRTVWR-283
-0000000000000000000000000000000000000000 3.4.5-beta2
-0000000000000000000000000000000000000000 DRTVWR-286
-0000000000000000000000000000000000000000 DRTVWR-287
-0000000000000000000000000000000000000000 3.4.5-beta3
-0000000000000000000000000000000000000000 DRTVWR-289
-0000000000000000000000000000000000000000 DRTVWR-290
-0000000000000000000000000000000000000000 DRTVWR-291
-0000000000000000000000000000000000000000 DRTVWR-292
-0000000000000000000000000000000000000000 3.4.5-beta4
-0000000000000000000000000000000000000000 DRTVWR-296
-0000000000000000000000000000000000000000 DRTVWR-297
-0000000000000000000000000000000000000000 3.4.5-beta5
-4f777ffb99fefdc6497c61385c22688ff149c659 SL-2.0.0
-668851b2ef0f8cf8df07a0fba429e4a6c1e70abb SL-2.0.1
-b03065d018b8a2e28b7de85b293a4c992cb4c12d SL-2.1.0
-bb38ff1a763738609e1b3cada6d15fa61e5e84b9 SL-2.1.1
-1415e6538d54fd5d568ee88343424d57c6803c2c SL-2.2.0
-6ad3d6fa35a4e320e9ce442fce2bf9c7fc852556 SL-2.3.0
-1ed382c6a08ba3850b6ce9061bc551ddece0ea07 SL-2.4.0
-b723921b5c711bd24dbe77dc76ef488b544dac78 SL-2.5.0
-4dede9ae1ec74d41f6887719f6f1de7340d8578d SL-2.5.1
-b53a0576eec80614d7767ed72b40ed67aeff27c9 SL-2.5.2
-42f32494bac475d0737799346f6831558ae8bf5d SL-2.6.0
-c9182ed77d427c759cfacf49a7b71a2e20d522aa SL-2.6.1
-214180ad5714ce8392b82bbebcc92f4babd98300 SL-2.6.2
-8f2da1701c81a62352df2b8d413d27fb2cade9a6 SL-2.6.3
-dac76a711da5f1489a01c1fa62ec97d99c25736d SL-2.6.6
-be2000b946f8cb3de5f44b2d419287d4c48ec4eb SL-2.6.8
-77e5a08344c95738ab879f9671b7758cddd712a3 SL-2.6.9
-a9abb9633a266c8d2fe62411cfd1c86d32da72bf SL-2.7.1
-fe3a8e7973072ea62043c08b19b66626c1a720eb SL-2.7.2
-057f319dd8eccdf63a54d99686c68cdcb31b6abc SL-2.7.4
-6866d9df6efbd441c66451debd376d21211de39c SL-2.7.5
-493d9127ee50e84ba08a736a65a23ca86f7a5b01 SL-2.8.0
-29e93d7e19991011bd12b5748142b11a5dcb4370 SL-2.8.1
-fb85792b84bf28428889c4cc966469d92e5dac4c SL-2.8.3
-1778f26b6d0ae762dec3ca37140f66620f2485d9 SL-3.0.0
-0496d2f74043cf4e6058e76ac3db03d44cff42ce SL-3.0.3
-ae2de7b0b33c03dc5bdf3a7bfa54463b512221b2 SL-3.1.0
-3150219d229d628f0c15e58e8a51511cbd97e58d SL-3.2.0
-a8c7030d6845186fac7c188be4323a0e887b4184 SL-3.2.1
-bd6bcde2584491fd9228f1fa51c4575f4e764e19 SL-3.2.4
-c6175c955a19e9b9353d242889ec1779b5762522 SL-3.2.5
-51b2fd52e36aab8f670e0874e7e1472434ec4b4a SL-3.2.8
-5e8d2662f38a66eca6c591295f5880d47afc73f7 SL-3.3.0
-c623bbc854b6f7ee1b33a3718f76715046aa2937 SL-3.3.1
-675668bd24d3bea570814f71762a2a806f7e1b8d SL-3.3.2
-6428242e124b523813bfaf4c45b3d422f0298c81 SL-3.3.3
-28e100d0379a2b0710c57647a28fc5239d3d7b99 SL-3.3.4
-97977c67245f52db20eb15f1918cc0f24778cabc SL-3.4.0
-e59ffd3fe0838ae6b09b242a6e9df71761b88f41 SL-3.4.1
-16310aabccf315870f7cc9bf966926c0ad6954fa SL-3.4.2
-0a2ca6546b499239afeb66d17b2fadbcdbe36ab1 SL-3.4.3
-e1bb1ae7d8b12faeb37933a737c199cc9b9f89cc SL-3.4.4
-425f96b1e81e01644bf5e951961e7d1023bffb89 RLVa-1.2.0
-fc0cbb86f5bd6e7737159e35aea2c4cf9f619b62 RLVa-1.2.1
-43cb7dc1804de1a25c0b2b3f0715584af1f8b470 RLVa-1.2.2
-89532c8dfd5b6c29f1cb032665b44a74a52452e1 RLVa-1.3.0
-7bc5039ccf0b36eafbf6ce33a52b5e26332aa04c RLVa-1.3.1
-a563f7e215c7883c1cfd20908085687a0ed96284 RLVa-1.4.0
-40644beae9c4a617504163d5c9f195dc7bfff1b4 RLVa-1.4.1
-8787094c309a44ca32b7472acc9217a3c37f00c3 RLVa-1.4.2
-11c6c85ddd223bcbd6b3afc53f9a0f5fd349ba65 RLVa-1.4.3
-53b44208d44a601fe24e78c1a1909dc82356cded RLVa-1.4.4
-6522747820037cc11e5b7d0491a0a9808a958709 RLVa-1.4.5
-0c8f23b2c4cf96d1a08bd527b3ccb6339a9fdb60 RLVa-1.4.6
-674db463770b78f836fc9c87a1b2235e212a576c RLVa-1.4.7
diff --git a/BuildParams b/BuildParams
index b020a52497..c929c2d90d 100644
--- a/BuildParams
+++ b/BuildParams
@@ -132,6 +132,18 @@ viewer-pathfinding.build_debug_release_separately = true
viewer-pathfinding.build_CYGWIN_Debug = false
viewer-pathfinding.build_viewer_update_version_manager = false
+# ========================================
+# viewer-chui
+#
+# ========================================
+
+viewer-chui.viewer_channel = "Project Viewer - CHUI"
+viewer-chui.login_channel = "Project Viewer - CHUI"
+viewer-chui.viewer_grid = agni
+viewer-chui.build_debug_release_separately = true
+viewer-chui.build_CYGWIN_Debug = false
+viewer-chui.build_viewer_update_version_manager = false
+
# =================================================================
# asset delivery 2010 projects
# =================================================================
diff --git a/autobuild.xml b/autobuild.xml
index 84affb7ad3..312adcaafa 100755
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1334,9 +1334,9 @@
archive
name
linux
diff --git a/debian/rules b/debian/rules
old mode 100755
new mode 100644
diff --git a/doc/contributions.txt b/doc/contributions.txt
index f4629cb2e8..e983db8b59 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -299,6 +299,7 @@ ChickyBabes Zuzu
Christopher Organiser
Ciaran Laval
Cinder Roxley
+ BUG-2326
STORM-1703
Clara Young
Coaldust Numbers
@@ -745,10 +746,12 @@ Marc Claridge
Marc2 Sands
Marianne McCann
Marine Kelley
+ CHUIBUG-134
STORM-281
MartinRJ Fayray
STORM-1844
STORM-1845
+ STORM-1934
Matthew Anthony
Matthew Dowd
VWR-1344
@@ -897,6 +900,7 @@ NickyD
Nicky Dasmijn
VWR-29228
MAINT-873
+ SUN-72
Nicky Perian
OPEN-1
STORM-1087
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
old mode 100755
new mode 100644
index a83fa5df8b..184560c80f
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -467,7 +467,7 @@ void LLAvatarAppearance::computeBodySize()
// [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8)
mAvatarOffset.mV[VZ] = getAvatarOffset();
// [/RLVa:KB]
-// mAvatarOffset.mV[VZ] = getVisualParamWeight(11001);
+// mAvatarOffset.mV[VZ] = getVisualParamWeight(AVATAR_HOVER);
mPelvisToFoot = hip.mV[VZ] * pelvis_scale.mV[VZ] -
knee.mV[VZ] * hip_scale.mV[VZ] -
@@ -491,6 +491,25 @@ void LLAvatarAppearance::computeBodySize()
mAvatarOffset.mV[VX] = 0.0f;
mAvatarOffset.mV[VY] = 0.0f;
+ // Certain configurations of avatars can force the overall height (with offset) to go negative.
+ // Enforce a constraint to make sure we don't go below 0.1 meters.
+ // Camera positioning and other things start to break down when your avatar is "walking" while being fully underground
+ if (new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] < 0.1f)
+ {
+ mAvatarOffset.mV[VZ] = -(new_body_size.mV[VZ] - 0.11f); // avoid floating point rounding making the above check continue to fail.
+
+ llassert(new_body_size.mV[VZ] + mAvatarOffset.mV[VZ] >= 0.1f);
+
+ if (mWearableData && isSelf())
+ {
+ LLWearable* shape = mWearableData->getWearable(LLWearableType::WT_SHAPE, 0);
+ if (shape)
+ {
+ shape->setVisualParamWeight(AVATAR_HOVER, mAvatarOffset.mV[VZ], false);
+ }
+ }
+ }
+
if (new_body_size != mBodySize || old_offset != mAvatarOffset.mV[VZ])
{
mBodySize = new_body_size;
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
old mode 100755
new mode 100644
diff --git a/indra/llappearance/llavatarappearancedefines.h b/indra/llappearance/llavatarappearancedefines.h
index 496f85c107..8a1d2c4707 100644
--- a/indra/llappearance/llavatarappearancedefines.h
+++ b/indra/llappearance/llavatarappearancedefines.h
@@ -41,6 +41,8 @@ extern const S32 SCRATCH_TEX_WIDTH;
extern const S32 SCRATCH_TEX_HEIGHT;
extern const S32 IMPOSTOR_PERIOD;
+static const U32 AVATAR_HOVER = 11001;
+
//--------------------------------------------------------------------
// Enums
//--------------------------------------------------------------------
diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp
old mode 100755
new mode 100644
diff --git a/indra/llappearance/llavatarjointmesh.h b/indra/llappearance/llavatarjointmesh.h
old mode 100755
new mode 100644
diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp
index 56ad35b0cc..f027e066ca 100644
--- a/indra/llappearance/lltexlayer.cpp
+++ b/indra/llappearance/lltexlayer.cpp
@@ -38,7 +38,7 @@
#include "llvfs.h"
#include "lltexlayerparams.h"
#include "lltexturemanagerbridge.h"
-#include "llrender2dutils.h"
+#include "../llui/llui.h"
#include "llwearable.h"
#include "llwearabledata.h"
#include "llvertexbuffer.h"
diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp
old mode 100755
new mode 100644
index 64b3b62185..6aae9a8cc1
--- a/indra/llappearance/lltexlayerparams.cpp
+++ b/indra/llappearance/lltexlayerparams.cpp
@@ -33,7 +33,7 @@
#include "llquantize.h"
#include "lltexlayer.h"
#include "lltexturemanagerbridge.h"
-#include "llrender2dutils.h"
+#include "../llui/llui.h"
#include "llwearable.h"
//-----------------------------------------------------------------------------
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index 4028c1dfad..d86a460511 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -81,13 +81,13 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const
output_stream << mDescription << "\n";
// permissions
- if( !mPermissions.exportStream( output_stream ) )
+ if( !mPermissions.exportLegacyStream( output_stream ) )
{
return FALSE;
}
// sale info
- if( !mSaleInfo.exportStream( output_stream ) )
+ if( !mSaleInfo.exportLegacyStream( output_stream ) )
{
return FALSE;
}
@@ -263,7 +263,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
llwarns << "Bad Wearable asset: missing valid permissions" << llendl;
return LLWearable::FAILURE;
}
- if( !mPermissions.importStream( input_stream ) )
+ if( !mPermissions.importLegacyStream( input_stream ) )
{
return LLWearable::FAILURE;
}
@@ -288,7 +288,7 @@ LLWearable::EImportResult LLWearable::importStream( std::istream& input_stream,
// up the vast majority of the tasks.
BOOL has_perm_mask = FALSE;
U32 perm_mask = 0;
- if( !mSaleInfo.importStream(input_stream, has_perm_mask, perm_mask) )
+ if( !mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask) )
{
return LLWearable::FAILURE;
}
diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp
old mode 100755
new mode 100644
diff --git a/indra/llappearance/llwearabledata.h b/indra/llappearance/llwearabledata.h
index 3817b27b3c..cee9592caa 100644
--- a/indra/llappearance/llwearabledata.h
+++ b/indra/llappearance/llwearabledata.h
@@ -2,7 +2,7 @@
* @file llwearabledata.h
* @brief LLWearableData class header file
*
- * $LicenseInfo:firstyear=20012license=viewerlgpl$
+ * $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp
index aef5bb3f1e..530549da31 100644
--- a/indra/llaudio/llaudioengine.cpp
+++ b/indra/llaudio/llaudioengine.cpp
@@ -848,6 +848,10 @@ void LLAudioEngine::triggerSound(const LLUUID &audio_uuid, const LLUUID& owner_i
asp->play(audio_uuid);
}
+void LLAudioEngine::triggerSound(SoundData& soundData)
+{
+ triggerSound(soundData.audio_uuid, soundData.owner_id, soundData.gain, soundData.type, soundData.pos_global);
+}
void LLAudioEngine::setListenerPos(LLVector3 aVec)
{
diff --git a/indra/llaudio/llaudioengine.h b/indra/llaudio/llaudioengine.h
index b1117a9c47..4422a622be 100644
--- a/indra/llaudio/llaudioengine.h
+++ b/indra/llaudio/llaudioengine.h
@@ -66,6 +66,7 @@ class LLAudioChannel;
class LLAudioChannelOpenAL;
class LLAudioBuffer;
class LLStreamingAudioInterface;
+struct SoundData;
//
@@ -145,8 +146,10 @@ public:
void triggerSound(const LLUUID &sound_id, const LLUUID& owner_id, const F32 gain,
const S32 type = LLAudioEngine::AUDIO_TYPE_NONE,
const LLVector3d &pos_global = LLVector3d::zero,
- const LLUUID source_object = LLUUID::null);
+ const LLUUID source_object = LLUUID::null);
// NaCl End
+ void triggerSound(SoundData& soundData);
+
bool preloadSound(const LLUUID &id);
void addAudioSource(LLAudioSource *asp);
@@ -485,6 +488,27 @@ protected:
LLFrameTimer mLastUseTimer;
};
+struct SoundData
+{
+ LLUUID audio_uuid;
+ LLUUID owner_id;
+ F32 gain;
+ S32 type;
+ LLVector3d pos_global;
+
+ SoundData(const LLUUID &audio_uuid,
+ const LLUUID& owner_id,
+ const F32 gain,
+ const S32 type = LLAudioEngine::AUDIO_TYPE_NONE,
+ const LLVector3d &pos_global = LLVector3d::zero)
+ {
+ this->audio_uuid = audio_uuid;
+ this->owner_id = owner_id;
+ this->gain = gain;
+ this->type = type;
+ this->pos_global = pos_global;
+ }
+};
extern LLAudioEngine* gAudiop;
diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp
index 155226cf17..c16cae1bbc 100644
--- a/indra/llcharacter/llanimationstates.cpp
+++ b/indra/llcharacter/llanimationstates.cpp
@@ -46,7 +46,7 @@ LLUUID const ANIM_AGENT_BLOW_KISS ("db84829b-462c-ee83-1e27-9bbee66b
LLUUID const ANIM_AGENT_BORED ("b906c4ba-703b-1940-32a3-0c7f7d791510");
LLUUID const ANIM_AGENT_BOW ("82e99230-c906-1403-4d9c-3889dd98daba");
LLUUID const ANIM_AGENT_BRUSH ("349a3801-54f9-bf2c-3bd0-1ac89772af01");
-LLUUID const ANIM_AGENT_BUSY ("efcf670c-2d18-8128-973a-034ebc806b67");
+LLUUID const ANIM_AGENT_DO_NOT_DISTURB ("efcf670c-2d18-8128-973a-034ebc806b67");
LLUUID const ANIM_AGENT_CLAP ("9b0c1c4e-8ac7-7969-1494-28c874c4f668");
LLUUID const ANIM_AGENT_COURTBOW ("9ba1c942-08be-e43a-fb29-16ad440efc50");
LLUUID const ANIM_AGENT_CROUCH ("201f3fdf-cb1f-dbec-201f-7333e328ae7c");
@@ -211,7 +211,7 @@ LLAnimationLibrary::LLAnimationLibrary() :
mAnimMap[ANIM_AGENT_BORED]= mAnimStringTable.addString("express_bored");
mAnimMap[ANIM_AGENT_BOW]= mAnimStringTable.addString("bow");
mAnimMap[ANIM_AGENT_BRUSH]= mAnimStringTable.addString("brush");
- mAnimMap[ANIM_AGENT_BUSY]= mAnimStringTable.addString("busy");
+ mAnimMap[ANIM_AGENT_DO_NOT_DISTURB]= mAnimStringTable.addString("busy");
mAnimMap[ANIM_AGENT_CLAP]= mAnimStringTable.addString("clap");
mAnimMap[ANIM_AGENT_COURTBOW]= mAnimStringTable.addString("courtbow");
mAnimMap[ANIM_AGENT_CROUCH]= mAnimStringTable.addString("crouch");
diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h
index aa6579ac8e..84185c3f92 100644
--- a/indra/llcharacter/llanimationstates.h
+++ b/indra/llcharacter/llanimationstates.h
@@ -56,7 +56,7 @@ extern const LLUUID ANIM_AGENT_BLOW_KISS;
extern const LLUUID ANIM_AGENT_BORED;
extern const LLUUID ANIM_AGENT_BOW;
extern const LLUUID ANIM_AGENT_BRUSH;
-extern const LLUUID ANIM_AGENT_BUSY;
+extern const LLUUID ANIM_AGENT_DO_NOT_DISTURB;
extern const LLUUID ANIM_AGENT_CLAP;
extern const LLUUID ANIM_AGENT_COURTBOW;
extern const LLUUID ANIM_AGENT_CROUCH;
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp
old mode 100755
new mode 100644
diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp
old mode 100755
new mode 100644
diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h
old mode 100755
new mode 100644
diff --git a/indra/llcommon/imageids.cpp b/indra/llcommon/imageids.cpp
old mode 100755
new mode 100644
diff --git a/indra/llcommon/imageids.h b/indra/llcommon/imageids.h
old mode 100755
new mode 100644
diff --git a/indra/llcommon/llassettype.cpp b/indra/llcommon/llassettype.cpp
index 5e566d6c7c..5ae2df3994 100644
--- a/indra/llcommon/llassettype.cpp
+++ b/indra/llcommon/llassettype.cpp
@@ -95,6 +95,7 @@ LLAssetDictionary::LLAssetDictionary()
addEntry(LLAssetType::AT_LINK_FOLDER, new AssetEntry("FOLDER_LINK", "link_f", "sym folder link", false, false, true));
addEntry(LLAssetType::AT_MESH, new AssetEntry("MESH", "mesh", "mesh", false, false, false));
addEntry(LLAssetType::AT_WIDGET, new AssetEntry("WIDGET", "widget", "widget", false, false, false));
+ addEntry(LLAssetType::AT_PERSON, new AssetEntry("PERSON", "person", "person", false, false, false));
addEntry(LLAssetType::AT_NONE, new AssetEntry("NONE", "-1", NULL, FALSE, FALSE, FALSE));
};
diff --git a/indra/llcommon/llassettype.h b/indra/llcommon/llassettype.h
index d538accbf7..69b01731e5 100644
--- a/indra/llcommon/llassettype.h
+++ b/indra/llcommon/llassettype.h
@@ -112,6 +112,9 @@ public:
AT_WIDGET = 40,
// UI Widget: this is *not* an inventory asset type, only a viewer side asset (e.g. button, other ui items...)
+ AT_PERSON = 45,
+ // A user uuid which is not an inventory asset type, used in viewer only for adding a person to a chat via drag and drop.
+
AT_MESH = 49,
// Mesh data in our proprietary SLM format
diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp
index 3206843bf4..642bd82e90 100644
--- a/indra/llcommon/llavatarname.cpp
+++ b/indra/llcommon/llavatarname.cpp
@@ -30,6 +30,7 @@
#include "llavatarname.h"
#include "lldate.h"
+#include "llframetimer.h"
#include "llsd.h"
// Store these in pre-built std::strings to avoid memory allocations in
@@ -42,6 +43,14 @@ static const std::string IS_DISPLAY_NAME_DEFAULT("is_display_name_default");
static const std::string DISPLAY_NAME_EXPIRES("display_name_expires");
static const std::string DISPLAY_NAME_NEXT_UPDATE("display_name_next_update");
+bool LLAvatarName::sUseDisplayNames = true;
+
+// Minimum time-to-live (in seconds) for a name entry.
+// Avatar name should always guarantee to expire reasonably soon by default
+// so if the failure to get a valid expiration time was due to something temporary
+// we will eventually request and get the right data.
+const F64 MIN_ENTRY_LIFETIME = 60.0;
+
LLAvatarName::LLAvatarName()
: mUsername(),
mDisplayName(),
@@ -61,6 +70,17 @@ bool LLAvatarName::operator<(const LLAvatarName& rhs) const
return mUsername < rhs.mUsername;
}
+//static
+void LLAvatarName::setUseDisplayNames(bool use)
+{
+ sUseDisplayNames = use;
+}
+//static
+bool LLAvatarName::useDisplayNames()
+{
+ return sUseDisplayNames;
+}
+
LLSD LLAvatarName::asLLSD() const
{
LLSD sd;
@@ -85,21 +105,75 @@ void LLAvatarName::fromLLSD(const LLSD& sd)
mExpires = expires.secondsSinceEpoch();
LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE];
mNextUpdate = next_update.secondsSinceEpoch();
+
+ // Some avatars don't have explicit display names set. Force a legible display name here.
+ if (mDisplayName.empty())
+ {
+ mDisplayName = mUsername;
+ }
+}
+
+// Transform a string (typically provided by the legacy service) into a decent
+// avatar name instance.
+void LLAvatarName::fromString(const std::string& full_name)
+{
+ mDisplayName = full_name;
+ std::string::size_type index = full_name.find(' ');
+ if (index != std::string::npos)
+ {
+ // The name is in 2 parts (first last)
+ mLegacyFirstName = full_name.substr(0, index);
+ mLegacyLastName = full_name.substr(index+1);
+ if (mLegacyLastName != "Resident")
+ {
+ mUsername = mLegacyFirstName + "." + mLegacyLastName;
+ mDisplayName = full_name;
+ LLStringUtil::toLower(mUsername);
+ }
+ else
+ {
+ // Very old names do have a dummy "Resident" last name
+ // that we choose to hide from users.
+ mUsername = mLegacyFirstName;
+ mDisplayName = mLegacyFirstName;
+ }
+ }
+ else
+ {
+ mLegacyFirstName = full_name;
+ mLegacyLastName = "";
+ mUsername = full_name;
+ mDisplayName = full_name;
+ }
+ mIsDisplayNameDefault = true;
+ mIsTemporaryName = true;
+ setExpires(MIN_ENTRY_LIFETIME);
+}
+
+void LLAvatarName::setExpires(F64 expires)
+{
+ mExpires = LLFrameTimer::getTotalSeconds() + expires;
}
std::string LLAvatarName::getCompleteName() const
{
std::string name;
- if (mUsername.empty() || mIsDisplayNameDefault)
- // If the display name feature is off
- // OR this particular display name is defaulted (i.e. based on user name),
- // then display only the easier to read instance of the person's name.
+ if (sUseDisplayNames)
{
- name = mDisplayName;
+ if (mUsername.empty() || mIsDisplayNameDefault)
+ {
+ // If this particular display name is defaulted (i.e. based on user name),
+ // then display only the easier to read instance of the person's name.
+ name = mDisplayName;
+ }
+ else
+ {
+ name = mDisplayName + " (" + mUsername + ")";
+ }
}
else
{
- name = mDisplayName + " (" + mUsername + ")";
+ name = getUserName();
}
return name;
}
@@ -118,3 +192,48 @@ std::string LLAvatarName::getLegacyName() const
name += mLegacyLastName;
return name;
}
+
+std::string LLAvatarName::getDisplayName() const
+{
+ if (sUseDisplayNames)
+ {
+ return mDisplayName;
+ }
+ else
+ {
+ return getUserName();
+ }
+}
+
+std::string LLAvatarName::getUserName() const
+{
+ std::string name;
+ if (mLegacyLastName.empty() || (mLegacyLastName == "Resident"))
+ {
+ if (mLegacyFirstName.empty())
+ {
+ // If we cannot create a user name from the legacy strings, use the display name
+ name = mDisplayName;
+ }
+ else
+ {
+ // The last name might be empty if it defaulted to "Resident"
+ name = mLegacyFirstName;
+ }
+ }
+ else
+ {
+ name = mLegacyFirstName + " " + mLegacyLastName;
+ }
+ return name;
+}
+
+void LLAvatarName::dump() const
+{
+ LL_DEBUGS("AvNameCache") << "LLAvatarName: "
+ << "user '" << mUsername << "' "
+ << "display '" << mDisplayName << "' "
+ << "expires in " << mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
+ << LL_ENDL;
+}
+
diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index ba258d6d52..7542a8dece 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -39,10 +39,27 @@ public:
bool operator<(const LLAvatarName& rhs) const;
+ // Conversion to and from LLSD (cache file or server response)
LLSD asLLSD() const;
-
void fromLLSD(const LLSD& sd);
+ // Used only in legacy mode when the display name capability is not provided server side
+ // or to otherwise create a temporary valid item.
+ void fromString(const std::string& full_name);
+
+ // Set the name object to become invalid in "expires" seconds from now
+ void setExpires(F64 expires);
+
+ // Set and get the display name flag set by the user in preferences.
+ static void setUseDisplayNames(bool use);
+ static bool useDisplayNames();
+
+ // A name object is valid if not temporary and not yet expired (default is expiration not checked)
+ bool isValidName(F64 max_unrefreshed = 0.0f) const { return !mIsTemporaryName && (mExpires >= max_unrefreshed); }
+
+ // Return true if the name is made up from legacy or temporary data
+ bool isDisplayNameDefault() const { return mIsDisplayNameDefault; }
+
// For normal names, returns "James Linden (james.linden)"
// When display names are disabled returns just "James Linden"
std::string getCompleteName() const;
@@ -51,11 +68,38 @@ public:
// compatibility with systems like voice and muting
// *TODO: Eliminate this in favor of username only
std::string getLegacyName() const;
+
+ // "José Sanchez" or "James Linden", UTF-8 encoded Unicode
+ // Takes the display name preference into account. This is truly the name that should
+ // be used for all UI where an avatar name has to be used unless we truly want something else (rare)
+ std::string getDisplayName() const;
+
+ // Returns "James Linden" or "bobsmith123 Resident"
+ // Used where we explicitely prefer or need a non UTF-8 legacy (ASCII) name
+ // Also used for backwards compatibility with systems like voice and muting
+ std::string getUserName() const;
+
+ // Returns "james.linden" or the legacy name for very old names
+ std::string getAccountName() const { return mUsername; }
+ // Debug print of the object
+ void dump() const;
+
+ // Names can change, so need to keep track of when name was
+ // last checked.
+ // Unix time-from-epoch seconds for efficiency
+ F64 mExpires;
+
+ // You can only change your name every N hours, so record
+ // when the next update is allowed
+ // Unix time-from-epoch seconds
+ F64 mNextUpdate;
+
+private:
// "bobsmith123" or "james.linden", US-ASCII only
std::string mUsername;
- // "Jose' Sanchez" or "James Linden", UTF-8 encoded Unicode
+ // "José Sanchez" or "James Linden", UTF-8 encoded Unicode
// Contains data whether or not user has explicitly set
// a display name; may duplicate their username.
std::string mDisplayName;
@@ -81,15 +125,9 @@ public:
// shown in UI, but are not serialized.
bool mIsTemporaryName;
- // Names can change, so need to keep track of when name was
- // last checked.
- // Unix time-from-epoch seconds for efficiency
- F64 mExpires;
-
- // You can only change your name every N hours, so record
- // when the next update is allowed
- // Unix time-from-epoch seconds
- F64 mNextUpdate;
+ // Global flag indicating if display name should be used or not
+ // This will affect the output of the high level "get" methods
+ static bool sUseDisplayNames;
};
#endif
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 22606ad340..eaca45c576 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -864,12 +864,8 @@ llifstream::llifstream(const std::string& _Filename,
#if LL_WINDOWS
std::istream(&_M_filebuf)
{
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
-
- // if (_M_filebuf.open(_Filename.c_str(), _Mode | ios_base::in) == 0)
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open(wideName.c_str(), _Mode | ios_base::in) == 0)
- //
{
_Myios::setstate(ios_base::failbit);
}
@@ -888,12 +884,8 @@ llifstream::llifstream(const char* _Filename,
#if LL_WINDOWS
std::istream(&_M_filebuf)
{
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
-
- // if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0)
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open(wideName.c_str(), _Mode | ios_base::in) == 0)
- //
{
_Myios::setstate(ios_base::failbit);
}
@@ -939,10 +931,6 @@ bool llifstream::is_open() const
void llifstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
- // if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0)
- //
-
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::in) == 0)
@@ -997,12 +985,8 @@ llofstream::llofstream(const std::string& _Filename,
#if LL_WINDOWS
std::ostream(&_M_filebuf)
{
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
-
- // if (_M_filebuf.open(_Filename.c_str(), _Mode | ios_base::out) == 0)
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
- //
{
_Myios::setstate(ios_base::failbit);
}
@@ -1021,12 +1005,8 @@ llofstream::llofstream(const char* _Filename,
#if LL_WINDOWS
std::ostream(&_M_filebuf)
{
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
-
- // if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0)
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
- //
{
_Myios::setstate(ios_base::failbit);
}
@@ -1070,11 +1050,6 @@ bool llofstream::is_open() const
void llofstream::open(const char* _Filename, ios_base::openmode _Mode)
{ // open a C stream with specified mode
-
- // Need to convert to UTF16 for Win, Windows API does not use UTF8
- // if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0)
- //
-
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)
diff --git a/indra/llcommon/llhandle.h b/indra/llcommon/llhandle.h
index 6af5e198d6..401e4d759a 100644
--- a/indra/llcommon/llhandle.h
+++ b/indra/llcommon/llhandle.h
@@ -194,13 +194,6 @@ public:
return mHandle;
}
-protected:
- typedef LLHandle handle_type_t;
- LLHandleProvider()
- {
- // provided here to enforce T deriving from LLHandleProvider
- }
-
template
LLHandle getDerivedHandle(typename boost::enable_if< typename boost::is_convertible >::type* dummy = 0) const
{
@@ -209,6 +202,12 @@ protected:
return downcast_handle;
}
+protected:
+ typedef LLHandle handle_type_t;
+ LLHandleProvider()
+ {
+ // provided here to enforce T deriving from LLHandleProvider
+ }
private:
mutable LLRootHandle mHandle;
diff --git a/indra/llcommon/llinitparam.cpp b/indra/llcommon/llinitparam.cpp
index db72aa19b9..89c831d296 100644
--- a/indra/llcommon/llinitparam.cpp
+++ b/indra/llcommon/llinitparam.cpp
@@ -40,7 +40,9 @@ namespace LLInitParam
{
const U8* my_addr = reinterpret_cast(this);
const U8* block_addr = reinterpret_cast(enclosing_block);
- mEnclosingBlockOffset = 0x7FFFffff & (U32)(my_addr - block_addr);
+ U32 enclosing_block_offset = 0x7FFFffff & (U32)(my_addr - block_addr);
+ mEnclosingBlockOffsetLow = enclosing_block_offset & 0x0000ffff;
+ mEnclosingBlockOffsetHigh = (enclosing_block_offset & 0x007f0000) >> 16;
}
//
@@ -112,6 +114,35 @@ namespace LLInitParam
std::copy(src_block_data.mAllParams.begin(), src_block_data.mAllParams.end(), std::back_inserter(mAllParams));
}
+ void BlockDescriptor::addParam(const ParamDescriptorPtr in_param, const char* char_name)
+ {
+ // create a copy of the param descriptor in mAllParams
+ // so other data structures can store a pointer to it
+ mAllParams.push_back(in_param);
+ ParamDescriptorPtr param(mAllParams.back());
+
+ std::string name(char_name);
+ if ((size_t)param->mParamHandle > mMaxParamOffset)
+ {
+ llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl;
+ }
+
+ if (name.empty())
+ {
+ mUnnamedParams.push_back(param);
+ }
+ else
+ {
+ // don't use insert, since we want to overwrite existing entries
+ mNamedParams[name] = param;
+ }
+
+ if (param->mValidationFunc)
+ {
+ mValidationList.push_back(std::make_pair(param->mParamHandle, param->mValidationFunc));
+ }
+ }
+
BlockDescriptor::BlockDescriptor()
: mMaxParamOffset(0),
mInitializationState(UNINITIALIZED),
@@ -150,7 +181,8 @@ namespace LLInitParam
bool BaseBlock::submitValue(Parser::name_stack_t& name_stack, Parser& p, bool silent)
{
- if (!deserializeBlock(p, std::make_pair(name_stack.begin(), name_stack.end()), true))
+ Parser::name_stack_range_t range = std::make_pair(name_stack.begin(), name_stack.end());
+ if (!deserializeBlock(p, range, true))
{
if (!silent)
{
@@ -196,12 +228,7 @@ namespace LLInitParam
if (serialize_func)
{
const Param* diff_param = diff_block ? diff_block->getParamFromHandle(param_handle) : NULL;
- // each param descriptor remembers its serial number
- // so we can inspect the same param under different names
- // and see that it has the same number
- name_stack.push_back(std::make_pair("", true));
serialize_func(*param, parser, name_stack, diff_param);
- name_stack.pop_back();
}
}
@@ -295,7 +322,7 @@ namespace LLInitParam
return true;
}
- bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool ignored)
+ bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool ignored)
{
BlockDescriptor& block_data = mostDerivedBlockDescriptor();
bool names_left = name_stack_range.first != name_stack_range.second;
@@ -308,15 +335,12 @@ namespace LLInitParam
{
const std::string& top_name = name_stack_range.first->first;
- ParamDescriptor::deserialize_func_t deserialize_func = NULL;
- Param* paramp = NULL;
-
BlockDescriptor::param_map_t::iterator found_it = block_data.mNamedParams.find(top_name);
if (found_it != block_data.mNamedParams.end())
{
// find pointer to member parameter from offset table
- paramp = getParamFromHandle(found_it->second->mParamHandle);
- deserialize_func = found_it->second->mDeserializeFunc;
+ Param* paramp = getParamFromHandle(found_it->second->mParamHandle);
+ ParamDescriptor::deserialize_func_t deserialize_func = found_it->second->mDeserializeFunc;
Parser::name_stack_range_t new_name_stack(name_stack_range.first, name_stack_range.second);
++new_name_stack.first;
@@ -358,36 +382,6 @@ namespace LLInitParam
return false;
}
- //static
- void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name)
- {
- // create a copy of the param descriptor in mAllParams
- // so other data structures can store a pointer to it
- block_data.mAllParams.push_back(in_param);
- ParamDescriptorPtr param(block_data.mAllParams.back());
-
- std::string name(char_name);
- if ((size_t)param->mParamHandle > block_data.mMaxParamOffset)
- {
- llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block" << llendl;
- }
-
- if (name.empty())
- {
- block_data.mUnnamedParams.push_back(param);
- }
- else
- {
- // don't use insert, since we want to overwrite existing entries
- block_data.mNamedParams[name] = param;
- }
-
- if (param->mValidationFunc)
- {
- block_data.mValidationList.push_back(std::make_pair(param->mParamHandle, param->mValidationFunc));
- }
- }
-
void BaseBlock::addSynonym(Param& param, const std::string& synonym)
{
BlockDescriptor& block_data = mostDerivedBlockDescriptor();
@@ -460,7 +454,7 @@ namespace LLInitParam
if (merge_func)
{
Param* paramp = getParamFromHandle((*it)->mParamHandle);
- llassert(paramp->mEnclosingBlockOffset == (*it)->mParamHandle);
+ llassert(paramp->getEnclosingBlockOffset() == (*it)->mParamHandle);
some_param_changed |= merge_func(*paramp, *other_paramp, overwrite);
}
}
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index f1f8c3f72a..6cea21423d 100644
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -38,6 +38,71 @@
#include "llerror.h"
#include "llstl.h"
+namespace LLTypeTags
+{
+ template
+ struct TypeTagBase
+ {
+ typedef void is_tag_t;
+ typedef INNER_TYPE inner_t;
+ static const int SORT_ORDER=_SORT_ORDER;
+ };
+
+ template
+ struct GreaterThan
+ {
+ static const bool value = VAL1 > VAL2;
+ };
+
+ template::value >
+ struct Swap
+ {
+ typedef typename ITEM::template Cons::value_t value_t;
+ };
+
+ template
+ struct Swap-
+ {
+ typedef typename REST::template Cons::value_t>::value_t value_t;
+ };
+
+ template
+ struct IsSortable
+ {
+ static const bool value = false;
+ };
+
+ template
+ struct IsSortable
+ {
+ static const bool value = true;
+ };
+
+ template::value>
+ struct InsertInto
+ {
+ typedef typename ITEM::template Cons::value_t value_t;
+ };
+
+ template
+ struct InsertInto
-
+ {
+ typedef typename Swap
- ::value_t value_t;
+ };
+
+ template::value>
+ struct Sorted
+ {
+ typedef T value_t;
+ };
+
+ template
+ struct Sorted
+ {
+ typedef typename InsertInto::value_t>::value_t value_t;
+ };
+}
+
namespace LLInitParam
{
// used to indicate no matching value to a given name when parsing
@@ -45,6 +110,8 @@ namespace LLInitParam
template const T& defaultValue() { static T value; return value; }
+ // wraps comparison operator between any 2 values of the same type
+ // specialize to handle cases where equality isn't defined well, or at all
template ::value >
struct ParamCompare
{
@@ -79,24 +146,123 @@ namespace LLInitParam
// helper functions and classes
typedef ptrdiff_t param_handle_t;
+ struct IS_A_BLOCK {};
+ struct NOT_BLOCK {};
+
+ // these templates allow us to distinguish between template parameters
+ // that derive from BaseBlock and those that don't
+ template
+ struct IsBlock
+ {
+ typedef NOT_BLOCK value_t;
+ };
+
+ template
+ struct IsBlock
+ {
+ typedef IS_A_BLOCK value_t;
+ };
+
+ // ParamValue class directly manages the wrapped value
+ // by holding on to a copy (scalar params)
+ // or deriving from it (blocks)
+ // has specializations for custom value behavior
+ // and "tag" values like Lazy and Atomic
+ template::value_t>
+ class ParamValue
+ {
+ typedef ParamValue self_t;
+
+ public:
+ typedef T default_value_t;
+ typedef T value_t;
+
+ ParamValue(): mValue() {}
+ ParamValue(const default_value_t& other) : mValue(other) {}
+
+ void setValue(const value_t& val)
+ {
+ mValue = val;
+ }
+
+ const value_t& getValue() const
+ {
+ return mValue;
+ }
+
+ T& getValue()
+ {
+ return mValue;
+ }
+
+ protected:
+ T mValue;
+ };
+
+ template
+ class ParamValue
+ : public T
+ {
+ typedef ParamValue self_t;
+ public:
+ typedef T default_value_t;
+ typedef T value_t;
+
+ ParamValue()
+ : T(),
+ mValidated(false)
+ {}
+
+ ParamValue(const default_value_t& other)
+ : T(other),
+ mValidated(false)
+ {}
+
+ void setValue(const value_t& val)
+ {
+ *this = val;
+ }
+
+ const value_t& getValue() const
+ {
+ return *this;
+ }
+
+ T& getValue()
+ {
+ return *this;
+ }
+
+ protected:
+ mutable bool mValidated; // lazy validation flag
+ };
+
// empty default implementation of key cache
// leverages empty base class optimization
template
class TypeValues
+ : public ParamValue::value_t>
{
private:
struct Inaccessable{};
public:
typedef std::map value_name_map_t;
typedef Inaccessable name_t;
+ typedef TypeValues type_value_t;
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename param_value_t::value_t value_t;
+
+ TypeValues(const typename param_value_t::value_t& val)
+ : param_value_t(val)
+ {}
void setValueName(const std::string& key) {}
std::string getValueName() const { return ""; }
- std::string calcValueName(const T& value) const { return ""; }
+ std::string calcValueName(const value_t& value) const { return ""; }
void clearValueName() const {}
- static bool getValueFromName(const std::string& name, T& value)
+ static bool getValueFromName(const std::string& name, value_t& value)
{
return false;
}
@@ -111,15 +277,39 @@ namespace LLInitParam
return NULL;
}
+ void assignNamedValue(const Inaccessable& name)
+ {}
+
+ operator const value_t&() const
+ {
+ return param_value_t::getValue();
+ }
+
+ const value_t& operator()() const
+ {
+ return param_value_t::getValue();
+ }
+
static value_name_map_t* getValueNames() {return NULL;}
};
- template >
+ // helper class to implement name value lookups
+ // and caching of last used name
+ template , bool IS_SPECIALIZED = true >
class TypeValuesHelper
+ : public ParamValue::value_t>
{
+ typedef TypeValuesHelper self_t;
public:
typedef typename std::map value_name_map_t;
typedef std::string name_t;
+ typedef self_t type_value_t;
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename param_value_t::value_t value_t;
+
+ TypeValuesHelper(const typename param_value_t::value_t& val)
+ : param_value_t(val)
+ {}
//TODO: cache key by index to save on param block size
void setValueName(const std::string& value_name)
@@ -132,7 +322,7 @@ namespace LLInitParam
return mValueName;
}
- std::string calcValueName(const T& value) const
+ std::string calcValueName(const value_t& value) const
{
value_name_map_t* map = getValueNames();
for (typename value_name_map_t::iterator it = map->begin(), end_it = map->end();
@@ -153,7 +343,7 @@ namespace LLInitParam
mValueName.clear();
}
- static bool getValueFromName(const std::string& name, T& value)
+ static bool getValueFromName(const std::string& name, value_t& value)
{
value_name_map_t* map = getValueNames();
typename value_name_map_t::iterator found_it = map->find(name);
@@ -195,18 +385,90 @@ namespace LLInitParam
return &sValues;
}
- static void declare(const std::string& name, const T& value)
+ static void declare(const std::string& name, const value_t& value)
{
(*getValueNames())[name] = value;
}
+ void operator ()(const std::string& name)
+ {
+ *this = name;
+ }
+
+ void assignNamedValue(const std::string& name)
+ {
+ if (getValueFromName(name, param_value_t::getValue()))
+ {
+ setValueName(name);
+ }
+ }
+
+ operator const value_t&() const
+ {
+ return param_value_t::getValue();
+ }
+
+ const value_t& operator()() const
+ {
+ return param_value_t::getValue();
+ }
+
protected:
- static void getName(const std::string& name, const T& value)
+ static void getName(const std::string& name, const value_t& value)
{}
mutable std::string mValueName;
};
+ // string types can support custom named values, but need
+ // to disambiguate in code between a string that is a named value
+ // and a string that is a name
+ template
+ class TypeValuesHelper
+ : public TypeValuesHelper
+ {
+ public:
+ typedef TypeValuesHelper self_t;
+ typedef TypeValuesHelper base_t;
+ typedef std::string value_t;
+ typedef std::string name_t;
+ typedef self_t type_value_t;
+
+ TypeValuesHelper(const std::string& val)
+ : TypeValuesHelper(val)
+ {}
+
+ void operator ()(const std::string& name)
+ {
+ *this = name;
+ }
+
+ self_t& operator =(const std::string& name)
+ {
+ if (base_t::getValueFromName(name, ParamValue::getValue()))
+ {
+ base_t::setValueName(name);
+ }
+ else
+ {
+ ParamValue::setValue(name);
+ }
+ return *this;
+ }
+
+ operator const value_t&() const
+ {
+ return ParamValue::getValue();
+ }
+
+ const value_t& operator()() const
+ {
+ return ParamValue::getValue();
+ }
+
+ };
+
+ // parser base class with mechanisms for registering readers/writers/inspectors of different types
class LL_COMMON_API Parser
{
LOG_CLASS(Parser);
@@ -235,25 +497,25 @@ namespace LLInitParam
virtual ~Parser();
template bool readValue(T& param, typename boost::disable_if >::type* dummy = 0)
- {
+ {
parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
if (found_it != mParserReadFuncs->end())
- {
+ {
return found_it->second(*this, (void*)¶m);
+ }
+
+ return false;
}
- return false;
- }
-
template bool readValue(T& param, typename boost::enable_if >::type* dummy = 0)
- {
+ {
parser_read_func_map_t::iterator found_it = mParserReadFuncs->find(&typeid(T));
if (found_it != mParserReadFuncs->end())
- {
+ {
return found_it->second(*this, (void*)¶m);
- }
+ }
else
- {
+ {
found_it = mParserReadFuncs->find(&typeid(S32));
if (found_it != mParserReadFuncs->end())
{
@@ -261,20 +523,20 @@ namespace LLInitParam
bool parsed = found_it->second(*this, (void*)&int_value);
param = (T)int_value;
return parsed;
+ }
}
+ return false;
}
- return false;
- }
template bool writeValue(const T& param, name_stack_t& name_stack)
- {
+ {
parser_write_func_map_t::iterator found_it = mParserWriteFuncs->find(&typeid(T));
if (found_it != mParserWriteFuncs->end())
- {
+ {
return found_it->second(*this, (const void*)¶m, name_stack);
+ }
+ return false;
}
- return false;
- }
// dispatch inspection to registered inspection functions, for each parameter in a param block
template bool inspectValue(name_stack_t& name_stack, S32 min_count, S32 max_count, const possible_values_t* possible_values)
@@ -326,7 +588,7 @@ namespace LLInitParam
};
typedef bool(*merge_func_t)(Param&, const Param&, bool);
- typedef bool(*deserialize_func_t)(Param&, Parser&, const Parser::name_stack_range_t&, bool);
+ typedef bool(*deserialize_func_t)(Param&, Parser&, Parser::name_stack_range_t&, bool);
typedef void(*serialize_func_t)(const Param&, Parser&, Parser::name_stack_t&, const Param* diff_param);
typedef void(*inspect_func_t)(const Param&, Parser&, Parser::name_stack_t&, S32 min_count, S32 max_count);
typedef bool(*validation_func_t)(const Param*);
@@ -371,6 +633,7 @@ namespace LLInitParam
} EInitializationState;
void aggregateBlockData(BlockDescriptor& src_block_data);
+ void addParam(ParamDescriptorPtr param, const char* name);
typedef boost::unordered_map param_map_t;
typedef std::vector param_list_t;
@@ -386,48 +649,58 @@ namespace LLInitParam
class BaseBlock* mCurrentBlockPtr; // pointer to block currently being constructed
};
- class LL_COMMON_API BaseBlock
- {
- public:
//TODO: implement in terms of owned_ptr
template
- class Lazy
+ class LazyValue
{
public:
- Lazy()
+ LazyValue()
: mPtr(NULL)
{}
- ~Lazy()
+ ~LazyValue()
{
delete mPtr;
}
- Lazy(const Lazy& other)
+ LazyValue(const T& value)
{
- if (other.mPtr)
- {
- mPtr = new T(*other.mPtr);
- }
- else
- {
- mPtr = NULL;
- }
- }
+ mPtr = new T(value);
+ }
- Lazy& operator = (const Lazy& other)
+ LazyValue(const LazyValue& other)
+ : mPtr(NULL)
+ {
+ *this = other;
+ }
+
+ LazyValue& operator = (const LazyValue& other)
+ {
+ if (!other.mPtr)
{
- if (other.mPtr)
+ delete mPtr;
+ mPtr = NULL;
+ }
+ else
+ {
+ if (!mPtr)
{
mPtr = new T(*other.mPtr);
}
else
{
- mPtr = NULL;
+ *mPtr = *(other.mPtr);
+ }
}
return *this;
}
+ bool operator==(const LazyValue& other) const
+ {
+ if (empty() || other.empty()) return false;
+ return *mPtr == *other.mPtr;
+ }
+
bool empty() const
{
return mPtr == NULL;
@@ -435,18 +708,29 @@ namespace LLInitParam
void set(const T& other)
{
- delete mPtr;
+ if (!mPtr)
+ {
mPtr = new T(other);
}
+ else
+ {
+ *mPtr = other;
+ }
+ }
const T& get() const
{
- return ensureInstance();
+ return *ensureInstance();
}
T& get()
{
- return ensureInstance();
+ return *ensureInstance();
+ }
+
+ operator const T&() const
+ {
+ return get();
}
private:
@@ -461,13 +745,50 @@ namespace LLInitParam
}
private:
- // if you get a compilation error with this, that means you are using a forward declared struct for T
- // unfortunately, the type traits we rely on don't work with forward declared typed
- //static const int dummy = sizeof(T);
mutable T* mPtr;
};
+ // root class of all parameter blocks
+
+ class LL_COMMON_API BaseBlock
+ {
+ public:
+ // lift block tags into baseblock namespace so derived classes do not need to qualify them
+ typedef LLInitParam::IS_A_BLOCK IS_A_BLOCK;
+ typedef LLInitParam::NOT_BLOCK NOT_A_BLOCK;
+
+ template
+ struct Sequential : public LLTypeTags::TypeTagBase
+ {
+ template struct Cons { typedef Sequential > value_t; };
+ template struct Cons > { typedef Sequential
value_t; };
+ };
+
+ template
+ struct Atomic : public LLTypeTags::TypeTagBase
+ {
+ template struct Cons { typedef Atomic > value_t; };
+ template struct Cons > { typedef Atomic value_t; };
+ };
+
+ template::value_t >
+ struct Lazy : public LLTypeTags::TypeTagBase
+ {
+ template struct Cons
+ {
+ typedef Lazy, BLOCK_T> value_t;
+ };
+ template struct Cons >
+ {
+ typedef Lazy value_t;
+ };
+ template struct Cons >
+ {
+ typedef Lazy value_t;
+ };
+ };
+
// "Multiple" constraint types, put here in root class to avoid ambiguity during use
struct AnyAmount
{
@@ -533,12 +854,12 @@ namespace LLInitParam
// Blocks can override this to do custom tracking of changes
virtual void paramChanged(const Param& changed_param, bool user_provided) {}
- bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name);
+ bool deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack_range, bool new_name);
void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block = NULL) const;
bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const;
- virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
- virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
+ virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return getBlockDescriptor(); }
+ virtual BlockDescriptor& mostDerivedBlockDescriptor() { return getBlockDescriptor(); }
// take all provided params from other and apply to self
bool overwriteFrom(const BaseBlock& other)
@@ -552,10 +873,17 @@ namespace LLInitParam
return false;
}
- static void addParam(BlockDescriptor& block_data, ParamDescriptorPtr param, const char* name);
-
ParamDescriptorPtr findParamDescriptor(const Param& param);
+ // take all provided params from other and apply to self
+ bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite);
+
+ static BlockDescriptor& getBlockDescriptor()
+ {
+ static BlockDescriptor sBlockDescriptor;
+ return sBlockDescriptor;
+ }
+
protected:
void init(BlockDescriptor& descriptor, BlockDescriptor& base_descriptor, size_t block_size);
@@ -564,25 +892,11 @@ namespace LLInitParam
{
return mergeBlock(block_data, source, overwrite);
}
- // take all provided params from other and apply to self
- bool mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite);
-
- static BlockDescriptor& selfBlockDescriptor()
- {
- static BlockDescriptor sBlockDescriptor;
- return sBlockDescriptor;
- }
private:
const std::string& getParamName(const BlockDescriptor& block_data, const Param* paramp) const;
};
- template
- struct ParamCompare, false >
- {
- static bool equals(const BaseBlock::Lazy& a, const BaseBlock::Lazy& b) { return !a.empty() || !b.empty(); }
- };
-
class LL_COMMON_API Param
{
public:
@@ -611,256 +925,68 @@ namespace LLInitParam
// get address of enclosing BLOCK class using stored offset to enclosing BaseBlock class
return *const_cast
(reinterpret_cast
- (my_addr - (ptrdiff_t)(S32)mEnclosingBlockOffset));
+ (my_addr - (ptrdiff_t)getEnclosingBlockOffset()));
+ }
+
+ U32 getEnclosingBlockOffset() const
+ {
+ return ((U32)mEnclosingBlockOffsetHigh << 16) | (U32)mEnclosingBlockOffsetLow;
}
private:
friend class BaseBlock;
- U32 mEnclosingBlockOffset:31;
- U32 mIsProvided:1;
+ //24 bits for member offset field and 1 bit for provided flag
+ U16 mEnclosingBlockOffsetLow;
+ U8 mEnclosingBlockOffsetHigh:7;
+ U8 mIsProvided:1;
};
- // these templates allow us to distinguish between template parameters
- // that derive from BaseBlock and those that don't
- template
- struct IsBlock
- {
- static const bool value = false;
- struct EmptyBase {};
- typedef EmptyBase base_class_t;
- };
-
- template
- struct IsBlock
- {
- static const bool value = true;
- typedef BaseBlock base_class_t;
- };
-
- template
- struct IsBlock, typename T::baseblock_base_class_t >
- {
- static const bool value = true;
- typedef BaseBlock base_class_t;
- };
-
- template::value>
- class ParamValue : public NAME_VALUE_LOOKUP
- {
- public:
- typedef const T& value_assignment_t;
- typedef T value_t;
- typedef ParamValue self_t;
-
- ParamValue(): mValue() {}
- ParamValue(value_assignment_t other) : mValue(other) {}
-
- void setValue(value_assignment_t val)
- {
- mValue = val;
- }
-
- value_assignment_t getValue() const
- {
- return mValue;
- }
-
- T& getValue()
- {
- return mValue;
- }
-
- operator value_assignment_t() const
- {
- return mValue;
- }
-
- value_assignment_t operator()() const
- {
- return mValue;
- }
-
- void operator ()(const typename NAME_VALUE_LOOKUP::name_t& name)
- {
- *this = name;
- }
-
- self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
- {
- if (NAME_VALUE_LOOKUP::getValueFromName(name, mValue))
- {
- NAME_VALUE_LOOKUP::setValueName(name);
- }
-
- return *this;
- }
-
- protected:
- T mValue;
- };
-
- template
- class ParamValue
- : public T,
- public NAME_VALUE_LOOKUP
- {
- public:
- typedef const T& value_assignment_t;
- typedef T value_t;
- typedef ParamValue self_t;
-
- ParamValue()
- : T(),
- mValidated(false)
- {}
-
- ParamValue(value_assignment_t other)
- : T(other),
- mValidated(false)
- {}
-
- void setValue(value_assignment_t val)
- {
- *this = val;
- }
-
- value_assignment_t getValue() const
- {
- return *this;
- }
-
- T& getValue()
- {
- return *this;
- }
-
- operator value_assignment_t() const
- {
- return *this;
- }
-
- value_assignment_t operator()() const
- {
- return *this;
- }
-
- void operator ()(const typename NAME_VALUE_LOOKUP::name_t& name)
- {
- *this = name;
- }
-
- self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
- {
- if (NAME_VALUE_LOOKUP::getValueFromName(name, *this))
- {
- setValueName(name);
- }
-
- return *this;
- }
-
- protected:
- mutable bool mValidated; // lazy validation flag
- };
-
- template
- class ParamValue
- : public NAME_VALUE_LOOKUP
- {
- public:
- typedef const std::string& value_assignment_t;
- typedef std::string value_t;
- typedef ParamValue self_t;
-
- ParamValue(): mValue() {}
- ParamValue(value_assignment_t other) : mValue(other) {}
-
- void setValue(value_assignment_t val)
- {
- if (NAME_VALUE_LOOKUP::getValueFromName(val, mValue))
- {
- NAME_VALUE_LOOKUP::setValueName(val);
- }
- else
- {
- mValue = val;
- }
- }
-
- value_assignment_t getValue() const
- {
- return mValue;
- }
-
- std::string& getValue()
- {
- return mValue;
- }
-
- operator value_assignment_t() const
- {
- return mValue;
- }
-
- value_assignment_t operator()() const
- {
- return mValue;
- }
-
- protected:
- std::string mValue;
- };
-
-
template >
struct ParamIterator
{
- typedef typename std::vector >::const_iterator const_iterator;
- typedef typename std::vector >::iterator iterator;
+ typedef typename std::vector::const_iterator const_iterator;
+ typedef typename std::vector::iterator iterator;
};
- // specialize for custom parsing/decomposition of specific classes
- // e.g. TypedParam has left, top, right, bottom, etc...
+ // wrapper for parameter with a known type
+ // specialized to handle 4 cases:
+ // simple "scalar" value
+ // parameter that is itself a block
+ // multiple scalar values, stored in a vector
+ // multiple blocks, stored in a vector
template,
bool HAS_MULTIPLE_VALUES = false,
- bool VALUE_IS_BLOCK = IsBlock >::value>
+ typename VALUE_IS_BLOCK = typename IsBlock::value_t> >::value_t>
class TypedParam
: public Param,
- public ParamValue
+ public NAME_VALUE_LOOKUP::type_value_t
{
+ protected:
+ typedef TypedParam self_t;
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename param_value_t::default_value_t default_value_t;
+ typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
public:
- typedef TypedParam self_t;
- typedef ParamValue param_value_t;
- typedef typename param_value_t::value_assignment_t value_assignment_t;
- typedef NAME_VALUE_LOOKUP name_value_lookup_t;
+ typedef typename param_value_t::value_t value_t;
- using param_value_t::operator();
+ using named_value_t::operator();
- TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
- : Param(block_descriptor.mCurrentBlockPtr)
+ TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
+ : Param(block_descriptor.mCurrentBlockPtr),
+ named_value_t(value)
{
if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING))
{
- ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
- block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
- &mergeWith,
- &deserializeParam,
- &serializeParam,
- validate_func,
- &inspectParam,
- min_count, max_count));
- BaseBlock::addParam(block_descriptor, param_descriptor, name);
+ init(block_descriptor, validate_func, min_count, max_count, name);
}
-
- param_value_t::setValue(value);
}
bool isProvided() const { return Param::anyProvided(); }
- static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
+ static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
self_t& typed_param = static_cast(param);
// no further names in stack, attempt to parse value now
@@ -869,9 +995,9 @@ namespace LLInitParam
std::string name;
// try to parse a known named value
- if(name_value_lookup_t::valueNamesExist()
+ if(named_value_t::valueNamesExist()
&& parser.readValue(name)
- && name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
+ && named_value_t::getValueFromName(name, typed_param.getValue()))
{
typed_param.setValueName(name);
typed_param.setProvided();
@@ -915,7 +1041,9 @@ namespace LLInitParam
if (!parser.writeValue(typed_param.getValue(), name_stack))
{
std::string calculated_key = typed_param.calcValueName(typed_param.getValue());
- if (!diff_param || !ParamCompare::equals(static_cast(diff_param)->getValueName(), calculated_key))
+ if (calculated_key.size()
+ && (!diff_param
+ || !ParamCompare::equals(static_cast(diff_param)->getValueName(), calculated_key)))
{
parser.writeValue(calculated_key, name_stack);
}
@@ -928,22 +1056,23 @@ namespace LLInitParam
// tell parser about our actual type
parser.inspectValue(name_stack, min_count, max_count, NULL);
// then tell it about string-based alternatives ("red", "blue", etc. for LLColor4)
- if (name_value_lookup_t::getPossibleValues())
+ if (named_value_t::getPossibleValues())
{
- parser.inspectValue(name_stack, min_count, max_count, name_value_lookup_t::getPossibleValues());
+ parser.inspectValue(name_stack, min_count, max_count, named_value_t::getPossibleValues());
}
}
- void set(value_assignment_t val, bool flag_as_provided = true)
+ void set(const value_t& val, bool flag_as_provided = true)
{
- param_value_t::clearValueName();
+ named_value_t::clearValueName();
param_value_t::setValue(val);
setProvided(flag_as_provided);
}
- self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+ self_t& operator =(const typename named_value_t::name_t& name)
{
- return static_cast(param_value_t::operator =(name));
+ named_value_t::assignNamedValue(name);
+ return *this;
}
protected:
@@ -968,41 +1097,47 @@ namespace LLInitParam
}
return false;
}
+ private:
+ void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
+ {
+ ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
+ block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
+ &mergeWith,
+ &deserializeParam,
+ &serializeParam,
+ validate_func,
+ &inspectParam,
+ min_count, max_count));
+ block_descriptor.addParam(param_descriptor, name);
+ }
};
// parameter that is a block
template
- class TypedParam
+ class TypedParam
: public Param,
- public ParamValue
+ public NAME_VALUE_LOOKUP::type_value_t
{
+ protected:
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename param_value_t::default_value_t default_value_t;
+ typedef TypedParam self_t;
+ typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
public:
- typedef ParamValue param_value_t;
- typedef typename param_value_t::value_assignment_t value_assignment_t;
- typedef TypedParam self_t;
- typedef NAME_VALUE_LOOKUP name_value_lookup_t;
+ using named_value_t::operator();
+ typedef typename param_value_t::value_t value_t;
- using param_value_t::operator();
-
- TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
+ TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
: Param(block_descriptor.mCurrentBlockPtr),
- param_value_t(value)
+ named_value_t(value)
{
if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING))
{
- ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
- block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
- &mergeWith,
- &deserializeParam,
- &serializeParam,
- validate_func,
- &inspectParam,
- min_count, max_count));
- BaseBlock::addParam(block_descriptor, param_descriptor, name);
+ init(block_descriptor, validate_func, min_count, max_count, name);
}
}
- static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
+ static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
self_t& typed_param = static_cast(param);
@@ -1010,9 +1145,9 @@ namespace LLInitParam
{ // try to parse a known named value
std::string name;
- if(name_value_lookup_t::valueNamesExist()
+ if(named_value_t::valueNamesExist()
&& parser.readValue(name)
- && name_value_lookup_t::getValueFromName(name, typed_param.getValue()))
+ && named_value_t::getValueFromName(name, typed_param.getValue()))
{
typed_param.setValueName(name);
typed_param.setProvided();
@@ -1044,9 +1179,9 @@ namespace LLInitParam
std::string key = typed_param.getValueName();
if (!key.empty())
{
- if (!parser.writeValue(key, name_stack))
+ if (!diff_param || !ParamCompare::equals(static_cast(diff_param)->getValueName(), key))
{
- return;
+ parser.writeValue(key, name_stack);
}
}
else
@@ -1057,8 +1192,16 @@ namespace LLInitParam
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
{
- // I am a param that is also a block, so just recurse into my contents
const self_t& typed_param = static_cast(param);
+
+ // tell parser about our actual type
+ parser.inspectValue(name_stack, min_count, max_count, NULL);
+ // then tell it about string-based alternatives ("red", "blue", etc. for LLColor4)
+ if (named_value_t::getPossibleValues())
+ {
+ parser.inspectValue(name_stack, min_count, max_count, named_value_t::getPossibleValues());
+ }
+
typed_param.inspectBlock(parser, name_stack, min_count, max_count);
}
@@ -1076,32 +1219,34 @@ namespace LLInitParam
}
// assign block contents to this param-that-is-a-block
- void set(value_assignment_t val, bool flag_as_provided = true)
+ void set(const value_t& val, bool flag_as_provided = true)
{
param_value_t::setValue(val);
- param_value_t::clearValueName();
+ named_value_t::clearValueName();
// force revalidation of block
// next call to isProvided() will update provision status based on validity
param_value_t::mValidated = false;
setProvided(flag_as_provided);
}
- self_t& operator =(const typename NAME_VALUE_LOOKUP::name_t& name)
+ self_t& operator =(const typename named_value_t::name_t& name)
{
- return static_cast(param_value_t::operator =(name));
+ named_value_t::assignNamedValue(name);
+ return *this;
}
// propagate changed status up to enclosing block
/*virtual*/ void paramChanged(const Param& changed_param, bool user_provided)
{
param_value_t::paramChanged(changed_param, user_provided);
+
if (user_provided)
{
// a child param has been explicitly changed
// so *some* aspect of this block is now provided
param_value_t::mValidated = false;
setProvided();
- param_value_t::clearValueName();
+ named_value_t::clearValueName();
}
else
{
@@ -1125,7 +1270,7 @@ namespace LLInitParam
if (src_typed_param.anyProvided())
{
- if (dst_typed_param.mergeBlockParam(src_typed_param.isProvided(), dst_typed_param.isProvided(), param_value_t::selfBlockDescriptor(), src_typed_param, overwrite))
+ if (dst_typed_param.mergeBlockParam(src_typed_param.isProvided(), dst_typed_param.isProvided(), param_value_t::getBlockDescriptor(), src_typed_param, overwrite))
{
dst_typed_param.clearValueName();
dst_typed_param.setProvided(true);
@@ -1134,56 +1279,72 @@ namespace LLInitParam
}
return false;
}
+
+ private:
+ void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
+ {
+ ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
+ block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
+ &mergeWith,
+ &deserializeParam,
+ &serializeParam,
+ validate_func,
+ &inspectParam,
+ min_count, max_count));
+ block_descriptor.addParam(param_descriptor, name);
+ }
};
- // container of non-block parameters
+ // list of non-block parameters
template
- class TypedParam
+ class TypedParam
: public Param
{
- public:
- typedef TypedParam self_t;
- typedef ParamValue param_value_t;
- typedef typename std::vector container_t;
- typedef const container_t& value_assignment_t;
-
- typedef typename param_value_t::value_t value_t;
- typedef NAME_VALUE_LOOKUP name_value_lookup_t;
+ protected:
+ typedef TypedParam self_t;
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename std::vector container_t;
+ typedef container_t default_value_t;
+ typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
- TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
+ public:
+ typedef typename param_value_t::value_t value_t;
+
+ TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
: Param(block_descriptor.mCurrentBlockPtr)
{
std::copy(value.begin(), value.end(), std::back_inserter(mValues));
if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING))
{
- ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
- block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
- &mergeWith,
- &deserializeParam,
- &serializeParam,
- validate_func,
- &inspectParam,
- min_count, max_count));
- BaseBlock::addParam(block_descriptor, param_descriptor, name);
+ init(block_descriptor, validate_func, min_count, max_count, name);
+
}
}
bool isProvided() const { return Param::anyProvided(); }
- static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
+ static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
+ Parser::name_stack_range_t new_name_stack_range(name_stack_range);
self_t& typed_param = static_cast(param);
value_t value;
+
+ // pop first element if empty string
+ if (new_name_stack_range.first != new_name_stack_range.second && new_name_stack_range.first->first.empty())
+ {
+ ++new_name_stack_range.first;
+ }
+
// no further names in stack, attempt to parse value now
if (name_stack_range.first == name_stack_range.second)
{
std::string name;
// try to parse a known named value
- if(name_value_lookup_t::valueNamesExist()
+ if(named_value_t::valueNamesExist()
&& parser.readValue(name)
- && name_value_lookup_t::getValueFromName(name, value))
+ && named_value_t::getValueFromName(name, value))
{
typed_param.add(value);
typed_param.mValues.back().setValueName(name);
@@ -1201,14 +1362,14 @@ namespace LLInitParam
static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
{
const self_t& typed_param = static_cast(param);
- if (!typed_param.isProvided() || name_stack.empty()) return;
+ if (!typed_param.isProvided()) return;
for (const_iterator it = typed_param.mValues.begin(), end_it = typed_param.mValues.end();
it != end_it;
++it)
{
std::string key = it->getValueName();
- name_stack.back().second = true;
+ name_stack.push_back(std::make_pair(std::string(), true));
if(key.empty())
// not parsed via name values, write out value directly
@@ -1230,19 +1391,21 @@ namespace LLInitParam
break;
}
}
+
+ name_stack.pop_back();
}
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
{
parser.inspectValue(name_stack, min_count, max_count, NULL);
- if (name_value_lookup_t::getPossibleValues())
+ if (named_value_t::getPossibleValues())
{
- parser.inspectValue(name_stack, min_count, max_count, name_value_lookup_t::getPossibleValues());
+ parser.inspectValue(name_stack, min_count, max_count, named_value_t::getPossibleValues());
}
}
- void set(value_assignment_t val, bool flag_as_provided = true)
+ void set(const container_t& val, bool flag_as_provided = true)
{
mValues = val;
setProvided(flag_as_provided);
@@ -1250,26 +1413,24 @@ namespace LLInitParam
param_value_t& add()
{
- mValues.push_back(param_value_t(value_t()));
+ mValues.push_back(value_t());
Param::setProvided();
return mValues.back();
}
self_t& add(const value_t& item)
{
- param_value_t param_value;
- param_value.setValue(item);
- mValues.push_back(param_value);
+ mValues.push_back(item);
setProvided();
return *this;
}
- self_t& add(const typename name_value_lookup_t::name_t& name)
+ self_t& add(const typename named_value_t::name_t& name)
{
value_t value;
// try to parse a per type named value
- if (name_value_lookup_t::getValueFromName(name, value))
+ if (named_value_t::getValueFromName(name, value))
{
add(value);
mValues.back().setValueName(name);
@@ -1279,9 +1440,9 @@ namespace LLInitParam
}
// implicit conversion
- operator value_assignment_t() const { return mValues; }
+ operator const container_t&() const { return mValues; }
// explicit conversion
- value_assignment_t operator()() const { return mValues; }
+ const container_t& operator()() const { return mValues; }
typedef typename container_t::iterator iterator;
typedef typename container_t::const_iterator const_iterator;
@@ -1322,62 +1483,79 @@ namespace LLInitParam
}
container_t mValues;
+
+ private:
+ void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
+ {
+ ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
+ block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
+ &mergeWith,
+ &deserializeParam,
+ &serializeParam,
+ validate_func,
+ &inspectParam,
+ min_count, max_count));
+ block_descriptor.addParam(param_descriptor, name);
+ }
};
- // container of block parameters
+ // list of block parameters
template
- class TypedParam
+ class TypedParam
: public Param
{
+ protected:
+ typedef TypedParam self_t;
+ typedef ParamValue::value_t> param_value_t;
+ typedef typename std::vector container_t;
+ typedef typename NAME_VALUE_LOOKUP::type_value_t named_value_t;
+ typedef container_t default_value_t;
+ typedef typename container_t::iterator iterator;
+ typedef typename container_t::const_iterator const_iterator;
public:
- typedef TypedParam self_t;
- typedef ParamValue param_value_t;
- typedef typename std::vector container_t;
- typedef const container_t& value_assignment_t;
typedef typename param_value_t::value_t value_t;
- typedef NAME_VALUE_LOOKUP name_value_lookup_t;
- TypedParam(BlockDescriptor& block_descriptor, const char* name, value_assignment_t value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
+ TypedParam(BlockDescriptor& block_descriptor, const char* name, const default_value_t& value, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count)
: Param(block_descriptor.mCurrentBlockPtr)
{
std::copy(value.begin(), value.end(), back_inserter(mValues));
if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING))
{
- ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
- block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
- &mergeWith,
- &deserializeParam,
- &serializeParam,
- validate_func,
- &inspectParam,
- min_count, max_count));
- BaseBlock::addParam(block_descriptor, param_descriptor, name);
+ init(block_descriptor, validate_func, min_count, max_count, name);
}
}
bool isProvided() const { return Param::anyProvided(); }
- static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
+ static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
+ Parser::name_stack_range_t new_name_stack_range(name_stack_range);
self_t& typed_param = static_cast(param);
bool new_value = false;
+ bool new_array_value = false;
- if (new_name || typed_param.mValues.empty())
+ // pop first element if empty string
+ if (new_name_stack_range.first != new_name_stack_range.second && new_name_stack_range.first->first.empty())
+ {
+ new_array_value = new_name_stack_range.first->second;
+ ++new_name_stack_range.first;
+ }
+
+ if (new_name || new_array_value || typed_param.mValues.empty())
{
new_value = true;
typed_param.mValues.push_back(value_t());
}
-
param_value_t& value = typed_param.mValues.back();
if (name_stack_range.first == name_stack_range.second)
{ // try to parse a known named value
std::string name;
- if(name_value_lookup_t::valueNamesExist()
+ if(named_value_t::valueNamesExist()
&& parser.readValue(name)
- && name_value_lookup_t::getValueFromName(name, value.getValue()))
+ && named_value_t::getValueFromName(name, value.getValue()))
{
typed_param.mValues.back().setValueName(name);
typed_param.setProvided();
@@ -1386,9 +1564,13 @@ namespace LLInitParam
}
// attempt to parse block...
- if(value.deserializeBlock(parser, name_stack_range, new_name))
+ if(value.deserializeBlock(parser, new_name_stack_range, new_name))
{
typed_param.setProvided();
+ if (new_array_value)
+ {
+ name_stack_range.first->second = false;
+ }
return true;
}
@@ -1404,13 +1586,13 @@ namespace LLInitParam
static void serializeParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, const Param* diff_param)
{
const self_t& typed_param = static_cast(param);
- if (!typed_param.isProvided() || name_stack.empty()) return;
+ if (!typed_param.isProvided()) return;
for (const_iterator it = typed_param.mValues.begin(), end_it = typed_param.mValues.end();
it != end_it;
++it)
{
- name_stack.back().second = true;
+ name_stack.push_back(std::make_pair(std::string(), true));
std::string key = it->getValueName();
if (!key.empty())
@@ -1423,16 +1605,27 @@ namespace LLInitParam
{
it->serializeBlock(parser, name_stack, NULL);
}
+
+ name_stack.pop_back();
}
}
static void inspectParam(const Param& param, Parser& parser, Parser::name_stack_t& name_stack, S32 min_count, S32 max_count)
{
- // I am a vector of blocks, so describe my contents recursively
- param_value_t(value_t()).inspectBlock(parser, name_stack, min_count, max_count);
+ const param_value_t& value_param = param_value_t(value_t());
+
+ // tell parser about our actual type
+ parser.inspectValue(name_stack, min_count, max_count, NULL);
+ // then tell it about string-based alternatives ("red", "blue", etc. for LLColor4)
+ if (named_value_t::getPossibleValues())
+ {
+ parser.inspectValue(name_stack, min_count, max_count, named_value_t::getPossibleValues());
}
- void set(value_assignment_t val, bool flag_as_provided = true)
+ value_param.inspectBlock(parser, name_stack, min_count, max_count);
+ }
+
+ void set(const container_t& val, bool flag_as_provided = true)
{
mValues = val;
setProvided(flag_as_provided);
@@ -1452,12 +1645,12 @@ namespace LLInitParam
return *this;
}
- self_t& add(const typename name_value_lookup_t::name_t& name)
+ self_t& add(const typename named_value_t::name_t& name)
{
value_t value;
// try to parse a per type named value
- if (name_value_lookup_t::getValueFromName(name, value))
+ if (named_value_t::getValueFromName(name, value))
{
add(value);
mValues.back().setValueName(name);
@@ -1466,12 +1659,10 @@ namespace LLInitParam
}
// implicit conversion
- operator value_assignment_t() const { return mValues; }
+ operator const container_t&() const { return mValues; }
// explicit conversion
- value_assignment_t operator()() const { return mValues; }
+ const container_t& operator()() const { return mValues; }
- typedef typename container_t::iterator iterator;
- typedef typename container_t::const_iterator const_iterator;
iterator begin() { return mValues.begin(); }
iterator end() { return mValues.end(); }
const_iterator begin() const { return mValues.begin(); }
@@ -1518,6 +1709,20 @@ namespace LLInitParam
}
container_t mValues;
+
+ private:
+ void init( BlockDescriptor &block_descriptor, ParamDescriptor::validation_func_t validate_func, S32 min_count, S32 max_count, const char* name )
+ {
+ ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
+ block_descriptor.mCurrentBlockPtr->getHandleFromParam(this),
+ &mergeWith,
+ &deserializeParam,
+ &serializeParam,
+ validate_func,
+ &inspectParam,
+ min_count, max_count));
+ block_descriptor.addParam(param_descriptor, name);
+ }
};
template
@@ -1532,13 +1737,13 @@ namespace LLInitParam
// take all provided params from other and apply to self
bool overwriteFrom(const self_t& other)
{
- return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, true);
+ return static_cast(this)->mergeBlock(getBlockDescriptor(), other, true);
}
// take all provided params that are not already provided, and apply to self
bool fillFrom(const self_t& other)
{
- return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, false);
+ return static_cast(this)->mergeBlock(getBlockDescriptor(), other, false);
}
bool mergeBlockParam(bool source_provided, bool dest_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite)
@@ -1556,7 +1761,7 @@ namespace LLInitParam
bool mergeBlock(BlockDescriptor& block_data, const self_t& other, bool overwrite)
{
mCurChoice = other.mCurChoice;
- return base_block_t::mergeBlock(selfBlockDescriptor(), other, overwrite);
+ return base_block_t::mergeBlock(getBlockDescriptor(), other, overwrite);
}
// clear out old choice when param has changed
@@ -1577,38 +1782,38 @@ namespace LLInitParam
base_block_t::paramChanged(changed_param, user_provided);
}
- virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
- virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
+ virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return getBlockDescriptor(); }
+ virtual BlockDescriptor& mostDerivedBlockDescriptor() { return getBlockDescriptor(); }
protected:
ChoiceBlock()
: mCurChoice(0)
{
- BaseBlock::init(selfBlockDescriptor(), base_block_t::selfBlockDescriptor(), sizeof(DERIVED_BLOCK));
+ BaseBlock::init(getBlockDescriptor(), base_block_t::getBlockDescriptor(), sizeof(DERIVED_BLOCK));
}
// Alternatives are mutually exclusive wrt other Alternatives in the same block.
// One alternative in a block will always have isChosen() == true.
// At most one alternative in a block will have isProvided() == true.
- template >
+ template ::type_value_t >
class Alternative : public TypedParam
{
+ typedef TypedParam super_t;
+ typedef typename super_t::value_t value_t;
+ typedef typename super_t::default_value_t default_value_t;
+
public:
friend class ChoiceBlock;
- typedef Alternative self_t;
- typedef TypedParam >::value> super_t;
- typedef typename super_t::value_assignment_t value_assignment_t;
-
using super_t::operator =;
- explicit Alternative(const char* name = "", value_assignment_t val = defaultValue())
- : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1),
+ explicit Alternative(const char* name = "", const default_value_t& val = defaultValue())
+ : super_t(DERIVED_BLOCK::getBlockDescriptor(), name, val, NULL, 0, 1),
mOriginalValue(val)
{
// assign initial choice to first declared option
- DERIVED_BLOCK* blockp = ((DERIVED_BLOCK*)DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr);
- if (LL_UNLIKELY(DERIVED_BLOCK::selfBlockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING))
+ DERIVED_BLOCK* blockp = ((DERIVED_BLOCK*)DERIVED_BLOCK::getBlockDescriptor().mCurrentBlockPtr);
+ if (LL_UNLIKELY(DERIVED_BLOCK::getBlockDescriptor().mInitializationState == BlockDescriptor::INITIALIZING))
{
if(blockp->mCurChoice == 0)
{
@@ -1622,27 +1827,27 @@ namespace LLInitParam
static_cast(Param::enclosingBlock()).paramChanged(*this, true);
}
- void chooseAs(value_assignment_t val)
+ void chooseAs(const value_t& val)
{
super_t::set(val);
}
- void operator =(value_assignment_t val)
+ void operator =(const value_t& val)
{
super_t::set(val);
}
- void operator()(typename super_t::value_assignment_t val)
+ void operator()(const value_t& val)
{
super_t::set(val);
}
- operator value_assignment_t() const
+ operator const value_t&() const
{
return (*this)();
}
- value_assignment_t operator()() const
+ const value_t& operator()() const
{
if (static_cast(Param::enclosingBlock()).getCurrentChoice() == this)
{
@@ -1657,11 +1862,11 @@ namespace LLInitParam
}
private:
- T mOriginalValue;
+ default_value_t mOriginalValue;
};
- protected:
- static BlockDescriptor& selfBlockDescriptor()
+ public:
+ static BlockDescriptor& getBlockDescriptor()
{
static BlockDescriptor sBlockDescriptor;
return sBlockDescriptor;
@@ -1681,6 +1886,8 @@ namespace LLInitParam
: public BASE_BLOCK
{
typedef Block self_t;
+
+ protected:
typedef Block block_t;
public:
@@ -1689,80 +1896,82 @@ namespace LLInitParam
// take all provided params from other and apply to self
bool overwriteFrom(const self_t& other)
{
- return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, true);
+ return static_cast(this)->mergeBlock(getBlockDescriptor(), other, true);
}
// take all provided params that are not already provided, and apply to self
bool fillFrom(const self_t& other)
{
- return static_cast(this)->mergeBlock(selfBlockDescriptor(), other, false);
+ return static_cast(this)->mergeBlock(getBlockDescriptor(), other, false);
}
- virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return selfBlockDescriptor(); }
- virtual BlockDescriptor& mostDerivedBlockDescriptor() { return selfBlockDescriptor(); }
+ virtual const BlockDescriptor& mostDerivedBlockDescriptor() const { return getBlockDescriptor(); }
+ virtual BlockDescriptor& mostDerivedBlockDescriptor() { return getBlockDescriptor(); }
protected:
Block()
{
//#pragma message("Parsing LLInitParam::Block")
- BaseBlock::init(selfBlockDescriptor(), BASE_BLOCK::selfBlockDescriptor(), sizeof(DERIVED_BLOCK));
+ BaseBlock::init(getBlockDescriptor(), BASE_BLOCK::getBlockDescriptor(), sizeof(DERIVED_BLOCK));
}
//
// Nested classes for declaring parameters
//
- template >
+ template ::type_value_t >
class Optional : public TypedParam
{
- public:
- typedef TypedParam >::value> super_t;
- typedef typename super_t::value_assignment_t value_assignment_t;
+ typedef TypedParam super_t;
+ typedef typename super_t::value_t value_t;
+ typedef typename super_t::default_value_t default_value_t;
+ public:
using super_t::operator();
using super_t::operator =;
- explicit Optional(const char* name = "", value_assignment_t val = defaultValue())
- : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, NULL, 0, 1)
+ explicit Optional(const char* name = "", const default_value_t& val = defaultValue())
+ : super_t(DERIVED_BLOCK::getBlockDescriptor(), name, val, NULL, 0, 1)
{
//#pragma message("Parsing LLInitParam::Block::Optional")
}
- Optional& operator =(value_assignment_t val)
+ Optional& operator =(const value_t& val)
{
super_t::set(val);
return *this;
}
- DERIVED_BLOCK& operator()(value_assignment_t val)
+ DERIVED_BLOCK& operator()(const value_t& val)
{
super_t::set(val);
return static_cast(Param::enclosingBlock());
}
};
- template >
+ template ::type_value_t >
class Mandatory : public TypedParam
{
- public:
- typedef TypedParam >::value> super_t;
+ typedef TypedParam super_t;
typedef Mandatory self_t;
- typedef typename super_t::value_assignment_t value_assignment_t;
+ typedef typename super_t::value_t value_t;
+ typedef typename super_t::default_value_t default_value_t;
+ public:
using super_t::operator();
using super_t::operator =;
// mandatory parameters require a name to be parseable
- explicit Mandatory(const char* name = "", value_assignment_t val = defaultValue())
- : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, val, &validate, 1, 1)
+ explicit Mandatory(const char* name = "", const default_value_t& val = defaultValue())
+ : super_t(DERIVED_BLOCK::getBlockDescriptor(), name, val, &validate, 1, 1)
{}
- Mandatory& operator =(value_assignment_t val)
+ Mandatory& operator =(const value_t& val)
{
super_t::set(val);
return *this;
}
- DERIVED_BLOCK& operator()(typename super_t::value_assignment_t val)
+ DERIVED_BLOCK& operator()(const value_t& val)
{
super_t::set(val);
return static_cast(Param::enclosingBlock());
@@ -1776,28 +1985,29 @@ namespace LLInitParam
};
- template >
+ template ::type_value_t >
class Multiple : public TypedParam
{
- public:
- typedef TypedParam >::value> super_t;
+ typedef TypedParam super_t;
typedef Multiple self_t;
typedef typename super_t::container_t container_t;
- typedef typename super_t::value_assignment_t value_assignment_t;
+ typedef typename super_t::value_t value_t;
+
+ public:
typedef typename super_t::iterator iterator;
typedef typename super_t::const_iterator const_iterator;
explicit Multiple(const char* name = "")
- : super_t(DERIVED_BLOCK::selfBlockDescriptor(), name, container_t(), &validate, RANGE::minCount, RANGE::maxCount)
+ : super_t(DERIVED_BLOCK::getBlockDescriptor(), name, container_t(), &validate, RANGE::minCount, RANGE::maxCount)
{}
- Multiple& operator =(value_assignment_t val)
+ Multiple& operator =(const container_t& val)
{
super_t::set(val);
return *this;
}
- DERIVED_BLOCK& operator()(typename super_t::value_assignment_t val)
+ DERIVED_BLOCK& operator()(const container_t& val)
{
super_t::set(val);
return static_cast(Param::enclosingBlock());
@@ -1810,13 +2020,15 @@ namespace LLInitParam
}
};
- class Deprecated : public Param
+ // can appear in data files, but will ignored during parsing
+ // cannot read or write in code
+ class Ignored : public Param
{
public:
- explicit Deprecated(const char* name)
- : Param(DERIVED_BLOCK::selfBlockDescriptor().mCurrentBlockPtr)
+ explicit Ignored(const char* name)
+ : Param(DERIVED_BLOCK::getBlockDescriptor().mCurrentBlockPtr)
{
- BlockDescriptor& block_descriptor = DERIVED_BLOCK::selfBlockDescriptor();
+ BlockDescriptor& block_descriptor = DERIVED_BLOCK::getBlockDescriptor();
if (LL_UNLIKELY(block_descriptor.mInitializationState == BlockDescriptor::INITIALIZING))
{
ParamDescriptorPtr param_descriptor = ParamDescriptorPtr(new ParamDescriptor(
@@ -1827,11 +2039,11 @@ namespace LLInitParam
NULL,
NULL,
0, S32_MAX));
- BaseBlock::addParam(block_descriptor, param_descriptor, name);
+ block_descriptor.addParam(param_descriptor, name);
}
}
- static bool deserializeParam(Param& param, Parser& parser, const Parser::name_stack_range_t& name_stack_range, bool new_name)
+ static bool deserializeParam(Param& param, Parser& parser, Parser::name_stack_range_t& name_stack_range, bool new_name)
{
if (name_stack_range.first == name_stack_range.second)
{
@@ -1844,19 +2056,46 @@ namespace LLInitParam
}
};
- // different semantics for documentation purposes, but functionally identical
- typedef Deprecated Ignored;
+ // can appear in data files, or be written to in code, but data will be ignored
+ // cannot be read in code
+ class Deprecated : public Ignored
+ {
+ public:
+ explicit Deprecated(const char* name) : Ignored(name) {}
- protected:
- static BlockDescriptor& selfBlockDescriptor()
+ // dummy writer interfaces
+ template
+ Deprecated& operator =(const T& val)
+ {
+ // do nothing
+ return *this;
+ }
+
+ template
+ DERIVED_BLOCK& operator()(const T& val)
+ {
+ // do nothing
+ return static_cast(Param::enclosingBlock());
+ }
+
+ template
+ void set(const T& val, bool flag_as_provided = true)
+ {
+ // do nothing
+ }
+ };
+
+ public:
+ static BlockDescriptor& getBlockDescriptor()
{
static BlockDescriptor sBlockDescriptor;
return sBlockDescriptor;
}
- template
+ protected:
+ template
void changeDefault(TypedParam& param,
- typename TypedParam::value_assignment_t value)
+ const typename TypedParam::value_t& value)
{
if (!param.isProvided())
{
@@ -1866,204 +2105,420 @@ namespace LLInitParam
};
- template
- class BatchBlock
- : public Block
+ template
+ struct IsBlock, BLOCK_T >, void>
{
- public:
- typedef BatchBlock self_t;
- typedef Block super_t;
+ typedef IS_A_BLOCK value_t;
+ };
- BatchBlock()
+ template
+ struct IsBlock, BLOCK_T >, void>
+ {
+ typedef NOT_BLOCK value_t;
+ };
+
+ template
+ struct IsBlock, typename IsBlock >::value_t >, BLOCK_IDENTIFIER>
+ {
+ typedef typename IsBlock::value_t value_t;
+ };
+
+ template
+ struct IsBlock, typename IsBlock >::value_t >, BLOCK_IDENTIFIER>
+ {
+ typedef typename IsBlock::value_t value_t;
+ };
+
+
+ template
+ struct InnerMostType
+ {
+ typedef T value_t;
+ };
+
+ template