Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
c8221993
Commit
c8221993
authored
13 years ago
by
Leslie Linden
Browse files
Options
Downloads
Patches
Plain Diff
mac and linux build fixes
parent
98ec4db6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llui/llloadingindicator.cpp
+1
-1
1 addition, 1 deletion
indra/llui/llloadingindicator.cpp
indra/llxuixml/llinitparam.h
+29
-24
29 additions, 24 deletions
indra/llxuixml/llinitparam.h
with
30 additions
and
25 deletions
indra/llui/llloadingindicator.cpp
+
1
−
1
View file @
c8221993
...
@@ -77,7 +77,7 @@ void LLLoadingIndicator::draw()
...
@@ -77,7 +77,7 @@ void LLLoadingIndicator::draw()
start
();
start
();
}
}
LLUIImagePtr
cur_image
=
mImages
.
empty
()
?
NULL
:
mImages
[
mCurImageIdx
];
LLUIImagePtr
cur_image
=
mImages
.
empty
()
?
LLUIImagePtr
(
NULL
)
:
mImages
[
mCurImageIdx
];
// Draw current image.
// Draw current image.
if
(
cur_image
.
notNull
()
)
if
(
cur_image
.
notNull
()
)
...
...
This diff is collapsed.
Click to expand it.
indra/llxuixml/llinitparam.h
+
29
−
24
View file @
c8221993
...
@@ -100,7 +100,7 @@ namespace LLInitParam
...
@@ -100,7 +100,7 @@ namespace LLInitParam
class
TypeValuesHelper
class
TypeValuesHelper
{
{
public:
public:
typedef
std
::
map
<
std
::
string
,
T
>
value_name_map_t
;
typedef
typename
std
::
map
<
std
::
string
,
T
>
value_name_map_t
;
//TODO: cache key by index to save on param block size
//TODO: cache key by index to save on param block size
void
setValueName
(
const
std
::
string
&
value_name
)
void
setValueName
(
const
std
::
string
&
value_name
)
...
@@ -121,7 +121,7 @@ namespace LLInitParam
...
@@ -121,7 +121,7 @@ namespace LLInitParam
static
bool
getValueFromName
(
const
std
::
string
&
name
,
T
&
value
)
static
bool
getValueFromName
(
const
std
::
string
&
name
,
T
&
value
)
{
{
value_name_map_t
*
map
=
getValueNames
();
value_name_map_t
*
map
=
getValueNames
();
value_name_map_t
::
iterator
found_it
=
map
->
find
(
name
);
typename
value_name_map_t
::
iterator
found_it
=
map
->
find
(
name
);
if
(
found_it
==
map
->
end
())
return
false
;
if
(
found_it
==
map
->
end
())
return
false
;
value
=
found_it
->
second
;
value
=
found_it
->
second
;
...
@@ -151,7 +151,7 @@ namespace LLInitParam
...
@@ -151,7 +151,7 @@ namespace LLInitParam
static
std
::
vector
<
std
::
string
>
sValues
;
static
std
::
vector
<
std
::
string
>
sValues
;
value_name_map_t
*
map
=
getValueNames
();
value_name_map_t
*
map
=
getValueNames
();
for
(
value_name_map_t
::
iterator
it
=
map
->
begin
(),
end_it
=
map
->
end
();
for
(
typename
value_name_map_t
::
iterator
it
=
map
->
begin
(),
end_it
=
map
->
end
();
it
!=
end_it
;
it
!=
end_it
;
++
it
)
++
it
)
{
{
...
@@ -598,6 +598,7 @@ namespace LLInitParam
...
@@ -598,6 +598,7 @@ namespace LLInitParam
typedef
const
T
&
value_assignment_t
;
typedef
const
T
&
value_assignment_t
;
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
HAS_MULTIPLE_VALUES
,
VALUE_IS_BLOCK
>
self_t
;
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
HAS_MULTIPLE_VALUES
,
VALUE_IS_BLOCK
>
self_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
typedef
ParamValue
<
T
,
NAME_VALUE_LOOKUP
>
param_value_t
;
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
...
@@ -704,7 +705,7 @@ namespace LLInitParam
...
@@ -704,7 +705,7 @@ namespace LLInitParam
void
set
(
value_assignment_t
val
,
bool
flag_as_provided
=
true
)
void
set
(
value_assignment_t
val
,
bool
flag_as_provided
=
true
)
{
{
setValue
(
val
);
setValue
(
val
);
clearValueName
();
param_value_t
::
clearValueName
();
setProvided
(
flag_as_provided
);
setProvided
(
flag_as_provided
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
flag_as_provided
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
flag_as_provided
);
}
}
...
@@ -718,9 +719,9 @@ namespace LLInitParam
...
@@ -718,9 +719,9 @@ namespace LLInitParam
}
}
// implicit conversion
// implicit conversion
operator
value_assignment_t
()
const
{
return
getValue
();
}
operator
value_assignment_t
()
const
{
return
param_value_t
::
getValue
();
}
// explicit conversion
// explicit conversion
value_assignment_t
operator
()()
const
{
return
getValue
();
}
value_assignment_t
operator
()()
const
{
return
param_value_t
::
getValue
();
}
protected
:
protected
:
...
@@ -752,10 +753,11 @@ namespace LLInitParam
...
@@ -752,10 +753,11 @@ namespace LLInitParam
typedef
value_const_t
&
value_assignment_t
;
typedef
value_const_t
&
value_assignment_t
;
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
false
,
true
>
self_t
;
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
false
,
true
>
self_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
typedef
ParamValue
<
T
,
NAME_VALUE_LOOKUP
>
param_value_t
;
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
:
Param
(
block_descriptor
.
mCurrentBlockPtr
),
P
aram
V
alue
(
value
)
p
aram
_v
alue
_t
(
value
)
{
{
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
))
if
(
LL_UNLIKELY
(
block_descriptor
.
mInitializationState
==
BlockDescriptor
::
INITIALIZING
))
{
{
...
@@ -840,23 +842,23 @@ namespace LLInitParam
...
@@ -840,23 +842,23 @@ namespace LLInitParam
bool
isProvided
()
const
bool
isProvided
()
const
{
{
// only validate block when it hasn't already passed validation with current data
// only validate block when it hasn't already passed validation with current data
if
(
Param
::
anyProvided
()
&&
mValidatedVersion
<
getLastChangeVersion
())
if
(
Param
::
anyProvided
()
&&
param_value_t
::
mValidatedVersion
<
param_value_t
::
getLastChangeVersion
())
{
{
// a sub-block is "provided" when it has been filled in enough to be valid
// a sub-block is "provided" when it has been filled in enough to be valid
mValidated
=
validateBlock
(
false
);
param_value_t
::
mValidated
=
param_value_t
::
validateBlock
(
false
);
mValidatedVersion
=
getLastChangeVersion
();
param_value_t
::
mValidatedVersion
=
param_value_t
::
getLastChangeVersion
();
}
}
return
Param
::
anyProvided
()
&&
mValidated
;
return
Param
::
anyProvided
()
&&
param_value_t
::
mValidated
;
}
}
// assign block contents to this param-that-is-a-block
// assign block contents to this param-that-is-a-block
void
set
(
value_assignment_t
val
,
bool
flag_as_provided
=
true
)
void
set
(
value_assignment_t
val
,
bool
flag_as_provided
=
true
)
{
{
setValue
(
val
);
setValue
(
val
);
clearValueName
();
param_value_t
::
clearValueName
();
// force revalidation of block by clearing known provided version
// force revalidation of block by clearing known provided version
// next call to isProvided() will update provision status based on validity
// next call to isProvided() will update provision status based on validity
mValidatedVersion
=
-
1
;
param_value_t
::
mValidatedVersion
=
-
1
;
setProvided
(
flag_as_provided
);
setProvided
(
flag_as_provided
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
flag_as_provided
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
flag_as_provided
);
}
}
...
@@ -883,9 +885,9 @@ namespace LLInitParam
...
@@ -883,9 +885,9 @@ namespace LLInitParam
}
}
// implicit conversion
// implicit conversion
operator
value_assignment_t
()
const
{
return
getValue
();
}
operator
value_assignment_t
()
const
{
return
param_value_t
::
getValue
();
}
// explicit conversion
// explicit conversion
value_assignment_t
operator
()()
const
{
return
getValue
();
}
value_assignment_t
operator
()()
const
{
return
param_value_t
::
getValue
();
}
protected
:
protected
:
...
@@ -897,7 +899,7 @@ namespace LLInitParam
...
@@ -897,7 +899,7 @@ namespace LLInitParam
if
(
src_typed_param
.
isProvided
()
if
(
src_typed_param
.
isProvided
()
&&
(
overwrite
||
!
dst_typed_param
.
isProvided
()))
&&
(
overwrite
||
!
dst_typed_param
.
isProvided
()))
{
{
if
(
dst_typed_param
.
merge
(
selfBlockDescriptor
(),
src_typed_param
,
overwrite
))
if
(
dst_typed_param
.
merge
(
param_value_t
::
selfBlockDescriptor
(),
src_typed_param
,
overwrite
))
{
{
dst_typed_param
.
clearValueName
();
dst_typed_param
.
clearValueName
();
return
true
;
return
true
;
...
@@ -914,14 +916,15 @@ namespace LLInitParam
...
@@ -914,14 +916,15 @@ namespace LLInitParam
{
{
public:
public:
typedef
TypedParam
<
VALUE_TYPE
,
NAME_VALUE_LOOKUP
,
true
,
false
>
self_t
;
typedef
TypedParam
<
VALUE_TYPE
,
NAME_VALUE_LOOKUP
,
true
,
false
>
self_t
;
typedef
typename
std
::
vector
<
ParamValue
<
VALUE_TYPE
,
NAME_VALUE_LOOKUP
>
>
container_t
;
typedef
ParamValue
<
VALUE_TYPE
,
NAME_VALUE_LOOKUP
>
param_value_t
;
typedef
typename
std
::
vector
<
param_value_t
>
container_t
;
typedef
const
container_t
&
value_assignment_t
;
typedef
const
container_t
&
value_assignment_t
;
typedef
VALUE_TYPE
value_t
;
typedef
VALUE_TYPE
value_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
typedef
NAME_VALUE_LOOKUP
name_value_lookup_t
;
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
TypedParam
(
BlockDescriptor
&
block_descriptor
,
const
char
*
name
,
value_assignment_t
value
,
ParamDescriptor
::
validation_func_t
validate_func
,
S32
min_count
,
S32
max_count
)
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
,
:
Param
(
block_descriptor
.
mCurrentBlockPtr
)
{
{
std
::
copy
(
value
.
begin
(),
value
.
end
(),
std
::
back_inserter
(
mValues
));
std
::
copy
(
value
.
begin
(),
value
.
end
(),
std
::
back_inserter
(
mValues
));
...
@@ -1033,7 +1036,7 @@ namespace LLInitParam
...
@@ -1033,7 +1036,7 @@ namespace LLInitParam
value_t
&
add
()
value_t
&
add
()
{
{
mValues
.
push_back
(
P
aram
V
alue
(
value_t
()));
mValues
.
push_back
(
p
aram
_v
alue
_t
(
value_t
()));
setProvided
(
true
);
setProvided
(
true
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
true
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
true
);
return
mValues
.
back
();
return
mValues
.
back
();
...
@@ -1041,7 +1044,7 @@ namespace LLInitParam
...
@@ -1041,7 +1044,7 @@ namespace LLInitParam
void
add
(
const
value_t
&
item
)
void
add
(
const
value_t
&
item
)
{
{
mValues
.
push_back
(
P
aram
V
alue
(
item
));
mValues
.
push_back
(
p
aram
_v
alue
_t
(
item
));
setProvided
(
true
);
setProvided
(
true
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
true
);
Param
::
enclosingBlock
().
paramChanged
(
*
this
,
true
);
}
}
...
@@ -1567,6 +1570,7 @@ namespace LLInitParam
...
@@ -1567,6 +1570,7 @@ namespace LLInitParam
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
false
,
IsBlock
<
param_value_t
>::
value
>
super_t
;
typedef
TypedParam
<
T
,
NAME_VALUE_LOOKUP
,
false
,
IsBlock
<
param_value_t
>::
value
>
super_t
;
typedef
Batch
<
T
,
RANGE
,
NAME_VALUE_LOOKUP
>
self_t
;
typedef
Batch
<
T
,
RANGE
,
NAME_VALUE_LOOKUP
>
self_t
;
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
typedef
typename
super_t
::
value_assignment_t
value_assignment_t
;
typedef
typename
super_t
::
value_t
value_t
;
struct
BatchDefaultValue
:
public
ParamDescriptor
::
UserData
struct
BatchDefaultValue
:
public
ParamDescriptor
::
UserData
{
{
...
@@ -1589,7 +1593,7 @@ namespace LLInitParam
...
@@ -1589,7 +1593,7 @@ namespace LLInitParam
if
(
param_descriptorp
)
if
(
param_descriptorp
)
{
{
param_descriptorp
->
mDeserializeFunc
=
&
deserializeParam
;
param_descriptorp
->
mDeserializeFunc
=
&
deserializeParam
;
param_descriptorp
->
mUserData
=
new
BatchDefaultValue
(
new
_value_t
(
val
));
param_descriptorp
->
mUserData
=
new
BatchDefaultValue
(
new
param
_value_t
(
val
));
}
}
}
}
}
}
...
@@ -1707,7 +1711,7 @@ namespace LLInitParam
...
@@ -1707,7 +1711,7 @@ namespace LLInitParam
typedef
ParamValue
<
T
,
TypeValues
<
T
>
>
derived_t
;
typedef
ParamValue
<
T
,
TypeValues
<
T
>
>
derived_t
;
typedef
CustomParamValue
<
T
>
self_t
;
typedef
CustomParamValue
<
T
>
self_t
;
typedef
Block
<
typename
derived_t
>
block_t
;
typedef
Block
<
derived_t
>
block_t
;
typedef
const
T
&
value_assignment_t
;
typedef
const
T
&
value_assignment_t
;
CustomParamValue
(
const
T
&
value
=
T
())
CustomParamValue
(
const
T
&
value
=
T
())
...
@@ -1796,7 +1800,7 @@ namespace LLInitParam
...
@@ -1796,7 +1800,7 @@ namespace LLInitParam
if
(
block_t
::
validateBlock
(
emit_errors
))
if
(
block_t
::
validateBlock
(
emit_errors
))
{
{
// clear stale keyword associated with old value
// clear stale keyword associated with old value
clearValueName
();
TypeValues
<
T
>::
clearValueName
();
mValueAge
=
BLOCK_AUTHORITATIVE
;
mValueAge
=
BLOCK_AUTHORITATIVE
;
static_cast
<
derived_t
*>
(
const_cast
<
self_t
*>
(
this
))
->
updateValueFromBlock
();
static_cast
<
derived_t
*>
(
const_cast
<
self_t
*>
(
this
))
->
updateValueFromBlock
();
return
true
;
return
true
;
...
@@ -1828,10 +1832,11 @@ namespace LLInitParam
...
@@ -1828,10 +1832,11 @@ namespace LLInitParam
void
setValue
(
value_assignment_t
val
)
void
setValue
(
value_assignment_t
val
)
{
{
derived_t
&
typed_param
=
static_cast
<
derived_t
&>
(
*
this
);
// set param version number to be up to date, so we ignore block contents
// set param version number to be up to date, so we ignore block contents
mValueAge
=
VALUE_AUTHORITATIVE
;
mValueAge
=
VALUE_AUTHORITATIVE
;
mValue
=
val
;
mValue
=
val
;
clearValueName
();
typed_param
.
clearValueName
();
static_cast
<
derived_t
*>
(
const_cast
<
self_t
*>
(
this
))
->
updateBlockFromValue
();
static_cast
<
derived_t
*>
(
const_cast
<
self_t
*>
(
this
))
->
updateBlockFromValue
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment