Merge pull request #3973 from techee/dart
[geany-mirror.git] / scintilla / include / ScintillaStructures.h
blob4d13a4367e02fb58c0a16e328d05e32bf9dfd32a
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.
10 #ifndef SCINTILLASTRUCTURES_H
11 #define SCINTILLASTRUCTURES_H
13 namespace Scintilla {
15 using PositionCR = long;
17 struct CharacterRange {
18 PositionCR cpMin;
19 PositionCR cpMax;
22 struct CharacterRangeFull {
23 Position cpMin;
24 Position cpMax;
27 struct TextRange {
28 CharacterRange chrg;
29 char *lpstrText;
32 struct TextRangeFull {
33 CharacterRangeFull chrg;
34 char *lpstrText;
37 struct TextToFind {
38 CharacterRange chrg;
39 const char *lpstrText;
40 CharacterRange chrgText;
43 struct TextToFindFull {
44 CharacterRangeFull chrg;
45 const char *lpstrText;
46 CharacterRangeFull chrgText;
49 using SurfaceID = void *;
51 struct Rectangle {
52 int left;
53 int top;
54 int right;
55 int bottom;
58 /* This structure is used in printing. Not needed by most client code. */
60 struct RangeToFormat {
61 SurfaceID hdc;
62 SurfaceID hdcTarget;
63 Rectangle rc;
64 Rectangle rcPage;
65 CharacterRange chrg;
68 struct RangeToFormatFull {
69 SurfaceID hdc;
70 SurfaceID hdcTarget;
71 Rectangle rc;
72 Rectangle rcPage;
73 CharacterRangeFull chrg;
76 struct NotifyHeader {
77 /* Compatible with Windows NMHDR.
78 * hwndFrom is really an environment specific window handle or pointer
79 * but most clients of Scintilla.h do not have this type visible. */
80 void *hwndFrom;
81 uptr_t idFrom;
82 Notification code;
85 enum class Message; // Declare in case ScintillaMessages.h not included
87 struct NotificationData {
88 NotifyHeader nmhdr;
89 Position position;
90 /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
91 /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
92 /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
93 /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
94 /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */
96 int ch;
97 /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */
98 /* SCN_USERLISTSELECTION */
99 KeyMod modifiers;
100 /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
101 /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
103 ModificationFlags modificationType; /* SCN_MODIFIED */
104 const char *text;
105 /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */
107 Position length; /* SCN_MODIFIED */
108 Position linesAdded; /* SCN_MODIFIED */
109 Message message; /* SCN_MACRORECORD */
110 uptr_t wParam; /* SCN_MACRORECORD */
111 sptr_t lParam; /* SCN_MACRORECORD */
112 Position line; /* SCN_MODIFIED */
113 FoldLevel foldLevelNow; /* SCN_MODIFIED */
114 FoldLevel foldLevelPrev; /* SCN_MODIFIED */
115 int margin; /* SCN_MARGINCLICK */
116 int listType; /* SCN_USERLISTSELECTION */
117 int x; /* SCN_DWELLSTART, SCN_DWELLEND */
118 int y; /* SCN_DWELLSTART, SCN_DWELLEND */
119 int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
120 Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
121 Update updated; /* SCN_UPDATEUI */
122 CompletionMethods listCompletionMethod;
123 /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
124 CharacterSource characterSource; /* SCN_CHARADDED */
129 #endif