summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llxuixml/llinitparam.h145
-rw-r--r--indra/llxuixml/llxuiparser.cpp4
-rw-r--r--indra/newview/llsyswellwindow.h2
3 files changed, 147 insertions, 4 deletions
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index a956719fa3..be63e5cb39 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -207,7 +207,7 @@ namespace LLInitParam
typedef T value_t;
ParamValue()
- : T(),
+ : T(),
mValidated(false)
{}
@@ -742,6 +742,13 @@ namespace LLInitParam
typedef LLInitParam::NOT_BLOCK NOT_A_BLOCK;
template<typename T>
+ struct Sequential : public LLTypeTags::TypeTagBase<T, 2>
+ {
+ template <typename S> struct Cons { typedef Sequential<ParamValue<S> > value_t; };
+ template <typename S> struct Cons<Sequential<S> > { typedef Sequential<S> value_t; };
+ };
+
+ template<typename T>
struct Atomic : public LLTypeTags::TypeTagBase<T, 1>
{
template <typename S> struct Cons { typedef Atomic<ParamValue<S> > value_t; };
@@ -2050,6 +2057,13 @@ namespace LLInitParam
typedef typename IsBlock<T>::value_t value_t;
};
+ template<typename T, typename BLOCK_IDENTIFIER>
+ struct IsBlock<ParamValue<BaseBlock::Sequential<T>, typename IsBlock<BaseBlock::Sequential<T> >::value_t >, BLOCK_IDENTIFIER>
+ {
+ typedef typename IsBlock<T>::value_t value_t;
+ };
+
+
template<typename T>
struct InnerMostType
{
@@ -2157,6 +2171,135 @@ namespace LLInitParam
T mValue;
};
+ template<typename T>
+ class ParamValue <BaseBlock::Sequential<T>, IS_A_BLOCK>
+ {
+ typedef ParamValue <BaseBlock::Sequential<T>, IS_A_BLOCK> self_t;
+
+ public:
+ typedef typename InnerMostType<T>::value_t value_t;
+ typedef T default_value_t;
+
+ ParamValue()
+ : mValue(),
+ mValidated(false)
+ {
+ mCurParam = getBlockDescriptor().mAllParams.begin();
+ }
+
+ ParamValue(const default_value_t& value)
+ : mValue(value),
+ mValidated(false)
+ {
+ mCurParam = getBlockDescriptor().mAllParams.begin();
+ }
+
+ void setValue(const value_t& val)
+ {
+ mValue.setValue(val);
+ }
+
+ const value_t& getValue() const
+ {
+ return mValue.getValue();
+ }
+
+ value_t& getValue()
+ {
+ return mValue.getValue();
+ }
+
+ bool deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack_range, bool new_name)
+ {
+ if (new_name)
+ {
+ mCurParam = getBlockDescriptor().mAllParams.begin();
+ }
+ if (name_stack_range.first == name_stack_range.second
+ && mCurParam != getBlockDescriptor().mAllParams.end())
+ {
+ // deserialize to mCurParam
+ LLParamDescriptor& pd = *(*mCurParam);
+ ParamDescriptor::deserialize_func_t deserialize_func = pd.mDeserializeFunc;
+ LLParam* paramp = mValue.getParamFromHandle(pd.mParamHandle);
+
+ if (deserialize_func
+ && paramp
+ && deserialize_func(paramp, p, name_stack_range, new_name))
+ {
+ ++mCurParam;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ else
+ {
+ return mValue.deserializeBlock(p, name_stack_range, new_name);
+ }
+ }
+
+ void serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const self_t* diff_block = NULL) const
+ {
+ const BaseBlock* base_block = diff_block
+ ? &(diff_block->mValue)
+ : NULL;
+ mValue.serializeBlock(p, name_stack, base_block);
+ }
+
+ bool inspectBlock(Parser& p, Parser::name_stack_t name_stack = Parser::name_stack_t(), S32 min_count = 0, S32 max_count = S32_MAX) const
+ {
+ return mValue.inspectBlock(p, name_stack, min_count, max_count);
+ }
+
+ bool mergeBlockParam(bool source_provided, bool dst_provided, BlockDescriptor& block_data, const self_t& source, bool overwrite)
+ {
+ return mValue.mergeBlock(block_data, source.getValue(), overwrite);
+ }
+
+ bool validateBlock(bool emit_errors = true) const
+ {
+ return mValue.validateBlock(emit_errors);
+ }
+
+ static BlockDescriptor& getBlockDescriptor()
+ {
+ return value_t::getBlockDescriptor();
+ }
+
+ mutable bool mValidated; // lazy validation flag
+
+ private:
+
+ BlockDescriptor::all_params_list_t::iterator mCurParam;
+ T mValue;
+ };
+
+ template<typename T>
+ class ParamValue <BaseBlock::Sequential<T>, NOT_BLOCK>
+ : public T
+ {
+ typedef ParamValue <BaseBlock::Sequential<T>, NOT_BLOCK> self_t;
+
+ public:
+ typedef typename InnerMostType<T>::value_t value_t;
+ typedef T default_value_t;
+
+ ParamValue()
+ : T(),
+ mValidated(false)
+ {}
+
+ ParamValue(const default_value_t& value)
+ : T(value.getValue()),
+ mValidated(false)
+ {}
+
+ mutable bool mValidated; // lazy validation flag
+ };
+
template<typename T, typename BLOCK_T>
class ParamValue <BaseBlock::Lazy<T, IS_A_BLOCK>, BLOCK_T>
{
diff --git a/indra/llxuixml/llxuiparser.cpp b/indra/llxuixml/llxuiparser.cpp
index 808e391575..9cd88a1620 100644
--- a/indra/llxuixml/llxuiparser.cpp
+++ b/indra/llxuixml/llxuiparser.cpp
@@ -115,8 +115,8 @@ struct All : public LLInitParam::Block<All, Occurs>
struct Attribute : public LLInitParam::Block<Attribute>
{
- Mandatory<std::string> name;
- Mandatory<std::string> type;
+ Mandatory<std::string> name,
+ type;
Mandatory<EUse> use;
Attribute()
diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h
index caf30cfd67..f497f546aa 100644
--- a/indra/newview/llsyswellwindow.h
+++ b/indra/newview/llsyswellwindow.h
@@ -123,7 +123,7 @@ protected:
struct WellNotificationChannel : public LLNotificationChannel
{
WellNotificationChannel(LLNotificationWellWindow*);
- void onAdd(LLNotificationPtr notify)
+ void onDelete(LLNotificationPtr notify)
{
mWellWindow->removeItemByID(notify->getID());
}