diff options
author | Neil <nyamatongwe@gmail.com> | 2022-05-17 08:52:34 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2022-05-17 08:52:34 +1000 |
commit | 475450c76ceef43a7f5b2c68ed5848baee96b6dc (patch) | |
tree | 110ed93d9989eb049ecb0ee2c6fc62692adcefa0 /include | |
parent | e107ecdf3f5576e90dc90c69fc57f24d1f499b61 (diff) | |
download | scintilla-mirror-475450c76ceef43a7f5b2c68ed5848baee96b6dc.tar.gz |
Duplicate APIs to support 64-bit document positions on Win32:
SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL.
Diffstat (limited to 'include')
-rw-r--r-- | include/Scintilla.h | 27 | ||||
-rw-r--r-- | include/Scintilla.iface | 15 | ||||
-rw-r--r-- | include/ScintillaCall.h | 4 | ||||
-rw-r--r-- | include/ScintillaMessages.h | 3 | ||||
-rw-r--r-- | include/ScintillaStructures.h | 24 |
5 files changed, 72 insertions, 1 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h index 14f788eae..0a5c46933 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -474,7 +474,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCFIND_POSIX 0x00400000 #define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 +#define SCI_FINDTEXTFULL 2196 #define SCI_FORMATRANGE 2151 +#define SCI_FORMATRANGEFULL 2777 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 @@ -487,6 +489,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 +#define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 @@ -1267,17 +1270,33 @@ struct Sci_CharacterRange { Sci_PositionCR cpMax; }; +struct Sci_CharacterRangeFull { + Sci_Position cpMin; + Sci_Position cpMax; +}; + struct Sci_TextRange { struct Sci_CharacterRange chrg; char *lpstrText; }; +struct Sci_TextRangeFull { + struct Sci_CharacterRangeFull chrg; + char *lpstrText; +}; + struct Sci_TextToFind { struct Sci_CharacterRange chrg; const char *lpstrText; struct Sci_CharacterRange chrgText; }; +struct Sci_TextToFindFull { + struct Sci_CharacterRangeFull chrg; + const char *lpstrText; + struct Sci_CharacterRangeFull chrgText; +}; + typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1298,6 +1317,14 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; +struct Sci_RangeToFormatFull { + Sci_SurfaceID hdc; + Sci_SurfaceID hdcTarget; + struct Sci_Rectangle rc; + struct Sci_Rectangle rcPage; + struct Sci_CharacterRangeFull chrg; +}; + #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 */ diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 7c20e9144..be3d78692 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -60,9 +60,12 @@ ## cells -> pointer to array of cells, each cell containing a style byte and character byte ## pointer -> void* pointer that may point to a document, loader, internal text storage or similar ## textrange -> range of a min and a max position with an output string +## textrangefull -> range of a min and a max position with an output string - supports 64-bit ## findtext -> searchrange, text -> foundposition +## findtextfull -> searchrange, text -> foundposition ## keymod -> integer containing key in low half and modifiers in high half ## formatrange +## formatrangefull ## Enumeration types always start with a capital letter ## Types no longer used: ## findtextex -> searchrange @@ -1212,9 +1215,15 @@ ali SCFIND_CXX11REGEX=CXX11_REG_EX # Find some text in the document. fun position FindText=2150(FindOption searchFlags, findtext ft) -# On Windows, will draw the document into a display context such as a printer. +# Find some text in the document. +fun position FindTextFull=2196(FindOption searchFlags, findtextfull ft) + +# Draw the document into a display context such as a printer. fun position FormatRange=2151(bool draw, formatrange fr) +# Draw the document into a display context such as a printer. +fun position FormatRangeFull=2777(bool draw, formatrangefull fr) + # Retrieve the display line at the top of the display. get line GetFirstVisibleLine=2152(,) @@ -1255,6 +1264,10 @@ fun position GetSelText=2161(, stringresult text) # Return the length of the text. fun position GetTextRange=2162(, textrange tr) +# Retrieve a range of text that can be past 2GB. +# Return the length of the text. +fun position GetTextRangeFull=2039(, textrangefull tr) + # Draw the selection either highlighted or in normal (non-highlighted) style. fun void HideSelection=2163(bool hide,) diff --git a/include/ScintillaCall.h b/include/ScintillaCall.h index 83e62d6da..40cf1e576 100644 --- a/include/ScintillaCall.h +++ b/include/ScintillaCall.h @@ -68,6 +68,7 @@ public: char CharacterAt(Position position); int UnsignedStyleAt(Position position); std::string StringOfSpan(Span span); + std::string StringOfRange(Span span); Position ReplaceTarget(std::string_view text); Position ReplaceTargetRE(std::string_view text); Position SearchInTarget(std::string_view text); @@ -322,7 +323,9 @@ public: void SetPrintColourMode(Scintilla::PrintOption mode); Scintilla::PrintOption PrintColourMode(); Position FindText(Scintilla::FindOption searchFlags, void *ft); + Position FindTextFull(Scintilla::FindOption searchFlags, void *ft); Position FormatRange(bool draw, void *fr); + Position FormatRangeFull(bool draw, void *fr); Line FirstVisibleLine(); Position GetLine(Line line, char *text); std::string GetLine(Line line); @@ -337,6 +340,7 @@ public: Position GetSelText(char *text); std::string GetSelText(); Position GetTextRange(void *tr); + Position GetTextRangeFull(void *tr); void HideSelection(bool hide); int PointXFromPosition(Position pos); int PointYFromPosition(Position pos); diff --git a/include/ScintillaMessages.h b/include/ScintillaMessages.h index d7bec7f75..3b2927472 100644 --- a/include/ScintillaMessages.h +++ b/include/ScintillaMessages.h @@ -258,7 +258,9 @@ enum class Message { SetPrintColourMode = 2148, GetPrintColourMode = 2149, FindText = 2150, + FindTextFull = 2196, FormatRange = 2151, + FormatRangeFull = 2777, GetFirstVisibleLine = 2152, GetLine = 2153, GetLineCount = 2154, @@ -271,6 +273,7 @@ enum class Message { SetSel = 2160, GetSelText = 2161, GetTextRange = 2162, + GetTextRangeFull = 2039, HideSelection = 2163, PointXFromPosition = 2164, PointYFromPosition = 2165, diff --git a/include/ScintillaStructures.h b/include/ScintillaStructures.h index 6bd16e8c1..a3418173f 100644 --- a/include/ScintillaStructures.h +++ b/include/ScintillaStructures.h @@ -19,17 +19,33 @@ struct CharacterRange { PositionCR cpMax; }; +struct CharacterRangeFull { + Position cpMin; + Position cpMax; +}; + struct TextRange { CharacterRange chrg; char *lpstrText; }; +struct TextRangeFull { + CharacterRangeFull chrg; + char *lpstrText; +}; + struct TextToFind { CharacterRange chrg; const char *lpstrText; CharacterRange chrgText; }; +struct TextToFindFull { + CharacterRangeFull chrg; + const char *lpstrText; + CharacterRangeFull chrgText; +}; + using SurfaceID = void *; struct Rectangle { @@ -49,6 +65,14 @@ struct RangeToFormat { CharacterRange chrg; }; +struct RangeToFormatFull { + SurfaceID hdc; + SurfaceID hdcTarget; + Rectangle rc; + Rectangle rcPage; + CharacterRangeFull chrg; +}; + struct NotifyHeader { /* Compatible with Windows NMHDR. * hwndFrom is really an environment specific window handle or pointer |