Initial HelpGen source cleaning.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-05-23 15:22:10 +00:00
parent 6131340355
commit 8bc17f14f4
7 changed files with 338 additions and 336 deletions

View File

@@ -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,28 @@
#if defined( wxUSE_TEMPLATE_STL )
#include <vector.h>
typedef vector<int> SPBlockListT;
#include <vector.h>
typedef vector<int> SPBlockListT;
#ifdef WIN32
#include <bstring.h>
#else
#include <strclass.h>
#include <string.h>
#endif
#ifdef WIN32
#include <bstring.h>
#else
#include <strclass.h>
#include <string.h>
#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;
#if wxUSE_STD_STRING
using std::string;
#else
// FIXME:: dirty!
#define string wxString
#endif
typedef WXSTL_VECTOR_SHALLOW_COPY(int) SPBlockListT;
#endif
@@ -63,46 +63,46 @@
class SourcePainter
{
protected:
string mResultStr;
SPBlockListT mBlocks;
bool mCollectResultsOn;
string 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(string& result, MarkupTagsT tags);
SPBlockListT& GetBlocks();
// returns vector of block descriptors, see SPBlockListT definition
// (block descriptors can be used for fast custom hightlighted 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