diff options
| author | mitchell <unknown> | 2020-04-05 16:00:55 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-04-05 16:00:55 -0400 |
| commit | 5f4a3252dfb66b77f6ed4acf0e4bc46a5c678744 (patch) | |
| tree | b7216cc0c52046816f7bc5f060b354dfc010fe58 /src/CallTip.h | |
| parent | b467fbec5c0b13bb71444191b250b50677238361 (diff) | |
| download | scintilla-mirror-5f4a3252dfb66b77f6ed4acf0e4bc46a5c678744.tar.gz | |
Backport: Widen types to size_t to match change from int to position of CallTipSetHlt
in Scintilla.iface.
Backport of changeset 8098:228c9f9aa839.
Diffstat (limited to 'src/CallTip.h')
| -rw-r--r-- | src/CallTip.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/CallTip.h b/src/CallTip.h index a720bd3a3..1a0a317cb 100644 --- a/src/CallTip.h +++ b/src/CallTip.h @@ -10,11 +10,19 @@ namespace Scintilla { +struct Chunk { + size_t start; + size_t end; + Chunk(size_t start_=0, size_t end_=0) noexcept : start(start_), end(end_) { + assert(start <= end); + } + size_t Length() const noexcept; +}; + /** */ class CallTip { - int startHighlight; // character offset to start and... - int endHighlight; // ...end of highlighted text + Chunk highlight; // character offset to start and end of highlighted text std::string val; Font font; PRectangle rectUp; // rectangle of last up angle in the tip @@ -25,9 +33,8 @@ class CallTip { bool useStyleCallTip; // if true, STYLE_CALLTIP should be used bool above; // if true, display calltip above text - void DrawChunk(Surface *surface, int &x, const char *s, - int posStart, int posEnd, int ytext, PRectangle rcClient, - bool highlight, bool draw); + int DrawChunk(Surface *surface, int x, const char *s, size_t len, + int ytext, PRectangle rcClient, bool asHighlight, bool draw); int PaintContents(Surface *surfaceWindow, bool draw); bool IsTabCharacter(char ch) const noexcept; int NextTabPos(int x) const noexcept; @@ -71,7 +78,7 @@ public: /// Set a range of characters to be displayed in a highlight style. /// Commonly used to highlight the current parameter. - void SetHighlight(int start, int end); + void SetHighlight(size_t start, size_t end); /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand. void SetTabSize(int tabSz) noexcept; |
