Source cleaning: whitespaces, tabs, -1/wxID_ANY, TRUE/true, FALSE/false.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-09-27 19:06:39 +00:00
parent 2e5cc335a7
commit 6953da0088
13 changed files with 106 additions and 106 deletions

View File

@@ -35,8 +35,8 @@ public:
void SetTitleFormat(const wxString& format); void SetTitleFormat(const wxString& format);
void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); } void SetTempDir(const wxString& path) { m_helpData.SetTempDir(path); }
bool AddBook(const wxString& book_url, bool show_wait_msg = FALSE); bool AddBook(const wxString& book_url, bool show_wait_msg = false);
bool AddBook(const wxFileName& book_file, bool show_wait_msg = FALSE); bool AddBook(const wxFileName& book_file, bool show_wait_msg = false);
bool Display(const wxString& x); bool Display(const wxString& x);
bool Display(int id); bool Display(int id);
@@ -68,7 +68,7 @@ public:
virtual void SetFrameParameters(const wxString& title, virtual void SetFrameParameters(const wxString& title,
const wxSize& size, const wxSize& size,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
bool newFrameEachTime = FALSE); bool newFrameEachTime = false);
/// Obtains the latest settings used by the help frame and the help /// Obtains the latest settings used by the help frame and the help
/// frame. /// frame.
virtual wxFrame *GetFrameParameters(wxSize *size = NULL, virtual wxFrame *GetFrameParameters(wxSize *size = NULL,

View File

@@ -35,7 +35,7 @@ class WXDLLIMPEXP_HTML wxHtmlHelpData;
class WXDLLIMPEXP_HTML wxHtmlBookRecord class WXDLLIMPEXP_HTML wxHtmlBookRecord
{ {
public: public:
wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath, wxHtmlBookRecord(const wxString& bookfile, const wxString& basepath,
const wxString& title, const wxString& start) const wxString& title, const wxString& start)
{ {
m_BookFile = bookfile; m_BookFile = bookfile;
@@ -62,8 +62,8 @@ public:
void SetBasePath(const wxString& path) { m_BasePath = path; } void SetBasePath(const wxString& path) { m_BasePath = path; }
void SetStart(const wxString& start) { m_Start = start; } void SetStart(const wxString& start) { m_Start = start; }
// returns full filename of page (which is part of the book), // returns full filename of page (which is part of the book),
// i.e. with book's basePath prepended. If page is already absolute // i.e. with book's basePath prepended. If page is already absolute
// path, basePath is _not_ prepended. // path, basePath is _not_ prepended.
wxString GetFullPath(const wxString &page) const; wxString GetFullPath(const wxString &page) const;
@@ -82,7 +82,7 @@ WX_DECLARE_USER_EXPORTED_OBJARRAY(wxHtmlBookRecord, wxHtmlBookRecArray,
struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem
{ {
wxHtmlHelpDataItem() : level(0), parent(NULL), id(-1), book(NULL) {} wxHtmlHelpDataItem() : level(0), parent(NULL), id(wxID_ANY), book(NULL) {}
short int level; short int level;
wxHtmlHelpDataItem *parent; wxHtmlHelpDataItem *parent;
@@ -90,7 +90,7 @@ struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem
wxString name; wxString name;
wxString page; wxString page;
wxHtmlBookRecord *book; wxHtmlBookRecord *book;
// returns full filename of m_Page, i.e. with book's basePath prepended // returns full filename of m_Page, i.e. with book's basePath prepended
wxString GetFullPath() const { return book->GetFullPath(page); } wxString GetFullPath() const { return book->GetFullPath(page); }
@@ -115,7 +115,7 @@ struct wxHtmlContentsItem
wxChar *m_Name; wxChar *m_Name;
wxChar *m_Page; wxChar *m_Page;
wxHtmlBookRecord *m_Book; wxHtmlBookRecord *m_Book;
// returns full filename of m_Page, i.e. with book's basePath prepended // returns full filename of m_Page, i.e. with book's basePath prepended
wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); } wxString GetFullPath() const { return m_Book->GetFullPath(m_Page); }
@@ -141,7 +141,7 @@ public:
virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only); virtual void LookFor(const wxString& keyword, bool case_sensitive, bool whole_words_only);
// Scans the stream for the keyword. // Scans the stream for the keyword.
// Returns TRUE if the stream contains keyword, fALSE otherwise // Returns true if the stream contains keyword, fALSE otherwise
virtual bool Scan(const wxFSFile& file); virtual bool Scan(const wxFSFile& file);
private: private:
@@ -243,7 +243,7 @@ protected:
wxHtmlHelpDataItems m_contents; // list of all available books and pages wxHtmlHelpDataItems m_contents; // list of all available books and pages
wxHtmlHelpDataItems m_index; // list of index itesm wxHtmlHelpDataItems m_index; // list of index itesm
#if WXWIN_COMPATIBILITY_2_4 #if WXWIN_COMPATIBILITY_2_4
// deprecated data structures, set only if GetContents(), GetIndex() // deprecated data structures, set only if GetContents(), GetIndex()
// called // called

View File

@@ -243,7 +243,7 @@ protected:
private: private:
void DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it); void DisplayIndexItem(const wxHtmlHelpMergedIndexItem *it);
wxHtmlHelpMergedIndex *m_mergedIndex; wxHtmlHelpMergedIndex *m_mergedIndex;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxHtmlHelpFrame) DECLARE_NO_COPY_CLASS(wxHtmlHelpFrame)
}; };

View File

@@ -36,7 +36,7 @@ class WXDLLIMPEXP_HTML wxHtmlContainerCell;
class WXDLLIMPEXP_HTML wxHtmlSelection class WXDLLIMPEXP_HTML wxHtmlSelection
{ {
public: public:
wxHtmlSelection() wxHtmlSelection()
: m_fromPos(wxDefaultPosition), m_toPos(wxDefaultPosition), : m_fromPos(wxDefaultPosition), m_toPos(wxDefaultPosition),
m_fromPrivPos(wxDefaultPosition), m_toPrivPos(wxDefaultPosition), m_fromPrivPos(wxDefaultPosition), m_toPrivPos(wxDefaultPosition),
m_fromCell(NULL), m_toCell(NULL) {} m_fromCell(NULL), m_toCell(NULL) {}
@@ -44,14 +44,14 @@ public:
void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell, void Set(const wxPoint& fromPos, const wxHtmlCell *fromCell,
const wxPoint& toPos, const wxHtmlCell *toCell); const wxPoint& toPos, const wxHtmlCell *toCell);
void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell); void Set(const wxHtmlCell *fromCell, const wxHtmlCell *toCell);
const wxHtmlCell *GetFromCell() const { return m_fromCell; } const wxHtmlCell *GetFromCell() const { return m_fromCell; }
const wxHtmlCell *GetToCell() const { return m_toCell; } const wxHtmlCell *GetToCell() const { return m_toCell; }
// these values are in absolute coordinates: // these values are in absolute coordinates:
const wxPoint& GetFromPos() const { return m_fromPos; } const wxPoint& GetFromPos() const { return m_fromPos; }
const wxPoint& GetToPos() const { return m_toPos; } const wxPoint& GetToPos() const { return m_toPos; }
// these are From/ToCell's private data // these are From/ToCell's private data
const wxPoint& GetFromPrivPos() const { return m_fromPrivPos; } const wxPoint& GetFromPrivPos() const { return m_fromPrivPos; }
const wxPoint& GetToPrivPos() const { return m_toPrivPos; } const wxPoint& GetToPrivPos() const { return m_toPrivPos; }
@@ -59,8 +59,8 @@ public:
void SetToPrivPos(const wxPoint& pos) { m_toPrivPos = pos; } void SetToPrivPos(const wxPoint& pos) { m_toPrivPos = pos; }
void ClearPrivPos() { m_toPrivPos = m_fromPrivPos = wxDefaultPosition; } void ClearPrivPos() { m_toPrivPos = m_fromPrivPos = wxDefaultPosition; }
bool IsEmpty() const bool IsEmpty() const
{ return m_fromPos == wxDefaultPosition && { return m_fromPos == wxDefaultPosition &&
m_toPos == wxDefaultPosition; } m_toPos == wxDefaultPosition; }
private: private:
@@ -85,14 +85,14 @@ class WXDLLIMPEXP_HTML wxHtmlRenderingState
public: public:
wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT) {} wxHtmlRenderingState() : m_selState(wxHTML_SEL_OUT) {}
void SetSelectionState(wxHtmlSelectionState s) { m_selState = s; } void SetSelectionState(wxHtmlSelectionState s) { m_selState = s; }
wxHtmlSelectionState GetSelectionState() const { return m_selState; } wxHtmlSelectionState GetSelectionState() const { return m_selState; }
void SetFgColour(const wxColour& c) { m_fgColour = c; } void SetFgColour(const wxColour& c) { m_fgColour = c; }
const wxColour& GetFgColour() const { return m_fgColour; } const wxColour& GetFgColour() const { return m_fgColour; }
void SetBgColour(const wxColour& c) { m_bgColour = c; } void SetBgColour(const wxColour& c) { m_bgColour = c; }
const wxColour& GetBgColour() const { return m_bgColour; } const wxColour& GetBgColour() const { return m_bgColour; }
private: private:
wxHtmlSelectionState m_selState; wxHtmlSelectionState m_selState;
wxColour m_fgColour, m_bgColour; wxColour m_fgColour, m_bgColour;
@@ -127,12 +127,12 @@ public:
void SetSelection(wxHtmlSelection *s) { m_selection = s; } void SetSelection(wxHtmlSelection *s) { m_selection = s; }
wxHtmlSelection *GetSelection() const { return m_selection; } wxHtmlSelection *GetSelection() const { return m_selection; }
void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; } void SetStyle(wxHtmlRenderingStyle *style) { m_style = style; }
wxHtmlRenderingStyle& GetStyle() { return *m_style; } wxHtmlRenderingStyle& GetStyle() { return *m_style; }
wxHtmlRenderingState& GetState() { return m_state; } wxHtmlRenderingState& GetState() { return m_state; }
protected: protected:
wxHtmlSelection *m_selection; wxHtmlSelection *m_selection;
wxHtmlRenderingStyle *m_style; wxHtmlRenderingStyle *m_style;
@@ -172,7 +172,7 @@ public:
int GetPosX() const {return m_PosX;} int GetPosX() const {return m_PosX;}
int GetPosY() const {return m_PosY;} int GetPosY() const {return m_PosY;}
int GetWidth() const {return m_Width;} int GetWidth() const {return m_Width;}
// Returns the maximum possible length of the cell. // Returns the maximum possible length of the cell.
// Call Layout at least once before using GetMaxTotalWidth() // Call Layout at least once before using GetMaxTotalWidth()
virtual int GetMaxTotalWidth() const { return m_Width; } virtual int GetMaxTotalWidth() const { return m_Width; }
@@ -259,7 +259,7 @@ public:
// Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
// is true - the cell can be split on two pages // is true - the cell can be split on two pages
void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; } void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; }
// Can the line be broken before this cell? // Can the line be broken before this cell?
virtual bool IsLinebreakAllowed() const virtual bool IsLinebreakAllowed() const
{ return !IsFormattingCell(); } { return !IsFormattingCell(); }
@@ -281,20 +281,20 @@ public:
// Returns first (last) terminal cell inside this cell. It may return NULL, // Returns first (last) terminal cell inside this cell. It may return NULL,
// but it is rare -- only if there are no terminals in the tree. // but it is rare -- only if there are no terminals in the tree.
virtual wxHtmlCell *GetFirstTerminal() const virtual wxHtmlCell *GetFirstTerminal() const
{ return wxConstCast(this, wxHtmlCell); } { return wxConstCast(this, wxHtmlCell); }
virtual wxHtmlCell *GetLastTerminal() const virtual wxHtmlCell *GetLastTerminal() const
{ return wxConstCast(this, wxHtmlCell); } { return wxConstCast(this, wxHtmlCell); }
// Returns cell's depth, i.e. how far under the root cell it is // Returns cell's depth, i.e. how far under the root cell it is
// (if it is the root, depth is 0) // (if it is the root, depth is 0)
unsigned GetDepth() const; unsigned GetDepth() const;
// Returns true if the cell appears before 'cell' in natural order of // Returns true if the cell appears before 'cell' in natural order of
// cells (= as they are read). If cell A is (grand)parent of cell B, // cells (= as they are read). If cell A is (grand)parent of cell B,
// then both A.IsBefore(B) and B.IsBefore(A) always return true. // then both A.IsBefore(B) and B.IsBefore(A) always return true.
bool IsBefore(wxHtmlCell *cell) const; bool IsBefore(wxHtmlCell *cell) const;
// Converts the cell into text representation. If sel != NULL then // Converts the cell into text representation. If sel != NULL then
// only part of the cell inside the selection is converted. // only part of the cell inside the selection is converted.
virtual wxString ConvertToText(wxHtmlSelection *WXUNUSED(sel)) const virtual wxString ConvertToText(wxHtmlSelection *WXUNUSED(sel)) const
@@ -351,7 +351,7 @@ protected:
void Split(wxDC& dc, void Split(wxDC& dc,
const wxPoint& selFrom, const wxPoint& selTo, const wxPoint& selFrom, const wxPoint& selTo,
unsigned& pos1, unsigned& pos2) const; unsigned& pos1, unsigned& pos2) const;
wxString m_Word; wxString m_Word;
bool m_allowLinebreak; bool m_allowLinebreak;
@@ -424,11 +424,11 @@ public:
virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y, virtual wxHtmlCell *FindCellByPos(wxCoord x, wxCoord y,
unsigned flags = wxHTML_FIND_EXACT) const; unsigned flags = wxHTML_FIND_EXACT) const;
virtual wxHtmlCell *GetFirstTerminal() const; virtual wxHtmlCell *GetFirstTerminal() const;
virtual wxHtmlCell *GetLastTerminal() const; virtual wxHtmlCell *GetLastTerminal() const;
// Removes indentation on top or bottom of the container (i.e. above or // Removes indentation on top or bottom of the container (i.e. above or
// below first/last terminal cell). For internal use only. // below first/last terminal cell). For internal use only.
void RemoveExtraSpacing(bool top, bool bottom); void RemoveExtraSpacing(bool top, bool bottom);
@@ -442,7 +442,7 @@ protected:
wxHtmlCell *cell) const; wxHtmlCell *cell) const;
void UpdateRenderingStatePost(wxHtmlRenderingInfo& info, void UpdateRenderingStatePost(wxHtmlRenderingInfo& info,
wxHtmlCell *cell) const; wxHtmlCell *cell) const;
protected: protected:
int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom; int m_IndentLeft, m_IndentRight, m_IndentTop, m_IndentBottom;
// indentation of subcells. There is always m_Indent pixels // indentation of subcells. There is always m_Indent pixels
@@ -469,7 +469,7 @@ protected:
int m_MaxTotalWidth; int m_MaxTotalWidth;
// Maximum possible length if ignoring line wrap // Maximum possible length if ignoring line wrap
DECLARE_ABSTRACT_CLASS(wxHtmlContainerCell) DECLARE_ABSTRACT_CLASS(wxHtmlContainerCell)
DECLARE_NO_COPY_CLASS(wxHtmlContainerCell) DECLARE_NO_COPY_CLASS(wxHtmlContainerCell)
}; };

View File

@@ -75,11 +75,11 @@
#define wxHTML_COND_ISANCHOR 1 #define wxHTML_COND_ISANCHOR 1
// Finds the anchor of 'param' name (pointer to wxString). // Finds the anchor of 'param' name (pointer to wxString).
#define wxHTML_COND_ISIMAGEMAP 2 #define wxHTML_COND_ISIMAGEMAP 2
// Finds imagemap of 'param' name (pointer to wxString). // Finds imagemap of 'param' name (pointer to wxString).
// (used exclusively by m_image.cpp) // (used exclusively by m_image.cpp)
#define wxHTML_COND_USER 10000 #define wxHTML_COND_USER 10000
// User-defined conditions should start from this number // User-defined conditions should start from this number

View File

@@ -38,7 +38,7 @@ public:
wxHtmlFilter() : wxObject() {} wxHtmlFilter() : wxObject() {}
virtual ~wxHtmlFilter() {} virtual ~wxHtmlFilter() {}
// returns TRUE if this filter is able to open&read given file // returns true if this filter is able to open&read given file
virtual bool CanRead(const wxFSFile& file) const = 0; virtual bool CanRead(const wxFSFile& file) const = 0;
// Reads given file and returns HTML document. // Reads given file and returns HTML document.

View File

@@ -57,7 +57,7 @@ public:
wxFileSystem* GetFS() const { return m_FS; } wxFileSystem* GetFS() const { return m_FS; }
// Opens file if the parser is allowed to open given URL (may be forbidden // Opens file if the parser is allowed to open given URL (may be forbidden
// for security reasons) // for security reasons)
virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const; virtual wxFSFile *OpenURL(wxHtmlURLType type, const wxString& url) const;
// You can simply call this method when you need parsed output. // You can simply call this method when you need parsed output.
@@ -72,9 +72,9 @@ public:
virtual void InitParser(const wxString& source); virtual void InitParser(const wxString& source);
// This must be called after Parse(). // This must be called after Parse().
virtual void DoneParser(); virtual void DoneParser();
// May be called during parsing to immediately return from Parse(). // May be called during parsing to immediately return from Parse().
virtual void StopParsing() { m_stopParsing = TRUE; } virtual void StopParsing() { m_stopParsing = true; }
// Parses the m_Source from begin_pos to end_pos-1. // Parses the m_Source from begin_pos to end_pos-1.
// (in noparams version it parses whole m_Source) // (in noparams version it parses whole m_Source)
@@ -93,7 +93,7 @@ public:
// adds handler to the list & hash table of handlers. // adds handler to the list & hash table of handlers.
virtual void AddTagHandler(wxHtmlTagHandler *handler); virtual void AddTagHandler(wxHtmlTagHandler *handler);
// Forces the handler to handle additional tags (not returned by GetSupportedTags). // Forces the handler to handle additional tags (not returned by GetSupportedTags).
// The handler should already be in use by this parser. // The handler should already be in use by this parser.
// Example: you want to parse following pseudo-html structure: // Example: you want to parse following pseudo-html structure:
// <myitems> // <myitems>
@@ -111,21 +111,21 @@ public:
wxString* GetSource() {return &m_Source;} wxString* GetSource() {return &m_Source;}
void SetSource(const wxString& src); void SetSource(const wxString& src);
// Sets HTML source and remebers current parser's state so that it can // Sets HTML source and remebers current parser's state so that it can
// later be restored. This is useful for on-line modifications of // later be restored. This is useful for on-line modifications of
// HTML source (for example, <pre> handler replaces spaces with &nbsp; // HTML source (for example, <pre> handler replaces spaces with &nbsp;
// and newlines with <br>) // and newlines with <br>)
virtual void SetSourceAndSaveState(const wxString& src); virtual void SetSourceAndSaveState(const wxString& src);
// Restores parser's state from stack or returns FALSE if the stack is // Restores parser's state from stack or returns false if the stack is
// empty // empty
virtual bool RestoreState(); virtual bool RestoreState();
// Parses HTML string 'markup' and extracts charset info from <meta> tag // Parses HTML string 'markup' and extracts charset info from <meta> tag
// if present. Returns empty string if the tag is missing. // if present. Returns empty string if the tag is missing.
// For wxHTML's internal use. // For wxHTML's internal use.
static wxString ExtractCharsetInformation(const wxString& markup); static wxString ExtractCharsetInformation(const wxString& markup);
// Returns entity parser object, used to substitute HTML &entities; // Returns entity parser object, used to substitute HTML &entities;
wxHtmlEntitiesParser *GetEntitiesParser() const { return m_entitiesParser; } wxHtmlEntitiesParser *GetEntitiesParser() const { return m_entitiesParser; }
@@ -134,7 +134,7 @@ protected:
void CreateDOMTree(); void CreateDOMTree();
void DestroyDOMTree(); void DestroyDOMTree();
void CreateDOMSubTree(wxHtmlTag *cur, void CreateDOMSubTree(wxHtmlTag *cur,
int begin_pos, int end_pos, int begin_pos, int end_pos,
wxHtmlTagsCache *cache); wxHtmlTagsCache *cache);
// Adds text to the output. // Adds text to the output.
@@ -159,9 +159,9 @@ protected:
size_t m_CurTextPiece; size_t m_CurTextPiece;
wxString m_Source; wxString m_Source;
wxHtmlParserState *m_SavedStates; wxHtmlParserState *m_SavedStates;
// handlers that handle particular tags. The table is accessed by // handlers that handle particular tags. The table is accessed by
// key = tag's name. // key = tag's name.
// This attribute MUST be filled by derived class otherwise it would // This attribute MUST be filled by derived class otherwise it would
@@ -180,10 +180,10 @@ protected:
wxFileSystem *m_FS; wxFileSystem *m_FS;
// handlers stack used by PushTagHandler and PopTagHandler // handlers stack used by PushTagHandler and PopTagHandler
wxList *m_HandlersStack; wxList *m_HandlersStack;
// entity parse // entity parse
wxHtmlEntitiesParser *m_entitiesParser; wxHtmlEntitiesParser *m_entitiesParser;
// flag indicating that the parser should stop // flag indicating that the parser should stop
bool m_stopParsing; bool m_stopParsing;
}; };
@@ -208,7 +208,7 @@ public:
// NOTE : each _instance_ of handler is guaranteed to be called // NOTE : each _instance_ of handler is guaranteed to be called
// only by one parser. This means you don't have to care about // only by one parser. This means you don't have to care about
// reentrancy. // reentrancy.
virtual void SetParser(wxHtmlParser *parser) virtual void SetParser(wxHtmlParser *parser)
{ m_Parser = parser; } { m_Parser = parser; }
// Returns list of supported tags. The list is in uppercase and // Returns list of supported tags. The list is in uppercase and
@@ -219,14 +219,14 @@ public:
// This is hadling core method. It does all the Steps 1-3. // This is hadling core method. It does all the Steps 1-3.
// To process step 2, you can call ParseInner() // To process step 2, you can call ParseInner()
// returned value : TRUE if it called ParseInner(), // returned value : true if it called ParseInner(),
// FALSE etherwise // false etherwise
virtual bool HandleTag(const wxHtmlTag& tag) = 0; virtual bool HandleTag(const wxHtmlTag& tag) = 0;
protected: protected:
// parses input between beginning and ending tag. // parses input between beginning and ending tag.
// m_Parser must be set. // m_Parser must be set.
void ParseInner(const wxHtmlTag& tag) void ParseInner(const wxHtmlTag& tag)
{ m_Parser->DoParsing(tag.GetBeginPos(), tag.GetEndPos1()); } { m_Parser->DoParsing(tag.GetBeginPos(), tag.GetEndPos1()); }
wxHtmlParser *m_Parser; wxHtmlParser *m_Parser;
@@ -244,11 +244,11 @@ class WXDLLIMPEXP_HTML wxHtmlEntitiesParser : public wxObject
public: public:
wxHtmlEntitiesParser(); wxHtmlEntitiesParser();
virtual ~wxHtmlEntitiesParser(); virtual ~wxHtmlEntitiesParser();
// Sets encoding of output string. // Sets encoding of output string.
// Has no effect if wxUSE_WCHAR_T==0 or wxUSE_UNICODE==1 // Has no effect if wxUSE_WCHAR_T==0 or wxUSE_UNICODE==1
void SetEncoding(wxFontEncoding encoding); void SetEncoding(wxFontEncoding encoding);
// Parses entities in input and replaces them with respective characters // Parses entities in input and replaces them with respective characters
// (with respect to output encoding) // (with respect to output encoding)
wxString Parse(const wxString& input); wxString Parse(const wxString& input);

View File

@@ -30,7 +30,7 @@ enum
wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals
}; };
// Classes derived from this class serve as simple text processors for // Classes derived from this class serve as simple text processors for
// wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered // wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered
// processors before displaying it, thus allowing for on-the-fly // processors before displaying it, thus allowing for on-the-fly
// modifications of the markup. // modifications of the markup.
@@ -40,7 +40,7 @@ class WXDLLIMPEXP_HTML wxHtmlProcessor : public wxObject
DECLARE_ABSTRACT_CLASS(wxHtmlProcessor) DECLARE_ABSTRACT_CLASS(wxHtmlProcessor)
public: public:
wxHtmlProcessor() : wxObject(), m_enabled(TRUE) {} wxHtmlProcessor() : wxObject(), m_enabled(true) {}
virtual ~wxHtmlProcessor() {} virtual ~wxHtmlProcessor() {}
// Process input text and return processed result // Process input text and return processed result
@@ -49,12 +49,12 @@ public:
// Return priority value of this processor. The higher, the sooner // Return priority value of this processor. The higher, the sooner
// is the processor applied to the text. // is the processor applied to the text.
virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE; } virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE; }
// Enable/disable the processor. wxHtmlWindow won't use a disabled // Enable/disable the processor. wxHtmlWindow won't use a disabled
// processor even if it is in its processors queue. // processor even if it is in its processors queue.
virtual void Enable(bool enable = TRUE) { m_enabled = enable; } virtual void Enable(bool enable = true) { m_enabled = enable; }
bool IsEnabled() const { return m_enabled; } bool IsEnabled() const { return m_enabled; }
protected: protected:
bool m_enabled; bool m_enabled;
}; };

View File

@@ -87,17 +87,17 @@ public:
// Returns tag's name in uppercase. // Returns tag's name in uppercase.
inline wxString GetName() const {return m_Name;} inline wxString GetName() const {return m_Name;}
// Returns TRUE if the tag has given parameter. Parameter // Returns true if the tag has given parameter. Parameter
// should always be in uppercase. // should always be in uppercase.
// Example : <IMG SRC="test.jpg"> HasParam("SRC") returns TRUE // Example : <IMG SRC="test.jpg"> HasParam("SRC") returns true
bool HasParam(const wxString& par) const; bool HasParam(const wxString& par) const;
// Returns value of the param. Value is in uppercase unless it is // Returns value of the param. Value is in uppercase unless it is
// enclosed with " // enclosed with "
// Example : <P align=right> GetParam("ALIGN") returns (RIGHT) // Example : <P align=right> GetParam("ALIGN") returns (RIGHT)
// <P IMG SRC="WhaT.jpg"> GetParam("SRC") returns (WhaT.jpg) // <P IMG SRC="WhaT.jpg"> GetParam("SRC") returns (WhaT.jpg)
// (or ("WhaT.jpg") if with_commas == TRUE) // (or ("WhaT.jpg") if with_commas == true)
wxString GetParam(const wxString& par, bool with_commas = FALSE) const; wxString GetParam(const wxString& par, bool with_commas = false) const;
// Convenience functions: // Convenience functions:
bool GetParamAsColour(const wxString& par, wxColour *clr) const; bool GetParamAsColour(const wxString& par, wxColour *clr) const;
@@ -105,7 +105,7 @@ public:
// Scans param like scanf() functions family does. // Scans param like scanf() functions family does.
// Example : ScanParam("COLOR", "\"#%X\"", &clr); // Example : ScanParam("COLOR", "\"#%X\"", &clr);
// This is always with with_commas=FALSE // This is always with with_commas=false
// Returns number of scanned values // Returns number of scanned values
// (like sscanf() does) // (like sscanf() does)
// NOTE: unlike scanf family, this function only accepts // NOTE: unlike scanf family, this function only accepts
@@ -116,12 +116,12 @@ public:
wxString GetAllParams() const; wxString GetAllParams() const;
#if WXWIN_COMPATIBILITY_2_2 #if WXWIN_COMPATIBILITY_2_2
// return TRUE if this is ending tag (</something>) or FALSE // return true if this is ending tag (</something>) or false
// if it isn't (<something>) // if it isn't (<something>)
inline bool IsEnding() const {return FALSE;} inline bool IsEnding() const {return false;}
#endif #endif
// return TRUE if this there is matching ending tag // return true if this there is matching ending tag
inline bool HasEnding() const {return m_End1 >= 0;} inline bool HasEnding() const {return m_End1 >= 0;}
// returns beginning position of _internal_ block of text // returns beginning position of _internal_ block of text

View File

@@ -68,7 +68,7 @@ class WXDLLIMPEXP_HTML wxHtmlWindow : public wxScrolledWindow
public: public:
wxHtmlWindow() { Init(); } wxHtmlWindow() { Init(); }
wxHtmlWindow(wxWindow *parent, wxWindowID id = -1, wxHtmlWindow(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxHW_DEFAULT_STYLE, long style = wxHW_DEFAULT_STYLE,
@@ -79,7 +79,7 @@ public:
} }
~wxHtmlWindow(); ~wxHtmlWindow();
bool Create(wxWindow *parent, wxWindowID id = -1, bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,
long style = wxHW_SCROLLBAR_AUTO, long style = wxHW_SCROLLBAR_AUTO,
@@ -88,7 +88,7 @@ public:
// Set HTML page and display it. !! source is HTML document itself, // Set HTML page and display it. !! source is HTML document itself,
// it is NOT address/filename of HTML document. If you want to // it is NOT address/filename of HTML document. If you want to
// specify document location, use LoadPage() istead // specify document location, use LoadPage() istead
// Return value : FALSE if an error occured, TRUE otherwise // Return value : false if an error occured, true otherwise
bool SetPage(const wxString& source); bool SetPage(const wxString& source);
// Append to current page // Append to current page
@@ -135,7 +135,7 @@ public:
void SetStandardFonts(int size = -1, void SetStandardFonts(int size = -1,
const wxString& normal_face = wxEmptyString, const wxString& normal_face = wxEmptyString,
const wxString& fixed_face = wxEmptyString); const wxString& fixed_face = wxEmptyString);
// Sets space between text and window borders. // Sets space between text and window borders.
void SetBorders(int b) {m_Borders = b;} void SetBorders(int b) {m_Borders = b;}
@@ -147,7 +147,7 @@ public:
virtual void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString); virtual void WriteCustomization(wxConfigBase *cfg, wxString path = wxEmptyString);
// Goes to previous/next page (in browsing history) // Goes to previous/next page (in browsing history)
// Returns TRUE if successful, FALSE otherwise // Returns true if successful, false otherwise
bool HistoryBack(); bool HistoryBack();
bool HistoryForward(); bool HistoryForward();
bool HistoryCanBack(); bool HistoryCanBack();
@@ -192,19 +192,19 @@ public:
// Called when wxHtmlWindow wants to fetch data from an URL (e.g. when // Called when wxHtmlWindow wants to fetch data from an URL (e.g. when
// loading a page or loading an image). The data are downloaded if and only if // loading a page or loading an image). The data are downloaded if and only if
// OnOpeningURL returns TRUE. If OnOpeningURL returns wxHTML_REDIRECT, // OnOpeningURL returns true. If OnOpeningURL returns wxHTML_REDIRECT,
// it must set *redirect to the new URL // it must set *redirect to the new URL
virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType WXUNUSED(type), virtual wxHtmlOpeningStatus OnOpeningURL(wxHtmlURLType WXUNUSED(type),
const wxString& WXUNUSED(url), const wxString& WXUNUSED(url),
wxString *WXUNUSED(redirect)) const wxString *WXUNUSED(redirect)) const
{ return wxHTML_OPEN; } { return wxHTML_OPEN; }
#if wxUSE_CLIPBOARD #if wxUSE_CLIPBOARD
// Helper functions to select parts of page: // Helper functions to select parts of page:
void SelectWord(const wxPoint& pos); void SelectWord(const wxPoint& pos);
void SelectLine(const wxPoint& pos); void SelectLine(const wxPoint& pos);
void SelectAll(); void SelectAll();
// Convert selection to text: // Convert selection to text:
wxString SelectionToText() { return DoSelectionToText(m_selection); } wxString SelectionToText() { return DoSelectionToText(m_selection); }
@@ -214,14 +214,14 @@ public:
virtual void ApplyParentThemeBackground(const wxColour& WXUNUSED(bg)) virtual void ApplyParentThemeBackground(const wxColour& WXUNUSED(bg))
{ /* do nothing */ } { /* do nothing */ }
protected: protected:
void Init(); void Init();
// Scrolls to anchor of this name. (Anchor is #news // Scrolls to anchor of this name. (Anchor is #news
// or #features etc. it is part of address sometimes: // or #features etc. it is part of address sometimes:
// http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/index.html#news) // http://www.ms.mff.cuni.cz/~vsla8348/wxhtml/index.html#news)
// Return value : TRUE if anchor exists, FALSE otherwise // Return value : true if anchor exists, false otherwise
bool ScrollToAnchor(const wxString& anchor); bool ScrollToAnchor(const wxString& anchor);
// Prepares layout (= fill m_PosX, m_PosY for fragments) based on // Prepares layout (= fill m_PosX, m_PosY for fragments) based on
@@ -272,7 +272,7 @@ protected:
protected: protected:
wxString DoSelectionToText(wxHtmlSelection *sel); wxString DoSelectionToText(wxHtmlSelection *sel);
// This is pointer to the first cell in parsed data. (Note: the first cell // This is pointer to the first cell in parsed data. (Note: the first cell
// is usually top one = all other cells are sub-cells of this one) // is usually top one = all other cells are sub-cells of this one)
wxHtmlContainerCell *m_Cell; wxHtmlContainerCell *m_Cell;
@@ -328,7 +328,7 @@ private:
wxHtmlCell *m_tmpSelFromCell; wxHtmlCell *m_tmpSelFromCell;
// a flag indicated if mouse moved // a flag indicated if mouse moved
// (if TRUE we will try to change cursor in last call to OnIdle) // (if true we will try to change cursor in last call to OnIdle)
bool m_tmpMouseMoved; bool m_tmpMouseMoved;
// contains last link name // contains last link name
wxHtmlLinkInfo *m_tmpLastLink; wxHtmlLinkInfo *m_tmpLastLink;

View File

@@ -30,7 +30,7 @@
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// wxHtmlDCRenderer // wxHtmlDCRenderer
// This class is capable of rendering HTML into specified // This class is capable of rendering HTML into specified
// portion of DC // portion of DC
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@@ -52,9 +52,9 @@ public:
// Sets the text to be displayed. // Sets the text to be displayed.
// Basepath is base directory (html string would be stored there if it was in // Basepath is base directory (html string would be stored there if it was in
// file). It is used to determine path for loading images, for example. // file). It is used to determine path for loading images, for example.
// isdir is FALSE if basepath is filename, TRUE if it is directory name // isdir is false if basepath is filename, true if it is directory name
// (see wxFileSystem for detailed explanation) // (see wxFileSystem for detailed explanation)
void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = TRUE); void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = true);
// Sets fonts to be used when displaying HTML page. (if size null then default sizes used). // Sets fonts to be used when displaying HTML page. (if size null then default sizes used).
void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL); void SetFonts(wxString normal_face, wxString fixed_face, const int *sizes = NULL);
@@ -123,13 +123,13 @@ public:
wxHtmlPrintout(const wxString& title = wxT("Printout")); wxHtmlPrintout(const wxString& title = wxT("Printout"));
~wxHtmlPrintout(); ~wxHtmlPrintout();
void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = TRUE); void SetHtmlText(const wxString& html, const wxString &basepath = wxEmptyString, bool isdir = true);
// prepares the class for printing this html document. // prepares the class for printing this html document.
// Must be called before using the class, in fact just after constructor // Must be called before using the class, in fact just after constructor
// //
// basepath is base directory (html string would be stored there if it was in // basepath is base directory (html string would be stored there if it was in
// file). It is used to determine path for loading images, for example. // file). It is used to determine path for loading images, for example.
// isdir is FALSE if basepath is filename, TRUE if it is directory name // isdir is false if basepath is filename, true if it is directory name
// (see wxFileSystem for detailed explanation) // (see wxFileSystem for detailed explanation)
void SetHtmlFile(const wxString &htmlfile); void SetHtmlFile(const wxString &htmlfile);
@@ -154,12 +154,12 @@ public:
const wxString& normal_face = wxEmptyString, const wxString& normal_face = wxEmptyString,
const wxString& fixed_face = wxEmptyString); const wxString& fixed_face = wxEmptyString);
void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2, void SetMargins(float top = 25.2, float bottom = 25.2, float left = 25.2, float right = 25.2,
float spaces = 5); float spaces = 5);
// sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space // sets margins in milimeters. Defaults to 1 inch for margins and 0.5cm for space
// between text and header and/or footer // between text and header and/or footer
// wxPrintout stuff: // wxPrintout stuff:
bool OnPrintPage(int page); bool OnPrintPage(int page);
bool HasPage(int page); bool HasPage(int page);
void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo); void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo);
@@ -206,12 +206,12 @@ private:
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
// wxHtmlEasyPrinting // wxHtmlEasyPrinting
// This class provides very simple interface to printing // This class provides very simple interface to printing
// architecture. It allows you to print HTML documents only // architecture. It allows you to print HTML documents only
// with very few commands. // with very few commands.
// //
// Note : do not create this class on stack only. // Note : do not create this class on stack only.
// You should create an instance on app startup and // You should create an instance on app startup and
// use this instance for all printing. Why? The class // use this instance for all printing. Why? The class
// stores page&printer settings in it. // stores page&printer settings in it.
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
@@ -254,10 +254,10 @@ public:
void SetStandardFonts(int size = -1, void SetStandardFonts(int size = -1,
const wxString& normal_face = wxEmptyString, const wxString& normal_face = wxEmptyString,
const wxString& fixed_face = wxEmptyString); const wxString& fixed_face = wxEmptyString);
wxPrintData *GetPrintData(); wxPrintData *GetPrintData();
wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;} wxPageSetupDialogData *GetPageSetupData() {return m_PageSetupData;}
// return page setting data objects. // return page setting data objects.
// (You can set their parameters.) // (You can set their parameters.)
protected: protected:
@@ -279,7 +279,7 @@ private:
FontMode_Standard FontMode_Standard
}; };
FontMode m_fontMode; FontMode m_fontMode;
wxString m_Headers[2], m_Footers[2]; wxString m_Headers[2], m_Footers[2];
wxWindow *m_ParentWindow; wxWindow *m_ParentWindow;

View File

@@ -55,14 +55,14 @@ public:
const wxValidator& validator = wxDefaultValidator, const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("webkitctrl")); const wxString& name = wxT("webkitctrl"));
virtual ~wxWebKitCtrl(); virtual ~wxWebKitCtrl();
void LoadURL(const wxString &url); void LoadURL(const wxString &url);
bool CanGoBack(); bool CanGoBack();
bool CanGoForward(); bool CanGoForward();
bool GoBack(); bool GoBack();
bool GoForward(); bool GoForward();
void Reload(); void Reload();
void Stop(); void Stop();
bool CanGetPageSource(); bool CanGetPageSource();
wxString GetPageSource(); wxString GetPageSource();
@@ -118,13 +118,13 @@ protected:
typedef void (wxEvtHandler::*wxWebKitStateChangedEventFunction)(wxWebKitStateChangedEvent&); typedef void (wxEvtHandler::*wxWebKitStateChangedEventFunction)(wxWebKitStateChangedEvent&);
BEGIN_DECLARE_EVENT_TYPES() BEGIN_DECLARE_EVENT_TYPES()
DECLARE_LOCAL_EVENT_TYPE(wxEVT_WEBKIT_STATE_CHANGED, -1) DECLARE_LOCAL_EVENT_TYPE(wxEVT_WEBKIT_STATE_CHANGED, wxID_ANY)
END_DECLARE_EVENT_TYPES() END_DECLARE_EVENT_TYPES()
#define EVT_WEBKIT_STATE_CHANGED(func) \ #define EVT_WEBKIT_STATE_CHANGED(func) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_STATE_CHANGED, \ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_STATE_CHANGED, \
-1, \ wxID_ANY, \
-1, \ wxID_ANY, \
(wxObjectEventFunction) \ (wxObjectEventFunction) \
(wxWebKitStateChangedEventFunction) & func, \ (wxWebKitStateChangedEventFunction) & func, \
(wxObject *) NULL ), (wxObject *) NULL ),

View File

@@ -77,7 +77,7 @@ public:
void SetStandardFonts(int size = -1, void SetStandardFonts(int size = -1,
const wxString& normal_face = wxEmptyString, const wxString& normal_face = wxEmptyString,
const wxString& fixed_face = wxEmptyString); const wxString& fixed_face = wxEmptyString);
// Adds tags module. see wxHtmlTagsModule for details. // Adds tags module. see wxHtmlTagsModule for details.
static void AddModule(wxHtmlTagsModule *module); static void AddModule(wxHtmlTagsModule *module);
@@ -154,7 +154,7 @@ private:
wxHtmlContainerCell *m_Container; wxHtmlContainerCell *m_Container;
// current container. See Open/CloseContainer for details. // current container. See Open/CloseContainer for details.
int m_FontBold, m_FontItalic, m_FontUnderlined, m_FontFixed; // this is not TRUE,FALSE but 1,0, we need it for indexing int m_FontBold, m_FontItalic, m_FontUnderlined, m_FontFixed; // this is not true,false but 1,0, we need it for indexing
int m_FontSize; /* -2 to +4, 0 is default */ int m_FontSize; /* -2 to +4, 0 is default */
wxColour m_LinkColor; wxColour m_LinkColor;
wxColour m_ActualColor; wxColour m_ActualColor;
@@ -162,7 +162,7 @@ private:
wxHtmlLinkInfo m_Link; wxHtmlLinkInfo m_Link;
// actual hypertext link or empty string // actual hypertext link or empty string
bool m_UseLink; bool m_UseLink;
// TRUE if m_Link is not empty // true if m_Link is not empty
long m_CharHeight, m_CharWidth; long m_CharHeight, m_CharWidth;
// average height of normal-sized text // average height of normal-sized text
int m_Align; int m_Align;
@@ -190,7 +190,7 @@ private:
#endif #endif
wxHtmlWordCell *m_lastWordCell; wxHtmlWordCell *m_lastWordCell;
DECLARE_NO_COPY_CLASS(wxHtmlWinParser) DECLARE_NO_COPY_CLASS(wxHtmlWinParser)
}; };