Gastly CHUI merge pass 1, don't count on anything to work.

master
Tank_Master 2013-06-26 12:14:54 -07:00
commit 14001c54df
631 changed files with 35896 additions and 27313 deletions

View File

@ -1,2 +1,2 @@
d2202f2501db50084ca884bcb97a03c7b1c2ec4e
f501c2356b74bc8c5a48bdf42621a2d4f5bea808
a52aa93d9772c677a4594b22411e99d3ca7cb7c3
c0b22ce8586c399ea4201ef08036782e06a78d13

View File

@ -1 +1 @@
336854c58a54210c0b5046e4dd8af49acc1a9159
23a6fee23f1d6a2432201906d41e80f3471e8700

View File

@ -1 +1 @@
336854c58a54210c0b5046e4dd8af49acc1a9159
23a6fee23f1d6a2432201906d41e80f3471e8700

View File

@ -1 +1 @@
9ea58fa9198ff25fa7ff9446a1bbe52b01076f16
ff000086493c960ef83586482bbcd3fd78cda094

View File

@ -1 +1 @@
230637f9ff30c055fed20e05cbcfb2420cdecef0
13149a524874b608aeb76325b35faff113a5ea53

472
.hgtags
View File

@ -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

View File

@ -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
# =================================================================

View File

@ -1334,9 +1334,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>088a1c30e499289e94bc1738fd3d6a25</string>
<string>5bc44db15eb3cca021382e40e04a9a38</string>
<key>url</key>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/270564/arch/Linux/installer/llappearanceutility_source-0.1-linux-20130219.tar.bz2</string>
<string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/llappearanceutility-source/rev/271972/arch/Linux/installer/llappearanceutility_source-0.1-linux-20130315.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>

0
debian/rules vendored Executable file → Normal file
View File

View File

@ -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

21
indra/llappearance/llavatarappearance.cpp Executable file → Normal file
View File

@ -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;

0
indra/llappearance/llavatarappearance.h Executable file → Normal file
View File

View File

@ -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
//--------------------------------------------------------------------

0
indra/llappearance/llavatarjointmesh.cpp Executable file → Normal file
View File

0
indra/llappearance/llavatarjointmesh.h Executable file → Normal file
View File

View File

@ -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"

2
indra/llappearance/lltexlayerparams.cpp Executable file → Normal file
View File

@ -33,7 +33,7 @@
#include "llquantize.h"
#include "lltexlayer.h"
#include "lltexturemanagerbridge.h"
#include "llrender2dutils.h"
#include "../llui/llui.h"
#include "llwearable.h"
//-----------------------------------------------------------------------------

View File

@ -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;
}

0
indra/llappearance/llwearabledata.cpp Executable file → Normal file
View File

View File

@ -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.
*

View File

@ -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)
{

View File

@ -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;

View File

@ -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");

View File

@ -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;

0
indra/llcharacter/llcharacter.cpp Executable file → Normal file
View File

0
indra/llcharacter/llvisualparam.cpp Executable file → Normal file
View File

0
indra/llcharacter/llvisualparam.h Executable file → Normal file
View File

0
indra/llcommon/imageids.cpp Executable file → Normal file
View File

0
indra/llcommon/imageids.h Executable file → Normal file
View File

View File

@ -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));
};

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -864,12 +864,8 @@ llifstream::llifstream(const std::string& _Filename,
#if LL_WINDOWS
std::istream(&_M_filebuf)
{
// <FS:ND> 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)
// </FS:ND>
{
_Myios::setstate(ios_base::failbit);
}
@ -888,12 +884,8 @@ llifstream::llifstream(const char* _Filename,
#if LL_WINDOWS
std::istream(&_M_filebuf)
{
// <FS:ND> 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)
// </FS:ND>
{
_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
// <FS:ND> Need to convert to UTF16 for Win, Windows API does not use UTF8
// if (_M_filebuf.open(_Filename, _Mode | ios_base::in) == 0)
// </FS:ND>
#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)
{
// <FS:ND> 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)
// <FS:ND>
{
_Myios::setstate(ios_base::failbit);
}
@ -1021,12 +1005,8 @@ llofstream::llofstream(const char* _Filename,
#if LL_WINDOWS
std::ostream(&_M_filebuf)
{
// <FS:ND> 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)
// </FS:ND>
{
_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
// <FS:ND> Need to convert to UTF16 for Win, Windows API does not use UTF8
// if (_M_filebuf.open(_Filename, _Mode | ios_base::out) == 0)
// </FS:ND>
#if LL_WINDOWS
llutf16string wideName = utf8str_to_utf16str( _Filename );
if (_M_filebuf.open( wideName.c_str(), _Mode | ios_base::out) == 0)

View File

@ -194,13 +194,6 @@ public:
return mHandle;
}
protected:
typedef LLHandle<T> handle_type_t;
LLHandleProvider()
{
// provided here to enforce T deriving from LLHandleProvider<T>
}
template <typename U>
LLHandle<U> getDerivedHandle(typename boost::enable_if< typename boost::is_convertible<U*, T*> >::type* dummy = 0) const
{
@ -209,6 +202,12 @@ protected:
return downcast_handle;
}
protected:
typedef LLHandle<T> handle_type_t;
LLHandleProvider()
{
// provided here to enforce T deriving from LLHandleProvider<T>
}
private:
mutable LLRootHandle<T> mHandle;

View File

@ -40,7 +40,9 @@ namespace LLInitParam
{
const U8* my_addr = reinterpret_cast<const U8*>(this);
const U8* block_addr = reinterpret_cast<const U8*>(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<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << 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<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << 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);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@
* semantics: one instance per process, rather than one instance per module as
* sometimes happens with data simply declared static.
*/
class LL_COMMON_API LLInstanceTrackerBase : public boost::noncopyable
class LL_COMMON_API LLInstanceTrackerBase
{
protected:
/// Get a process-unique void* pointer slot for the specified type_info
@ -245,6 +245,9 @@ protected:
virtual const KEY& getKey() const { return mInstanceKey; }
private:
LLInstanceTracker( const LLInstanceTracker& );
const LLInstanceTracker& operator=( const LLInstanceTracker& );
void add_(KEY key)
{
mInstanceKey = key;

View File

@ -27,6 +27,7 @@
#define LLREFCOUNT_H
#include <boost/noncopyable.hpp>
#include <boost/intrusive_ptr.hpp>
#include "nd/ndintrin.h" // <FS:ND/> For FAA/FAD
@ -104,4 +105,22 @@ private:
#endif
};
/**
* intrusive pointer support
* this allows you to use boost::intrusive_ptr with any LLRefCount-derived type
*/
namespace boost
{
inline void intrusive_ptr_add_ref(LLRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLRefCount* p)
{
p->unref();
}
};
#endif

View File

@ -307,6 +307,10 @@ public:
virtual ~StaticRegistrar() {}
StaticRegistrar(ref_const_key_t key, ref_const_value_t value)
{
if (singleton_t::instance().exists(key))
{
llerrs << "Duplicate registry entry under key \"" << key << "\"" << llendl;
}
singleton_t::instance().mStaticScope->add(key, value);
}
};

View File

@ -223,10 +223,14 @@ LLSD& LLParamSDParserUtilities::getSDWriteNode(LLSD& input, LLInitParam::Parser:
{
bool new_traversal = it->second;
LLSD* child_sd = it->first.empty() ? sd_to_write : &(*sd_to_write)[it->first];
if (child_sd->isArray())
LLSD* child_sd;
if (it->first.empty())
{
child_sd = sd_to_write;
if (child_sd->isUndefined())
{
*child_sd = LLSD::emptyArray();
}
if (new_traversal)
{
// write to new element at end
@ -240,22 +244,7 @@ LLSD& LLParamSDParserUtilities::getSDWriteNode(LLSD& input, LLInitParam::Parser:
}
else
{
if (new_traversal
&& child_sd->isDefined()
&& !child_sd->isArray())
{
// copy child contents into first element of an array
LLSD new_array = LLSD::emptyArray();
new_array.append(*child_sd);
// assign array to slot that previously held the single value
*child_sd = new_array;
// return next element in that array
sd_to_write = &((*child_sd)[1]);
}
else
{
sd_to_write = child_sd;
}
sd_to_write = &(*sd_to_write)[it->first];
}
it->second = false;
}
@ -283,8 +272,9 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI
it != sd.endArray();
++it)
{
stack.back().second = true;
stack.push_back(make_pair(std::string(), true));
readSDValues(cb, *it, stack);
stack.pop_back();
}
}
else if (sd.isUndefined())
@ -313,8 +303,14 @@ namespace LLInitParam
{
// LLSD specialization
// block param interface
bool ParamValue<LLSD, TypeValues<LLSD>, false>::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name)
bool ParamValue<LLSD, NOT_BLOCK>::deserializeBlock(Parser& p, Parser::name_stack_range_t& name_stack, bool new_name)
{
if (name_stack.first == name_stack.second
&& p.readValue<LLSD>(mValue))
{
return true;
}
LLSD& sd = LLParamSDParserUtilities::getSDWriteNode(mValue, name_stack);
LLSD::String string;
@ -328,15 +324,18 @@ namespace LLInitParam
}
//static
void ParamValue<LLSD, TypeValues<LLSD>, false>::serializeElement(Parser& p, const LLSD& sd, Parser::name_stack_t& name_stack)
void ParamValue<LLSD, NOT_BLOCK>::serializeElement(Parser& p, const LLSD& sd, Parser::name_stack_t& name_stack)
{
p.writeValue<LLSD::String>(sd.asString(), name_stack);
}
void ParamValue<LLSD, TypeValues<LLSD>, false>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const
void ParamValue<LLSD, NOT_BLOCK>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const
{
// read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc)
Parser::name_stack_t stack;
LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, stack);
// attempt to write LLSD out directly
if (!p.writeValue<LLSD>(mValue, name_stack))
{
// otherwise read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc)
LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack);
}
}
}

View File

@ -30,6 +30,7 @@
#include "llapp.h"
#include "llapr.h"
#include "apr_thread_cond.h"
#include "boost/intrusive_ptr.hpp"
class LLThread;
class LLMutex;
@ -284,6 +285,22 @@ private:
S32 mRef;
};
/**
* intrusive pointer support for LLThreadSafeRefCount
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
*/
namespace boost
{
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
{
p->ref();
}
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
{
p->unref();
}
};
//============================================================================
// Simple responder for self destructing callbacks

View File

@ -28,8 +28,8 @@
#define LL_LLVERSIONVIEWER_H
const S32 LL_VERSION_MAJOR = 3;
const S32 LL_VERSION_MINOR = 4;
const S32 LL_VERSION_PATCH = 6;
const S32 LL_VERSION_MINOR = 5;
const S32 LL_VERSION_PATCH = 1;
const S32 LL_VERSION_BUILD = 264760;
const char * const LL_CHANNEL = "Firestorm-private";

View File

@ -51,7 +51,8 @@ enum EDragAndDropType
DAD_LINK = 14,
DAD_MESH = 15,
DAD_WIDGET = 16,
DAD_COUNT = 17, // number of types in this enum
DAD_PERSON = 17,
DAD_COUNT = 18, // number of types in this enum
};
// Reasons for drags to be denied.

0
indra/llimage/CMakeLists.txt Executable file → Normal file
View File

View File

@ -21,10 +21,6 @@ include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
${LLXML_SYSTEM_INCLUDE_DIRS}
)
include_directories(SYSTEM
${LLCOMMON_SYSTEM_INCLUDE_DIRS}
${LLXML_SYSTEM_INCLUDE_DIRS}
)
set(llinventory_SOURCE_FILES
llcategory.cpp
@ -68,12 +64,6 @@ list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES})
add_library (llinventory ${llinventory_SOURCE_FILES})
target_link_libraries(llinventory
${LLCOMMON_LIBRARIES}
${LLMATH_LIBRARIES}
${LLMESSAGE_LIBRARIES}
${LLXML_LIBRARIES}
)
#add unit tests

View File

@ -75,13 +75,15 @@ LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
mUUID(uuid),
mParentUUID(parent_uuid),
mType(type),
mName(name)
mName(name),
mCreationDate(0)
{
correctInventoryName(mName);
}
LLInventoryObject::LLInventoryObject() :
mType(LLAssetType::AT_NONE)
mType(LLAssetType::AT_NONE),
mCreationDate(0)
{
}
@ -275,6 +277,26 @@ void LLInventoryObject::correctInventoryName(std::string& name)
LLStringUtil::truncate(name, DB_INV_ITEM_NAME_STR_LEN);
}
time_t LLInventoryObject::getCreationDate() const
{
return mCreationDate;
}
void LLInventoryObject::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
}
const std::string& LLInventoryItem::getDescription() const
{
return mDescription;
}
const std::string& LLInventoryItem::getActualDescription() const
{
return mDescription;
}
///----------------------------------------------------------------------------
/// Class LLInventoryItem
@ -297,9 +319,10 @@ LLInventoryItem::LLInventoryItem(const LLUUID& uuid,
mDescription(desc),
mSaleInfo(sale_info),
mInventoryType(inv_type),
mFlags(flags),
mCreationDate(creation_date_utc)
mFlags(flags)
{
mCreationDate = creation_date_utc;
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
LLStringUtil::replaceChar(mDescription, '|', ' ');
mPermissions.initMasks(inv_type);
@ -312,9 +335,9 @@ LLInventoryItem::LLInventoryItem() :
mDescription(),
mSaleInfo(),
mInventoryType(LLInventoryType::IT_NONE),
mFlags(0),
mCreationDate(0)
mFlags(0)
{
mCreationDate = 0;
}
LLInventoryItem::LLInventoryItem(const LLInventoryItem* other) :
@ -374,21 +397,6 @@ void LLInventoryItem::setAssetUUID(const LLUUID& asset_id)
}
const std::string& LLInventoryItem::getDescription() const
{
return mDescription;
}
const std::string& LLInventoryItem::getActualDescription() const
{
return mDescription;
}
time_t LLInventoryItem::getCreationDate() const
{
return mCreationDate;
}
U32 LLInventoryItem::getCRC32() const
{
// *FIX: Not a real crc - more of a checksum.
@ -445,11 +453,6 @@ void LLInventoryItem::setFlags(U32 flags)
mFlags = flags;
}
void LLInventoryItem::setCreationDate(time_t creation_date_utc)
{
mCreationDate = creation_date_utc;
}
// Currently only used in the Viewer to handle calling cards
// where the creator is actually used to store the target.
void LLInventoryItem::setCreator(const LLUUID& creator)
@ -511,6 +514,12 @@ U32 LLInventoryItem::getFlags() const
return mFlags;
}
time_t LLInventoryItem::getCreationDate() const
{
return mCreationDate;
}
// virtual
void LLInventoryItem::packMessage(LLMessageSystem* msg) const
{
@ -933,7 +942,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
}
else if(0 == strcmp("permissions", keyword))
{
success = mPermissions.importStream(input_stream);
success = mPermissions.importLegacyStream(input_stream);
}
else if(0 == strcmp("sale_info", keyword))
{
@ -943,7 +952,7 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
// should pick up the vast majority of the tasks.
BOOL has_perm_mask = FALSE;
U32 perm_mask = 0;
success = mSaleInfo.importStream(input_stream, has_perm_mask, perm_mask);
success = mSaleInfo.importLegacyStream(input_stream, has_perm_mask, perm_mask);
if(has_perm_mask)
{
if(perm_mask == PERM_NONE)
@ -1059,7 +1068,7 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
output_stream << "\t\titem_id\t" << uuid_str << "\n";
mParentUUID.toString(uuid_str);
output_stream << "\t\tparent_id\t" << uuid_str << "\n";
mPermissions.exportStream(output_stream);
mPermissions.exportLegacyStream(output_stream);
// Check for permissions to see the asset id, and if so write it
// out as an asset id. Otherwise, apply our cheesy encryption.
@ -1093,7 +1102,7 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu
std::string buffer;
buffer = llformat( "\t\tflags\t%08x\n", mFlags);
output_stream << buffer;
mSaleInfo.exportStream(output_stream);
mSaleInfo.exportLegacyStream(output_stream);
output_stream << "\t\tname\t" << mName.c_str() << "|\n";
output_stream << "\t\tdesc\t" << mDescription.c_str() << "|\n";
output_stream << "\t\tcreation_date\t" << mCreationDate << "\n";

View File

@ -73,6 +73,7 @@ public:
virtual LLAssetType::EType getType() const;
LLAssetType::EType getActualType() const; // bypasses indirection for linked items
BOOL getIsLinkType() const;
virtual time_t getCreationDate() const;
//--------------------------------------------------------------------
// Mutators
@ -83,6 +84,7 @@ public:
virtual void rename(const std::string& new_name);
void setParent(const LLUUID& new_parent);
void setType(LLAssetType::EType type);
virtual void setCreationDate(time_t creation_date_utc); // only stored for items
private:
// in place correction for inventory name string
@ -111,6 +113,7 @@ protected:
LLUUID mParentUUID; // Parent category. Root categories have LLUUID::NULL.
LLAssetType::EType mType;
std::string mName;
time_t mCreationDate; // seconds from 1/1/1970, UTC
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -176,7 +179,6 @@ public:
void setPermissions(const LLPermissions& perm);
void setInventoryType(LLInventoryType::EType inv_type);
void setFlags(U32 flags);
void setCreationDate(time_t creation_date_utc);
void setCreator(const LLUUID& creator); // only used for calling cards
// Check for changes in permissions masks and sale info
@ -222,7 +224,6 @@ protected:
LLSaleInfo mSaleInfo;
LLInventoryType::EType mInventoryType;
U32 mFlags;
time_t mCreationDate; // seconds from 1/1/1970, UTC
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -85,6 +85,7 @@ LLInventoryDictionary::LLInventoryDictionary()
addEntry(LLInventoryType::IT_GESTURE, new InventoryEntry("gesture", "gesture", 1, LLAssetType::AT_GESTURE));
addEntry(LLInventoryType::IT_MESH, new InventoryEntry("mesh", "mesh", 1, LLAssetType::AT_MESH));
addEntry(LLInventoryType::IT_WIDGET, new InventoryEntry("widget", "widget", 1, LLAssetType::AT_WIDGET));
addEntry(LLInventoryType::IT_PERSON, new InventoryEntry("person", "person", 1, LLAssetType::AT_PERSON));
}
@ -140,7 +141,7 @@ DEFAULT_ASSET_FOR_INV_TYPE[LLAssetType::AT_COUNT] =
LLInventoryType::IT_NONE, // 42 AT_NONE
LLInventoryType::IT_NONE, // 43 AT_NONE
LLInventoryType::IT_NONE, // 44 AT_NONE
LLInventoryType::IT_NONE, // 45 AT_NONE
LLInventoryType::IT_PERSON, // 45 AT_PERSON
LLInventoryType::IT_NONE, // 46 AT_NONE
LLInventoryType::IT_NONE, // 47 AT_NONE
LLInventoryType::IT_NONE, // 48 AT_NONE

View File

@ -63,7 +63,8 @@ public:
IT_GESTURE = 20,
IT_MESH = 22,
IT_WIDGET = 23,
IT_COUNT = 24,
IT_PERSON = 24,
IT_COUNT = 25,
IT_NONE = -1
};

View File

@ -577,17 +577,143 @@ int splitCacheLine( char *aBuffer, char *&aKeyword, char *&aValue );
BOOL LLPermissions::importFile(LLFILE* fp)
{
llifstream ifs(fp);
return importStream(ifs);
init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
const S32 BUFSIZE = 16384;
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[BUFSIZE]; /* Flawfinder: ignore */
char keyword[256]; /* Flawfinder: ignore */
char valuestr[256]; /* Flawfinder: ignore */
char uuid_str[256]; /* Flawfinder: ignore */
U32 mask;
keyword[0] = '\0';
valuestr[0] = '\0';
while (!feof(fp))
{
if (fgets(buffer, BUFSIZE, fp) == NULL)
{
buffer[0] = '\0';
}
sscanf( /* Flawfinder: ignore */
buffer,
" %255s %255s",
keyword, valuestr);
if (!strcmp("{", keyword))
{
continue;
}
if (!strcmp("}",keyword))
{
break;
}
else if (!strcmp("creator_mask", keyword))
{
// legacy support for "creator" masks
sscanf(valuestr, "%x", &mask);
mMaskBase = mask;
fixFairUse();
}
else if (!strcmp("base_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskBase = mask;
//fixFairUse();
}
else if (!strcmp("owner_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskOwner = mask;
}
else if (!strcmp("group_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskGroup = mask;
}
else if (!strcmp("everyone_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskEveryone = mask;
}
else if (!strcmp("next_owner_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskNextOwner = mask;
}
else if (!strcmp("creator_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mCreator.set(uuid_str);
}
else if (!strcmp("owner_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mOwner.set(uuid_str);
}
else if (!strcmp("last_owner_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mLastOwner.set(uuid_str);
}
else if (!strcmp("group_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mGroup.set(uuid_str);
}
else if (!strcmp("group_owned", keyword))
{
sscanf(valuestr, "%d", &mask);
if(mask) mIsGroupOwned = true;
else mIsGroupOwned = false;
}
else
{
llinfos << "unknown keyword " << keyword << " in permissions import" << llendl;
}
}
fix();
return TRUE;
}
BOOL LLPermissions::exportFile(LLFILE* fp) const
{
llofstream ofs(fp);
return exportStream(ofs);
std::string uuid_str;
fprintf(fp, "\tpermissions 0\n");
fprintf(fp, "\t{\n");
fprintf(fp, "\t\tbase_mask\t%08x\n", mMaskBase);
fprintf(fp, "\t\towner_mask\t%08x\n", mMaskOwner);
fprintf(fp, "\t\tgroup_mask\t%08x\n", mMaskGroup);
fprintf(fp, "\t\teveryone_mask\t%08x\n", mMaskEveryone);
fprintf(fp, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner);
mCreator.toString(uuid_str);
fprintf(fp, "\t\tcreator_id\t%s\n", uuid_str.c_str());
mOwner.toString(uuid_str);
fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str());
mLastOwner.toString(uuid_str);
fprintf(fp, "\t\tlast_owner_id\t%s\n", uuid_str.c_str());
mGroup.toString(uuid_str);
fprintf(fp, "\t\tgroup_id\t%s\n", uuid_str.c_str());
if(mIsGroupOwned)
{
fprintf(fp, "\t\tgroup_owned\t1\n");
}
fprintf(fp,"\t}\n");
return TRUE;
}
BOOL LLPermissions::importStream(std::istream& input_stream)
BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
{
init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
const S32 BUFSIZE = 16384;
@ -606,18 +732,6 @@ BOOL LLPermissions::importStream(std::istream& input_stream)
while (input_stream.good())
{
input_stream.getline(buffer, BUFSIZE);
if (input_stream.eof())
{
llwarns << "Bad permissions: early end of input stream"
<< llendl;
return FALSE;
}
if (input_stream.fail())
{
llwarns << "Bad permissions: failed to read from input stream"
<< llendl;
return FALSE;
}
sscanf( /* Flawfinder: ignore */
buffer,
" %255s %255s",
@ -691,8 +805,7 @@ BOOL LLPermissions::importStream(std::istream& input_stream)
}
else
{
llwarns << "unknown keyword " << keyword
<< " in permissions import" << llendl;
llinfos << "unknown keyword " << keyword << " in permissions import" << llendl;
}
}
fix();
@ -700,26 +813,36 @@ BOOL LLPermissions::importStream(std::istream& input_stream)
}
BOOL LLPermissions::exportStream(std::ostream& output_stream) const
BOOL LLPermissions::exportLegacyStream(std::ostream& output_stream) const
{
if (!output_stream.good()) return FALSE;
std::string uuid_str;
output_stream << "\tpermissions 0\n";
output_stream << "\t{\n";
char prev_fill = output_stream.fill('0');
output_stream << std::hex;
output_stream << "\t\tbase_mask\t" << std::setw(8) << mMaskBase << "\n";
output_stream << "\t\towner_mask\t" << std::setw(8) << mMaskOwner << "\n";
output_stream << "\t\tgroup_mask\t" << std::setw(8) << mMaskGroup << "\n";
output_stream << "\t\teveryone_mask\t" << std::setw(8) << mMaskEveryone << "\n";
output_stream << "\t\tnext_owner_mask\t" << std::setw(8) << mMaskNextOwner << "\n";
output_stream << std::dec;
output_stream.fill(prev_fill);
std::string buffer;
buffer = llformat( "\t\tbase_mask\t%08x\n", mMaskBase);
output_stream << buffer;
buffer = llformat( "\t\towner_mask\t%08x\n", mMaskOwner);
output_stream << buffer;
buffer = llformat( "\t\tgroup_mask\t%08x\n", mMaskGroup);
output_stream << buffer;
buffer = llformat( "\t\teveryone_mask\t%08x\n", mMaskEveryone);
output_stream << buffer;
buffer = llformat( "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner);
output_stream << buffer;
output_stream << "\t\tcreator_id\t" << mCreator << "\n";
output_stream << "\t\towner_id\t" << mOwner << "\n";
output_stream << "\t\tlast_owner_id\t" << mLastOwner << "\n";
output_stream << "\t\tgroup_id\t" << mGroup << "\n";
mCreator.toString(uuid_str);
output_stream << "\t\tcreator_id\t" << uuid_str << "\n";
mOwner.toString(uuid_str);
output_stream << "\t\towner_id\t" << uuid_str << "\n";
mLastOwner.toString(uuid_str);
output_stream << "\t\tlast_owner_id\t" << uuid_str << "\n";
mGroup.toString(uuid_str);
output_stream << "\t\tgroup_id\t" << uuid_str << "\n";
if(mIsGroupOwned)
{

View File

@ -316,8 +316,8 @@ public:
BOOL importFile(LLFILE* fp);
BOOL exportFile(LLFILE* fp) const;
BOOL importStream(std::istream& input_stream);
BOOL exportStream(std::ostream& output_stream) const;
BOOL importLegacyStream(std::istream& input_stream);
BOOL exportLegacyStream(std::ostream& output_stream) const;
bool operator==(const LLPermissions &rhs) const;
bool operator!=(const LLPermissions &rhs) const;

View File

@ -81,13 +81,15 @@ U32 LLSaleInfo::getCRC32() const
BOOL LLSaleInfo::exportFile(LLFILE* fp) const
{
llofstream ofs(fp);
return exportStream(ofs);
fprintf(fp, "\tsale_info\t0\n\t{\n");
fprintf(fp, "\t\tsale_type\t%s\n", lookup(mSaleType));
fprintf(fp, "\t\tsale_price\t%d\n", mSalePrice);
fprintf(fp,"\t}\n");
return TRUE;
}
BOOL LLSaleInfo::exportStream(std::ostream& output_stream) const
BOOL LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
{
if (!output_stream.good()) return FALSE;
output_stream << "\tsale_info\t0\n\t{\n";
output_stream << "\t\tsale_type\t" << lookup(mSaleType) << "\n";
output_stream << "\t\tsale_price\t" << mSalePrice << "\n";
@ -131,40 +133,25 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask)
// because I can't find any non-test code references to it. 2009-05-04 JC
BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask)
{
llifstream ifs(fp);
return importStream(ifs, has_perm_mask, perm_mask);
}
BOOL LLSaleInfo::importStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask)
{
has_perm_mask = FALSE;
const S32 BUFSIZE = 16384;
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[BUFSIZE]; /* Flawfinder: ignore */
char keyword[255]; /* Flawfinder: ignore */
char valuestr[255]; /* Flawfinder: ignore */
char buffer[MAX_STRING]; /* Flawfinder: ignore */
char keyword[MAX_STRING]; /* Flawfinder: ignore */
char valuestr[MAX_STRING]; /* Flawfinder: ignore */
BOOL success = TRUE;
keyword[0] = '\0';
valuestr[0] = '\0';
while(input_stream.good())
while(success && (!feof(fp)))
{
input_stream.getline(buffer, MAX_STRING);
if (input_stream.eof())
if (fgets(buffer, MAX_STRING, fp) == NULL)
{
llwarns << "Bad sale info: early end of input stream"
<< llendl;
return FALSE;
}
if (input_stream.fail())
{
llwarns << "Bad sale info: failed to read from input stream"
<< llendl;
return FALSE;
buffer[0] = '\0';
}
sscanf( /* Flawfinder: ignore */
buffer,
" %254s %254s",
@ -202,7 +189,63 @@ BOOL LLSaleInfo::importStream(std::istream& input_stream, BOOL& has_perm_mask, U
<< "' in sale info import" << llendl;
}
}
return TRUE;
return success;
}
BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask)
{
has_perm_mask = FALSE;
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[MAX_STRING]; /* Flawfinder: ignore */
char keyword[MAX_STRING]; /* Flawfinder: ignore */
char valuestr[MAX_STRING]; /* Flawfinder: ignore */
BOOL success = TRUE;
keyword[0] = '\0';
valuestr[0] = '\0';
while(success && input_stream.good())
{
input_stream.getline(buffer, MAX_STRING);
sscanf( /* Flawfinder: ignore */
buffer,
" %254s %254s",
keyword, valuestr);
if(!keyword[0])
{
continue;
}
if(0 == strcmp("{",keyword))
{
continue;
}
if(0 == strcmp("}", keyword))
{
break;
}
else if(0 == strcmp("sale_type", keyword))
{
mSaleType = lookup(valuestr);
}
else if(0 == strcmp("sale_price", keyword))
{
sscanf(valuestr, "%d", &mSalePrice);
mSalePrice = llclamp(mSalePrice, 0, S32_MAX);
}
else if (!strcmp("perm_mask", keyword))
{
//llinfos << "found deprecated keyword perm_mask" << llendl;
has_perm_mask = TRUE;
sscanf(valuestr, "%x", &perm_mask);
}
else
{
llwarns << "unknown keyword '" << keyword
<< "' in sale info import" << llendl;
}
}
return success;
}
void LLSaleInfo::setSalePrice(S32 price)

View File

@ -89,11 +89,11 @@ public:
BOOL exportFile(LLFILE* fp) const;
BOOL importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask);
BOOL exportStream(std::ostream& output_stream) const;
BOOL exportLegacyStream(std::ostream& output_stream) const;
LLSD asLLSD() const;
operator LLSD() const { return asLLSD(); }
bool fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask);
BOOL importStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask);
BOOL importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask);
LLSD packMessage() const;
void unpackMessage(LLSD sales);

0
indra/llmath/CMakeLists.txt Executable file → Normal file
View File

View File

@ -44,10 +44,6 @@ namespace LLAvatarNameCache
{
use_display_name_signal_t mUseDisplayNamesSignal;
// Manual override for display names - can disable even if the region
// supports it.
bool sUseDisplayNames = true;
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
// RLVa override for display names
bool sForceDisplayNames = false;
@ -57,18 +53,22 @@ namespace LLAvatarNameCache
// current region supports display names.
bool sRunning = false;
// Use the People API (modern) for fetching name if true. Use the old legacy protocol if false.
// For testing, there's a UsePeopleAPI setting that can be flipped (must restart viewer).
bool sUsePeopleAPI = true;
// Base lookup URL for name service.
// On simulator, loaded from indra.xml
// On viewer, usually a simulator capability (at People API team's request)
// Includes the trailing slash, like "http://pdp60.lindenlab.com:8000/agents/"
std::string sNameLookupURL;
// accumulated agent IDs for next query against service
// Accumulated agent IDs for next query against service
typedef std::set<LLUUID> ask_queue_t;
ask_queue_t sAskQueue;
// agent IDs that have been requested, but with no reply
// maps agent ID to frame time request was made
// Agent IDs that have been requested, but with no reply.
// Maps agent ID to frame time request was made.
typedef std::map<LLUUID, F64> pending_queue_t;
pending_queue_t sPendingQueue;
@ -79,21 +79,21 @@ namespace LLAvatarNameCache
typedef std::map<LLUUID, callback_signal_t*> signal_map_t;
signal_map_t sSignalMap;
// names we know about
// The cache at last, i.e. avatar names we know about.
typedef std::map<LLUUID, LLAvatarName> cache_t;
cache_t sCache;
// Send bulk lookup requests a few times a second at most
// only need per-frame timing resolution
// Send bulk lookup requests a few times a second at most.
// Only need per-frame timing resolution.
LLFrameTimer sRequestTimer;
/// Maximum time an unrefreshed cache entry is allowed
// Maximum time an unrefreshed cache entry is allowed.
const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0;
/// Time when unrefreshed cached names were checked last
// Time when unrefreshed cached names were checked last.
static F64 sLastExpireCheck;
/// Time-to-live for a temp cache entry.
// Time-to-live for a temp cache entry.
const F64 TEMP_CACHE_ENTRY_LIFETIME = 60.0;
//-----------------------------------------------------------------------
@ -101,26 +101,21 @@ namespace LLAvatarNameCache
//-----------------------------------------------------------------------
// Handle name response off network.
// Optionally skip adding to cache, used when this is a fallback to the
// legacy name system.
void processName(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool add_to_cache);
const LLAvatarName& av_name);
void requestNamesViaCapability();
// Legacy name system callback
// Legacy name system callbacks
void legacyNameCallback(const LLUUID& agent_id,
const std::string& full_name,
bool is_group
);
bool is_group);
void legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group);
void requestNamesViaLegacy();
// Fill in an LLAvatarName with the legacy name data
void buildLegacyName(const std::string& full_name,
LLAvatarName* av_name);
// Do a single callback to a given slot
void fireSignal(const LLUUID& agent_id,
const callback_slot_t& slot,
@ -215,20 +210,11 @@ public:
// Use expiration time from header
av_name.mExpires = expires;
// Some avatars don't have explicit display names set
if (av_name.mDisplayName.empty())
{
av_name.mDisplayName = av_name.mUsername;
}
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << " "
<< "user '" << av_name.mUsername << "' "
<< "display '" << av_name.mDisplayName << "' "
<< "expires in " << expires - now << " seconds"
<< LL_ENDL;
LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << LL_ENDL;
av_name.dump();
// cache it and fire signals
LLAvatarNameCache::processName(agent_id, av_name, true);
LLAvatarNameCache::processName(agent_id, av_name);
}
// Same logic as error response case
@ -294,8 +280,7 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent "
<< agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback,
_1, _2, _3));
boost::bind(&LLAvatarNameCache::legacyNameFetch, _1, _2, _3));
}
else
{
@ -306,28 +291,23 @@ void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id)
LLAvatarNameCache::sPendingQueue.erase(agent_id);
LLAvatarName& av_name = existing->second;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent "
<< agent_id
<< "user '" << av_name.mUsername << "' "
<< "display '" << av_name.mDisplayName << "' "
<< "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds"
<< LL_ENDL;
av_name.mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME; // reset expiry time so we don't constantly rerequest.
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " << agent_id << LL_ENDL;
av_name.dump();
// Reset expiry time so we don't constantly rerequest.
av_name.setExpires(TEMP_CACHE_ENTRY_LIFETIME);
}
}
void LLAvatarNameCache::processName(const LLUUID& agent_id,
const LLAvatarName& av_name,
bool add_to_cache)
void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name)
{
if (add_to_cache)
{
sCache[agent_id] = av_name;
}
// Add to the cache
sCache[agent_id] = av_name;
// Suppress request from the queue
sPendingQueue.erase(agent_id);
// signal everyone waiting on this name
// Signal everyone waiting on this name
signal_map_t::iterator sig_it = sSignalMap.find(agent_id);
if (sig_it != sSignalMap.end())
{
@ -404,22 +384,33 @@ void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
// Construct a dummy record for this name. By convention, SLID is blank
// Never expires, but not written to disk, so lasts until end of session.
LLAvatarName av_name;
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameCallback "
<< "agent " << agent_id << " "
<< "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" )
<< LL_ENDL;
buildLegacyName(full_name, &av_name);
// Put the received data in the cache
legacyNameFetch(agent_id, full_name, is_group);
// Retrieve the name and set it to never (or almost never...) expire: when we are using the legacy
// protocol, we do not get an expiration date for each name and there's no reason to ask the
// data again and again so we set the expiration time to the largest value admissible.
std::map<LLUUID,LLAvatarName>::iterator av_record = sCache.find(agent_id);
LLAvatarName& av_name = av_record->second;
av_name.setExpires(MAX_UNREFRESHED_TIME);
}
// Add to cache, because if we don't we'll keep rerequesting the
// same record forever. buildLegacyName should always guarantee
// that these records expire reasonably soon
// (in TEMP_CACHE_ENTRY_LIFETIME seconds), so if the failure was due
// to something temporary we will eventually request and get the right data.
processName(agent_id, av_name, true);
void LLAvatarNameCache::legacyNameFetch(const LLUUID& agent_id,
const std::string& full_name,
bool is_group)
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameFetch "
<< "agent " << agent_id << " "
<< "full name '" << full_name << "'"
<< ( is_group ? " [group]" : "" )
<< LL_ENDL;
// Construct an av_name record from this name.
LLAvatarName av_name;
av_name.fromString(full_name);
// Add to cache: we're still using the new cache even if we're using the old (legacy) protocol.
processName(agent_id, av_name);
}
void LLAvatarNameCache::requestNamesViaLegacy()
@ -441,20 +432,19 @@ void LLAvatarNameCache::requestNamesViaLegacy()
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL;
gCacheName->get(agent_id, false, // legacy compatibility
boost::bind(&LLAvatarNameCache::legacyNameCallback,
_1, _2, _3));
boost::bind(&LLAvatarNameCache::legacyNameCallback, _1, _2, _3));
}
}
void LLAvatarNameCache::initClass(bool running)
void LLAvatarNameCache::initClass(bool running, bool usePeopleAPI)
{
sRunning = running;
//[Caching DN : SJ] Check if caching names is running
llinfos << "Caching DN : sRunning = " << sRunning << llendl;
sUsePeopleAPI = usePeopleAPI;
}
void LLAvatarNameCache::cleanupClass()
{
sCache.clear();
}
void LLAvatarNameCache::importFile(std::istream& istr)
@ -495,7 +485,7 @@ void LLAvatarNameCache::exportFile(std::ostream& ostr)
const LLUUID& agent_id = it->first;
const LLAvatarName& av_name = it->second;
// Do not write temporary or expired entries to the stored cache
if (!av_name.mIsTemporaryName && av_name.mExpires >= max_unrefreshed)
if (av_name.isValidName(max_unrefreshed))
{
// key must be a string
agents[agent_id.asString()] = av_name.asLLSD();
@ -516,6 +506,11 @@ bool LLAvatarNameCache::hasNameLookupURL()
return !sNameLookupURL.empty();
}
bool LLAvatarNameCache::usePeopleAPI()
{
return hasNameLookupURL() && sUsePeopleAPI;
}
void LLAvatarNameCache::idle()
{
// By convention, start running at first idle() call
@ -532,13 +527,12 @@ void LLAvatarNameCache::idle()
if (!sAskQueue.empty())
{
if (useDisplayNames())
if (usePeopleAPI())
{
requestNamesViaCapability();
}
else
{
// ...fall back to legacy name cache system
requestNamesViaLegacy();
}
}
@ -586,7 +580,7 @@ void LLAvatarNameCache::eraseUnrefreshed()
if (av_name.mExpires < max_unrefreshed)
{
LL_DEBUGS("AvNameCache") << it->first
<< " user '" << av_name.mUsername << "' "
<< " user '" << av_name.getAccountName() << "' "
<< "expired " << now - av_name.mExpires << " secs ago"
<< LL_ENDL;
sCache.erase(it++);
@ -600,46 +594,6 @@ void LLAvatarNameCache::eraseUnrefreshed()
}
}
void LLAvatarNameCache::buildLegacyName(const std::string& full_name,
LLAvatarName* av_name)
{
llassert(av_name);
av_name->mUsername = "";
av_name->mDisplayName = full_name;
av_name->mIsDisplayNameDefault = true;
av_name->mIsTemporaryName = true;
av_name->mExpires = LLFrameTimer::getTotalSeconds() + TEMP_CACHE_ENTRY_LIFETIME;
// <FS:Ansariel> Please leave this when merging! In case no display names
// are used, you would have to retrieve mDisplayName to get
// the legacy name - something that absolutely makes no
// sense. And getLegacyName(), which is supposed to return
// the legacy name, returns an empty string. By adding the
// next two lines, getLegacyName() will function properly
// in either display name or no display name case.
std::istringstream fname(full_name);
fname >> av_name->mLegacyFirstName >> av_name->mLegacyLastName;
// </FS:Ansariel>
// <FS:Ansariel> Also fill username for in case of disabled display names.
// We need this for instance for FIRE-4297
if (LLCacheName::sDontTrimLegacyNames && av_name->mLegacyLastName == "Resident")
{
av_name->mUsername = av_name->mLegacyFirstName;
}
else
{
av_name->mUsername = full_name;
}
LLStringUtil::toLower(av_name->mUsername);
LLStringUtil::replaceChar(av_name->mUsername, ' ', '.');
// </FS:Ansariel>
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName "
<< full_name
<< LL_ENDL;
}
// fills in av_name if it has it in the cache, even if expired (can check expiry time)
// returns bool specifying if av_name was filled, false otherwise
bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
@ -647,45 +601,31 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name)
if (sRunning)
{
// ...only do immediate lookups when cache is running
if (useDisplayNames())
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{
// ...use display names cache
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
*av_name = it->second;
if(LGGContactSets::getInstance()->hasPseudonym(agent_id))
{
*av_name = it->second;
if(LGGContactSets::getInstance()->hasPseudonym(agent_id))
{
LLSD info = av_name->asLLSD();
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)?(info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString()) : LGGContactSets::getInstance()->getPseudonym(agent_id);
av_name->fromLLSD(info);
}
LLSD info = av_name->asLLSD();
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)?(info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString()) : LGGContactSets::getInstance()->getPseudonym(agent_id);
av_name->fromLLSD(info);
}
// re-request name if entry is expired
if (av_name->mExpires < LLFrameTimer::getTotalSeconds())
{
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
}
return true;
}
}
else
{
// ...use legacy names cache
std::string full_name;
if (gCacheName->getFullName(agent_id, full_name))
// re-request name if entry is expired
if (av_name->mExpires < LLFrameTimer::getTotalSeconds())
{
buildLegacyName(full_name, av_name);
return true;
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get "
<< "refresh agent " << agent_id
<< LL_ENDL;
sAskQueue.insert(agent_id);
}
}
return true;
}
}
@ -716,68 +656,37 @@ LLAvatarNameCache::callback_connection_t LLAvatarNameCache::get(const LLUUID& ag
if (sRunning)
{
// ...only do immediate lookups when cache is running
if (useDisplayNames())
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{
LL_DEBUGS("AvNameCache") << "DN cache lookup for " << agent_id << llendl;
// ...use new cache
std::map<LLUUID,LLAvatarName>::iterator it = sCache.find(agent_id);
if (it != sCache.end())
{
LLAvatarName& av_name = it->second;
LLSD test = av_name.asLLSD();
LL_DEBUGS("AvNameCache") << "DN cache hit for :" << test["display_name"].asString()+" (" + test["legacy_first_name"].asString()+" "+test["legacy_last_name"].asString()+")" << llendl;
if(LGGContactSets::getInstance()->hasPseudonym(agent_id))
{
LL_DEBUGS("AvNameCache") << "DN cache hit via alias" << llendl;
LLSD info = av_name.asLLSD();
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)?(info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString()) : LGGContactSets::getInstance()->getPseudonym(agent_id);
av_name.fromLLSD(info);
}
if (av_name.mExpires > LLFrameTimer::getTotalSeconds())
{
// ...name already exists in cache, fire callback now
LL_DEBUGS("AvNameCache") << "DN cache hit valid" << llendl;
fireSignal(agent_id, slot, av_name);
return connection;
}
LLAvatarName& av_name = it->second;
LLSD test = av_name.asLLSD();
LL_DEBUGS("AvNameCache") << "DN cache hit for :" << test["display_name"].asString()+" (" + test["legacy_first_name"].asString()+" "+test["legacy_last_name"].asString()+")" << llendl;
// If we get here, our DN is expired.
//Consider it a cache miss, handle as if sRunning was false.
LL_DEBUGS("AvNameCache") << "DN cache hit expired. " << av_name.mExpires << " vs. " << LLFrameTimer::getTotalSeconds() << llendl;
}
//If we get here, cache miss. We'll schedule it below
}
else
{
// ...use old name system
std::string full_name;
if (gCacheName->getFullName(agent_id, full_name))
if(LGGContactSets::getInstance()->hasPseudonym(agent_id))
{
LLAvatarName av_name;
buildLegacyName(full_name, &av_name);
LL_DEBUGS("AvNameCache") << "DN cache hit via alias" << llendl;
LLSD info = av_name.asLLSD();
info["is_display_name_default"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id);
info["display_name"] = LGGContactSets::getInstance()->hasDisplayNameRemoved(agent_id)?(info["legacy_first_name"].asString() + " " + info["legacy_last_name"].asString()) : LGGContactSets::getInstance()->getPseudonym(agent_id);
av_name.fromLLSD(info);
}
if (av_name.mExpires > LLFrameTimer::getTotalSeconds())
{
// ...name already exists in cache, fire callback now
fireSignal(agent_id, slot, av_name);
return connection;
}
}
}
// schedule a request
if (!isRequestPending(agent_id))
{
LL_DEBUGS("AvNameCache") << "DN scheduling lookup for" << agent_id << llendl;
sAskQueue.insert(agent_id);
}
else
{
LL_DEBUGS("AvNameCache") << "DN lookup for " << agent_id << " already in progress. Returning." << llendl;
}
// always store additional callback, even if request is pending
signal_map_t::iterator sig_it = sSignalMap.find(agent_id);
if (sig_it == sSignalMap.end())
@ -806,9 +715,9 @@ bool LLAvatarNameCache::getForceDisplayNames()
void LLAvatarNameCache::setForceDisplayNames(bool force)
{
sForceDisplayNames = force;
if ( (!sUseDisplayNames) && (force) )
if ( (!LLAvatarName::useDisplayNames()) && (force) )
{
setUseDisplayNames(true);
LLAvatarName::setUseDisplayNames(true);
}
}
// [/RLVa:KB]
@ -819,22 +728,14 @@ void LLAvatarNameCache::setUseDisplayNames(bool use)
// We need to force the use of the "display names" cache when @shownames=n restricted (and disallow toggling it)
use |= getForceDisplayNames();
// [/RLVa:KB]
if (use != sUseDisplayNames)
{
sUseDisplayNames = use;
// flush our cache
sCache.clear();
if (use != LLAvatarName::useDisplayNames())
{
LLAvatarName::setUseDisplayNames(use);
mUseDisplayNamesSignal();
}
}
bool LLAvatarNameCache::useDisplayNames()
{
// Must be both manually set on and able to look up names.
return sUseDisplayNames && !sNameLookupURL.empty();
}
// <FS:CR> FIRE-6659: Legacy "Resident" name toggle
void LLAvatarNameCache::clear()
{

View File

@ -37,33 +37,33 @@ class LLUUID;
namespace LLAvatarNameCache
{
typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
// Until the cache is set running, immediate lookups will fail and
// async lookups will be queued. This allows us to block requests
// until we know if the first region supports display names.
void initClass(bool running);
void initClass(bool running, bool usePeopleAPI);
void cleanupClass();
// Import/export the name cache to file.
void importFile(std::istream& istr);
void exportFile(std::ostream& ostr);
// On the viewer, usually a simulator capabilitity
// If empty, name cache will fall back to using legacy name
// lookup system
// On the viewer, usually a simulator capabilitity.
// If empty, name cache will fall back to using legacy name lookup system.
void setNameLookupURL(const std::string& name_lookup_url);
// Do we have a valid lookup URL, hence are we trying to use the
// new display name lookup system?
// Do we have a valid lookup URL, i.e. are we trying to use the
// more recent display name lookup system?
bool hasNameLookupURL();
bool usePeopleAPI();
// Periodically makes a batch request for display names not already in
// cache. Call once per frame.
// cache. Called once per frame.
void idle();
// If name is in cache, returns true and fills in provided LLAvatarName
// otherwise returns false
// otherwise returns false.
bool get(const LLUUID& agent_id, LLAvatarName *av_name);
// Callback types for get() below
@ -73,13 +73,19 @@ namespace LLAvatarNameCache
typedef callback_signal_t::slot_type callback_slot_t;
typedef boost::signals2::connection callback_connection_t;
// Fetches name information and calls callback.
// If name information is in cache, callback will be called immediately.
// Fetches name information and calls callbacks.
// If name information is in cache, callbacks will be called immediately.
callback_connection_t get(const LLUUID& agent_id, callback_slot_t slot);
// Allow display names to be explicitly disabled for testing.
// Set display name: flips the switch and triggers the callbacks.
void setUseDisplayNames(bool use);
bool useDisplayNames();
void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
bool getForceDisplayNames();
void setForceDisplayNames(bool force);
// [/RLVa:KB]
// [RLVa:KB] - Checked: 2010-12-08 (RLVa-1.4.0a) | Added: RLVa-1.2.2c
bool getForceDisplayNames();
@ -91,15 +97,13 @@ namespace LLAvatarNameCache
// </FS:CR> FIRE-6659: Legacy "Resident" name toggle
void erase(const LLUUID& agent_id);
/// Provide some fallback for agents that return errors
/// Provide some fallback for agents that return errors.
void handleAgentError(const LLUUID& agent_id);
// Force a re-fetch of the most recent data, but keep the current
// data in cache
void fetch(const LLUUID& agent_id); // FS:TM used in LGGContactSets
void insert(const LLUUID& agent_id, const LLAvatarName& av_name);
// Compute name expiration time from HTTP Cache-Control header,
// or return default value, in seconds from epoch.
F64 nameExpirationFromHeaders(LLSD headers);

View File

@ -566,6 +566,7 @@ std::string LLCacheName::cleanFullName(const std::string& full_name)
}
//static
// Transform hard-coded name provided by server to a more legible username
std::string LLCacheName::buildUsername(const std::string& full_name)
{
// rare, but handle hard-coded error names returned from server
@ -605,8 +606,9 @@ std::string LLCacheName::buildUsername(const std::string& full_name)
return username;
}
// if the input wasn't a correctly formatted legacy name just return it unchanged
return full_name;
// if the input wasn't a correctly formatted legacy name, just return it
// cleaned up from a potential terminal "Resident"
return cleanFullName(full_name);
}
//static

View File

@ -40,7 +40,7 @@ typedef boost::signals2::signal<void (const LLUUID& id,
bool is_group)> LLCacheNameSignal;
typedef LLCacheNameSignal::slot_type LLCacheNameCallback;
// Old callback with user data for compatability
// Old callback with user data for compatibility
typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*);
// Here's the theory:

View File

@ -156,18 +156,6 @@ const S32 DB_USER_SKILLS_BUF_SIZE = 255;
const S32 DB_NV_NAME_STR_LEN = 128;
const S32 DB_NV_NAME_BUF_SIZE = 129;
// votes.vote_text varchar(254)
const S32 DB_VOTE_TEXT_STR_LEN = 254;
const S32 DB_VOTE_TEXT_BUF_SIZE = 255;
// vpte type text varchar(9)
const S32 DB_VOTE_TYPE_STR_LEN = 9;
const S32 DB_VOTE_TYPE_BUF_SIZE = 10;
// vote result text
const S32 DB_VOTE_RESULT_BUF_LEN = 8;
const S32 DB_VOTE_RESULT_BUF_SIZE = 9;
// user_start_location.location_name varchar(254)
const S32 DB_START_LOCATION_STR_LEN = 254;
const S32 DB_START_LOCATION_BUF_SIZE = 255;

View File

@ -223,7 +223,11 @@ static void request(
{
if (!LLHTTPClient::hasPump())
{
responder->completed(U32_MAX, "No pump", LLSD());
if (responder)
{
responder->completed(U32_MAX, "No pump", LLSD());
}
delete body_injector;
return;
}
LLPumpIO::chain_t chain;
@ -231,8 +235,13 @@ static void request(
LLURLRequest* req = new LLURLRequest(method, url);
if(!req->isValid())//failed
{
delete req ;
return ;
if (responder)
{
responder->completed(498, "Internal Error - curl failure", LLSD());
}
delete req;
delete body_injector;
return;
}
req->setSSLVerifyCallback(LLHTTPClient::getCertVerifyCallback(), (void *)req);

View File

@ -43,8 +43,11 @@ void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr respo
void LLHTTPClientAdapter::get(const std::string& url, LLCurl::ResponderPtr responder, const LLSD& headers)
{
LLSD empty_pragma_header = headers;
// as above
empty_pragma_header["Pragma"] = " ";
if (!empty_pragma_header.has("Pragma"))
{
// as above
empty_pragma_header["Pragma"] = " ";
}
LLHTTPClient::get(url, responder, empty_pragma_header);
}

View File

@ -43,14 +43,6 @@
const U8 IM_ONLINE = 0;
const U8 IM_OFFLINE = 1;
const S32 VOTE_YES = 1;
const S32 VOTE_NO = 0;
const S32 VOTE_ABSTAIN = -1;
const S32 VOTE_MAJORITY = 0;
const S32 VOTE_SUPER_MAJORITY = 1;
const S32 VOTE_UNANIMOUS = 2;
const char EMPTY_BINARY_BUCKET[] = "";
const S32 EMPTY_BINARY_BUCKET_SIZE = 1;
const U32 NO_TIMESTAMP = 0;
@ -72,7 +64,6 @@ LLIMInfo::LLIMInfo() :
mViewerThinksToIsOnline(false),
mIMType(IM_NOTHING_SPECIAL),
mTimeStamp(0),
mSource(IM_FROM_SIM),
mTTL(IM_TTL)
{
}
@ -91,7 +82,6 @@ LLIMInfo::LLIMInfo(
LLSD data,
U8 offline,
U32 timestamp,
EIMSource source,
S32 ttl) :
mFromID(from_id),
mFromGroup(from_group),
@ -107,14 +97,12 @@ LLIMInfo::LLIMInfo(
mName(name),
mMessage(message),
mData(data),
mSource(source),
mTTL(ttl)
{
}
LLIMInfo::LLIMInfo(LLMessageSystem* msg, EIMSource source, S32 ttl) :
LLIMInfo::LLIMInfo(LLMessageSystem* msg, S32 ttl) :
mViewerThinksToIsOnline(false),
mSource(source),
mTTL(ttl)
{
unpackMessageBlock(msg);
@ -329,7 +317,6 @@ LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info)
param_message["region_id"] = im_info->mRegionID;
param_message["position"] = ll_sd_from_vector3(im_info->mPosition);
param_message["data"] = im_info->mData;
param_message["source"]= im_info->mSource;
param_message["ttl"] = im_info->mTTL;
LLSD param_agent;
@ -362,7 +349,6 @@ LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd)
param_message["data"],
(U8) param_message["offline"].asInteger(),
(U32) param_message["timestamp"].asInteger(),
(EIMSource)param_message["source"].asInteger(),
param_message["ttl"].asInteger());
return im_info;
@ -384,7 +370,6 @@ LLPointer<LLIMInfo> LLIMInfo::clone()
mData,
mOffline,
mTimeStamp,
mSource,
mTTL);
}

View File

@ -115,8 +115,8 @@ enum EInstantMessage
// viewer, since you can't IM an object yet.
IM_FROM_TASK = 19,
// sent an IM to a busy user, this is the auto response
IM_BUSY_AUTO_RESPONSE = 20,
// sent an IM to a do not disturb user, this is the auto response
IM_DO_NOT_DISTURB_AUTO_RESPONSE = 20,
// Shows the message in the console and chat history
IM_CONSOLE_AND_CHAT_HISTORY = 21,
@ -164,57 +164,9 @@ enum EInstantMessage
};
// Hooks for quickly hacking in experimental admin debug messages
// without needing to recompile the viewer
// *NOTE: This functionality has been moved to be a string based
// operation so that we don't even have to do a full recompile. This
// enumeration will be phased out soon.
enum EGodlikeRequest
{
GOD_WANTS_NOTHING,
// for requesting physics information about an object
GOD_WANTS_PHYSICS_INFO,
// two unused requests that can be appropriated for debug
// purposes (no viewer recompile necessary)
GOD_WANTS_FOO,
GOD_WANTS_BAR,
// to dump simulator terrain data to terrain.raw file
GOD_WANTS_TERRAIN_SAVE,
// to load simulator terrain data from terrain.raw file
GOD_WANTS_TERRAIN_LOAD,
GOD_WANTS_TOGGLE_AVATAR_GEOMETRY, // HACK for testing new avatar geom
// real-time telehub operations
GOD_WANTS_TELEHUB_INFO,
GOD_WANTS_CONNECT_TELEHUB,
GOD_WANTS_DELETE_TELEHUB,
GOD_WANTS_ADD_TELEHUB_SPAWNPOINT,
GOD_WANTS_REMOVE_TELEHUB_SPAWNPOINT,
};
enum EIMSource
{
IM_FROM_VIEWER,
IM_FROM_DATASERVER,
IM_FROM_SIM
};
extern const U8 IM_ONLINE;
extern const U8 IM_OFFLINE;
extern const S32 VOTE_YES;
extern const S32 VOTE_NO;
extern const S32 VOTE_ABSTAIN;
extern const S32 VOTE_MAJORITY;
extern const S32 VOTE_SUPER_MAJORITY;
extern const S32 VOTE_UNANIMOUS;
extern const char EMPTY_BINARY_BUCKET[];
extern const S32 EMPTY_BINARY_BUCKET_SIZE;
@ -237,7 +189,6 @@ protected:
public:
LLIMInfo(LLMessageSystem* msg,
EIMSource source = IM_FROM_SIM,
S32 ttl = IM_TTL);
LLIMInfo(
@ -254,7 +205,6 @@ public:
LLSD data,
U8 offline,
U32 timestamp,
EIMSource source,
S32 ttl = IM_TTL);
void packInstantMessage(LLMessageSystem* msg) const;
@ -277,7 +227,6 @@ public:
std::string mMessage;
LLSD mData;
EIMSource mSource;
S32 mTTL;
};

0
indra/llmessage/llurlrequest.cpp Executable file → Normal file
View File

0
indra/llprimitive/llprimitive.h Executable file → Normal file
View File

0
indra/llrender/llfontfreetype.cpp Executable file → Normal file
View File

View File

@ -598,6 +598,11 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
if(!fgi)
{
fgi = mFontFreetype->getGlyphInfo(wch);
if (NULL == fgi)
{
return 0;
}
}
// account for glyphs that run beyond the starting point for the next glyphs

View File

@ -57,8 +57,13 @@
BOOL gDebugSession = FALSE;
BOOL gDebugGL = FALSE;
BOOL gClothRipple = FALSE;
BOOL gHeadlessClient = FALSE;
BOOL gGLActive = FALSE;
static const std::string HEADLESS_VENDOR_STRING("Linden Lab");
static const std::string HEADLESS_RENDERER_STRING("Headless");
static const std::string HEADLESS_VERSION_STRING("1.0");
std::ofstream gFailLog;
#if GL_ARB_debug_output
@ -388,7 +393,7 @@ PFNGLACTIVETEXTUREARBPROC glActiveTextureARB = NULL;
PFNGLCLIENTACTIVETEXTUREARBPROC glClientActiveTextureARB = NULL;
PFNGLDRAWRANGEELEMENTSPROC glDrawRangeElements = NULL;
#endif // LL_LINUX_NV_GL_HEADERS
#endif // (LL_WINDOWS || LL_LINUX || LL_SOLARIS) && !LL_MESA_HEADLESS
#endif
LLGLManager gGLManager;
@ -592,12 +597,6 @@ bool LLGLManager::initGL()
if (mGLVendor.substr(0,4) == "ATI ")
{
mGLVendorShort = "ATI";
// "mobile" appears to be unused, and this code was causing warnings.
//BOOL mobile = FALSE;
//if (mGLRenderer.find("MOBILITY") != std::string::npos)
//{
// mobile = TRUE;
//}
mIsATI = TRUE;
#if LL_WINDOWS && !LL_MESA_HEADLESS
@ -786,9 +785,19 @@ void LLGLManager::setToDebugGPU()
void LLGLManager::getGLInfo(LLSD& info)
{
info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR));
info["GLInfo"]["GLRenderer"] = std::string((const char *)glGetString(GL_RENDERER));
info["GLInfo"]["GLVersion"] = std::string((const char *)glGetString(GL_VERSION));
if (gHeadlessClient)
{
info["GLInfo"]["GLVendor"] = HEADLESS_VENDOR_STRING;
info["GLInfo"]["GLRenderer"] = HEADLESS_RENDERER_STRING;
info["GLInfo"]["GLVersion"] = HEADLESS_VERSION_STRING;
return;
}
else
{
info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR));
info["GLInfo"]["GLRenderer"] = std::string((const char *)glGetString(GL_RENDERER));
info["GLInfo"]["GLVersion"] = std::string((const char *)glGetString(GL_VERSION));
}
#if !LL_MESA_HEADLESS
std::string all_exts = ll_safe_string((const char *)gGLHExts.mSysExts);
@ -805,9 +814,18 @@ std::string LLGLManager::getGLInfoString()
{
std::string info_str;
info_str += std::string("GL_VENDOR ") + ll_safe_string((const char *)glGetString(GL_VENDOR)) + std::string("\n");
info_str += std::string("GL_RENDERER ") + ll_safe_string((const char *)glGetString(GL_RENDERER)) + std::string("\n");
info_str += std::string("GL_VERSION ") + ll_safe_string((const char *)glGetString(GL_VERSION)) + std::string("\n");
if (gHeadlessClient)
{
info_str += std::string("GL_VENDOR ") + HEADLESS_VENDOR_STRING + std::string("\n");
info_str += std::string("GL_RENDERER ") + HEADLESS_RENDERER_STRING + std::string("\n");
info_str += std::string("GL_VERSION ") + HEADLESS_VERSION_STRING + std::string("\n");
}
else
{
info_str += std::string("GL_VENDOR ") + ll_safe_string((const char *)glGetString(GL_VENDOR)) + std::string("\n");
info_str += std::string("GL_RENDERER ") + ll_safe_string((const char *)glGetString(GL_RENDERER)) + std::string("\n");
info_str += std::string("GL_VERSION ") + ll_safe_string((const char *)glGetString(GL_VERSION)) + std::string("\n");
}
#if !LL_MESA_HEADLESS
std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts));
@ -820,9 +838,18 @@ std::string LLGLManager::getGLInfoString()
void LLGLManager::printGLInfoString()
{
LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL;
LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL;
LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL;
if (gHeadlessClient)
{
LL_INFOS("RenderInit") << "GL_VENDOR: " << HEADLESS_VENDOR_STRING << LL_ENDL;
LL_INFOS("RenderInit") << "GL_RENDERER: " << HEADLESS_RENDERER_STRING << LL_ENDL;
LL_INFOS("RenderInit") << "GL_VERSION: " << HEADLESS_VERSION_STRING << LL_ENDL;
}
else
{
LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL;
LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL;
LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL;
}
#if !LL_MESA_HEADLESS
std::string all_exts= ll_safe_string(((const char *)gGLHExts.mSysExts));
@ -834,7 +861,14 @@ void LLGLManager::printGLInfoString()
std::string LLGLManager::getRawGLString()
{
std::string gl_string;
gl_string = ll_safe_string((char*)glGetString(GL_VENDOR)) + " " + ll_safe_string((char*)glGetString(GL_RENDERER));
if (gHeadlessClient)
{
gl_string = HEADLESS_VENDOR_STRING + " " + HEADLESS_RENDERER_STRING;
}
else
{
gl_string = ll_safe_string((char*)glGetString(GL_VENDOR)) + " " + ll_safe_string((char*)glGetString(GL_RENDERER));
}
return gl_string;
}
@ -900,7 +934,7 @@ void LLGLManager::initExtensions()
mHasCubeMap = FALSE;
mHasOcclusionQuery = FALSE;
mHasPointParameters = FALSE;
mHasShaderObjects = TRUE;
mHasShaderObjects = FALSE;
mHasVertexShader = FALSE;
mHasFragmentShader = FALSE;
mHasTextureRectangle = FALSE;
@ -1452,8 +1486,8 @@ void assert_glerror()
void clear_glerror()
{
// Create or update texture to be used with this data
glGetError();
glGetError();
glGetError();
}
///////////////////////////////////////////////////////////////
@ -1952,10 +1986,7 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) :
if (mState)
{
mWasEnabled = sStateMap[state];
if (gDebugGL)
{
llassert(mWasEnabled == glIsEnabled(state));
}
llassert(mWasEnabled == glIsEnabled(state));
setEnabled(enabled);
stop_glerror();
}

View File

@ -457,6 +457,7 @@ void init_glstates();
void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor_specific, std::string* version_string );
extern BOOL gClothRipple;
extern BOOL gHeadlessClient;
extern BOOL gGLActive;
// Deal with changing glext.h definitions for newer SDK versions, specifically

View File

@ -913,31 +913,31 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
{
if (!LLGLSLShader::sNoFixedFunction)
{
// Initialize the first time this is called.
const S32 PIXELS = 32;
static GLubyte checkerboard[PIXELS * PIXELS];
static BOOL first = TRUE;
if( first )
// Initialize the first time this is called.
const S32 PIXELS = 32;
static GLubyte checkerboard[PIXELS * PIXELS];
static BOOL first = TRUE;
if( first )
{
for( S32 i = 0; i < PIXELS; i++ )
{
for( S32 i = 0; i < PIXELS; i++ )
for( S32 j = 0; j < PIXELS; j++ )
{
for( S32 j = 0; j < PIXELS; j++ )
{
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
}
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
}
first = FALSE;
}
first = FALSE;
}
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
// ...white squares
gGL.color4f( 1.f, 1.f, 1.f, alpha );
gl_rect_2d(rect);
// ...white squares
gGL.color4f( 1.f, 1.f, 1.f, alpha );
gl_rect_2d(rect);
// ...gray squares
gGL.color4f( .7f, .7f, .7f, alpha );
gGL.flush();
// ...gray squares
gGL.color4f( .7f, .7f, .7f, alpha );
gGL.flush();
glPolygonStipple( checkerboard );
@ -1413,145 +1413,132 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
gGL.popUIMatrix();
}
void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width,
const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec,
const U32 edges)
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect,
const LLVector3& width_vec, const LLVector3& height_vec)
{
LLVector3 left_border_width = ((edges & (~(U32)ROUNDED_RECT_RIGHT)) != 0) ? border_width : LLVector3::zero;
LLVector3 right_border_width = ((edges & (~(U32)ROUNDED_RECT_LEFT)) != 0) ? border_width : LLVector3::zero;
LLVector3 top_border_height = ((edges & (~(U32)ROUNDED_RECT_BOTTOM)) != 0) ? border_height : LLVector3::zero;
LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero;
gGL.begin(LLRender::QUADS);
{
// draw bottom left
gGL.texCoord2f(0.f, 0.f);
gGL.texCoord2f(clip_rect.mLeft, clip_rect.mBottom);
gGL.vertex3f(0.f, 0.f, 0.f);
gGL.texCoord2f(border_scale.mV[VX], 0.f);
gGL.vertex3fv(left_border_width.mV);
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(0.f, border_scale.mV[VY]);
gGL.vertex3fv(bottom_border_height.mV);
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV);
// draw bottom middle
gGL.texCoord2f(border_scale.mV[VX], 0.f);
gGL.vertex3fv(left_border_width.mV);
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 0.f);
gGL.vertex3fv((width_vec - right_border_width).mV);
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
// draw bottom right
gGL.texCoord2f(1.f - border_scale.mV[VX], 0.f);
gGL.vertex3fv((width_vec - right_border_width).mV);
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec).mV);
gGL.texCoord2f(1.f, 0.f);
gGL.texCoord2f(clip_rect.mRight, clip_rect.mBottom);
gGL.vertex3fv(width_vec.mV);
gGL.texCoord2f(1.f, border_scale.mV[VY]);
gGL.vertex3fv((width_vec + bottom_border_height).mV);
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
// draw left
gGL.texCoord2f(0.f, border_scale.mV[VY]);
gGL.vertex3fv(bottom_border_height.mV);
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(0.f, 1.f - border_scale.mV[VY]);
gGL.vertex3fv((height_vec - top_border_height).mV);
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV);
// draw middle
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
// draw right
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(1.f, border_scale.mV[VY]);
gGL.vertex3fv((width_vec + bottom_border_height).mV);
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom);
gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV);
gGL.texCoord2f(1.f, 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec + height_vec - top_border_height).mV);
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
// draw top left
gGL.texCoord2f(0.f, 1.f - border_scale.mV[VY]);
gGL.vertex3fv((height_vec - top_border_height).mV);
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], 1.f);
gGL.vertex3fv((left_border_width + height_vec).mV);
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV);
gGL.texCoord2f(0.f, 1.f);
gGL.texCoord2f(clip_rect.mLeft, clip_rect.mTop);
gGL.vertex3fv((height_vec).mV);
// draw top middle
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f);
gGL.vertex3fv((width_vec - right_border_width + height_vec).mV);
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV);
gGL.texCoord2f(border_scale.mV[VX], 1.f);
gGL.vertex3fv((left_border_width + height_vec).mV);
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop);
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV);
// draw top right
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(1.f, 1.f - border_scale.mV[VY]);
gGL.vertex3fv((width_vec + height_vec - top_border_height).mV);
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop);
gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV);
gGL.texCoord2f(1.f, 1.f);
gGL.texCoord2f(clip_rect.mRight, clip_rect.mTop);
gGL.vertex3fv((width_vec + height_vec).mV);
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f);
gGL.vertex3fv((width_vec - right_border_width + height_vec).mV);
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop);
gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV);
}
gGL.end();
}
void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec)
{
gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP);
}
// static
void LLRender2D::initClass(LLImageProviderInterface* image_provider,
const LLVector2* scale_factor)

View File

@ -106,8 +106,7 @@ typedef enum e_rounded_edge
void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const U32 edges = ROUNDED_RECT_ALL);
void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL);
void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec, U32 edges = ROUNDED_RECT_ALL);
void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec);
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect, const LLVector3& width_vec, const LLVector3& height_vec);
inline void gl_rect_2d( const LLRect& rect, BOOL filled )
{

View File

@ -112,6 +112,50 @@ void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4&
drawSolid(border_rect, color);
}
void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, const LLVector3& y_axis,
const LLRect& rect, const LLColor4& color)
{
F32 border_scale = 1.f;
F32 border_height = (1.f - mScaleRegion.getHeight()) * getHeight();
F32 border_width = (1.f - mScaleRegion.getWidth()) * getWidth();
if (rect.getHeight() < border_height || rect.getWidth() < border_width)
{
if(border_height - rect.getHeight() > border_width - rect.getWidth())
{
border_scale = (F32)rect.getHeight() / border_height;
}
else
{
border_scale = (F32)rect.getWidth() / border_width;
}
}
LLRender2D::pushMatrix();
{
LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis);
LLRender2D::translate(rect_origin.mV[VX],
rect_origin.mV[VY],
rect_origin.mV[VZ]);
gGL.getTexUnit(0)->bind(getImage());
gGL.color4fv(color.mV);
LLRectf center_uv_rect(mClipRegion.mLeft + mScaleRegion.mLeft * mClipRegion.getWidth(),
mClipRegion.mBottom + mScaleRegion.mTop * mClipRegion.getHeight(),
mClipRegion.mLeft + mScaleRegion.mRight * mClipRegion.getWidth(),
mClipRegion.mBottom + mScaleRegion.mBottom * mClipRegion.getHeight());
gl_segmented_rect_3d_tex(mClipRegion,
center_uv_rect,
LLRectf(border_width * border_scale * 0.5f / (F32)rect.getWidth(),
(rect.getHeight() - (border_height * border_scale * 0.5f)) / (F32)rect.getHeight(),
(rect.getWidth() - (border_width * border_scale * 0.5f)) / (F32)rect.getWidth(),
(border_height * border_scale * 0.5f) / (F32)rect.getHeight()),
rect.getWidth() * x_axis,
rect.getHeight() * y_axis);
} LLRender2D::popMatrix();
}
S32 LLUIImage::getWidth() const
{
// return clipped dimensions of actual image area
@ -155,7 +199,7 @@ void LLUIImage::onImageLoaded()
namespace LLInitParam
{
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
void ParamValue<LLUIImage*>::updateValueFromBlock()
{
// The keyword "none" is specifically requesting a null image
// do not default to current value. Used to overwrite template images.
@ -172,7 +216,7 @@ namespace LLInitParam
}
}
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool make_block_authoritative)
void ParamValue<LLUIImage*>::updateBlockFromValue(bool make_block_authoritative)
{
if (getValue() == NULL)
{

View File

@ -64,7 +64,9 @@ public:
void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const;
void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); }
void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, getWidth(), getHeight(), color, border_width); }
void draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, const LLVector3& y_axis, const LLRect& rect, const LLColor4& color);
const std::string& getName() const { return mName; }
virtual S32 getWidth() const;
@ -92,7 +94,7 @@ protected:
namespace LLInitParam
{
template<>
class ParamValue<LLUIImage*, TypeValues<LLUIImage*> >
class ParamValue<LLUIImage*>
: public CustomParamValue<LLUIImage*>
{
typedef boost::add_reference<boost::add_const<LLUIImage*>::type>::type T_const_ref;
@ -100,7 +102,7 @@ namespace LLInitParam
public:
Optional<std::string> name;
ParamValue(LLUIImage* const& image)
ParamValue(LLUIImage* const& image = NULL)
: super_t(image)
{
updateBlockFromValue(false);

View File

@ -43,6 +43,7 @@ set(llui_SOURCE_FILES
llbadgeholder.cpp
llbadgeowner.cpp
llbutton.cpp
llchatentry.cpp
llcheckboxctrl.cpp
llclipboard.cpp
llcombobox.cpp
@ -56,12 +57,16 @@ set(llui_SOURCE_FILES
lleditmenuhandler.cpp
llf32uictrl.cpp
llfiltereditor.cpp
llflashtimer.cpp
llflatlistview.cpp
llfloater.cpp
llfloaterreg.cpp
llfloaterreglistener.cpp
llflyoutbutton.cpp
llfocusmgr.cpp
llfolderview.cpp
llfolderviewitem.cpp
llfolderviewmodel.cpp
llfunctorregistry.cpp
lliconctrl.cpp
llkeywords.cpp
@ -76,7 +81,6 @@ set(llui_SOURCE_FILES
llmultislider.cpp
llmultisliderctrl.cpp
llnotifications.cpp
llnotificationslistener.cpp
llnotificationsutil.cpp
llpanel.cpp
llprogressbar.cpp
@ -144,6 +148,7 @@ set(llui_HEADER_FILES
llbadgeowner.h
llbutton.h
llcallbackmap.h
llchatentry.h
llcheckboxctrl.h
llclipboard.h
llcombobox.h
@ -157,12 +162,16 @@ set(llui_HEADER_FILES
lleditmenuhandler.h
llf32uictrl.h
llfiltereditor.h
llflashtimer.h
llflatlistview.h
llfloater.h
llfloaterreg.h
llfloaterreglistener.h
llflyoutbutton.h
llfocusmgr.h
llfolderview.h
llfolderviewitem.h
llfolderviewmodel.h
llfunctorregistry.h
llhelp.h
lliconctrl.h
@ -180,7 +189,6 @@ set(llui_HEADER_FILES
llmultislider.h
llnotificationptr.h
llnotifications.h
llnotificationslistener.h
llnotificationsutil.h
llnotificationtemplate.h
llnotificationvisibilityrule.h

View File

@ -184,7 +184,7 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleFontStyle(std::string
if (mHeaderTextbox)
{
std::string text = mHeaderTextbox->getText();
mStyleParams.font(mHeaderTextbox->getDefaultFont());
mStyleParams.font(mHeaderTextbox->getFont());
mStyleParams.font.style(style);
mHeaderTextbox->setText(text, mStyleParams);
}

View File

@ -50,8 +50,6 @@
#include "llhelp.h"
#include "lldockablefloater.h"
#include "llcheckboxctrl.h" // <FS:Zi> Add checkbox control toggle
static LLDefaultChildRegistry::Register<LLButton> r("button");
// Compiler optimization, generate extern template
@ -62,9 +60,6 @@ template class LLButton* LLView::getChild<class LLButton>(
S32 LLBUTTON_H_PAD = 0;
S32 BTN_HEIGHT_SMALL= 0;
S32 BTN_HEIGHT = 0;
// [SL:KB] - Patch: UI-DndButtonCommit | Checked: 2011-06-19 (Catznip-2.6.0c) | Added: Catznip-2.6.0c
F32 DELAY_DRAG_HOVER_COMMIT = 0.5;
// [/SL:KB]
LLButton::Params::Params()
: label_selected("label_selected"), // requires is_toggle true
@ -110,12 +105,9 @@ LLButton::Params::Params()
badge("badge"),
handle_right_mouse("handle_right_mouse"),
held_down_delay("held_down_delay"),
button_flash_enable("button_flash_enable", false),
button_flash_count("button_flash_count"),
// <FS:Zi> Add checkbox control toggle
// button_flash_rate("button_flash_rate")
button_flash_rate("button_flash_rate"),
checkbox_control("checkbox_control")
// </FS:Zi>
button_flash_rate("button_flash_rate")
{
addSynonym(is_toggle, "toggle");
changeDefault(initial_value, LLSD(false));
@ -180,14 +172,24 @@ LLButton::LLButton(const LLButton::Params& p)
mHeldDownSignal(NULL),
mUseDrawContextAlpha(p.use_draw_context_alpha),
mHandleRightMouse(p.handle_right_mouse),
mButtonFlashCount(p.button_flash_count),
// <FS:Zi> Add checkbox control toggle
// mButtonFlashRate(p.button_flash_rate)
mButtonFlashRate(p.button_flash_rate),
mCheckboxControl(p.checkbox_control),
mCheckboxControlPanel(NULL)
// </FS:Zi>
mFlashingTimer(NULL)
{
if (p.button_flash_enable)
{
// If optional parameter "p.button_flash_count" is not provided, LLFlashTimer will be
// used instead it a "default" value from gSavedSettings.getS32("FlashCount")).
// Likewise, missing "p.button_flash_rate" is replaced by gSavedSettings.getF32("FlashPeriod").
// Note: flashing should be allowed in settings.xml (boolean key "EnableButtonFlashing").
S32 flash_count = p.button_flash_count.isProvided()? p.button_flash_count : 0;
F32 flash_rate = p.button_flash_rate.isProvided()? p.button_flash_rate : 0.0;
mFlashingTimer = new LLFlashTimer ((LLFlashTimer::callback_t)NULL, flash_count, flash_rate);
}
else
{
mButtonFlashCount = p.button_flash_count;
mButtonFlashRate = p.button_flash_rate;
}
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
@ -281,6 +283,11 @@ LLButton::~LLButton()
delete mMouseDownSignal;
delete mMouseUpSignal;
delete mHeldDownSignal;
if (mFlashingTimer)
{
mFlashingTimer->unset();
}
}
// HACK: Committing a button is the same as instantly clicking it.
@ -376,31 +383,6 @@ BOOL LLButton::postBuild()
{
autoResize();
// <FS:Zi> Add checkbox control toggle
if(!mCheckboxControl.empty())
{
mCheckboxControlPanel=LLUICtrlFactory::createFromFile<LLPanel>("panel_button_checkbox.xml",this,LLDefaultChildRegistry::instance());
if(mCheckboxControlPanel)
{
mCheckboxControlPanel->reshape(getRect().getWidth(),getRect().getHeight());
LLCheckBoxCtrl* check=mCheckboxControlPanel->findChild<LLCheckBoxCtrl>("check_control");
if(check)
{
check->setControlName(mCheckboxControl,NULL);
}
else
{
llwarns << "Could not find checkbox control for button " << getName() << llendl;
}
}
else
{
llwarns << "Could not create checkbox panel for button " << getName() << llendl;
}
}
// <FS:Zi>
addBadgeToParentPanel();
return LLUICtrl::postBuild();
@ -630,40 +612,6 @@ void LLButton::draw()
{
static LLCachedControl<bool> sEnableButtonFlashing(*LLUI::sSettingGroups["config"], "EnableButtonFlashing", true);
F32 alpha = mUseDrawContextAlpha ? getDrawContext().mAlpha : getCurrentTransparency();
bool flash = FALSE;
if( mFlashing)
{
if ( sEnableButtonFlashing)
{
// <FS:Ansariel> Global flash rate override
//F32 elapsed = mFlashingTimer.getElapsedTimeF32();
//S32 flash_count = S32(elapsed * mButtonFlashRate * 2.f);
//// flash on or off?
//flash = (flash_count % 2 == 0) || flash_count > S32((F32)mButtonFlashCount * 2.f);
S32 buttonFlashCount = mButtonFlashCount;
F32 buttonFlashRate = mButtonFlashRate;
static LLCachedControl<bool> fsGlobalButtonFlashOverride(*LLUI::sSettingGroups["config"], "FSGlobalButtonFlashOverride", true);
static LLCachedControl<S32> fsButtonFlashCount(*LLUI::sSettingGroups["config"], "FSButtonFlashCount", true);
static LLCachedControl<F32> fsButtonFlashRate(*LLUI::sSettingGroups["config"], "FSButtonFlashRate", true);
if (fsGlobalButtonFlashOverride)
{
buttonFlashCount = (S32)fsButtonFlashCount;
buttonFlashRate = (F32)fsButtonFlashRate;
}
F32 elapsed = mFlashingTimer.getElapsedTimeF32();
S32 flash_count = S32(elapsed * buttonFlashRate * 2.f);
// flash on or off?
flash = (flash_count % 2 == 0) || flash_count > S32((F32)buttonFlashCount * 2.f);
// </FS:Ansariel> Global flash rate override
}
else
{ // otherwise just highlight button in flash color
flash = true;
}
}
bool pressed_by_keyboard = FALSE;
if (hasFocus())
@ -688,9 +636,21 @@ void LLButton::draw()
bool selected = getToggleState();
bool use_glow_effect = FALSE;
LLColor4 glow_color = LLColor4::white;
LLColor4 highlighting_color = LLColor4::white;
LLColor4 glow_color;
LLRender::eBlendType glow_type = LLRender::BT_ADD_WITH_ALPHA;
LLUIImage* imagep = NULL;
// Cancel sticking of color, if the button is pressed,
// or when a flashing of the previously selected button is ended
if (mFlashingTimer
&& ((selected && !mFlashingTimer->isFlashingInProgress()) || pressed))
{
mFlashing = false;
}
bool flash = mFlashing && sEnableButtonFlashing;
if (pressed && mDisplayPressedState)
{
imagep = selected ? mImagePressedSelected : mImagePressed;
@ -756,15 +716,20 @@ void LLButton::draw()
imagep = mImageFlash;
}
// else use usual flashing via flash_color
else
else if (mFlashingTimer)
{
LLColor4 flash_color = mFlashBgColor.get();
use_glow_effect = TRUE;
glow_type = LLRender::BT_ALPHA; // blend the glow
if (mNeedsHighlight) // highlighted AND flashing
glow_color = (glow_color*0.5f + flash_color*0.5f) % 2.0f; // average between flash and highlight colour, with sum of the opacity
else
if (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress())
{
glow_color = flash_color;
}
else if (mNeedsHighlight)
{
glow_color = highlighting_color;
}
}
}
@ -813,8 +778,7 @@ void LLButton::draw()
if (use_glow_effect)
{
mCurGlowStrength = lerp(mCurGlowStrength,
mFlashing ? (flash? 1.0 : 0.0)
: mHoverGlowStrength,
mFlashing ? (mFlashingTimer->isCurrentlyHighlighted() || !mFlashingTimer->isFlashingInProgress() || mNeedsHighlight? 1.0 : 0.0) : mHoverGlowStrength,
LLCriticalDamp::getInterpolant(0.05f));
}
else
@ -974,15 +938,6 @@ void LLButton::draw()
NULL, mUseEllipses);
}
// <FS:Zi> Add checkbox control toggle
if(mCheckboxControlPanel)
{
mCheckboxControlPanel->setOrigin(0,0);
mCheckboxControlPanel->reshape(getRect().getWidth(),getRect().getHeight());
mCheckboxControlPanel->draw();
}
// <FS:Zi>
LLUICtrl::draw();
}
@ -1010,21 +965,26 @@ void LLButton::setToggleState(BOOL b)
{
setControlValue(b); // will fire LLControlVariable callbacks (if any)
setValue(b); // may or may not be redundant
setFlashing(false); // stop flash state whenever the selected/unselected state if reset
// Unselected label assignments
autoResize();
}
}
void LLButton::setFlashing( BOOL b )
void LLButton::setFlashing(bool b)
{
if ((bool)b != mFlashing)
if (mFlashingTimer)
{
mFlashing = b;
mFlashingTimer.reset();
(b ? mFlashingTimer->startFlashing() : mFlashingTimer->stopFlashing());
}
else if (b != mFlashing)
{
mFlashing = b;
mFrameTimer.reset();
}
}
BOOL LLButton::toggleState()
{
bool flipped = ! getToggleState();

View File

@ -30,6 +30,7 @@
#include "lluuid.h"
#include "llbadgeowner.h"
#include "llcontrol.h"
#include "llflashtimer.h"
#include "lluictrl.h"
#include "v4color.h"
#include "llframetimer.h"
@ -46,9 +47,6 @@
extern S32 LLBUTTON_H_PAD;
extern S32 BTN_HEIGHT_SMALL;
extern S32 BTN_HEIGHT;
// [SL:KB] - Patch: UI-DndButtonCommit | Checked: 2011-06-19 (Catznip-2.6.0c) | Added: Catznip-2.6.0c
extern F32 DELAY_DRAG_HOVER_COMMIT;
// [/SL:KB]
//
// Helpful functions
@ -136,6 +134,7 @@ public:
Optional<bool> handle_right_mouse;
Optional<bool> button_flash_enable;
Optional<S32> button_flash_count;
Optional<F32> button_flash_rate;
@ -204,8 +203,9 @@ public:
void setToggleState(BOOL b);
void setHighlight(bool b);
void setFlashing( BOOL b );
void setFlashing( bool b );
BOOL getFlashing() const { return mFlashing; }
LLFlashTimer* getFlashTimer() {return mFlashingTimer;}
void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
LLFontGL::HAlign getHAlign() const { return mHAlign; }
@ -378,7 +378,8 @@ protected:
bool mForcePressedState;
bool mDisplayPressedState;
LLFrameTimer mFlashingTimer;
LLFrameTimer mFrameTimer;
LLFlashTimer * mFlashingTimer;
bool mHandleRightMouse;

257
indra/llui/llchatentry.cpp Normal file
View File

@ -0,0 +1,257 @@
/**
* @file llchatentry.cpp
* @brief LLChatEntry implementation
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llscrollcontainer.h"
#include "llchatentry.h"
static LLDefaultChildRegistry::Register<LLChatEntry> r("chat_editor");
LLChatEntry::Params::Params()
: has_history("has_history", true),
is_expandable("is_expandable", false),
expand_lines_count("expand_lines_count", 1)
{}
LLChatEntry::LLChatEntry(const Params& p)
: LLTextEditor(p),
mTextExpandedSignal(NULL),
mHasHistory(p.has_history),
mIsExpandable(p.is_expandable),
mExpandLinesCount(p.expand_lines_count),
mPrevLinesCount(0),
mSingleLineMode(false),
mPrevExpandedLineCount(S32_MAX)
{
// Initialize current history line iterator
mCurrentHistoryLine = mLineHistory.begin();
mAutoIndent = false;
}
LLChatEntry::~LLChatEntry()
{
delete mTextExpandedSignal;
}
void LLChatEntry::draw()
{
if(mIsExpandable)
{
expandText();
}
LLTextEditor::draw();
}
void LLChatEntry::onCommit()
{
updateHistory();
LLTextEditor::onCommit();
}
boost::signals2::connection LLChatEntry::setTextExpandedCallback(const commit_signal_t::slot_type& cb)
{
if (!mTextExpandedSignal)
{
mTextExpandedSignal = new commit_signal_t();
}
return mTextExpandedSignal->connect(cb);
}
void LLChatEntry::expandText()
{
S32 line_count = mSingleLineMode ? 1 : mExpandLinesCount;
int visible_lines_count = llabs(getVisibleLines(true).first - getVisibleLines(true).second);
bool can_changed = getLineCount() <= line_count || line_count < mPrevExpandedLineCount ;
mPrevExpandedLineCount = line_count;
// true if pasted text has more lines than expand height limit and expand limit is not reached yet
bool text_pasted = (getLineCount() > line_count) && (visible_lines_count < line_count);
if (mIsExpandable && (can_changed || text_pasted || mSingleLineMode) && getLineCount() != mPrevLinesCount)
{
int lines_height = 0;
if (text_pasted)
{
// text is pasted and now mLineInfoList.size() > mExpandLineCounts and mLineInfoList is not empty,
// so lines_height is the sum of the last 'expanded_line_count' lines height
lines_height = (mLineInfoList.end() - line_count)->mRect.mTop - mLineInfoList.back().mRect.mBottom;
}
else
{
lines_height = mLineInfoList.begin()->mRect.mTop - mLineInfoList.back().mRect.mBottom;
}
int height = mVPad * 2 + lines_height;
LLRect doc_rect = getRect();
doc_rect.setOriginAndSize(doc_rect.mLeft, doc_rect.mBottom, doc_rect.getWidth(), height);
setShape(doc_rect);
mPrevLinesCount = getLineCount();
if (mTextExpandedSignal)
{
(*mTextExpandedSignal)(this, LLSD() );
}
needsReflow();
}
}
// line history support
void LLChatEntry::updateHistory()
{
// On history enabled, remember committed line and
// reset current history line number.
// Be sure only to remember lines that are not empty and that are
// different from the last on the list.
if (mHasHistory && getLength())
{
// Add text to history, ignoring duplicates
if (mLineHistory.empty() || getText() != mLineHistory.back())
{
mLineHistory.push_back(getText());
}
mCurrentHistoryLine = mLineHistory.end();
}
}
void LLChatEntry::beforeValueChange()
{
if(this->getLength() == 0 && !mLabel.empty())
{
this->clearSegments();
}
}
void LLChatEntry::onValueChange(S32 start, S32 end)
{
//Internally resetLabel() must meet a condition before it can reset the label
resetLabel();
}
bool LLChatEntry::useLabel()
{
return !getLength() && !mLabel.empty();
}
void LLChatEntry::onFocusReceived()
{
}
void LLChatEntry::onFocusLost()
{
}
BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
{
BOOL handled = FALSE;
// In the case of a chat entry, pressing RETURN when something is selected
// should NOT erase the selection (unlike a notecard, for example)
if (key == KEY_RETURN)
{
endOfDoc();
startSelection();
endSelection();
}
LLTextEditor::handleSpecialKey(key, mask);
switch(key)
{
case KEY_RETURN:
if (MASK_NONE == mask)
{
needsReflow();
}
break;
case KEY_UP:
if (mHasHistory && MASK_CONTROL == mask)
{
if (!mLineHistory.empty() && mCurrentHistoryLine > mLineHistory.begin())
{
setText(*(--mCurrentHistoryLine));
endOfDoc();
}
else
{
LLUI::reportBadKeystroke();
}
handled = TRUE;
}
break;
case KEY_DOWN:
if (mHasHistory && MASK_CONTROL == mask)
{
if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1) )
{
setText(*(++mCurrentHistoryLine));
endOfDoc();
}
else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1) )
{
mCurrentHistoryLine++;
std::string empty("");
setText(empty);
needsReflow();
endOfDoc();
}
else
{
LLUI::reportBadKeystroke();
}
handled = TRUE;
}
break;
default:
break;
}
return handled;
}
void LLChatEntry::enableSingleLineMode(bool single_line_mode)
{
if (mScroller)
{
mScroller->setSize(single_line_mode ? 0 : -1);
}
mSingleLineMode = single_line_mode;
mPrevLinesCount = -1;
setWordWrap(!single_line_mode);
}

106
indra/llui/llchatentry.h Normal file
View File

@ -0,0 +1,106 @@
/**
* @file llchatentry.h
* @author Paul Guslisty
* @brief Text editor widget which is used for user input
*
* Features:
* Optional line history so previous entries can be recalled by CTRL UP/DOWN
* Optional auto-resize behavior on input chat field
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LLCHATENTRY_H_
#define LLCHATENTRY_H_
#include "lltexteditor.h"
class LLChatEntry : public LLTextEditor
{
public:
struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>
{
Optional<bool> has_history,
is_expandable;
Optional<int> expand_lines_count;
Params();
};
virtual ~LLChatEntry();
protected:
friend class LLUICtrlFactory;
LLChatEntry(const Params& p);
/*virtual*/ void beforeValueChange();
/*virtual*/ void onValueChange(S32 start, S32 end);
/*virtual*/ bool useLabel();
public:
virtual void draw();
virtual void onCommit();
/*virtual*/ void onFocusReceived();
/*virtual*/ void onFocusLost();
void enableSingleLineMode(bool single_line_mode);
boost::signals2::connection setTextExpandedCallback(const commit_signal_t::slot_type& cb);
private:
/**
* Implements auto-resize behavior.
* When user's typing reaches the right edge of the chat field
* the chat field expands vertically by one line. The bottom of
* the chat field remains bottom-justified. The chat field does
* not expand beyond mExpandLinesCount.
*/
void expandText();
/**
* Implements line history so previous entries can be recalled by CTRL UP/DOWN
*/
void updateHistory();
BOOL handleSpecialKey(const KEY key, const MASK mask);
// Fired when text height expanded to mExpandLinesCount
commit_signal_t* mTextExpandedSignal;
// line history support:
typedef std::vector<std::string> line_history_t;
line_history_t::iterator mCurrentHistoryLine; // currently browsed history line
line_history_t mLineHistory; // line history storage
bool mHasHistory; // flag for enabled/disabled line history
bool mIsExpandable;
bool mSingleLineMode;
S32 mExpandLinesCount;
S32 mPrevLinesCount;
S32 mPrevExpandedLineCount;
};
#endif /* LLCHATENTRY_H_ */

View File

@ -110,7 +110,7 @@ LLCheckBoxCtrl::LLCheckBoxCtrl(const LLCheckBoxCtrl::Params& p)
LLButton::Params params = p.check_button;
params.rect(btn_rect);
//params.control_name(p.control_name);
params.click_callback.function(boost::bind(&LLCheckBoxCtrl::onButtonPress, this, _2));
params.click_callback.function(boost::bind(&LLCheckBoxCtrl::onCommit, this));
params.commit_on_return(false);
// Checkboxes only allow boolean initial values, but buttons can
// take any LLSD.
@ -133,18 +133,6 @@ LLCheckBoxCtrl::~LLCheckBoxCtrl()
// Children all cleaned up by default view destructor.
}
// static
void LLCheckBoxCtrl::onButtonPress( const LLSD& data )
{
//if (mRadioStyle)
//{
// setValue(TRUE);
//}
onCommit();
}
void LLCheckBoxCtrl::onCommit()
{
if( getEnabled() )

View File

@ -107,8 +107,6 @@ public:
virtual void setControlName(const std::string& control_name, LLView* context);
void onButtonPress(const LLSD& data);
virtual BOOL isDirty() const; // Returns TRUE if the user has modified this control.
virtual void resetDirty(); // Clear dirty state

View File

@ -85,6 +85,7 @@ LLCommand::LLCommand(const LLCommand::Params& p)
, mIsRunningParameters(p.is_running_parameters)
, mIsStartingFunction(p.is_starting_function)
, mIsStartingParameters(p.is_starting_parameters)
, mIsFlashingAllowed(p.is_flashing_allowed)
, mControlVariable(p.control_name) // <FS:Zi> Add control_name to toolbar buttons
, mCheckboxControlVariable(p.checkbox_control) // <FS:Zi> Add checkbox control toggle
{

View File

@ -97,7 +97,7 @@ public:
Mandatory<std::string> tooltip_ref;
// <FS:Zi> Add control_name to toolbar buttons
// so we can have control_name instead of aall these functions.
// so we can have control_name instead of all these functions.
// Mandatory<std::string> execute_function;
Optional<std::string> execute_function;
// </FS:Zi>
@ -115,6 +115,8 @@ public:
Optional<std::string> is_starting_function;
Optional<LLSD> is_starting_parameters;
Optional<bool> is_flashing_allowed;
Optional<std::string> control_name; // <FS:Zi> Add control_name to toolbar buttons
Optional<std::string> checkbox_control; // <FS:Zi> Add checkbox control toggle
@ -145,6 +147,8 @@ public:
const std::string& isStartingFunctionName() const { return mIsStartingFunction; }
const LLSD& isStartingParameters() const { return mIsStartingParameters; }
bool isFlashingAllowed() const { return mIsFlashingAllowed; }
private:
LLCommandId mIdentifier;
@ -169,6 +173,8 @@ private:
std::string mIsStartingFunction;
LLSD mIsStartingParameters;
bool mIsFlashingAllowed;
// <FS;Zi> Add control_variable ald checkbox_control to commands in toolbar
std::string mControlVariable;
std::string mCheckboxControlVariable;

0
indra/llui/llcontainerview.cpp Executable file → Normal file
View File

View File

@ -31,7 +31,6 @@
LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
const LLUIImagePtr& dockTongue, DocAt dockAt, get_allowed_rect_callback_t get_allowed_rect_callback) :
mDockWidget(dockWidget),
mDockableFloater(dockableFloater),
mDockTongue(dockTongue),
mDockTongueX(0),
@ -39,10 +38,10 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
{
mDockAt = dockAt;
// <FS:ND> FIRE-9134; Fix crash on logout. USe handle to detect if mDockWidget is already dead (To simplify the amount of code changed for future merged, use a LLHandle + the old LLView*)
if (mDockWidget != NULL)
mDockHandle = mDockWidget->getHandle();
// </FS:ND>
if (dockWidget != NULL)
{
mDockWidgetHandle = dockWidget->getHandle();
}
if (dockableFloater->isDocked())
{
@ -67,7 +66,7 @@ LLDockControl::LLDockControl(LLView* dockWidget, LLFloater* dockableFloater,
repositionDockable();
}
if (mDockWidget != NULL)
if (getDock() != NULL)
{
mDockWidgetVisible = isDockVisible();
}
@ -83,23 +82,15 @@ LLDockControl::~LLDockControl()
void LLDockControl::setDock(LLView* dockWidget)
{
mDockWidget = dockWidget;
// <FS:ND> FIRE-9134; Fix crash on logout. USe handle to detect if mDockWidget is already dead (To simplify the amount of code changed for future merged, use a LLHandle + the old LLView*)
mDockHandle = LLHandle< LLView >();
// </FS:ND>
if (mDockWidget != NULL)
if (dockWidget != NULL)
{
// <FS:ND> FIRE-9134; Fix crash on logout. USe handle to detect if mDockWidget is already dead (To simplify the amount of code changed for future merged, use a LLHandle + the old LLView*)
mDockHandle = mDockWidget->getHandle();
// <FS:ND>
mDockWidgetHandle = dockWidget->getHandle();
repositionDockable();
mDockWidgetVisible = isDockVisible();
}
else
{
mDockWidgetHandle = LLHandle<LLView>();
mDockWidgetVisible = false;
}
}
@ -112,8 +103,8 @@ void LLDockControl::getAllowedRect(LLRect& rect)
void LLDockControl::repositionDockable()
{
if (!mDockWidget) return;
LLRect dockRect = mDockWidget->calcScreenRect();
if (!getDock()) return;
LLRect dockRect = getDock()->calcScreenRect();
LLRect rootRect;
LLRect floater_rect = mDockableFloater->calcScreenRect();
mGetAllowedRectCallback(rootRect);
@ -165,13 +156,13 @@ bool LLDockControl::isDockVisible()
{
bool res = true;
if (mDockWidget != NULL)
if (getDock() != NULL)
{
//we should check all hierarchy
res = mDockWidget->isInVisibleChain();
res = getDock()->isInVisibleChain();
if (res)
{
LLRect dockRect = mDockWidget->calcScreenRect();
LLRect dockRect = getDock()->calcScreenRect();
switch (mDockAt)
{
@ -184,7 +175,7 @@ bool LLDockControl::isDockVisible()
// assume that parent for all dockable floaters
// is the root view
LLRect dockParentRect =
mDockWidget->getRootView()->calcScreenRect();
getDock()->getRootView()->calcScreenRect();
if (dockRect.mRight <= dockParentRect.mLeft
|| dockRect.mLeft >= dockParentRect.mRight)
{
@ -204,7 +195,7 @@ bool LLDockControl::isDockVisible()
void LLDockControl::moveDockable()
{
// calculate new dockable position
LLRect dockRect = mDockWidget->calcScreenRect();
LLRect dockRect = getDock()->calcScreenRect();
LLRect rootRect;
mGetAllowedRectCallback(rootRect);
@ -278,7 +269,7 @@ void LLDockControl::moveDockable()
// calculate dock tongue position
dockParentRect = mDockWidget->getParent()->calcScreenRect();
dockParentRect = getDock()->getParent()->calcScreenRect();
if (dockRect.getCenterX() < dockParentRect.mLeft)
{
mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2;
@ -314,7 +305,7 @@ void LLDockControl::moveDockable()
}
// calculate dock tongue position
dockParentRect = mDockWidget->getParent()->calcScreenRect();
dockParentRect = getDock()->getParent()->calcScreenRect();
if (dockRect.getCenterX() < dockParentRect.mLeft)
{
mDockTongueX = dockParentRect.mLeft - mDockTongue->getWidth() / 2;

View File

@ -63,15 +63,7 @@ public:
void setDock(LLView* dockWidget);
LLView* getDock()
{
// <FS:ND> FIRE-9134; Fix crash on logout. USe handle to detect if mDockWidget is already dead (To simplify the amount of code changed for future merged, use a LLHandle + the old LLView*)
// return mDockWidget;
if( mDockWidget && !mDockHandle.isDead() )
return mDockWidget;
return 0;
// </FS:ND>
return mDockWidgetHandle.get();
}
void repositionDockable();
void drawToungue();
@ -91,7 +83,7 @@ private:
bool mRecalculateDockablePosition;
bool mDockWidgetVisible;
DocAt mDockAt;
LLView* mDockWidget;
LLHandle<LLView> mDockWidgetHandle;
LLRect mPrevDockRect;
LLRect mRootRect;
LLRect mFloaterRect;
@ -101,7 +93,7 @@ private:
S32 mDockTongueY;
// <FS:ND> FIRE-9134; Fix crash on logout. USe handle to detect if mDockWidget is already dead (To simplify the amount of code changed for future merged, use a LLHandle + the old LLView*)
LLHandle< LLView > mDockHandle;
// LLHandle< LLView > mDockHandle; <FS:TM> check CHUI merge
// </FS:ND>
};

100
indra/llui/llflashtimer.cpp Normal file
View File

@ -0,0 +1,100 @@
/**
* @file llflashtimer.cpp
* @brief LLFlashTimer class implementation
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "../newview/llviewerprecompiledheaders.h"
#include "llflashtimer.h"
#include "../newview/llviewercontrol.h"
#include "lleventtimer.h"
LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period)
: LLEventTimer(period)
, mCallback(cb)
, mCurrentTickCount(0)
, mIsFlashingInProgress(false)
, mIsCurrentlyHighlighted(false)
, mUnset(false)
{
mEventTimer.stop();
// By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973.
// Due to Timer is implemented as derived class from EventTimer it is impossible to change period
// in runtime. So, both settings are made as required restart.
mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount"));
if (mPeriod <= 0)
{
mPeriod = gSavedSettings.getF32("FlashPeriod");
}
}
void LLFlashTimer::unset()
{
mUnset = true;
mCallback = NULL;
}
BOOL LLFlashTimer::tick()
{
mIsCurrentlyHighlighted = !mIsCurrentlyHighlighted;
if (mCallback)
{
mCallback(mIsCurrentlyHighlighted);
}
if (++mCurrentTickCount >= mFlashCount)
{
stopFlashing();
}
return mUnset;
}
void LLFlashTimer::startFlashing()
{
mIsFlashingInProgress = true;
mIsCurrentlyHighlighted = true;
mEventTimer.start();
}
void LLFlashTimer::stopFlashing()
{
mEventTimer.stop();
mIsFlashingInProgress = false;
mIsCurrentlyHighlighted = false;
mCurrentTickCount = 0;
}
bool LLFlashTimer::isFlashingInProgress()
{
return mIsFlashingInProgress;
}
bool LLFlashTimer::isCurrentlyHighlighted()
{
return mIsCurrentlyHighlighted;
}

73
indra/llui/llflashtimer.h Normal file
View File

@ -0,0 +1,73 @@
/**
* @file llflashtimer.h
* @brief LLFlashTimer class implementation
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_FLASHTIMER_H
#define LL_FLASHTIMER_H
#include "lleventtimer.h"
class LLFlashTimer : public LLEventTimer
{
public:
typedef boost::function<void (bool)> callback_t;
/**
* Constructor.
*
* @param count - how many times callback should be called (twice to not change original state)
* @param period - how frequently callback should be called
* @param cb - callback to be called each tick
*/
LLFlashTimer(callback_t cb = NULL, S32 count = 0, F32 period = 0.0);
~LLFlashTimer() {};
/*virtual*/ BOOL tick();
void startFlashing();
void stopFlashing();
bool isFlashingInProgress();
bool isCurrentlyHighlighted();
/*
* Use this instead of deleting this object.
* The next call to tick() will return true and that will destroy this object.
*/
void unset();
private:
callback_t mCallback;
/**
* How many times parent will blink.
*/
S32 mFlashCount;
S32 mCurrentTickCount;
bool mIsCurrentlyHighlighted;
bool mIsFlashingInProgress;
bool mUnset;
};
#endif /* LL_FLASHTIMER_H */

View File

@ -63,6 +63,8 @@
// use this to control "jumping" behavior when Ctrl-Tabbing
const S32 TABBED_FLOATER_OFFSET = 0;
extern LLControlGroup gSavedSettings;
namespace LLInitParam
{
void TypeValues<LLFloaterEnums::EOpenPositioning>::declareValues()
@ -176,9 +178,6 @@ LLFloater::Params::Params()
save_dock_state("save_dock_state", false),
save_rect("save_rect", false),
save_visibility("save_visibility", false),
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
save_tearoff_state("save_tearoff_state", false),
// [/SL:KB]
can_dock("can_dock", false),
show_title("show_title", true),
positioning("positioning", LLFloaterEnums::POSITIONING_RELATIVE),
@ -268,8 +267,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mHasBeenDraggedWhileMinimized(FALSE),
mPreviousMinimizedBottom(0),
mPreviousMinimizedLeft(0),
mTearOffSignal(NULL),
// [/SL:KB]
mMinimizeSignal(NULL)
// mNotificationContext(NULL)
{
@ -555,9 +552,6 @@ LLFloater::~LLFloater()
storeDockStateControl();
delete mMinimizeSignal;
// [SL:KB] - Patch: UI-FloaterTearOffSignal | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
delete mTearOffSignal;
// [/SL:KB]
}
void LLFloater::storeRectControl()
@ -599,16 +593,6 @@ void LLFloater::storeDockStateControl()
}
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
void LLFloater::storeTearOffStateControl()
{
if ( (!sQuitting) && (mCanTearOff) && (mTearOffStateControl.size() > 1) )
{
getControlGroup()->setBOOL(mTearOffStateControl, isTornOff());
}
}
// [/SL:KB]
// static
std::string LLFloater::getControlName(const std::string& name, const LLSD& key)
{
@ -668,6 +652,17 @@ void LLFloater::setVisible( BOOL visible )
storeVisibilityControl();
}
void LLFloater::setIsSingleInstance(BOOL is_single_instance)
{
mSingleInstance = is_single_instance;
if (!mIsReuseInitialized)
{
mReuseInstance = is_single_instance; // reuse single-instance floaters by default
}
}
// virtual
void LLFloater::handleVisibilityChange ( BOOL new_visibility )
{
@ -683,14 +678,20 @@ void LLFloater::openFloater(const LLSD& key)
{
llinfos << "Opening floater " << getName() << llendl;
mKey = key; // in case we need to open ourselves again
if (getSoundFlags() != SILENT
// don't play open sound for hosted (tabbed) windows
&& !getHost()
&& !getFloaterHost()
&& (!getVisible() || isMinimized()))
{
make_ui_sound("UISndWindowOpen");
//Don't play a sound for incoming voice call based upon chat preference setting
bool playSound = !(getName() == "incoming call" && gSavedSettings.getBOOL("PlaySoundIncomingVoiceCall") == FALSE);
if(playSound)
{
make_ui_sound("UISndWindowOpen");
}
}
//RN: for now, we don't allow rehosting from one multifloater to another
@ -767,6 +768,33 @@ void LLFloater::closeFloater(bool app_quitting)
make_ui_sound("UISndWindowClose");
}
gFocusMgr.clearLastFocusForGroup(this);
if (hasFocus())
{
// Do this early, so UI controls will commit before the
// window is taken down.
releaseFocus();
// give focus to dependee floater if it exists, and we had focus first
if (isDependent())
{
LLFloater* dependee = mDependeeHandle.get();
if (dependee && !dependee->isDead())
{
dependee->setFocus(TRUE);
}
}
}
//If floater is a dependent, remove it from parent (dependee)
LLFloater* dependee = mDependeeHandle.get();
if (dependee)
{
dependee->removeDependentFloater(this);
}
// now close dependent floater
for(handle_set_iter_t dependent_it = mDependents.begin();
dependent_it != mDependents.end(); )
@ -785,28 +813,6 @@ void LLFloater::closeFloater(bool app_quitting)
}
cleanupHandles();
gFocusMgr.clearLastFocusForGroup(this);
if (hasFocus())
{
// Do this early, so UI controls will commit before the
// window is taken down.
releaseFocus();
// give focus to dependee floater if it exists, and we had focus first
if (isDependent())
{
LLFloater* dependee = mDependeeHandle.get();
if (dependee && !dependee->isDead())
{
dependee->setFocus(TRUE);
}
}
// STORM-1879: since this floater has focus, treat the closeFloater- call
// like a click on the close-button, and close gear- and contextmenus
LLMenuGL::sMenuContainer->hideMenus();
}
dirtyRect();
@ -842,6 +848,20 @@ void LLFloater::closeFloater(bool app_quitting)
}
}
/*virtual*/
void LLFloater::closeHostedFloater()
{
// When toggling *visibility*, close the host instead of the floater when hosted
if (getHost())
{
getHost()->closeFloater();
}
else
{
closeFloater();
}
}
/*virtual*/
void LLFloater::reshape(S32 width, S32 height, BOOL called_from_parent)
{
@ -902,38 +922,19 @@ LLMultiFloater* LLFloater::getHost()
return (LLMultiFloater*)mHostHandle.get();
}
// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-25 (Catznip-3.2.0b) | Added: Catznip-3.2.0b
LLMultiFloater* LLFloater::getLastHost() const
{
return (LLMultiFloater*)mLastHostHandle.get();
}
// [/SL:KB]
void LLFloater::applyControlsAndPosition(LLFloater* other)
{
// if (!applyDockState()) // <FS:Zi> Don't apply dock state and forget about the undocked values
{
// if (!applyRectControl())
// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-10-27 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
if ( (!applyRectControl()) && ((!getHost()) || (mTornOff)) )
// [/SL:KB]
// <FS:Ansariel> Don't apply position to undocked IM floater (FIRE-5459)
//applyPositioning(other); <FS:TM> CHUI Merge old
//if (!applyRectControl()) <FS:TM> CHUI Merge new
if ((strcmp(getName().c_str(), "panel_im") != 0)) // <FS:TM> CHUI Merge do we still want this?
{
// <FS:Ansariel> Don't apply position to undocked IM floater (FIRE-5459)
//applyPositioning(other);
if ((strcmp(getName().c_str(), "panel_im") != 0))
{
applyPositioning(other, true);
}
// </FS:Ansariel> Don't apply position to undocked IM floater (FIRE-5459)
applyPositioning(other, true);
}
// </FS:Ansariel> Don't apply position to undocked IM floater (FIRE-5459)
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
if (getHost())
{
applyTearOffState();
}
// [/SL:KB]
applyDockState(); // <FS:Zi> Only now apply docked state so floaters don't forget their positions
}
@ -1088,17 +1089,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open)
}
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
void LLFloater::applyTearOffState()
{
if ( (mCanTearOff) && (mTearOffStateControl.size() > 1) )
{
bool tearoffState = getControlGroup()->getBOOL(mTearOffStateControl);
setTornOff(tearoffState);
}
}
// [/SL:KB]
void LLFloater::applyTitle()
{
if (!mDragHandle)
@ -1290,7 +1280,6 @@ void LLFloater::setMinimized(BOOL minimize)
{
// minimized flag should be turned on before release focus
mMinimized = TRUE;
mExpandedRect = getRect();
// If the floater has been dragged while minimized in the
@ -1364,7 +1353,6 @@ void LLFloater::setMinimized(BOOL minimize)
}
setOrigin( mExpandedRect.mLeft, mExpandedRect.mBottom );
if (mButtonsEnabled[BUTTON_RESTORE])
{
mButtonsEnabled[BUTTON_MINIMIZE] = TRUE;
@ -1400,7 +1388,6 @@ void LLFloater::setMinimized(BOOL minimize)
// Reshape *after* setting mMinimized
reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
applyPositioning(NULL, false);
}
make_ui_sound("UISndWindowClose");
@ -1522,7 +1509,6 @@ void LLFloater::setHost(LLMultiFloater* host)
mButtonScale = 1.f;
//mButtonsEnabled[BUTTON_TEAR_OFF] = FALSE;
}
updateTitleButtons();
if (host)
{
mHostHandle = host->getHandle();
@ -1532,6 +1518,8 @@ void LLFloater::setHost(LLMultiFloater* host)
{
mHostHandle.markDead();
}
updateTitleButtons();
}
void LLFloater::moveResizeHandlesToFront()
@ -1688,10 +1676,19 @@ void LLFloater::bringToFront( S32 x, S32 y )
// virtual
void LLFloater::setVisibleAndFrontmost(BOOL take_focus)
void LLFloater::setVisibleAndFrontmost(BOOL take_focus, const LLSD& key)
{
setVisible(TRUE);
setFrontmost(take_focus);
LLMultiFloater* hostp = getHost();
if (hostp)
{
hostp->setVisible(TRUE);
hostp->setFrontmost(take_focus);
}
else
{
setVisible(TRUE);
setFrontmost(take_focus);
}
}
void LLFloater::setFrontmost(BOOL take_focus)
@ -1759,128 +1756,54 @@ void LLFloater::onClickMinimize(LLFloater* self)
self->setMinimized( !self->isMinimized() );
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
void LLFloater::setTornOff(bool torn_off)
void LLFloater::onClickTearOff(LLFloater* self)
{
if ( (!mCanTearOff) || (mTornOff == torn_off) )
if (!self)
return;
LLMultiFloater* host_floater = getHost();
if ( (torn_off) && (host_floater) ) // Tear off
S32 floater_header_size = self->mHeaderHeight;
LLMultiFloater* host_floater = self->getHost();
if (host_floater) //Tear off
{
// [SL:KB] - Patch: UI-FloaterTearSignal | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
if (mTearOffSignal)
(*mTearOffSignal)(this, LLSD(true));
// [/SL:KB]
LLRect new_rect;
host_floater->removeFloater(this);
host_floater->removeFloater(self);
// reparent to floater view
gFloaterView->addChild(this);
gFloaterView->addChild(self);
openFloater(getKey());
// get floater rect size from either the rect control or the saved rect -Zi
if (this->mRectControl.empty())
// restore old size and position -Zi
new_rect= getExpandedRect();
else
new_rect= getControlGroup()->getRect(mRectControl);
// only force position for floaters that have an empty rect -Zi
if(new_rect.isEmpty())
self->openFloater(self->getKey());
if (self->mSaveRect && !self->mRectControl.empty())
{
llwarns << "no rect saved yet, so reshape the floater" << llendl;
new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - mHeaderHeight - 5, getRect().getWidth(), getRect().getHeight());
setRect(new_rect);
self->applyRectControl();
}
setShape(new_rect);
storeRectControl();
gFloaterView->adjustToFitScreen(this, FALSE);
else
{ // only force position for floaters that don't have that data saved
new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - floater_header_size - 5, self->getRect().getWidth(), self->getRect().getHeight());
self->setRect(new_rect);
}
gFloaterView->adjustToFitScreen(self, FALSE);
// give focus to new window to keep continuity for the user
setFocus(TRUE);
mTornOff = true;;
self->setFocus(TRUE);
self->setTornOff(true);
}
else if (!torn_off) // Attach to parent.
else //Attach to parent.
{
storeRectControl();
// <FS:Zi> Mark floater as hosted here already, so any storeRectControl() call
// will know NOT to save floater sizes.
mTornOff = false; // <FS:Zi>
// save the current size and position -Zi
setExpandedRect( getRect() );
LLMultiFloater* new_host = (LLMultiFloater*)mLastHostHandle.get();
LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get();
if (new_host)
{
// [SL:KB] - Patch: UI-FloaterTearSignal | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
if (mTearOffSignal)
(*mTearOffSignal)(this, LLSD(false));
// [/SL:KB]
setMinimized(FALSE); // to reenable minimize button if it was minimized
new_host->showFloater(this);
if (self->mSaveRect)
{
self->storeRectControl();
}
self->setMinimized(FALSE); // to reenable minimize button if it was minimized
new_host->showFloater(self);
// make sure host is visible
new_host->openFloater(new_host->getKey());
}
// mTornOff = false; // <FS:Zi> This would be too late, so we moved it up
self->setTornOff(false);
}
updateTitleButtons();
storeTearOffStateControl();
storeVisibilityControl(); // <FS:Zi> Make sure to update visibility, too
self->updateTitleButtons();
self->setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
}
void LLFloater::onClickTearOff(LLFloater* self)
{
if ( (self) && (self->mCanTearOff) )
{
self->setTornOff(!self->mTornOff);
}
}
// [/SL:KB]
//void LLFloater::onClickTearOff(LLFloater* self)
//{
// if (!self)
// return;
// S32 floater_header_size = self->mHeaderHeight;
// LLMultiFloater* host_floater = self->getHost();
// if (host_floater) //Tear off
// {
// LLRect new_rect;
// host_floater->removeFloater(self);
// // reparent to floater view
// gFloaterView->addChild(self);
//
// self->openFloater(self->getKey());
//
// // only force position for floaters that don't have that data saved
// if (self->mRectControl.size() <= 1)
// {
// new_rect.setLeftTopAndSize(host_floater->getRect().mLeft + 5, host_floater->getRect().mTop - floater_header_size - 5, self->getRect().getWidth(), self->getRect().getHeight());
// self->setRect(new_rect);
// }
// gFloaterView->adjustToFitScreen(self, FALSE);
// // give focus to new window to keep continuity for the user
// self->setFocus(TRUE);
// self->setTornOff(true);
// }
// else //Attach to parent.
// {
// LLMultiFloater* new_host = (LLMultiFloater*)self->mLastHostHandle.get();
// if (new_host)
// {
// self->setMinimized(FALSE); // to reenable minimize button if it was minimized
// new_host->showFloater(self);
// // make sure host is visible
// new_host->openFloater(new_host->getKey());
// }
// self->setTornOff(false);
// }
// self->updateTitleButtons();
//}
// static
void LLFloater::onClickDock(LLFloater* self)
{
@ -1904,6 +1827,18 @@ void LLFloater::onClickHelp( LLFloater* self )
}
}
void LLFloater::initRectControl()
{
// save_rect and save_visibility only apply to registered floaters
if (mSaveRect)
{
std::string ctrl_name = getControlName(mInstanceName, mKey);
mRectControl = LLFloaterReg::declareRectControl(ctrl_name);
mPosXControl = LLFloaterReg::declarePosXControl(ctrl_name);
mPosYControl = LLFloaterReg::declarePosYControl(ctrl_name);
}
}
// static
void LLFloater::closeFrontmostFloater()
{
@ -2357,7 +2292,8 @@ LLFloaterView::LLFloaterView (const Params& p)
mFocusCycleMode(FALSE),
mMinimizePositionVOffset(0),
mSnapOffsetBottom(0),
mSnapOffsetRight(0)
mSnapOffsetRight(0),
mFrontChild(NULL)
{
mSnapView = getHandle();
}
@ -2507,6 +2443,17 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF
void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus)
{
if (mFrontChild == child)
{
if (give_focus && !gFocusMgr.childHasKeyboardFocus(child))
{
child->setFocus(TRUE);
}
return;
}
mFrontChild = child;
// *TODO: make this respect floater's mAutoFocus value, instead of
// using parameter
if (child->getHost())
@ -2514,15 +2461,14 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus)
// this floater is hosted elsewhere and hence not one of our children, abort
return;
}
std::vector<LLView*> floaters_to_move;
std::vector<LLFloater*> floaters_to_move;
// Look at all floaters...tab
for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it)
for (child_list_const_iter_t child_it = beginChild(); child_it != endChild(); ++child_it)
{
LLView* viewp = *child_it;
LLFloater *floater = (LLFloater *)viewp;
LLFloater* floater = dynamic_cast<LLFloater*>(*child_it);
// ...but if I'm a dependent floater...
if (child->isDependent())
if (floater && child->isDependent())
{
// ...look for floaters that have me as a dependent...
LLFloater::handle_set_iter_t found_dependent = floater->mDependents.find(child->getHandle());
@ -2530,15 +2476,14 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus)
if (found_dependent != floater->mDependents.end())
{
// ...and make sure all children of that floater (including me) are brought to front...
for(LLFloater::handle_set_iter_t dependent_it = floater->mDependents.begin();
dependent_it != floater->mDependents.end(); )
for (LLFloater::handle_set_iter_t dependent_it = floater->mDependents.begin();
dependent_it != floater->mDependents.end(); ++dependent_it)
{
LLFloater* sibling = dependent_it->get();
if (sibling)
{
floaters_to_move.push_back(sibling);
}
++dependent_it;
}
//...before bringing my parent to the front...
floaters_to_move.push_back(floater);
@ -2546,10 +2491,10 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus)
}
}
std::vector<LLView*>::iterator view_it;
for(view_it = floaters_to_move.begin(); view_it != floaters_to_move.end(); ++view_it)
std::vector<LLFloater*>::iterator floater_it;
for(floater_it = floaters_to_move.begin(); floater_it != floaters_to_move.end(); ++floater_it)
{
LLFloater* floaterp = (LLFloater*)(*view_it);
LLFloater* floaterp = *floater_it;
sendChildToFront(floaterp);
// always unminimize dependee, but allow dependents to stay minimized
@ -2561,23 +2506,19 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus)
floaters_to_move.clear();
// ...then bringing my own dependents to the front...
for(LLFloater::handle_set_iter_t dependent_it = child->mDependents.begin();
dependent_it != child->mDependents.end(); )
for (LLFloater::handle_set_iter_t dependent_it = child->mDependents.begin();
dependent_it != child->mDependents.end(); ++dependent_it)
{
LLFloater* dependent = dependent_it->get();
if (dependent)
{
sendChildToFront(dependent);
//don't un-minimize dependent windows automatically
// respect user's wishes
//dependent->setMinimized(FALSE);
}
++dependent_it;
}
// ...and finally bringing myself to front
// (do this last, so that I'm left in front at end of this call)
if( *getChildList()->begin() != child )
if (*beginChild() != child)
{
sendChildToFront(child);
}
@ -3129,21 +3070,14 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list)
void LLFloater::setInstanceName(const std::string& name)
{
if (name == mInstanceName)
return;
if (name != mInstanceName)
{
llassert_always(mInstanceName.empty());
mInstanceName = name;
if (!mInstanceName.empty())
{
std::string ctrl_name = getControlName(mInstanceName, mKey);
// save_rect and save_visibility only apply to registered floaters
if (mSaveRect)
{
mRectControl = LLFloaterReg::declareRectControl(ctrl_name);
mPosXControl = LLFloaterReg::declarePosXControl(ctrl_name);
mPosYControl = LLFloaterReg::declarePosYControl(ctrl_name);
}
initRectControl();
if (!mVisibilityControl.empty())
{
mVisibilityControl = LLFloaterReg::declareVisibilityControl(ctrl_name);
@ -3152,14 +3086,9 @@ void LLFloater::setInstanceName(const std::string& name)
{
mDocStateControl = LLFloaterReg::declareDockStateControl(ctrl_name);
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
if(!mTearOffStateControl.empty())
{
mTearOffStateControl = LLFloaterReg::declareTearOffStateControl(ctrl_name);
}
// [/SL:KB]
}
}
}
void LLFloater::setKey(const LLSD& newkey)
{
@ -3243,12 +3172,6 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
{
mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
if (p.save_tearoff_state)
{
mTearOffStateControl = "t"; // flag to build mTearOffStateControl name once mInstanceName is set
}
// [/SL:KB]
// open callback
if (p.open_callback.isProvided())
@ -3273,14 +3196,6 @@ boost::signals2::connection LLFloater::setMinimizeCallback( const commit_signal_
return mMinimizeSignal->connect(cb);
}
// [SL:KB] - Patch: UI-FloaterTearOffSignal | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
boost::signals2::connection LLFloater::setTearOffCallback( const commit_signal_t::slot_type& cb )
{
if (!mTearOffSignal) mTearOffSignal = new commit_signal_t();
return mTearOffSignal->connect(cb);
}
// [/SL:KB]
boost::signals2::connection LLFloater::setOpenCallback( const commit_signal_t::slot_type& cb )
{
return mOpenSignal.connect(cb);

View File

@ -161,9 +161,6 @@ public:
save_rect,
save_visibility,
save_dock_state,
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
save_tearoff_state,
// [/SL:KB]
can_dock,
show_title;
@ -210,9 +207,6 @@ public:
bool buildFromFile(const std::string &filename);
boost::signals2::connection setMinimizeCallback( const commit_signal_t::slot_type& cb );
// [SL:KB] - Patch: UI-FloaterTearOffSignal | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
boost::signals2::connection setTearOffCallback( const commit_signal_t::slot_type& cb );
// [/SL:KB]
boost::signals2::connection setOpenCallback( const commit_signal_t::slot_type& cb );
boost::signals2::connection setCloseCallback( const commit_signal_t::slot_type& cb );
@ -225,13 +219,17 @@ public:
/*virtual*/ void setFocus( BOOL b );
/*virtual*/ void setIsChrome(BOOL is_chrome);
/*virtual*/ void setRect(const LLRect &rect);
void setIsSingleInstance(BOOL is_single_instance);
void initFloater(const Params& p);
void openFloater(const LLSD& key = LLSD());
// If allowed, close the floater cleanly, releasing focus.
void closeFloater(bool app_quitting = false);
virtual void closeFloater(bool app_quitting = false);
// Close the floater or its host. Use when hidding or toggling a floater instance.
virtual void closeHostedFloater();
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
@ -242,9 +240,6 @@ public:
void center();
LLMultiFloater* getHost();
// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-25 (Catznip-3.2.0b) | Added: Catznip-3.2.0b
LLMultiFloater* getLastHost() const;
// [/SL:KB]
void applyTitle();
std::string getCurrentTitle() const;
@ -312,6 +307,7 @@ public:
/*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); // do not override
void setFrontmost(BOOL take_focus = TRUE);
virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD());
// Defaults to false.
virtual BOOL canSaveAs() const { return FALSE; }
@ -334,10 +330,9 @@ public:
bool isDocked() const { return mDocked; }
virtual void setDocked(bool docked, bool pop_on_undock = true);
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
bool isTornOff() const { return mTornOff; }
virtual void setTornOff(bool torn_off);
// [/SL:KB]
virtual void setTornOff(bool torn_off) { mTornOff = torn_off; }
bool isTornOff() {return mTornOff;}
void setOpenPositioning(LLFloaterEnums::EOpenPositioning pos) {mPositioning = pos;}
// Close the floater returned by getFrontmostClosableFloater() and
@ -368,26 +363,20 @@ protected:
void stackWith(LLFloater& other);
virtual void initRectControl();
virtual bool applyRectControl();
bool applyDockState();
void applyPositioning(LLFloater* other, bool on_open);
void applyRelativePosition();
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
void applyTearOffState();
// [/SL:KB]
void storeRectControl();
void storeVisibilityControl();
void storeDockStateControl();
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
void storeTearOffStateControl();
// [/SL:KB]
void setKey(const LLSD& key);
void setInstanceName(const std::string& name);
virtual void bringToFront(S32 x, S32 y);
virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE);
void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized
const LLRect& getExpandedRect() const { return mExpandedRect; }
@ -440,9 +429,6 @@ public:
commit_signal_t mCloseSignal;
commit_signal_t* mMinimizeSignal;
// [SL:KB] - Patch: UI-FloaterTearOffSignal | Checked: 2011-11-12 (Catznip-3.2.0a) | Added: Catznip-3.2.0a
commit_signal_t* mTearOffSignal;
// [/SL:KB]
protected:
bool mSaveRect;
@ -451,10 +437,6 @@ protected:
std::string mPosYControl;
std::string mVisibilityControl;
std::string mDocStateControl;
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
std::string mTearOffStateControl;
// [/SL:KB]
LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg
LLDragHandle* mDragHandle;
@ -468,9 +450,10 @@ private:
LLUIString mTitle;
LLUIString mShortTitle;
BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater
bool mReuseInstance; // true if we want to hide the floater when we close it instead of destroying it
std::string mInstanceName; // Store the instance name so we can remove ourselves from the list
BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater
bool mReuseInstance; // true if we want to hide the floater when we close it instead of destroying it
bool mIsReuseInitialized; // true if mReuseInstance already set from parameters
std::string mInstanceName; // Store the instance name so we can remove ourselves from the list
BOOL mDropShadow; // ## Zi: Optional Drop Shadows
S32 mLabelVPadding; // <FS:Zi> Make vertical label padding a per-skin option
@ -599,6 +582,7 @@ private:
S32 mMinimizePositionVOffset;
typedef std::vector<std::pair<LLHandle<LLFloater>, boost::signals2::connection> > hidden_floaters_t;
hidden_floaters_t mHiddenFloaters;
LLFloater * mFrontChild;
};
//

View File

@ -296,17 +296,9 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key)
LLFloater* instance = findInstance(name, key);
if (instance)
{
// When toggling *visibility*, close the host instead of the floater when hosted
if (instance->getHost())
instance->getHost()->closeFloater();
else
instance->closeFloater();
return true;
}
else
{
return false;
instance->closeHostedFloater();
}
return (instance != NULL);
}
//static
@ -316,11 +308,7 @@ bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
LLFloater* instance = findInstance(name, key);
if (LLFloater::isShown(instance))
{
// When toggling *visibility*, close the host instead of the floater when hosted
if (instance->getHost())
instance->getHost()->closeFloater();
else
instance->closeFloater();
instance->closeHostedFloater();
return false;
}
else
@ -471,24 +459,6 @@ std::string LLFloaterReg::getDockStateControlName(const std::string& name)
return res;
}
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
//static
std::string LLFloaterReg::declareTearOffStateControl(const std::string& name)
{
std::string controlname = getTearOffStateControlName(name);
LLFloater::getControlGroup()->declareBOOL(controlname, TRUE, llformat("Window Tear Off state for %s", name.c_str()), TRUE);
return controlname;
}
//static
std::string LLFloaterReg::getTearOffStateControlName(const std::string& name)
{
std::string res = std::string("floater_tearoff_") + name;
LLStringUtil::replaceChar(res, ' ', '_');
return res;
}
// [/SL:KB]
//static
void LLFloaterReg::registerControlVariables()
{
@ -536,51 +506,59 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD&
// * Also, if it is not on top, bring it forward when focus is given.
// * Else the target floater is open, close it.
//
std::string name = sdname.asString();
LLFloater* instance = getInstance(name, key);
if (!instance)
{
lldebugs << "Unable to get instance of floater '" << name << "'" << llendl;
return;
}
else if (instance->isMinimized())
// If hosted, we need to take that into account
LLFloater* host = instance->getHost();
if (host)
{
instance->setMinimized(FALSE);
instance->setVisibleAndFrontmost();
}
else if (!instance->isShown())
{
// [RLVa:KB] - Checked: 2011-12-17 (RLVa-1.4.5a) | Added: RLVa-1.4.5a
// [See LLFloaterReg::showInstance()]
if ( ((!sBlockShowFloaters) || (sAlwaysShowableList.find(name) != sAlwaysShowableList.end())) && (mValidateSignal(name, key)) )
if (host->isMinimized() || !host->isShown() || !host->isFrontmost())
{
host->setMinimized(FALSE);
instance->openFloater(key);
instance->setVisibleAndFrontmost(true, key);
}
else if (!instance->getVisible())
{
instance->openFloater(key);
instance->setVisibleAndFrontmost();
instance->setVisibleAndFrontmost(true, key);
instance->setFocus(TRUE);
}
else
{
instance->closeHostedFloater();
}
// [/RLVa:KB]
// instance->openFloater(key);
// instance->setVisibleAndFrontmost();
}
// [SL:KB] - Patch: Chat-NearbyChatBar | Checked: 2011-11-23 (Catznip-3.2.0b) | Modified: Catznip-3.2.0b
else
{
// Give focus to, or close, the host rather than the floater when hosted
LLFloater* floaterp = (!instance->getHost()) ? instance : instance->getHost();
if (!floaterp->isFrontmost() || !floaterp->hasFocus())
floaterp->setVisibleAndFrontmost();
if (instance->isMinimized())
{
instance->setMinimized(FALSE);
instance->setVisibleAndFrontmost(true, key);
}
else if (!instance->isShown())
{
instance->openFloater(key);
instance->setVisibleAndFrontmost(true, key);
}
else if (!instance->isFrontmost())
{
instance->setVisibleAndFrontmost(true, key);
}
else
floaterp->closeFloater();
{
instance->closeHostedFloater();
}
}
// [/SL:KB]
// else if (!instance->isFrontmost())
// {
// instance->setVisibleAndFrontmost();
// }
// else
// {
// instance->closeFloater();
// }
}
// static

View File

@ -151,11 +151,6 @@ public:
static std::string declareDockStateControl(const std::string& name);
static std::string getDockStateControlName(const std::string& name);
// [SL:KB] - Patch: UI-FloaterTearOffState | Checked: 2011-09-30 (Catznip-3.2.0a) | Added: Catznip-3.0.0a
static std::string declareTearOffStateControl(const std::string& name);
static std::string getTearOffStateControlName(const std::string& name);
// [/SL:KB]
static void registerControlVariables();
// Callback wrappers

File diff suppressed because it is too large Load Diff

View File

@ -39,19 +39,16 @@
#include "lluictrl.h"
#include "v4color.h"
#include "lldarray.h"
#include "stdenums.h"
#include "lldepthstack.h"
#include "lleditmenuhandler.h"
#include "llfontgl.h"
#include "llscrollcontainer.h"
#include "lltooldraganddrop.h"
#include "llviewertexture.h"
class LLFolderViewEventListener;
class LLFolderViewModelInterface;
class LLFolderViewFolder;
class LLFolderViewItem;
class LLInventoryModel;
class LLFolderViewFilter;
class LLPanel;
class LLLineEditor;
class LLMenuGL;
@ -91,136 +88,104 @@ public:
struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params>
{
Mandatory<LLPanel*> parent_panel;
Optional<LLUUID> task_id;
Optional<std::string> title;
Optional<bool> use_label_suffix,
allow_multiselect,
show_empty_message,
show_load_status,
use_ellipses;
use_ellipses,
show_item_link_overlays;
Mandatory<LLFolderViewModelInterface*> view_model;
Mandatory<std::string> options_menu;
Params();
};
friend class LLFolderViewScrollContainer;
typedef std::deque<LLFolderViewItem*> selected_items_t;
LLFolderView(const Params&);
virtual ~LLFolderView( void );
virtual BOOL canFocusChildren() const;
virtual const LLFolderView* getRoot() const { return this; }
virtual LLFolderView* getRoot() { return this; }
// FolderViews default to sort by name. This will change that,
// and resort the items if necessary.
void setSortOrder(U32 order);
void setFilterPermMask(PermissionMask filter_perm_mask);
LLFolderViewModelInterface* getFolderViewModel() { return mViewModel; }
const LLFolderViewModelInterface* getFolderViewModel() const { return mViewModel; }
typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t;
void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); }
void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); }
// filter is never null
LLInventoryFilter* getFilter();
const std::string getFilterSubString(BOOL trim = FALSE);
U32 getFilterObjectTypes() const;
PermissionMask getFilterPermissions() const;
// *NOTE: use getFilter()->getShowFolderState();
//LLInventoryFilter::EFolderShow getShowFolderState();
U32 getSortOrder() const;
BOOL isFilterModified();
bool getAllowMultiSelect() { return mAllowMultiSelect; }
// Close all folders in the view
void closeAllFolders();
void openTopLevelFolders();
virtual void toggleOpen() {};
virtual void setOpenArrangeRecursively(BOOL openitem, ERecurseType recurse);
virtual BOOL addFolder( LLFolderViewFolder* folder);
virtual void addFolder( LLFolderViewFolder* folder);
// Find width and height of this object and its children. Also
// makes sure that this view and its children are the right size.
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
virtual S32 arrange( S32* width, S32* height );
virtual S32 getItemHeight();
void arrangeAll() { mArrangeGeneration++; }
S32 getArrangeGeneration() { return mArrangeGeneration; }
// Apply filters to control visibility of inventory items
virtual void filter( LLInventoryFilter& filter);
// applies filters to control visibility of items
virtual void filter( LLFolderViewFilter& filter);
// Get the last selected item
virtual LLFolderViewItem* getCurSelectedItem( void );
selected_items_t& getSelectedItems( void );
// Record the selected item and pass it down the hierarchy.
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem,
BOOL take_keyboard_focus);
BOOL take_keyboard_focus = TRUE);
// Used by menu callbacks
void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
// Called once a frame to update the selection if mSelectThisID has been set
void updateSelection();
// This method is used to toggle the selection of an item.
// Walks children and keeps track of selected objects.
// This method is used to toggle the selection of an item. Walks
// children, and keeps track of selected objects.
virtual BOOL changeSelection(LLFolderViewItem* selection, BOOL selected);
virtual std::set<LLUUID> getSelectionList() const;
virtual std::set<LLFolderViewItem*> getSelectionList() const;
// Make sure if ancestor is selected, descendents are not
// Make sure if ancestor is selected, descendants are not
void sanitizeSelection();
void clearSelection();
virtual void clearSelection();
void addToSelectionList(LLFolderViewItem* item);
void removeFromSelectionList(LLFolderViewItem* item);
BOOL startDrag(LLToolDragAndDrop::ESource source);
bool startDrag();
void setDragAndDropThisFrame() { mDragAndDropThisFrame = TRUE; }
void setDraggingOverItem(LLFolderViewItem* item) { mDraggingOverItem = item; }
LLFolderViewItem* getDraggingOverItem() { return mDraggingOverItem; }
// Deletion functionality
void removeSelectedItems();
static void removeCutItems();
// Open the selected item
void openSelectedItems( void );
void propertiesSelectedItems( void );
// Change the folder type
void changeType(LLInventoryModel *model, LLFolderType::EType new_folder_type);
void autoOpenItem(LLFolderViewFolder* item);
void closeAutoOpenedFolders();
BOOL autoOpenTest(LLFolderViewFolder* item);
BOOL isOpen() const { return TRUE; } // root folder always open
// Copy & paste
virtual void copy();
virtual BOOL canCopy() const;
virtual void copy();
virtual void cut();
virtual BOOL canCut() const;
virtual void cut();
virtual void paste();
virtual BOOL canPaste() const;
virtual void doDelete();
virtual BOOL canDoDelete() const;
virtual void paste();
LLFolderViewItem* getNextUnselectedItem();
// Public rename functionality - can only start the process
void startRenamingSelectedItem( void );
// These functions were used when there was only one folderview,
// and relied on that concept. This functionality is now handled
// by the listeners and the lldraganddroptool.
//LLFolderViewItem* getMovingItem() { return mMovingItem; }
//void setMovingItem( LLFolderViewItem* item ) { mMovingItem = item; }
//void dragItemIntoFolder( LLFolderViewItem* moving_item, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept );
//void dragFolderIntoFolder( LLFolderViewFolder* moving_folder, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept );
// LLView functionality
///*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent );
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
@ -251,16 +216,9 @@ public:
BOOL getShowSingleSelection() { return mShowSingleSelection; }
F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); }
bool getUseEllipses() { return mUseEllipses; }
S32 getSelectedCount() { return (S32)mSelectedItems.size(); }
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
void removeItemID(const LLUUID& id);
LLFolderViewItem* getItemByID(const LLUUID& id);
LLFolderViewFolder* getFolderByID(const LLUUID& id);
bool doToSelected(LLInventoryModel* model, const LLSD& userdata);
void doIdle(); // Real idle routine
static void idle(void* user_data); // static glue to doIdle()
void update(); // needs to be called periodically (e.g. once per frame)
BOOL needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; }
BOOL needsAutoRename() { return mNeedsAutoRename; }
@ -268,9 +226,9 @@ public:
void setPinningSelectedItem(BOOL val) { mPinningSelectedItem = val; }
void setAutoSelectOverride(BOOL val) { mAutoSelectOverride = val; }
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
bool showItemLinkOverlays() { return mShowItemLinkOverlays; }
BOOL getDebugFilters() { return mDebugFilters; }
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
LLPanel* getParentPanel() { return mParentPanel; }
// DEBUG only
@ -299,18 +257,15 @@ protected:
BOOL addNoOptions(LLMenuGL* menu) const;
void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response);
protected:
LLHandle<LLView> mPopupMenuHandle;
typedef std::deque<LLFolderViewItem*> selected_items_t;
selected_items_t mSelectedItems;
BOOL mKeyboardSelection;
BOOL mAllowMultiSelect;
BOOL mShowEmptyMessage;
BOOL mShowFolderHierarchy;
LLUUID mSourceID;
// Renaming variables and methods
LLFolderViewItem* mRenameItem; // The item currently being renamed
@ -323,15 +278,13 @@ protected:
BOOL mAutoSelectOverride;
BOOL mNeedsAutoRename;
bool mUseLabelSuffix;
bool mShowItemLinkOverlays;
BOOL mDebugFilters;
U32 mSortOrder;
LLDepthStack<LLFolderViewFolder> mAutoOpenItems;
LLFolderViewFolder* mAutoOpenCandidate;
LLFrameTimer mAutoOpenTimer;
LLFrameTimer mSearchTimer;
std::string mSearchString;
LLInventoryFilter* mFilter;
BOOL mShowSelectionContext;
BOOL mShowSingleSelection;
LLFrameTimer mMultiSelectionFadeTimer;
@ -341,13 +294,11 @@ protected:
signal_t mReshapeSignal;
S32 mSignalSelectCallback;
S32 mMinWidth;
S32 mRunningHeight;
std::map<LLUUID, LLFolderViewItem*> mItemMap;
BOOL mDragAndDropThisFrame;
LLUUID mSelectThisID; // if non null, select this item
LLPanel* mParentPanel;
LLFolderViewModelInterface* mViewModel;
/**
* Is used to determine if we need to cut text In LLFolderViewItem to avoid horizontal scroll.
@ -389,11 +340,82 @@ private:
};
bool sort_item_name(LLFolderViewItem* a, LLFolderViewItem* b);
bool sort_item_date(LLFolderViewItem* a, LLFolderViewItem* b);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFolderViewFunctor
//
// Simple abstract base class for applying a functor to folders and
// items in a folder view hierarchy. This is suboptimal for algorithms
// that only work folders or only work on items, but I'll worry about
// that later when it's determined to be too slow.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLFolderViewFunctor
{
public:
virtual ~LLFolderViewFunctor() {}
virtual void doFolder(LLFolderViewFolder* folder) = 0;
virtual void doItem(LLFolderViewItem* item) = 0;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLSelectFirstFilteredItem
//
// This will select the first *item* found in the hierarchy. If no item can be
// selected, the first matching folder will.
// Since doFolder() is done first but we prioritize item selection, we let the
// first filtered folder set the selection and raise a folder flag.
// The selection might be overridden by the first filtered item in doItem()
// which checks an item flag. Since doFolder() checks the item flag too, the first
// item will still be selected if items were to be done first and folders second.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLSelectFirstFilteredItem : public LLFolderViewFunctor
{
public:
LLSelectFirstFilteredItem() : mItemSelected(FALSE), mFolderSelected(FALSE) {}
virtual ~LLSelectFirstFilteredItem() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
BOOL wasItemSelected() { return mItemSelected || mFolderSelected; }
protected:
BOOL mItemSelected;
BOOL mFolderSelected;
};
class LLOpenFilteredFolders : public LLFolderViewFunctor
{
public:
LLOpenFilteredFolders() {}
virtual ~LLOpenFilteredFolders() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
};
class LLSaveFolderState : public LLFolderViewFunctor
{
public:
LLSaveFolderState() : mApply(FALSE) {}
virtual ~LLSaveFolderState() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item) {}
void setApply(BOOL apply);
void clearOpenFolders() { mOpenFolders.clear(); }
protected:
std::set<LLUUID> mOpenFolders;
BOOL mApply;
};
class LLOpenFoldersWithSelection : public LLFolderViewFunctor
{
public:
LLOpenFoldersWithSelection() {}
virtual ~LLOpenFoldersWithSelection() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
};
// Flags for buildContextMenu()
const U32 SUPPRESS_OPEN_ITEM = 0x1;
const U32 FIRST_SELECTED_ITEM = 0x2;
const U32 ITEM_IN_MULTI_SELECTION = 0x4;
#endif // LL_LLFOLDERVIEW_H

File diff suppressed because it is too large Load Diff

View File

@ -26,55 +26,16 @@
#ifndef LLFOLDERVIEWITEM_H
#define LLFOLDERVIEWITEM_H
#include "llflashtimer.h"
#include "llview.h"
#include "lldarray.h" // *TODO: Eliminate, forward declare
#include "lluiimage.h"
class LLFontGL;
class LLFolderView;
class LLFolderViewEventListener;
class LLFolderViewModelItem;
class LLFolderViewFolder;
class LLFolderViewFunctor;
class LLFolderViewItem;
class LLFolderViewListenerFunctor;
class LLInventoryFilter;
class LLMenuGL;
class LLUIImage;
class LLViewerInventoryItem;
// These are grouping of inventory types.
// Order matters when sorting system folders to the top.
enum EInventorySortGroup
{
SG_SYSTEM_FOLDER,
SG_TRASH_FOLDER,
SG_NORMAL_FOLDER,
SG_ITEM
};
// *TODO: do we really need one sort object per folder?
// can we just have one of these per LLFolderView ?
class LLInventorySort
{
public:
LLInventorySort()
: mSortOrder(0),
mByDate(false),
mSystemToTop(false),
mFoldersByName(false) { }
// Returns true if order has changed
bool updateSort(U32 order);
U32 getSort() { return mSortOrder; }
bool isByDate() { return mByDate; }
bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b);
private:
U32 mSortOrder;
bool mByDate;
bool mSystemToTop;
bool mFoldersByName;
};
class LLFolderViewFilter;
class LLFolderViewModelInterface;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFolderViewItem
@ -86,153 +47,130 @@ private:
class LLFolderViewItem : public LLView
{
public:
static void initClass();
static void cleanupClass();
struct Params : public LLInitParam::Block<Params, LLView::Params>
{
Optional<LLUIImage*> icon;
Optional<LLUIImage*> icon_open; // used for folders
Optional<LLUIImage*> icon_overlay; // for links
Optional<LLFolderView*> root;
Mandatory<LLFolderViewEventListener*> listener;
Optional<LLUIImage*> folder_arrow_image,
selection_image;
Mandatory<LLFolderView*> root;
Mandatory<LLFolderViewModelItem*> listener;
Optional<LLUIImage*> folder_arrow_image;
Optional<S32> folder_indentation; // pixels
Optional<LLUIImage*> selection_image;
Optional<S32> item_height; // pixels
Optional<S32> item_top_pad; // pixels
Optional<S32> folder_indentation, // pixels
item_height,
item_top_pad;
Optional<S32> creation_date; //UTC seconds
Optional<time_t> creation_date;
Optional<bool> allow_open;
Optional<LLUIColor> font_color;
Optional<LLUIColor> font_highlight_color;
Optional<S32> left_pad,
icon_pad,
icon_width,
text_pad,
text_pad_right,
arrow_size,
max_folder_item_overlap;
Params();
};
// layout constants
static const S32 LEFT_PAD = 5;
// LEFT_INDENTATION is set via folder_indentation above
static const S32 ICON_PAD = 2;
static const S32 ICON_WIDTH = 16;
static const S32 TEXT_PAD = 1;
static const S32 TEXT_PAD_RIGHT = 4;
static const S32 ARROW_SIZE = 12;
static const S32 MAX_FOLDER_ITEM_OVERLAP = 2;
static const S32 DEFAULT_LABEL_PADDING_RIGHT = 4;
// animation parameters
static const F32 FOLDER_CLOSE_TIME_CONSTANT;
static const F32 FOLDER_OPEN_TIME_CONSTANT;
// <FS:ND> replaced by getSearchableLabel() const
// Mostly for debugging printout purposes.
// const std::string& getSearchableLabel() { return mSearchableLabel; }
// </FS:ND>
BOOL isLoading() const { return mIsLoading; }
private:
BOOL mIsSelected;
static const F32 FOLDER_CLOSE_TIME_CONSTANT,
FOLDER_OPEN_TIME_CONSTANT;
protected:
friend class LLUICtrlFactory;
friend class LLFolderViewEventListener;
friend class LLFolderViewModelItem;
LLFolderViewItem(const Params& p);
std::string mLabel;
// <FS:ND> Reduce memory load for users with huge inventory by only creating member we really need
// std::string mSearchableLabel;
// </FS:ND>
S32 mLabelWidth;
bool mLabelWidthDirty;
time_t mCreationDate;
S32 mLabelPaddingRight;
LLFolderViewFolder* mParentFolder;
LLFolderViewEventListener* mListener;
BOOL mIsCurSelection;
BOOL mSelectPending;
LLPointer<LLFolderViewModelItem> mViewModelItem;
LLFontGL::StyleFlags mLabelStyle;
std::string mLabelSuffix;
LLUIImagePtr mIcon;
#if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG // <FS:ND> Reduce memory load for users with huge inventory by only creating member we really need
std::string mStatusText;
#endif // </FS:ND>
LLUIImagePtr mIconOpen;
LLUIImagePtr mIconOverlay;
BOOL mHasVisibleChildren;
LLUIImagePtr mIcon,
mIconOpen,
mIconOverlay;
S32 mLocalIndentation;
S32 mIndentation;
S32 mItemHeight;
BOOL mPassedFilter;
S32 mLastFilterGeneration;
std::string::size_type mStringMatchOffset;
S32 mDragStartX,
mDragStartY;
// Begin Multi-substring inventory search
std::vector<std::string::size_type> mStringMatchOffsets;
std::vector<std::string::size_type> mStringMatchSizes;
// End Multi-substring inventory search
S32 mLeftPad,
mIconPad,
mIconWidth,
mTextPad,
mTextPadRight,
mArrowSize,
mMaxFolderItemOverlap;
F32 mControlLabelRotation;
LLFolderView* mRoot;
BOOL mDragAndDropTarget;
BOOL mIsLoading;
LLTimer mTimeSinceRequestStart;
bool mShowLoadStatus;
bool mIsMouseOverTitle;
bool mHasVisibleChildren,
mIsCurSelection,
mDragAndDropTarget,
mIsMouseOverTitle,
mAllowOpen,
mSelectPending;
LLUIColor mFontColor;
LLUIColor mFontHighlightColor;
// helper function to change the selection from the root.
void changeSelectionFromRoot(LLFolderViewItem* selection, BOOL selected);
// For now assuming all colors are the same in derived classes.
static bool sColorSetInitialized;
static LLUIColor sFgColor;
static LLUIColor sFgDisabledColor;
static LLUIColor sHighlightBgColor;
static LLUIColor sFlashBgColor;
static LLUIColor sFocusOutlineColor;
static LLUIColor sMouseOverColor;
static LLUIColor sFilterBGColor;
static LLUIColor sFilterTextColor;
static LLUIColor sSuffixColor;
static LLUIColor sSearchStatusColor;
// this is an internal method used for adding items to folders. A
// no-op at this level, but reimplemented in derived classes.
virtual BOOL addItem(LLFolderViewItem*) { return FALSE; }
virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; }
virtual void addItem(LLFolderViewItem*) { }
virtual void addFolder(LLFolderViewFolder*) { }
virtual bool isHighlightAllowed();
virtual bool isHighlightActive();
virtual bool isFlashing() { return false; }
virtual void setFlashState(bool) { }
static LLFontGL* getLabelFontForStyle(U8 style);
virtual void setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; }
BOOL mIsSelected;
public:
static void initClass();
static void cleanupClass();
BOOL postBuild();
// This function clears the currently selected item, and records
// the specified selected item appropriately for display and use
// in the UI. If open is TRUE, then folders are opened up along
// the way to the selection.
void setSelectionFromRoot(LLFolderViewItem* selection, BOOL openitem,
BOOL take_keyboard_focus = TRUE);
virtual void openItem( void );
// This function is called when the folder view is dirty. It's
// implemented here but called by derived classes when folding the
// views.
void arrangeFromRoot();
void filterFromRoot( void );
void arrangeAndSet(BOOL set_selection, BOOL take_keyboard_focus);
virtual ~LLFolderViewItem( void );
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
enum { ARRANGE = TRUE, DO_NOT_ARRANGE = FALSE };
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
virtual EInventorySortGroup getSortGroup() const;
virtual void addToFolder(LLFolderViewFolder* folder);
// Finds width and height of this object and it's children. Also
// makes sure that this view and it's children are the right size.
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
virtual S32 arrange( S32* width, S32* height );
virtual S32 getItemHeight();
// applies filters to control visibility of inventory items
virtual void filter( LLInventoryFilter& filter);
// updates filter serial number and optionally propagated value up to root
S32 getLastFilterGeneration() { return mLastFilterGeneration; }
virtual void dirtyFilter();
virtual S32 getLabelXPos();
S32 getIconPad();
S32 getTextPad();
// If 'selection' is 'this' then note that otherwise ignore.
// Returns TRUE if this item ends up being selected.
@ -250,7 +188,7 @@ public:
virtual void selectItem();
// gets multiple-element selection
virtual std::set<LLUUID> getSelectionList() const;
virtual std::set<LLFolderViewItem*> getSelectionList() const;
// Returns true is this object and all of its children can be removed (deleted by user)
virtual BOOL isRemovable();
@ -272,86 +210,54 @@ public:
BOOL hasVisibleChildren() { return mHasVisibleChildren; }
void setShowLoadStatus(bool status) { mShowLoadStatus = status; }
// Call through to the viewed object and return true if it can be
// removed. Returns true if it's removed.
//virtual BOOL removeRecursively(BOOL single_item);
BOOL remove();
// Build an appropriate context menu for the item. Flags unused.
void buildContextMenu(LLMenuGL& menu, U32 flags);
void buildContextMenu(class LLMenuGL& menu, U32 flags);
// This method returns the actual name of the thing being
// viewed. This method will ask the viewed object itself.
const std::string& getName( void ) const;
// const std::string& getSearchableLabel( void ) const;
std::string getSearchableLabel( void ) const;
// ## Zi: Extended Inventory Search
std::string getSearchableCreator( void ) const;
std::string getSearchableDescription( void ) const;
std::string getSearchableUUID( void ) const;
std::string getSearchableAll( void ) const;
LLViewerInventoryItem * getInventoryItem(void) const;
// ## Zi: Extended Inventory Search
// This method returns the label displayed on the view. This
// method was primarily added to allow sorting on the folder
// contents possible before the entire view has been constructed.
const std::string& getLabel() const { return mLabel; }
// Used for sorting, like getLabel() above.
virtual time_t getCreationDate() const { return mCreationDate; }
LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; }
const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; }
void setParentFolder(LLFolderViewFolder* parent) { mParentFolder = parent; }
LLFolderViewItem* getNextOpenNode( BOOL include_children = TRUE );
LLFolderViewItem* getPreviousOpenNode( BOOL include_children = TRUE );
const LLFolderViewEventListener* getListener( void ) const { return mListener; }
LLFolderViewEventListener* getListener( void ) { return mListener; }
// Gets the inventory item if it exists (null otherwise)
LLViewerInventoryItem * getInventoryItem(void);
const LLFolderViewModelItem* getViewModelItem( void ) const { return mViewModelItem; }
LLFolderViewModelItem* getViewModelItem( void ) { return mViewModelItem; }
const LLFolderViewModelInterface* getFolderViewModel( void ) const;
LLFolderViewModelInterface* getFolderViewModel( void );
// just rename the object.
void rename(const std::string& new_name);
// open
virtual void openItem( void );
virtual void preview(void);
// Show children (unfortunate that this is called "open")
// Show children
virtual void setOpen(BOOL open = TRUE) {};
virtual BOOL isOpen() const { return FALSE; }
virtual LLFolderView* getRoot();
virtual const LLFolderView* getRoot() const;
BOOL isDescendantOf( const LLFolderViewFolder* potential_ancestor );
S32 getIndentation() { return mIndentation; }
virtual BOOL potentiallyVisible(); // do we know for a fact that this item won't be displayed?
virtual BOOL potentiallyFiltered(); // do we know for a fact that this item has been filtered out?
virtual BOOL getFiltered();
virtual BOOL getFiltered(S32 filter_generation);
virtual void setFiltered(BOOL filtered, S32 filter_generation);
// change the icon
void setIcon(LLUIImagePtr icon);
virtual BOOL passedFilter(S32 filter_generation = -1);
// refresh information from the object being viewed.
void refreshFromListener();
virtual void refresh();
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
// LLView functionality
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
@ -361,15 +267,18 @@ public:
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return NULL; }
//virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return LLView::findChildView(name, recurse); }
// virtual void handleDropped();
virtual void draw();
void drawOpenFolderArrow(const Params& default_params, const LLUIColor& fg_color);
void drawHighlight(const BOOL showContent, const BOOL hasKeyboardFocus, const LLUIColor &selectColor, const LLUIColor &flashColor, const LLUIColor &outlineColor, const LLUIColor &mouseOverColor);
void drawLabel(const LLFontGL * font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
// <ND/> Don't bother with unneeded tooltips in inventor
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask);
@ -380,11 +289,6 @@ private:
static std::map<U8, LLFontGL*> sFonts; // map of styles to fonts
};
// function used for sorting.
typedef bool (*sort_order_f)(LLFolderViewItem* a, LLFolderViewItem* b);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFolderViewFolder
//
@ -399,33 +303,26 @@ protected:
LLFolderViewFolder( const LLFolderViewItem::Params& );
friend class LLUICtrlFactory;
public:
typedef enum e_trash
{
UNKNOWN, TRASH, NOT_TRASH
} ETrash;
void updateLabelRotation();
virtual bool isCollapsed() { return FALSE; }
public:
typedef std::list<LLFolderViewItem*> items_t;
typedef std::list<LLFolderViewFolder*> folders_t;
protected:
items_t mItems;
folders_t mFolders;
LLInventorySort mSortFunction;
BOOL mIsOpen;
BOOL mExpanderHighlighted;
F32 mCurHeight;
F32 mTargetHeight;
F32 mAutoOpenCountdown;
time_t mSubtreeCreationDate;
mutable ETrash mAmTrash;
S32 mLastArrangeGeneration;
S32 mLastCalculatedWidth;
S32 mCompletedFilterGeneration;
S32 mMostFilteredDescendantGeneration;
bool mNeedsSort;
bool mPassedFolderFilter;
public:
typedef enum e_recurse_type
@ -439,48 +336,25 @@ public:
virtual ~LLFolderViewFolder( void );
virtual BOOL potentiallyVisible();
LLFolderViewItem* getNextFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
LLFolderViewItem* getPreviousFromChild( LLFolderViewItem*, BOOL include_children = TRUE );
// addToFolder() returns TRUE if it succeeds. FALSE otherwise
virtual BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root);
virtual void addToFolder(LLFolderViewFolder* folder);
// Finds width and height of this object and it's children. Also
// makes sure that this view and it's children are the right size.
virtual S32 arrange( S32* width, S32* height, S32 filter_generation );
virtual S32 arrange( S32* width, S32* height );
BOOL needsArrange();
void requestSort();
// Returns the sort group (system, trash, folder) for this folder.
virtual EInventorySortGroup getSortGroup() const;
virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up);
virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; }
BOOL hasFilteredDescendants(S32 filter_generation);
BOOL hasFilteredDescendants();
// applies filters to control visibility of inventory items
virtual void filter( LLInventoryFilter& filter);
virtual void setFiltered(BOOL filtered, S32 filter_generation);
virtual BOOL getFiltered();
virtual BOOL getFiltered(S32 filter_generation);
virtual void dirtyFilter();
// folder-specific filtering (filter status propagates top down instead of bottom up)
void filterFolder(LLInventoryFilter& filter);
void setFilteredFolder(bool filtered, S32 filter_generation);
bool getFilteredFolder(S32 filter_generation);
bool descendantsPassedFilter(S32 filter_generation = -1);
// Passes selection information on to children and record
// selection information if necessary.
// Returns TRUE if this object (or a child) ends up being selected.
// If 'openitem' is TRUE then folders are opened up along the way to the selection.
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus);
virtual BOOL setSelection(LLFolderViewItem* selection, BOOL openitem, BOOL take_keyboard_focus = TRUE);
// This method is used to change the selection of an item.
// Recursively traverse all children; if 'selection' is 'this' then change
@ -500,31 +374,13 @@ public:
// destroys this folder, and all children
virtual void destroyView();
// If this folder can be removed, remove all children that can be
// removed, return TRUE if this is empty after the operation and
// it's viewed folder object can be removed.
//virtual BOOL removeRecursively(BOOL single_item);
//virtual BOOL remove();
// remove the specified item (and any children) if
// possible. Return TRUE if the item was deleted.
BOOL removeItem(LLFolderViewItem* item);
// simply remove the view (and any children) Don't bother telling
// the listeners.
void removeView(LLFolderViewItem* item);
// extractItem() removes the specified item from the folder, but
// doesn't delete it.
void extractItem( LLFolderViewItem* item );
virtual void extractItem( LLFolderViewItem* item );
// This function is called by a child that needs to be resorted.
void resort(LLFolderViewItem* item);
void setItemSortOrder(U32 ordering);
void sortBy(U32);
//BOOL (*func)(LLFolderViewItem* a, LLFolderViewItem* b));
void setAutoOpenCountdown(F32 countdown) { mAutoOpenCountdown = countdown; }
// folders can be opened. This will usually be called by internal
@ -535,8 +391,7 @@ public:
virtual void setOpen(BOOL openitem = TRUE);
// Called when a child is refreshed.
// don't rearrange child folder contents unless explicitly requested
virtual void requestArrange(BOOL include_descendants = FALSE);
virtual void requestArrange();
// internal method which doesn't update the entire view. This
// method was written because the list iterators destroy the state
@ -549,65 +404,60 @@ public:
// special case if an object is dropped on the child.
BOOL handleDragAndDropFromChild(MASK mask,
BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
void applyFunctorRecursively(LLFolderViewFunctor& functor);
virtual void applyListenerFunctorRecursively(LLFolderViewListenerFunctor& functor);
// Just apply this functor to the folder's immediate children.
void applyFunctorToChildren(LLFolderViewFunctor& functor);
// apply this functor to the folder's descendants.
void applyFunctorRecursively(LLFolderViewFunctor& functor);
virtual void openItem( void );
virtual BOOL addItem(LLFolderViewItem* item);
virtual BOOL addFolder( LLFolderViewFolder* folder);
// LLView functionality
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask );
virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask );
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
BOOL handleDragAndDropToThisFolder(MASK mask, BOOL drop,
virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask,
BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
BOOL handleDragAndDropToThisFolder(MASK mask,
BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg);
virtual void draw();
time_t getCreationDate() const;
bool isTrash() const;
folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); }
folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); }
folders_t::iterator getFoldersBegin() { return mFolders.begin(); }
folders_t::iterator getFoldersEnd() { return mFolders.end(); }
folders_t::size_type getFoldersCount() const { return mFolders.size(); }
items_t::const_iterator getItemsBegin() const { return mItems.begin(); }
items_t::const_iterator getItemsEnd() const { return mItems.end(); }
items_t::size_type getItemsCount() const { return mItems.size(); }
LLFolderViewFolder* getCommonAncestor(LLFolderViewItem* item_a, LLFolderViewItem* item_b, bool& reverse);
void gatherChildRangeExclusive(LLFolderViewItem* start, LLFolderViewItem* end, bool reverse, std::vector<LLFolderViewItem*>& items);
// internal functions for tracking folders and items separately
// use addToFolder() virtual method to ensure folders are always added to mFolders
// and not mItems
void addItem(LLFolderViewItem* item);
void addFolder( LLFolderViewFolder* folder);
//WARNING: do not call directly...use the appropriate LLFolderViewModel-derived class instead
template<typename SORT_FUNC> void sortFolders(const SORT_FUNC& func) { mFolders.sort(func); }
template<typename SORT_FUNC> void sortItems(const SORT_FUNC& func) { mItems.sort(func); }
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLFolderViewListenerFunctor
//
// This simple abstract base class can be used to applied to all
// listeners in a hierarchy.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLFolderViewListenerFunctor
{
public:
virtual ~LLFolderViewListenerFunctor() {}
virtual void operator()(LLFolderViewEventListener* listener) = 0;
};
#endif // LLFOLDERVIEWITEM_H

View File

@ -0,0 +1,68 @@
/**
* @file llfolderviewmodel.cpp
* @brief Implementation of the view model collection of classes.
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llfolderviewmodel.h"
#include "lltrans.h"
bool LLFolderViewModelCommon::needsSort(LLFolderViewModelItem* item)
{
return item->getSortVersion() < mTargetSortVersion;
}
std::string LLFolderViewModelCommon::getStatusText()
{
if (!contentsReady() || mFolderView->getViewModelItem()->getLastFilterGeneration() < getFilter().getCurrentGeneration())
{
return LLTrans::getString("Searching");
}
else
{
return getFilter().getEmptyLookupMessage();
}
}
void LLFolderViewModelCommon::filter()
{
getFilter().setFilterCount(llclamp(LLUI::sSettingGroups["config"]->getS32("FilterItemsPerFrame"), 1, 5000));
mFolderView->getViewModelItem()->filter(getFilter());
}
bool LLFolderViewModelItemCommon::hasFilterStringMatch()
{
return mStringMatchOffsetFilter != std::string::npos;
}
std::string::size_type LLFolderViewModelItemCommon::getFilterStringOffset()
{
return mStringMatchOffsetFilter;
}
std::string::size_type LLFolderViewModelItemCommon::getFilterStringSize()
{
return mRootViewModel.getFilter().getFilterStringSize();
}

View File

@ -0,0 +1,444 @@
/**
* @file llfolderviewmodel.h
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LLFOLDERVIEWMODEL_H
#define LLFOLDERVIEWMODEL_H
#include "llfontgl.h" // just for StyleFlags enum
#include "llfolderview.h"
// These are grouping of inventory types.
// Order matters when sorting system folders to the top.
enum EInventorySortGroup
{
SG_SYSTEM_FOLDER,
SG_TRASH_FOLDER,
SG_NORMAL_FOLDER,
SG_ITEM
};
class LLFontGL;
class LLInventoryModel;
class LLMenuGL;
class LLUIImage;
class LLUUID;
class LLFolderViewItem;
class LLFolderViewFolder;
class LLFolderViewFilter
{
public:
enum EFilterModified
{
FILTER_NONE, // nothing to do, already filtered
FILTER_RESTART, // restart filtering from scratch
FILTER_LESS_RESTRICTIVE, // existing filtered items will certainly pass this filter
FILTER_MORE_RESTRICTIVE // if you didn't pass the previous filter, you definitely won't pass this one
};
public:
LLFolderViewFilter() {}
virtual ~LLFolderViewFilter() {}
// +-------------------------------------------------------------------+
// + Execution And Results
// +-------------------------------------------------------------------+
virtual bool check(const LLFolderViewModelItem* item) = 0;
virtual bool checkFolder(const LLFolderViewModelItem* folder) const = 0;
virtual void setEmptyLookupMessage(const std::string& message) = 0;
virtual std::string getEmptyLookupMessage() const = 0;
virtual bool showAllResults() const = 0;
virtual std::string::size_type getStringMatchOffset(LLFolderViewModelItem* item) const = 0;
virtual std::string::size_type getFilterStringSize() const = 0;
// +-------------------------------------------------------------------+
// + Status
// +-------------------------------------------------------------------+
virtual bool isActive() const = 0;
virtual bool isModified() const = 0;
virtual void clearModified() = 0;
virtual const std::string& getName() const = 0;
virtual const std::string& getFilterText() = 0;
//RN: this is public to allow system to externally force a global refilter
virtual void setModified(EFilterModified behavior = FILTER_RESTART) = 0;
// +-------------------------------------------------------------------+
// + Count
// +-------------------------------------------------------------------+
virtual void setFilterCount(S32 count) = 0;
virtual S32 getFilterCount() const = 0;
virtual void decrementFilterCount() = 0;
// +-------------------------------------------------------------------+
// + Default
// +-------------------------------------------------------------------+
virtual bool isDefault() const = 0;
virtual bool isNotDefault() const = 0;
virtual void markDefault() = 0;
virtual void resetDefault() = 0;
// +-------------------------------------------------------------------+
// + Generation
// +-------------------------------------------------------------------+
virtual S32 getCurrentGeneration() const = 0;
virtual S32 getFirstSuccessGeneration() const = 0;
virtual S32 getFirstRequiredGeneration() const = 0;
};
class LLFolderViewModelInterface
{
public:
virtual ~LLFolderViewModelInterface() {}
virtual void requestSortAll() = 0;
virtual void sort(class LLFolderViewFolder*) = 0;
virtual void filter() = 0;
virtual bool contentsReady() = 0;
virtual void setFolderView(LLFolderView* folder_view) = 0;
virtual LLFolderViewFilter& getFilter() = 0;
virtual const LLFolderViewFilter& getFilter() const = 0;
virtual std::string getStatusText() = 0;
virtual bool startDrag(std::vector<LLFolderViewModelItem*>& items) = 0;
};
// This is an abstract base class that users of the folderview classes
// would use to bridge the folder view with the underlying data
class LLFolderViewModelItem : public LLRefCount
{
public:
LLFolderViewModelItem() { }
virtual ~LLFolderViewModelItem() { }
virtual void update() {} //called when drawing
virtual const std::string& getName() const = 0;
virtual const std::string& getDisplayName() const = 0;
virtual const std::string& getSearchableName() const = 0;
virtual LLPointer<LLUIImage> getIcon() const = 0;
virtual LLPointer<LLUIImage> getIconOpen() const { return getIcon(); }
virtual LLPointer<LLUIImage> getIconOverlay() const { return NULL; }
virtual LLFontGL::StyleFlags getLabelStyle() const = 0;
virtual std::string getLabelSuffix() const = 0;
virtual void openItem( void ) = 0;
virtual void closeItem( void ) = 0;
virtual void selectItem(void) = 0;
virtual BOOL isItemRenameable() const = 0;
virtual BOOL renameItem(const std::string& new_name) = 0;
virtual BOOL isItemMovable( void ) const = 0; // Can be moved to another folder
virtual void move( LLFolderViewModelItem* parent_listener ) = 0;
virtual BOOL isItemRemovable( void ) const = 0; // Can be destroyed
virtual BOOL removeItem() = 0;
virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) = 0;
virtual BOOL isItemCopyable() const = 0;
virtual BOOL copyToClipboard() const = 0;
virtual BOOL cutToClipboard() const = 0;
virtual BOOL isClipboardPasteable() const = 0;
virtual void pasteFromClipboard() = 0;
virtual void pasteLinkFromClipboard() = 0;
virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0;
virtual bool potentiallyVisible() = 0; // is the item definitely visible or we haven't made up our minds yet?
virtual bool filter( LLFolderViewFilter& filter) = 0;
virtual bool passedFilter(S32 filter_generation = -1) = 0;
virtual bool descendantsPassedFilter(S32 filter_generation = -1) = 0;
virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0;
virtual void setPassedFolderFilter(bool passed, S32 filter_generation) = 0;
virtual void dirtyFilter() = 0;
virtual bool hasFilterStringMatch() = 0;
virtual std::string::size_type getFilterStringOffset() = 0;
virtual std::string::size_type getFilterStringSize() = 0;
virtual S32 getLastFilterGeneration() const = 0;
virtual bool hasChildren() const = 0;
virtual void addChild(LLFolderViewModelItem* child) = 0;
virtual void removeChild(LLFolderViewModelItem* child) = 0;
// This method will be called to determine if a drop can be
// performed, and will set drop to TRUE if a drop is
// requested. Returns TRUE if a drop is possible/happened,
// otherwise FALSE.
virtual BOOL dragOrDrop(MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
std::string& tooltip_msg) = 0;
virtual void requestSort() = 0;
virtual S32 getSortVersion() = 0;
virtual void setSortVersion(S32 version) = 0;
virtual void setParent(LLFolderViewModelItem* parent) = 0;
virtual bool hasParent() = 0;
protected:
friend class LLFolderViewItem;
virtual void setFolderViewItem(LLFolderViewItem* folder_view_item) = 0;
};
class LLFolderViewModelItemCommon : public LLFolderViewModelItem
{
public:
LLFolderViewModelItemCommon(LLFolderViewModelInterface& root_view_model)
: mSortVersion(-1),
mPassedFilter(true),
mPassedFolderFilter(true),
mStringMatchOffsetFilter(std::string::npos),
mStringFilterSize(0),
mFolderViewItem(NULL),
mLastFilterGeneration(-1),
mLastFolderFilterGeneration(-1),
mMostFilteredDescendantGeneration(-1),
mParent(NULL),
mRootViewModel(root_view_model)
{
mChildren.clear();
}
void requestSort() { mSortVersion = -1; }
S32 getSortVersion() { return mSortVersion; }
void setSortVersion(S32 version) { mSortVersion = version;}
S32 getLastFilterGeneration() const { return mLastFilterGeneration; }
S32 getLastFolderFilterGeneration() const { return mLastFolderFilterGeneration; }
void dirtyFilter()
{
mLastFilterGeneration = -1;
mLastFolderFilterGeneration = -1;
// bubble up dirty flag all the way to root
if (mParent)
{
mParent->dirtyFilter();
}
}
bool hasFilterStringMatch();
std::string::size_type getFilterStringOffset();
std::string::size_type getFilterStringSize();
typedef std::list<LLFolderViewModelItem*> child_list_t;
virtual void addChild(LLFolderViewModelItem* child)
{
// Avoid duplicates: bail out if that child is already present in the list
// Note: this happens when models are created before views
child_list_t::const_iterator iter;
for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
{
if (child == *iter)
{
return;
}
}
mChildren.push_back(child);
child->setParent(this);
dirtyFilter();
requestSort();
}
virtual void removeChild(LLFolderViewModelItem* child)
{
mChildren.remove(child);
child->setParent(NULL);
dirtyFilter();
}
virtual void clearChildren()
{
// As this is cleaning the whole list of children wholesale, we do need to delete the pointed objects
// This is different and not equivalent to calling removeChild() on each child
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
mChildren.clear();
dirtyFilter();
}
child_list_t::const_iterator getChildrenBegin() const { return mChildren.begin(); }
child_list_t::const_iterator getChildrenEnd() const { return mChildren.end(); }
child_list_t::size_type getChildrenCount() const { return mChildren.size(); }
void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0)
{
mPassedFilter = passed;
mLastFilterGeneration = filter_generation;
mStringMatchOffsetFilter = string_offset;
mStringFilterSize = string_size;
}
void setPassedFolderFilter(bool passed, S32 filter_generation)
{
mPassedFolderFilter = passed;
mLastFolderFilterGeneration = filter_generation;
}
virtual bool potentiallyVisible()
{
return passedFilter() // we've passed the filter
|| getLastFilterGeneration() < mRootViewModel.getFilter().getFirstSuccessGeneration() // or we don't know yet
|| descendantsPassedFilter();
}
virtual bool passedFilter(S32 filter_generation = -1)
{
if (filter_generation < 0)
filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration();
bool passed_folder_filter = mPassedFolderFilter && mLastFolderFilterGeneration >= filter_generation;
bool passed_filter = mPassedFilter && mLastFilterGeneration >= filter_generation;
return passed_folder_filter
&& (descendantsPassedFilter(filter_generation)
|| passed_filter);
}
virtual bool descendantsPassedFilter(S32 filter_generation = -1)
{
if (filter_generation < 0) filter_generation = mRootViewModel.getFilter().getFirstSuccessGeneration();
return mMostFilteredDescendantGeneration >= filter_generation;
}
protected:
virtual void setParent(LLFolderViewModelItem* parent) { mParent = parent; }
virtual bool hasParent() { return mParent != NULL; }
S32 mSortVersion;
bool mPassedFilter;
bool mPassedFolderFilter;
std::string::size_type mStringMatchOffsetFilter;
std::string::size_type mStringFilterSize;
S32 mLastFilterGeneration;
S32 mLastFolderFilterGeneration;
S32 mMostFilteredDescendantGeneration;
child_list_t mChildren;
LLFolderViewModelItem* mParent;
LLFolderViewModelInterface& mRootViewModel;
void setFolderViewItem(LLFolderViewItem* folder_view_item) { mFolderViewItem = folder_view_item;}
LLFolderViewItem* mFolderViewItem;
};
class LLFolderViewModelCommon : public LLFolderViewModelInterface
{
public:
LLFolderViewModelCommon()
: mTargetSortVersion(0),
mFolderView(NULL)
{}
virtual void requestSortAll()
{
// sort everything
mTargetSortVersion++;
}
virtual std::string getStatusText();
virtual void filter();
void setFolderView(LLFolderView* folder_view) { mFolderView = folder_view;}
protected:
bool needsSort(class LLFolderViewModelItem* item);
S32 mTargetSortVersion;
LLFolderView* mFolderView;
};
template <typename SORT_TYPE, typename ITEM_TYPE, typename FOLDER_TYPE, typename FILTER_TYPE>
class LLFolderViewModel : public LLFolderViewModelCommon
{
public:
LLFolderViewModel(){}
virtual ~LLFolderViewModel() {}
typedef SORT_TYPE SortType;
typedef ITEM_TYPE ItemType;
typedef FOLDER_TYPE FolderType;
typedef FILTER_TYPE FilterType;
virtual SortType& getSorter() { return mSorter; }
virtual const SortType& getSorter() const { return mSorter; }
virtual void setSorter(const SortType& sorter) { mSorter = sorter; requestSortAll(); }
virtual FilterType& getFilter() { return mFilter; }
virtual const FilterType& getFilter() const { return mFilter; }
virtual void setFilter(const FilterType& filter) { mFilter = filter; }
// By default, we assume the content is available. If a network fetch mechanism is implemented for the model,
// this method needs to be overloaded and return the relevant fetch status.
virtual bool contentsReady() { return true; }
struct ViewModelCompare
{
ViewModelCompare(const SortType& sorter)
: mSorter(sorter)
{}
bool operator () (const LLFolderViewItem* a, const LLFolderViewItem* b) const
{
return mSorter(static_cast<const ItemType*>(a->getViewModelItem()), static_cast<const ItemType*>(b->getViewModelItem()));
}
bool operator () (const LLFolderViewFolder* a, const LLFolderViewFolder* b) const
{
return mSorter(static_cast<const ItemType*>(a->getViewModelItem()), static_cast<const ItemType*>(b->getViewModelItem()));
}
const SortType& mSorter;
};
void sort(LLFolderViewFolder* folder)
{
if (needsSort(folder->getViewModelItem()))
{
folder->sortFolders(ViewModelCompare(getSorter()));
folder->sortItems(ViewModelCompare(getSorter()));
folder->getViewModelItem()->setSortVersion(mTargetSortVersion);
folder->requestArrange();
}
}
protected:
SortType mSorter;
FilterType mFilter;
};
#endif // LLFOLDERVIEWMODEL_H

View File

@ -32,11 +32,10 @@
#include "lllocalcliprect.h"
#include "llpanel.h"
#include "llresizebar.h"
#include "llcriticaldamp.h"
#include "boost/foreach.hpp"
static const F32 MIN_FRACTIONAL_SIZE = 0.0f;
static const F32 MIN_FRACTIONAL_SIZE = 0.00001f;
static const F32 MAX_FRACTIONAL_SIZE = 1.f;
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
@ -71,7 +70,7 @@ LLLayoutPanel::LLLayoutPanel(const Params& p)
mCollapseAmt(0.f),
mVisibleAmt(1.f), // default to fully visible
mResizeBar(NULL),
mFractionalSize(MIN_FRACTIONAL_SIZE),
mFractionalSize(0.f),
mTargetDim(0),
mIgnoreReshape(false),
mOrientation(LLLayoutStack::HORIZONTAL)
@ -608,7 +607,7 @@ void LLLayoutStack::updateFractionalSizes()
{
if (panelp->mAutoResize)
{
total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim());
total_resizable_dim += llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
}
}
@ -759,12 +758,12 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
S32 new_dim = (mOrientation == HORIZONTAL)
? new_rect.getWidth()
: new_rect.getHeight();
S32 delta_dim = new_dim - resized_panel->getVisibleDim();
if (delta_dim == 0) return;
S32 delta_panel_dim = new_dim - resized_panel->getVisibleDim();
if (delta_panel_dim == 0) return;
F32 total_visible_fraction = 0.f;
F32 delta_auto_resize_headroom = 0.f;
F32 original_auto_resize_headroom = 0.f;
F32 old_auto_resize_headroom = 0.f;
LLLayoutPanel* other_resize_panel = NULL;
LLLayoutPanel* following_panel = NULL;
@ -773,7 +772,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
{
if (panelp->mAutoResize)
{
original_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
old_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
if (panelp->getVisible() && !panelp->mCollapsed)
{
total_visible_fraction += panelp->mFractionalSize;
@ -791,25 +790,24 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
}
if (resized_panel->mAutoResize)
{
if (!other_resize_panel || !other_resize_panel->mAutoResize)
{
delta_auto_resize_headroom += delta_dim;
delta_auto_resize_headroom += delta_panel_dim;
}
}
else
{
if (!other_resize_panel || other_resize_panel->mAutoResize)
{
delta_auto_resize_headroom -= delta_dim;
delta_auto_resize_headroom -= delta_panel_dim;
}
}
F32 fraction_given_up = 0.f;
F32 fraction_remaining = 1.f;
F32 updated_auto_resize_headroom = original_auto_resize_headroom + delta_auto_resize_headroom;
F32 new_auto_resize_headroom = old_auto_resize_headroom + delta_auto_resize_headroom;
enum
{
@ -821,7 +819,14 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
{
if (!panelp->getVisible() || panelp->mCollapsed) continue;
if (!panelp->getVisible() || panelp->mCollapsed)
{
if (panelp->mAutoResize)
{
fraction_remaining -= panelp->mFractionalSize;
}
continue;
}
if (panelp == resized_panel)
{
@ -833,9 +838,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
case BEFORE_RESIZED_PANEL:
if (panelp->mAutoResize)
{ // freeze current size as fraction of overall auto_resize space
F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f
F32 fractional_adjustment_factor = new_auto_resize_headroom == 0.f
? 1.f
: original_auto_resize_headroom / updated_auto_resize_headroom;
: old_auto_resize_headroom / new_auto_resize_headroom;
F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
MIN_FRACTIONAL_SIZE,
MAX_FRACTIONAL_SIZE);
@ -852,9 +857,9 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
case RESIZED_PANEL:
if (panelp->mAutoResize)
{ // freeze new size as fraction
F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
F32 new_fractional_size = (new_auto_resize_headroom == 0.f)
? MAX_FRACTIONAL_SIZE
: llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
: llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim()) / new_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
fraction_remaining -= panelp->mFractionalSize;
panelp->mFractionalSize = new_fractional_size;
@ -877,29 +882,22 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
else
{
// <FS:Ansariel> Don't divide by zero! updated_auto_resize_headroom
// will be zero if the next panel after the resized
// panel reaches it minimum size. Set the new
// fractional size to MAX_FRACTIONAL_SIZE because
// it seems to be always MAX_FRACTIONAL_SIZE during
// resizing.
//F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
// / updated_auto_resize_headroom,
// MIN_FRACTIONAL_SIZE,
// MAX_FRACTIONAL_SIZE);
F32 new_fractional_size = (updated_auto_resize_headroom == 0.f) ? MAX_FRACTIONAL_SIZE
: llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
/ updated_auto_resize_headroom,
if (new_auto_resize_headroom < 1.f)
{
new_auto_resize_headroom = 1.f;
}
F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
/ new_auto_resize_headroom,
MIN_FRACTIONAL_SIZE,
MAX_FRACTIONAL_SIZE);
// </FS:Ansariel>
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
panelp->mFractionalSize = new_fractional_size;
}
}
else
{
panelp->mTargetDim -= delta_dim;
panelp->mTargetDim -= delta_panel_dim;
}
which_panel = AFTER_RESIZED_PANEL;
break;
@ -915,7 +913,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
}
}
updateLayout();
normalizeFractionalSizes();
//normalizeFractionalSizes();
}
void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)

Some files were not shown because too many files have changed in this diff Show More