diff options
author | McCabe Maxsted | 2009-10-16 16:39:44 -0700 |
---|---|---|
committer | McCabe Maxsted | 2009-10-16 16:39:44 -0700 |
commit | ce82adec2a0124fe27f363653d2652b0f5c61f04 (patch) | |
tree | 35b3877b1d1fc92329a44a9a17d183b74b92890b /linden/indra/newview/rlvhelper.h | |
parent | Applied patch for VWR-6787 by Alissa Sabre - 'none' text in group window not ... (diff) | |
download | meta-impy-ce82adec2a0124fe27f363653d2652b0f5c61f04.zip meta-impy-ce82adec2a0124fe27f363653d2652b0f5c61f04.tar.gz meta-impy-ce82adec2a0124fe27f363653d2652b0f5c61f04.tar.bz2 meta-impy-ce82adec2a0124fe27f363653d2652b0f5c61f04.tar.xz |
Applied RLVa-1.0.4e_20091010_SL-1.22.11-diff.patch
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/rlvhelper.h | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/linden/indra/newview/rlvhelper.h b/linden/indra/newview/rlvhelper.h index f36989b..42d10b8 100644 --- a/linden/indra/newview/rlvhelper.h +++ b/linden/indra/newview/rlvhelper.h | |||
@@ -9,6 +9,15 @@ | |||
9 | #include "llwlparamset.h" | 9 | #include "llwlparamset.h" |
10 | #include "rlvdefines.h" | 10 | #include "rlvdefines.h" |
11 | 11 | ||
12 | #ifdef LL_WINDOWS | ||
13 | #pragma warning (push) | ||
14 | #pragma warning (disable : 4702) // warning C4702: unreachable code | ||
15 | #endif | ||
16 | #include <boost/variant.hpp> | ||
17 | #ifdef LL_WINDOWS | ||
18 | #pragma warning (pop) | ||
19 | #endif | ||
20 | |||
12 | // ============================================================================ | 21 | // ============================================================================ |
13 | // RlvCommand | 22 | // RlvCommand |
14 | // | 23 | // |
@@ -28,10 +37,12 @@ public: | |||
28 | const std::string& getOption() const { return m_strOption; } | 37 | const std::string& getOption() const { return m_strOption; } |
29 | const std::string& getParam() const { return m_strParam; } | 38 | const std::string& getParam() const { return m_strParam; } |
30 | ERlvParamType getParamType() const { return m_eParamType; } | 39 | ERlvParamType getParamType() const { return m_eParamType; } |
40 | bool isStrict() const { return m_fStrict; } | ||
31 | bool isValid() const { return m_fValid; } | 41 | bool isValid() const { return m_fValid; } |
32 | 42 | ||
33 | static ERlvBehaviour getBehaviourFromString(const std::string& strBhvr); | 43 | static ERlvBehaviour getBehaviourFromString(const std::string& strBhvr); |
34 | static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr); | 44 | static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr); |
45 | static bool hasStrictVariant(ERlvBehaviour eBhvr); | ||
35 | 46 | ||
36 | static void initLookupTable(); | 47 | static void initLookupTable(); |
37 | protected: | 48 | protected: |
@@ -50,6 +61,7 @@ protected: | |||
50 | bool m_fValid; | 61 | bool m_fValid; |
51 | std::string m_strBehaviour; | 62 | std::string m_strBehaviour; |
52 | ERlvBehaviour m_eBehaviour; | 63 | ERlvBehaviour m_eBehaviour; |
64 | bool m_fStrict; | ||
53 | std::string m_strOption; | 65 | std::string m_strOption; |
54 | std::string m_strParam; | 66 | std::string m_strParam; |
55 | ERlvParamType m_eParamType; | 67 | ERlvParamType m_eParamType; |
@@ -78,10 +90,8 @@ public: | |||
78 | bool removeCommand(const RlvCommand& rlvCmd); | 90 | bool removeCommand(const RlvCommand& rlvCmd); |
79 | 91 | ||
80 | std::string getStatusString(const std::string& strMatch) const; | 92 | std::string getStatusString(const std::string& strMatch) const; |
81 | bool hasBehaviour(ERlvBehaviour eBehaviour) const; | 93 | bool hasBehaviour(ERlvBehaviour eBehaviour, bool fStrictOnly) const; |
82 | bool hasBehaviour(const std::string& strBehaviour) const; | 94 | bool hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption, bool fStrictOnly) const; |
83 | bool hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const; | ||
84 | bool hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const; | ||
85 | 95 | ||
86 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } | 96 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } |
87 | 97 | ||
@@ -190,6 +200,24 @@ private: | |||
190 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; | 200 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; |
191 | 201 | ||
192 | // ============================================================================ | 202 | // ============================================================================ |
203 | // RlvException | ||
204 | // | ||
205 | |||
206 | typedef boost::variant<std::string, LLUUID, S32, ERlvBehaviour> RlvExceptionOption; | ||
207 | |||
208 | struct RlvException | ||
209 | { | ||
210 | public: | ||
211 | LLUUID idObject; // UUID of the object that added the exception | ||
212 | ERlvBehaviour eBehaviour; // Behaviour the exception applies to | ||
213 | RlvExceptionOption varOption; // Exception data (type is dependent on eBehaviour) | ||
214 | |||
215 | RlvException(const LLUUID& idObj, ERlvBehaviour eBhvr, const RlvExceptionOption& option) : idObject(idObj), eBehaviour(eBhvr), varOption(option) {} | ||
216 | private: | ||
217 | RlvException(); | ||
218 | }; | ||
219 | |||
220 | // ============================================================================ | ||
193 | // RlvWLSnapshot | 221 | // RlvWLSnapshot |
194 | // | 222 | // |
195 | 223 | ||
@@ -225,7 +253,7 @@ public: | |||
225 | static BOOL getDebug() { return rlvGetSettingBOOL(RLV_SETTING_DEBUG, FALSE); } | 253 | static BOOL getDebug() { return rlvGetSettingBOOL(RLV_SETTING_DEBUG, FALSE); } |
226 | static BOOL getForbidGiveToRLV() { return rlvGetSettingBOOL(RLV_SETTING_FORBIDGIVETORLV, TRUE); } | 254 | static BOOL getForbidGiveToRLV() { return rlvGetSettingBOOL(RLV_SETTING_FORBIDGIVETORLV, TRUE); } |
227 | 255 | ||
228 | static BOOL getEnableWear() { return rlvGetSettingBOOL(RLV_SETTING_ENABLEWEAR, FALSE); } | 256 | static BOOL getEnableWear(); |
229 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } | 257 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } |
230 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } | 258 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } |
231 | static BOOL getHideLockedInventory() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDINVENTORY, FALSE); } | 259 | static BOOL getHideLockedInventory() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDINVENTORY, FALSE); } |
@@ -290,6 +318,7 @@ struct RlvSelectIsSittingOn : public LLSelectedNodeFunctor | |||
290 | 318 | ||
291 | BOOL rlvAttachToEnabler(void* pParam); | 319 | BOOL rlvAttachToEnabler(void* pParam); |
292 | bool rlvCanDeleteOrReturn(); | 320 | bool rlvCanDeleteOrReturn(); |
321 | BOOL rlvEnableWearEnabler(void* pParam); | ||
293 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); | 322 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); |
294 | bool rlvIsEmote(const std::string& strUTF8Text); | 323 | bool rlvIsEmote(const std::string& strUTF8Text); |
295 | bool rlvIsValidReplyChannel(S32 nChannel); | 324 | bool rlvIsValidReplyChannel(S32 nChannel); |
@@ -344,6 +373,22 @@ inline void RlvCurrentlyWorn::fetchItem(const LLUUID& idItem) | |||
344 | } | 373 | } |
345 | } | 374 | } |
346 | 375 | ||
376 | inline bool RlvCommand::hasStrictVariant(ERlvBehaviour eBhvr) | ||
377 | { | ||
378 | switch (eBhvr) | ||
379 | { | ||
380 | case RLV_BHVR_RECVCHAT: | ||
381 | case RLV_BHVR_RECVEMOTE: | ||
382 | case RLV_BHVR_RECVIM: | ||
383 | case RLV_BHVR_SENDIM: | ||
384 | case RLV_BHVR_TPLURE: | ||
385 | case RLV_BHVR_SENDCHANNEL: | ||
386 | return true; | ||
387 | default: | ||
388 | return false; | ||
389 | } | ||
390 | } | ||
391 | |||
347 | // ============================================================================ | 392 | // ============================================================================ |
348 | // Inlined helper functions | 393 | // Inlined helper functions |
349 | // | 394 | // |