Fixed up Keywords

Up to date definitions and reorganizations,
commented out constants that apparently don't exist.
Fixed Strings not highlighting by borrowing missing code from Phoenix.

Also, this fixes 1020 being treated as UnknownAltitude when not on SL grid
and cleans up the horrible tabbing/spacing mud in llfloateravatarlist.cpp
This commit is contained in:
Lirusaito
2012-06-24 01:52:56 -04:00
parent 48a2d0497b
commit 26810ff16a
5 changed files with 596 additions and 308 deletions

View File

@@ -46,23 +46,27 @@ class LLTextSegment;
class LLKeywordToken
{
public:
enum TOKEN_TYPE { WORD, LINE, TWO_SIDED_DELIMITER, ONE_SIDED_DELIMITER };
enum TOKEN_TYPE { WORD, LINE, TWO_SIDED_DELIMITER, ONE_SIDED_DELIMITER, TWO_SIDED_DELIMITER_ESC };
LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip )
LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter )
:
mType( type ),
mToken( token ),
mColor( color ),
mToolTip( tool_tip )
mToolTip( tool_tip ),
mDelimiter( delimiter ) // right delimiter
{
}
S32 getLength() const { return mToken.size(); }
BOOL isHead(const llwchar* s) const;
S32 getLength2() const { return mDelimiter.size(); }
BOOL isHead(const llwchar* s, bool search_end_c_comment = false) const;
BOOL isTail(const llwchar* s) const;
const LLWString& getToken() const { return mToken; }
const LLColor3& getColor() const { return mColor; }
TOKEN_TYPE getType() const { return mType; }
const LLWString& getToolTip() const { return mToolTip; }
const LLWString& getDelimiter() const { return mDelimiter; }
#ifdef _DEBUG
void dump();
@@ -73,6 +77,7 @@ private:
LLWString mToken;
LLColor3 mColor;
LLWString mToolTip;
LLWString mDelimiter;
};
class LLKeywords
@@ -90,7 +95,8 @@ public:
void addToken(LLKeywordToken::TOKEN_TYPE type,
const std::string& key,
const LLColor3& color,
const std::string& tool_tip = LLStringUtil::null);
const std::string& tool_tip = LLStringUtil::null,
const std::string& delimiter = LLStringUtil::null);
typedef std::map<LLWString, LLKeywordToken*> word_token_map_t;
typedef word_token_map_t::const_iterator keyword_iterator_t;