X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42389ac7c31d1bc536cc5e45cc587a4a9be7897f..ae4ccf12b6a215281415ec8e431483255f57e5cf:/utils/HelpGen/src/sourcepainter.h diff --git a/utils/HelpGen/src/sourcepainter.h b/utils/HelpGen/src/sourcepainter.h index c2456e4da2..4b6b238d2b 100644 --- a/utils/HelpGen/src/sourcepainter.h +++ b/utils/HelpGen/src/sourcepainter.h @@ -6,7 +6,7 @@ // Created: 22/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleskandars Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __SOURCEPAINTER_G__ @@ -18,28 +18,21 @@ #if defined( wxUSE_TEMPLATE_STL ) - #include - typedef vector SPBlockListT; + #include + typedef vector SPBlockListT; - #ifdef WIN32 - #include - #else - #include - #include - #endif + #ifdef WIN32 + #include + #else + #include + #include + #endif #else - #include "wxstlvec.h" - #include "wx/string.h" - - #ifdef wxUSE_STD_STRING - using std::string; - #else - // FIXME:: dirty! - #define string wxString - #endif + #include "wxstlvec.h" + #include "wx/string.h" - typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT; + typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT; #endif @@ -63,46 +56,46 @@ class SourcePainter { protected: - string mResultStr; - SPBlockListT mBlocks; - bool mCollectResultsOn; + wxString mResultStr; + SPBlockListT mBlocks; + bool mCollectResultsOn; - // state variables - bool mIsInComment; - bool mCommentIsMultiline; + // state variables + bool mIsInComment; + bool mCommentIsMultiline; public: - // assembleResultString == TRUE - instructs painter - // to collect each chunk of srouce passed to ProcessSource(), - // so that results cann be futher obtained in a single string - // instead of vector of block descriptions + // assembleResultString == true - instructs painter + // to collect each chunk of srouce passed to ProcessSource(), + // so that results cann be futher obtained in a single string + // instead of vector of block descriptions - SourcePainter( bool assembleResultString = TRUE ); - virtual ~SourcePainter() {} + SourcePainter( bool assembleResultString = true ); + virtual ~SourcePainter() {} - // can be called multiple times (e.g. on each source line) - void ProcessSource( char* src, int srcLen ); + // can be called multiple times (e.g. on each source line) + void ProcessSource( char* src, int srcLen ); - // method, for manually adjusting state of source painter - void SetState( bool isInComment, - bool commentIsMultiline ); + // method, for manually adjusting state of source painter + void SetState( bool isInComment, + bool commentIsMultiline ); - // reinitializes object - clears results of previouse processing - void Init( bool assembleResultString = TRUE ); + // reinitializes object - clears results of previouse processing + void Init( bool assembleResultString = true ); - // generates string of highlighted source for the scipting - // language given by "tags" argument - - virtual void GetResultString(string& result, MarkupTagsT tags); + // generates string of highlighted source for the scipting + // language given by "tags" argument - // returns vector of block descriptors, see SPBlockListT definition - // (block descriptors can be used for fast custom hightlighted text generation) + virtual void GetResultString(wxString& result, MarkupTagsT tags); - SPBlockListT& GetBlocks(); + // returns vector of block descriptors, see SPBlockListT definition + // (block descriptors can be used for fast custom highlighted text generation) - // NOTE:: static method - // returns if the given word is a reserved word or basic type identifier - static bool IsKeyword( char* word, int wordLen ); + SPBlockListT& GetBlocks(); + + // NOTE:: static method + // returns if the given word is a reserved word or basic type identifier + static bool IsKeyword( char* word, int wordLen ); }; #endif