X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d75a69e8329cecf6f07c667ffc015186c230a2b5..058f225a44d83d42ba9d773efc705badbf0e5e3c:/include/wx/richtext/richtextbuffer.h diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index 0fbffbc9ef..798bb18832 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -80,7 +80,9 @@ #define wxRICHTEXT_USE_OWN_CARET 0 // Switch off for binary compatibility, on for faster drawing -#define wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING 1 +// Note: this seems to be buggy (overzealous use of extents) so +// don't use for now +#define wxRICHTEXT_USE_OPTIMIZED_LINE_DRAWING 0 /*! * Special characters @@ -89,7 +91,7 @@ extern WXDLLIMPEXP_RICHTEXT const wxChar wxRichTextLineBreakChar; /*! - * File types + * File types in wxRichText context. */ enum wxRichTextFileType { @@ -143,17 +145,23 @@ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextBuffer; /*! * Flags returned from hit-testing */ +enum wxRichTextHitTestFlags +{ + // The point was not on this object + wxRICHTEXT_HITTEST_NONE = 0x01, + + // The point was before the position returned from HitTest + wxRICHTEXT_HITTEST_BEFORE = 0x02, -// The point was not on this object -#define wxRICHTEXT_HITTEST_NONE 0x01 -// The point was before the position returned from HitTest -#define wxRICHTEXT_HITTEST_BEFORE 0x02 -// The point was after the position returned from HitTest -#define wxRICHTEXT_HITTEST_AFTER 0x04 -// The point was on the position returned from HitTest -#define wxRICHTEXT_HITTEST_ON 0x08 -// The point was on space outside content -#define wxRICHTEXT_HITTEST_OUTSIDE 0x10 + // The point was after the position returned from HitTest + wxRICHTEXT_HITTEST_AFTER = 0x04, + + // The point was on the position returned from HitTest + wxRICHTEXT_HITTEST_ON = 0x08, + + // The point was on space outside content + wxRICHTEXT_HITTEST_OUTSIDE = 0x10 +}; /*! * Flags for GetRangeSize @@ -697,7 +705,7 @@ public: virtual int GetParagraphLength(long paragraphNumber) const; /// Get the number of paragraphs - virtual int GetParagraphCount() const { return GetChildCount(); } + virtual int GetParagraphCount() const { return static_cast(GetChildCount()); } /// Get the number of visible lines virtual int GetLineCount() const; @@ -730,7 +738,7 @@ public: /// Combines 'style' with 'currentStyle' for the purpose of summarising the attributes of a range of /// content. - bool CollectStyle(wxTextAttr& currentStyle, const wxTextAttr& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes); + bool CollectStyle(wxTextAttr& currentStyle, const wxTextAttr& style, long& multipleStyleAttributes, int& multipleTextEffectAttributes, int& absentStyleAttributes, int& absentTextEffectAttributes); /// Set list style virtual bool SetListStyle(const wxRichTextRange& range, wxRichTextListStyleDefinition* def, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = 1, int specifiedLevel = -1); @@ -972,7 +980,7 @@ public: // Implementation /// Apply paragraph styles such as centering to the wrapped lines - virtual void ApplyParagraphStyle(const wxTextAttr& attr, const wxRect& rect); + virtual void ApplyParagraphStyle(const wxTextAttr& attr, const wxRect& rect, wxDC& dc); /// Insert text at the given position virtual bool InsertText(long pos, const wxString& text); @@ -1779,6 +1787,10 @@ protected: // in a larger document #define wxRICHTEXT_HANDLER_NO_HEADER_FOOTER 0x0080 +// Convert the more common face names to names that will work on the current platform +// in a larger document +#define wxRICHTEXT_HANDLER_CONVERT_FACENAMES 0x0100 + /*! * wxRichTextFileHandler * Base class for file handlers @@ -1893,7 +1905,7 @@ class WXDLLIMPEXP_RICHTEXT wxRichTextBufferDataObject: public wxDataObjectSimple public: // ctor doesn't copy the pointer, so it shouldn't go away while this object // is alive - wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = (wxRichTextBuffer*) NULL); + wxRichTextBufferDataObject(wxRichTextBuffer* richTextBuffer = NULL); virtual ~wxRichTextBufferDataObject(); // after a call to this function, the buffer is owned by the caller and it