From e603bf45ce1d29f17a0d4233484b4ce1806f235a Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 16 Nov 2016 09:27:40 +1100 Subject: Deprecate non-branded struct names in Scintilla.h. --- doc/ScintillaDoc.html | 2 +- doc/ScintillaHistory.html | 10 ++++++++++ include/Scintilla.h | 14 ++++++-------- qt/ScintillaEdit/ScintillaEdit.cpp.template | 4 ++-- src/Editor.cxx | 2 +- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 70ce8623f..5783ffe2c 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -7774,7 +7774,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next widgets.

void scintilla_set_id(ScintillaObject *sci, uptr_t id)
- Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all + Set the control ID which will be used in the idFrom field of the Sci_NotifyHeader structure of all notifications for this instance. This is equivalent to SCI_SETIDENTIFIER.

diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 47b2dd43d..758acc9fc 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -524,6 +524,16 @@ Released 16 October 2016.
  • + Structure names in Scintilla.h without prefixes are deprecated and will now only + be usable with INCLUDE_DEPRECATED_FEATURES defined.
    + Use the newer names with the "Sci_" prefix:
    + CharacterRange → Sci_CharacterRange
    + TextRange → Sci_TextRange
    + TextToFind → Sci_TextToFind
    + RangeToFormat → Sci_RangeToFormat
    + NotifyHeader → Sci_NotifyHeader +
  • +
  • Accessibility support allowing screen readers to work added on GTK+ and Cocoa.
  • diff --git a/include/Scintilla.h b/include/Scintilla.h index b6c75a32d..8c8e592f1 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -1112,10 +1112,6 @@ struct Sci_TextToFind { struct Sci_CharacterRange chrgText; }; -#define CharacterRange Sci_CharacterRange -#define TextRange Sci_TextRange -#define TextToFind Sci_TextToFind - typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1136,8 +1132,6 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; -#define RangeToFormat Sci_RangeToFormat - #ifndef __cplusplus /* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This * is not required in C++ code and actually seems to break ScintillaEditPy */ @@ -1154,8 +1148,6 @@ struct Sci_NotifyHeader { unsigned int code; }; -#define NotifyHeader Sci_NotifyHeader - struct SCNotification { Sci_NotifyHeader nmhdr; Sci_Position position; @@ -1207,6 +1199,12 @@ struct SCNotification { #define SCI_SETKEYSUNICODE 2521 #define SCI_GETKEYSUNICODE 2522 +#define CharacterRange Sci_CharacterRange +#define TextRange Sci_TextRange +#define TextToFind Sci_TextToFind +#define RangeToFormat Sci_RangeToFormat +#define NotifyHeader Sci_NotifyHeader + #endif #endif diff --git a/qt/ScintillaEdit/ScintillaEdit.cpp.template b/qt/ScintillaEdit/ScintillaEdit.cpp.template index 3aca02600..428d27701 100644 --- a/qt/ScintillaEdit/ScintillaEdit.cpp.template +++ b/qt/ScintillaEdit/ScintillaEdit.cpp.template @@ -25,7 +25,7 @@ QByteArray ScintillaEdit::TextReturner(int message, uptr_t wParam) const { } QPairScintillaEdit::find_text(int flags, const char *text, int cpMin, int cpMax) { - struct TextToFind ft = {{0, 0}, 0, {0, 0}}; + struct Sci_TextToFind ft = {{0, 0}, 0, {0, 0}}; ft.chrg.cpMin = cpMin; ft.chrg.cpMax = cpMax; ft.chrgText.cpMin = cpMin; @@ -43,7 +43,7 @@ QByteArray ScintillaEdit::get_text_range(int start, int end) { int length = end-start; QByteArray ba(length+1, '\0'); - struct TextRange tr = {{start, end}, ba.data()}; + struct Sci_TextRange tr = {{start, end}, ba.data()}; send(SCI_GETTEXTRANGE, 0, (sptr_t)&tr); ba.chop(1); // Remove extra NUL diff --git a/src/Editor.cxx b/src/Editor.cxx index 5f588b1fd..f219a5669 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -3932,7 +3932,7 @@ CaseFolder *Editor::CaseFolderForEncoding() { long Editor::FindText( uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD, ///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX. - sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range. + sptr_t lParam) { ///< @c Sci_TextToFind structure: The text to search for in the given range. Sci_TextToFind *ft = reinterpret_cast(lParam); int lengthFound = istrlen(ft->lpstrText); -- cgit v1.2.3