From 7183cecd14fbdc3cd31e1482248fabec7b23b1fb Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Tue, 5 Feb 2013 16:37:37 +0000 Subject: STORM-1831 merging in previous work --- indra/llui/llkeywords.h | 81 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 19 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index ac34015393..87f65dc0bf 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -1,25 +1,25 @@ -/** +/** * @file llkeywords.h * @brief Keyword list for LSL * * $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$ */ @@ -41,26 +41,35 @@ typedef LLPointer LLTextSegmentPtr; class LLKeywordToken { public: - /** + /** * @brief Types of tokens/delimters being parsed. * * @desc Tokens/delimiters that need to be identified/highlighted. All are terminated if an EOF is encountered. - * - WORD are keywords in the normal sense, i.e. constants, events, etc. - * - LINE are for entire lines (currently only flow control labels use this). - * - ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL. - * - TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with. - * - DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close. + * - TT_WORD are keywords in the normal sense, i.e. constants, events, etc. + * - TT_LINE are for entire lines (currently only flow control labels use this). + * - TT_ONE_SIDED_DELIMITER are for open-ended delimiters which are terminated by EOL. + * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with. + * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close. */ enum TOKEN_TYPE { - WORD, - LINE, - TWO_SIDED_DELIMITER, - ONE_SIDED_DELIMITER, - DOUBLE_QUOTATION_MARKS + TT_UNKNOWN, + TT_WORD, + TT_LINE, + TT_TWO_SIDED_DELIMITER, + TT_ONE_SIDED_DELIMITER, + TT_DOUBLE_QUOTATION_MARKS, + // Following constants are more specific versions of the preceding ones + TT_CONSTANT, // WORD + TT_EVENT, // WORD + TT_FLOW, // WORD + TT_FUNCTION, // WORD + TT_LABEL, // LINE + TT_SECTION, // WORD + TT_TYPE // WORD }; - LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) + LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) : mType( type ), mToken( token ), @@ -98,10 +107,19 @@ public: LLKeywords(); ~LLKeywords(); + void addColorGroup(const std::string key_in, const LLColor3 color); + LLColor3 getColorGroup(const std::string key_in); + BOOL loadFromFile(); BOOL loadFromFile(const std::string& filename); BOOL isLoaded() const { return mLoaded; } + void setFilenameColors(const std::string filename) { mFilenameColors = filename; } + void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); + BOOL initialise(); + std::string processColors(); + std::string processColors(LLSD &data, const std::string strGroup); + void processTokens(); // Add the token as described void addToken(LLKeywordToken::TOKEN_TYPE type, @@ -109,7 +127,7 @@ public: const LLColor3& color, const std::string& tool_tip = LLStringUtil::null, const std::string& delimiter = LLStringUtil::null); - + // This class is here as a performance optimization. // The word token map used to be defined as std::map. // This worked, but caused a performance bottleneck due to memory allocation and string copies @@ -133,6 +151,9 @@ public: const llwchar *mData; size_t mLength; bool mOwner; + + + LLColor3 mColor; }; typedef std::map word_token_map_t; @@ -140,20 +161,42 @@ public: keyword_iterator_t begin() const { return mWordTokenMap.begin(); } keyword_iterator_t end() const { return mWordTokenMap.end(); } + typedef std::map group_color_map_t; + typedef group_color_map_t::const_iterator color_iterator_t; + group_color_map_t mColorGroupMap; + #ifdef _DEBUG void dump(); #endif -private: +protected: + void processTokensGroup(LLSD& Tokens, const std::string Group); LLColor3 readColor(const std::string& s); + LLColor3 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); + BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); + LLSD mColors; BOOL mLoaded; + LLSD mSyntax; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; token_list_t mLineTokenList; token_list_t mDelimiterTokenList; + + typedef std::map element_attributes_t; + typedef element_attributes_t::const_iterator attribute_iterator_t; + element_attributes_t mAttributes; + std::string getAttribute(const std::string& key); + + std::string getArguments(LLSD& args); + +private: + BOOL ready() { return mReady; }; + BOOL mReady; + std::string mFilenameColors; + std::string mFilenameSyntax; }; #endif // LL_LLKEYWORDS_H -- cgit v1.2.3 From 582babac2f1acd7f558fa4bf13034c5f306fe115 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Mon, 11 Feb 2013 21:50:38 +0000 Subject: STORM-1831 Changes to LLSD structure and corresponding processing in llkeywords. Plus some formating clean ups. --- indra/llui/llkeywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 87f65dc0bf..badbd2ae85 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -61,8 +61,8 @@ public: TT_DOUBLE_QUOTATION_MARKS, // Following constants are more specific versions of the preceding ones TT_CONSTANT, // WORD + TT_CONTROL, // WORD TT_EVENT, // WORD - TT_FLOW, // WORD TT_FUNCTION, // WORD TT_LABEL, // LINE TT_SECTION, // WORD -- cgit v1.2.3 From 7d5ed4f7477c2c564f0e9dededf7131ed42d55b8 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 27 Jun 2013 21:28:52 +0100 Subject: Moving LSL highlighting colour info into .../skins/default/colors.xml where it makes more sense than its own xml file. Changing other functions to read it. --- indra/llui/llkeywords.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index badbd2ae85..6889b95339 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -30,6 +30,7 @@ #include "llstring.h" #include "v3color.h" +#include "v4color.h" #include #include #include @@ -69,7 +70,7 @@ public: TT_TYPE // WORD }; - LLKeywordToken( TOKEN_TYPE type, const LLColor3& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) + LLKeywordToken( TOKEN_TYPE type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) : mType( type ), mToken( token ), @@ -84,7 +85,7 @@ public: BOOL isHead(const llwchar* s) const; BOOL isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } - const LLColor3& getColor() const { return mColor; } + const LLColor4& getColor() const { return mColor; } TOKEN_TYPE getType() const { return mType; } const LLWString& getToolTip() const { return mToolTip; } const LLWString& getDelimiter() const { return mDelimiter; } @@ -96,7 +97,7 @@ public: private: TOKEN_TYPE mType; LLWString mToken; - LLColor3 mColor; + LLColor4 mColor; LLWString mToolTip; LLWString mDelimiter; }; @@ -107,12 +108,11 @@ public: LLKeywords(); ~LLKeywords(); - void addColorGroup(const std::string key_in, const LLColor3 color); - LLColor3 getColorGroup(const std::string key_in); + void addColorGroup(const std::string key_in, const LLColor4 color); + LLColor4 getColorGroup(const std::string key_in); BOOL loadFromFile(); BOOL loadFromFile(const std::string& filename); BOOL isLoaded() const { return mLoaded; } - void setFilenameColors(const std::string filename) { mFilenameColors = filename; } void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); @@ -124,7 +124,7 @@ public: // Add the token as described void addToken(LLKeywordToken::TOKEN_TYPE type, const std::string& key, - const LLColor3& color, + const LLColor4& color, const std::string& tool_tip = LLStringUtil::null, const std::string& delimiter = LLStringUtil::null); @@ -153,7 +153,7 @@ public: bool mOwner; - LLColor3 mColor; + LLColor4 mColor; }; typedef std::map word_token_map_t; @@ -161,7 +161,7 @@ public: keyword_iterator_t begin() const { return mWordTokenMap.begin(); } keyword_iterator_t end() const { return mWordTokenMap.end(); } - typedef std::map group_color_map_t; + typedef std::map group_color_map_t; typedef group_color_map_t::const_iterator color_iterator_t; group_color_map_t mColorGroupMap; @@ -171,8 +171,8 @@ public: protected: void processTokensGroup(LLSD& Tokens, const std::string Group); - LLColor3 readColor(const std::string& s); - LLColor3 readColor(LLSD& sd); + LLColor4 readColor(const std::string& s); + LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); @@ -195,7 +195,6 @@ protected: private: BOOL ready() { return mReady; }; BOOL mReady; - std::string mFilenameColors; std::string mFilenameSyntax; }; -- cgit v1.2.3 From 0ffaf25e7599391841508fbac769bc3b544930a5 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Tue, 15 Oct 2013 21:46:24 +0100 Subject: STORM-1831 Removing unnecessary semi-colon --- indra/llui/llkeywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 6889b95339..77a12bc1e5 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -193,7 +193,7 @@ protected: std::string getArguments(LLSD& args); private: - BOOL ready() { return mReady; }; + BOOL ready() { return mReady; } BOOL mReady; std::string mFilenameSyntax; }; -- cgit v1.2.3 From 79645e6981a97224024c5226d8713dce9569d54a Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Mon, 21 Oct 2013 04:09:20 +0100 Subject: STORM-1831 First attempt at using SyntaxIdLSL capability. (incomplete) --- indra/llui/llkeywords.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 77a12bc1e5..1bd23549d2 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -28,6 +28,7 @@ #define LL_LLKEYWORDS_H +#include "lldir.h" #include "llstring.h" #include "v3color.h" #include "v4color.h" @@ -116,7 +117,7 @@ public: void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - BOOL initialise(); + BOOL initialise(ELLPath path, const std::string filename); std::string processColors(); std::string processColors(LLSD &data, const std::string strGroup); void processTokens(); -- cgit v1.2.3 From 4af21580297dd85727ffdc5d4eee89ad58ead271 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sat, 9 Nov 2013 11:31:32 +0000 Subject: Adding method to load cached/default syntax file and method to access sKeyWordsXML. --- indra/llui/llkeywords.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 1bd23549d2..f98453405d 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -83,8 +83,8 @@ public: S32 getLengthHead() const { return mToken.size(); } S32 getLengthTail() const { return mDelimiter.size(); } - BOOL isHead(const llwchar* s) const; - BOOL isTail(const llwchar* s) const; + bool isHead(const llwchar* s) const; + bool isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } const LLColor4& getColor() const { return mColor; } TOKEN_TYPE getType() const { return mType; } @@ -111,13 +111,13 @@ public: void addColorGroup(const std::string key_in, const LLColor4 color); LLColor4 getColorGroup(const std::string key_in); - BOOL loadFromFile(); - BOOL loadFromFile(const std::string& filename); - BOOL isLoaded() const { return mLoaded; } + bool loadFromFile(); + bool loadFromFile(const std::string& filename); + bool isLoaded() const { return mLoaded; } void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - BOOL initialise(ELLPath path, const std::string filename); + bool initialise(ELLPath path, const std::string filename); std::string processColors(); std::string processColors(LLSD &data, const std::string strGroup); void processTokens(); @@ -176,10 +176,10 @@ protected: LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); - BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); + bool loadIntoLLSD( const std::string& filename, LLSD& data ); LLSD mColors; - BOOL mLoaded; + bool mLoaded; LLSD mSyntax; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; @@ -194,8 +194,8 @@ protected: std::string getArguments(LLSD& args); private: - BOOL ready() { return mReady; } - BOOL mReady; + bool ready() { return mReady; } + bool mReady; std::string mFilenameSyntax; }; -- cgit v1.2.3 From 29b2129e1eec0dbbb909422e82766a58f14c5da3 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sat, 9 Nov 2013 11:32:08 +0000 Subject: Backed out changeset: e82d9467bec8 --- indra/llui/llkeywords.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index f98453405d..1bd23549d2 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -83,8 +83,8 @@ public: S32 getLengthHead() const { return mToken.size(); } S32 getLengthTail() const { return mDelimiter.size(); } - bool isHead(const llwchar* s) const; - bool isTail(const llwchar* s) const; + BOOL isHead(const llwchar* s) const; + BOOL isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } const LLColor4& getColor() const { return mColor; } TOKEN_TYPE getType() const { return mType; } @@ -111,13 +111,13 @@ public: void addColorGroup(const std::string key_in, const LLColor4 color); LLColor4 getColorGroup(const std::string key_in); - bool loadFromFile(); - bool loadFromFile(const std::string& filename); - bool isLoaded() const { return mLoaded; } + BOOL loadFromFile(); + BOOL loadFromFile(const std::string& filename); + BOOL isLoaded() const { return mLoaded; } void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - bool initialise(ELLPath path, const std::string filename); + BOOL initialise(ELLPath path, const std::string filename); std::string processColors(); std::string processColors(LLSD &data, const std::string strGroup); void processTokens(); @@ -176,10 +176,10 @@ protected: LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); - bool loadIntoLLSD( const std::string& filename, LLSD& data ); + BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); LLSD mColors; - bool mLoaded; + BOOL mLoaded; LLSD mSyntax; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; @@ -194,8 +194,8 @@ protected: std::string getArguments(LLSD& args); private: - bool ready() { return mReady; } - bool mReady; + BOOL ready() { return mReady; } + BOOL mReady; std::string mFilenameSyntax; }; -- cgit v1.2.3 From 5e27952ee4698006c86ebdca60c4eab305ddebac Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sun, 10 Nov 2013 20:24:13 +0000 Subject: storm-1831 Switch to use the llsyntaxid keywords LLSD directly --- indra/llui/llkeywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 1bd23549d2..24a0450912 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -117,7 +117,7 @@ public: void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - BOOL initialise(ELLPath path, const std::string filename); + bool initialise(LLSD SyntaxXML); std::string processColors(); std::string processColors(LLSD &data, const std::string strGroup); void processTokens(); -- cgit v1.2.3 From 009245510149c26337ac1cca64a367cd2234725b Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Sun, 10 Nov 2013 22:35:49 +0000 Subject: Removing unused getter/setter and property for mFilenameSyntax, mReady. --- indra/llui/llkeywords.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 24a0450912..f14605157d 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -113,8 +113,7 @@ public: LLColor4 getColorGroup(const std::string key_in); BOOL loadFromFile(); BOOL loadFromFile(const std::string& filename); - BOOL isLoaded() const { return mLoaded; } - void setFilenameSyntax(const std::string filename) { mFilenameSyntax = filename; } + bool isLoaded() const { return mLoaded; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); bool initialise(LLSD SyntaxXML); @@ -179,7 +178,7 @@ protected: BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); LLSD mColors; - BOOL mLoaded; + bool mLoaded; LLSD mSyntax; word_token_map_t mWordTokenMap; typedef std::deque token_list_t; @@ -194,9 +193,6 @@ protected: std::string getArguments(LLSD& args); private: - BOOL ready() { return mReady; } - BOOL mReady; - std::string mFilenameSyntax; }; #endif // LL_LLKEYWORDS_H -- cgit v1.2.3 From 3e41917403fb3519adac2343ca21a1f289596621 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Mon, 11 Nov 2013 16:33:04 +0000 Subject: Removing no longer used member variable, adding method to reset the mLoaded status --- indra/llui/llkeywords.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index f14605157d..074cedfc63 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -110,6 +110,7 @@ public: ~LLKeywords(); void addColorGroup(const std::string key_in, const LLColor4 color); + void clearLoaded() { mLoaded = false; } LLColor4 getColorGroup(const std::string key_in); BOOL loadFromFile(); BOOL loadFromFile(const std::string& filename); -- cgit v1.2.3 From fa5c3320cc9c50462b222b1b1197d9c16064983e Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 21 Nov 2013 19:55:38 +0000 Subject: storm-1831 Cleaning up colour LLSD processing code which is no longer used as colours come from the colors XML file. --- indra/llui/llkeywords.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 074cedfc63..d0f1de8389 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -118,8 +118,6 @@ public: void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); bool initialise(LLSD SyntaxXML); - std::string processColors(); - std::string processColors(LLSD &data, const std::string strGroup); void processTokens(); // Add the token as described -- cgit v1.2.3 From f6d86fcacf79c8147e2075db64caee7521f3b227 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Tue, 17 Dec 2013 18:23:09 +0000 Subject: Fixing some BOOL to bool and changing one function to void --- indra/llui/llkeywords.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index d0f1de8389..689fd75bcd 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -83,8 +83,8 @@ public: S32 getLengthHead() const { return mToken.size(); } S32 getLengthTail() const { return mDelimiter.size(); } - BOOL isHead(const llwchar* s) const; - BOOL isTail(const llwchar* s) const; + bool isHead(const llwchar* s) const; + bool isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } const LLColor4& getColor() const { return mColor; } TOKEN_TYPE getType() const { return mType; } @@ -112,12 +112,10 @@ public: void addColorGroup(const std::string key_in, const LLColor4 color); void clearLoaded() { mLoaded = false; } LLColor4 getColorGroup(const std::string key_in); - BOOL loadFromFile(); - BOOL loadFromFile(const std::string& filename); bool isLoaded() const { return mLoaded; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - bool initialise(LLSD SyntaxXML); + void initialise(LLSD SyntaxXML); void processTokens(); // Add the token as described -- cgit v1.2.3 From 00a99d9097131c02c6486112b32e57f534bf61be Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Thu, 6 Feb 2014 16:47:27 +0000 Subject: Adding clear methods to remove any highlighting. --- indra/llui/llkeywords.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 689fd75bcd..de7645a5d2 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -110,6 +110,7 @@ public: ~LLKeywords(); void addColorGroup(const std::string key_in, const LLColor4 color); + void clear(); void clearLoaded() { mLoaded = false; } LLColor4 getColorGroup(const std::string key_in); bool isLoaded() const { return mLoaded; } -- cgit v1.2.3 From 8bc42784122619e3f37afabbc5888821c3430369 Mon Sep 17 00:00:00 2001 From: Ima Mechanique Date: Fri, 28 Mar 2014 17:21:36 +0000 Subject: strom-1831: Cleaning out commented and unused code --- indra/llui/llkeywords.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index de7645a5d2..689fd75bcd 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -110,7 +110,6 @@ public: ~LLKeywords(); void addColorGroup(const std::string key_in, const LLColor4 color); - void clear(); void clearLoaded() { mLoaded = false; } LLColor4 getColorGroup(const std::string key_in); bool isLoaded() const { return mLoaded; } -- cgit v1.2.3 From 20a7d749cf8ea76c1481022f17153e72670b23ec Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 16 Apr 2014 11:52:46 -0600 Subject: Orphaned definition --- indra/llui/llkeywords.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 689fd75bcd..2f7932f815 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -172,7 +172,6 @@ protected: LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); - BOOL loadIntoLLSD( const std::string& filename, LLSD& data ); LLSD mColors; bool mLoaded; -- cgit v1.2.3 From dcffb97518cb2888489c93b90862518f761967dd Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 18 Apr 2014 23:13:57 -0600 Subject: Move some more script editor functions from LLTextEditor to LLScriptEditor --- indra/llui/llkeywords.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 2f7932f815..69bc8919db 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -53,7 +53,7 @@ public: * - TT_TWO_SIDED_DELIMITER are for delimiters that end with a different delimiter than they open with. * - TT_DOUBLE_QUOTATION_MARKS are for delimiting areas using the same delimiter to open and close. */ - enum TOKEN_TYPE + typedef enum e_token_type { TT_UNKNOWN, TT_WORD, @@ -69,9 +69,9 @@ public: TT_LABEL, // LINE TT_SECTION, // WORD TT_TYPE // WORD - }; + } ETokenType; - LLKeywordToken( TOKEN_TYPE type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) + LLKeywordToken( ETokenType type, const LLColor4& color, const LLWString& token, const LLWString& tool_tip, const LLWString& delimiter ) : mType( type ), mToken( token ), @@ -87,7 +87,7 @@ public: bool isTail(const llwchar* s) const; const LLWString& getToken() const { return mToken; } const LLColor4& getColor() const { return mColor; } - TOKEN_TYPE getType() const { return mType; } + ETokenType getType() const { return mType; } const LLWString& getToolTip() const { return mToolTip; } const LLWString& getDelimiter() const { return mDelimiter; } @@ -96,7 +96,7 @@ public: #endif private: - TOKEN_TYPE mType; + ETokenType mType; LLWString mToken; LLColor4 mColor; LLWString mToolTip; @@ -119,7 +119,7 @@ public: void processTokens(); // Add the token as described - void addToken(LLKeywordToken::TOKEN_TYPE type, + void addToken(LLKeywordToken::ETokenType type, const std::string& key, const LLColor4& color, const std::string& tool_tip = LLStringUtil::null, -- cgit v1.2.3 From e8422e5bed6c593c8a26b533f33103911a1d3da6 Mon Sep 17 00:00:00 2001 From: Cinder Date: Tue, 6 May 2014 11:09:50 -0600 Subject: Let's get started: some code policy cleanup, reference arguments where we can, correct spelling --- indra/llui/llkeywords.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 69bc8919db..b17e9dd942 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -109,9 +109,9 @@ public: LLKeywords(); ~LLKeywords(); - void addColorGroup(const std::string key_in, const LLColor4 color); + void addColorGroup(const std::string& key_in, const LLColor4& color); void clearLoaded() { mLoaded = false; } - LLColor4 getColorGroup(const std::string key_in); + LLColor4 getColorGroup(const std::string& key_in); bool isLoaded() const { return mLoaded; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); @@ -167,7 +167,7 @@ public: #endif protected: - void processTokensGroup(LLSD& Tokens, const std::string Group); + void processTokensGroup(const LLSD& Tokens, const std::string& Group); LLColor4 readColor(const std::string& s); LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); -- cgit v1.2.3 From 8501d6494bceeea962d7251d882ddc244a8daa7f Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 7 May 2014 19:58:56 -0600 Subject: Code policy --- indra/llui/llkeywords.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index b17e9dd942..eecb327fee 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -115,7 +115,7 @@ public: bool isLoaded() const { return mLoaded; } void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); - void initialise(LLSD SyntaxXML); + void initialize(LLSD SyntaxXML); void processTokens(); // Add the token as described -- cgit v1.2.3 From 8c970eae222eb94d42e951e47153b97de744f6e5 Mon Sep 17 00:00:00 2001 From: Cinder Date: Fri, 16 May 2014 09:18:38 -0600 Subject: Remove orphaned LLKeywords methods --- indra/llui/llkeywords.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index eecb327fee..4e20b4459e 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -109,7 +109,6 @@ public: LLKeywords(); ~LLKeywords(); - void addColorGroup(const std::string& key_in, const LLColor4& color); void clearLoaded() { mLoaded = false; } LLColor4 getColorGroup(const std::string& key_in); bool isLoaded() const { return mLoaded; } @@ -168,12 +167,9 @@ public: protected: void processTokensGroup(const LLSD& Tokens, const std::string& Group); - LLColor4 readColor(const std::string& s); - LLColor4 readColor(LLSD& sd); void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); - LLSD mColors; bool mLoaded; LLSD mSyntax; word_token_map_t mWordTokenMap; -- cgit v1.2.3 From e6b20328c2e25223359dede17357682b5b4e7ea1 Mon Sep 17 00:00:00 2001 From: Cinder Date: Wed, 4 Jun 2014 22:51:20 -0600 Subject: A little more cleanup in LLSyntaxIDLSL and LLKeywords --- indra/llui/llkeywords.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'indra/llui/llkeywords.h') diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 4e20b4459e..18e2ed06c5 100755 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -113,7 +113,10 @@ public: LLColor4 getColorGroup(const std::string& key_in); bool isLoaded() const { return mLoaded; } - void findSegments(std::vector *seg_list, const LLWString& text, const LLColor4 &defaultColor, class LLTextEditor& editor ); + void findSegments(std::vector *seg_list, + const LLWString& text, + const LLColor4 &defaultColor, + class LLTextEditor& editor); void initialize(LLSD SyntaxXML); void processTokens(); @@ -167,8 +170,19 @@ public: protected: void processTokensGroup(const LLSD& Tokens, const std::string& Group); - void insertSegment(std::vector& seg_list, LLTextSegmentPtr new_segment, S32 text_len, const LLColor4 &defaultColor, class LLTextEditor& editor); - void insertSegments(const LLWString& wtext, std::vector& seg_list, LLKeywordToken* token, S32 text_len, S32 seg_start, S32 seg_end, const LLColor4 &defaultColor, LLTextEditor& editor); + void insertSegment(std::vector& seg_list, + LLTextSegmentPtr new_segment, + S32 text_len, + const LLColor4 &defaultColor, + class LLTextEditor& editor); + void insertSegments(const LLWString& wtext, + std::vector& seg_list, + LLKeywordToken* token, + S32 text_len, + S32 seg_start, + S32 seg_end, + const LLColor4 &defaultColor, + LLTextEditor& editor); bool mLoaded; LLSD mSyntax; @@ -182,9 +196,7 @@ protected: element_attributes_t mAttributes; std::string getAttribute(const std::string& key); - std::string getArguments(LLSD& args); - -private: + std::string getArguments(LLSD& arguments); }; #endif // LL_LLKEYWORDS_H -- cgit v1.2.3