1// Scintilla source code edit control
2/** @file ScintillaStructures.h
3 ** Structures used to communicate with Scintilla.
4 ** The same structures are defined for C in Scintilla.h.
5 ** Uses definitions from ScintillaTypes.h.
6 **/
7// Copyright 2021 by Neil Hodgson <neilh@scintilla.org>
8// The License.txt file describes the conditions under which this software may be distributed.
9
10#ifndef SCINTILLASTRUCTURES_H
11#define SCINTILLASTRUCTURES_H
12
13namespace Scintilla {
14
15using PositionCR = long;
16
17struct CharacterRange {
18 PositionCR cpMin;
19 PositionCR cpMax;
20};
21
22struct TextRange {
23 CharacterRange chrg;
24 char *lpstrText;
25};
26
27struct TextToFind {
28 CharacterRange chrg;
29 const char *lpstrText;
30 CharacterRange chrgText;
31};
32
33using SurfaceID = void *;
34
35struct Rectangle {
36 int left;
37 int top;
38 int right;
39 int bottom;
40};
41
42/* This structure is used in printing. Not needed by most client code. */
43
44struct RangeToFormat {
45 SurfaceID hdc;
46 SurfaceID hdcTarget;
47 Rectangle rc;
48 Rectangle rcPage;
49 CharacterRange chrg;
50};
51
52struct NotifyHeader {
53 /* Compatible with Windows NMHDR.
54 * hwndFrom is really an environment specific window handle or pointer
55 * but most clients of Scintilla.h do not have this type visible. */
56 void *hwndFrom;
57 uptr_t idFrom;
58 Notification code;
59};
60
61struct NotificationData {
62 NotifyHeader nmhdr;
63 Position position;
64 /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
65 /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
66 /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
67 /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
68 /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
69
70 int ch;
71 /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */
72 /* SCN_USERLISTSELECTION */
73 KeyMod modifiers;
74 /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
75 /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
76
77 ModificationFlags modificationType; /* SCN_MODIFIED */
78 const char *text;
79 /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
80
81 Position length; /* SCN_MODIFIED */
82 Position linesAdded; /* SCN_MODIFIED */
83 Message message; /* SCN_MACRORECORD */
84 uptr_t wParam; /* SCN_MACRORECORD */
85 sptr_t lParam; /* SCN_MACRORECORD */
86 Position line; /* SCN_MODIFIED */
87 FoldLevel foldLevelNow; /* SCN_MODIFIED */
88 FoldLevel foldLevelPrev; /* SCN_MODIFIED */
89 int margin; /* SCN_MARGINCLICK */
90 int listType; /* SCN_USERLISTSELECTION */
91 int x; /* SCN_DWELLSTART, SCN_DWELLEND */
92 int y; /* SCN_DWELLSTART, SCN_DWELLEND */
93 int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
94 Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
95 Update updated; /* SCN_UPDATEUI */
96 CompletionMethods listCompletionMethod;
97 /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
98 CharacterSource characterSource; /* SCN_CHARADDED */
99};
100
101}
102
103#endif
104