1 // SciTE - Scintilla based Text Editor
2 /** @file ScintillaTypes.h
3 ** Types used to communicate with Scintilla.
4 **/
5 // Copyright 1998-2019 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7
8 /* Most of this file is automatically generated from the Scintilla.iface interface definition
9 * file which contains any comments about the definitions. APIFacer.py does the generation. */
10
11 #ifndef SCINTILLATYPES_H
12 #define SCINTILLATYPES_H
13
14 namespace Scintilla::API {
15
16 // Enumerations
17 //++Autogenerated -- start of section automatically generated from Scintilla.iface
18
19 enum class WhiteSpace {
20 Invisible = 0,
21 VisibleAlways = 1,
22 VisibleAfterIndent = 2,
23 VisibleOnlyInIndent = 3,
24 };
25
26 enum class TabDrawMode {
27 LongArrow = 0,
28 StrikeOut = 1,
29 };
30
31 enum class EndOfLine {
32 CrLf = 0,
33 Cr = 1,
34 Lf = 2,
35 };
36
37 enum class IMEInteraction {
38 Windowed = 0,
39 Inline = 1,
40 };
41
42 enum class Alpha {
43 Transparent = 0,
44 Opaque = 255,
45 NoAlpha = 256,
46 };
47
48 enum class CursorShape {
49 Normal = -1,
50 Arrow = 2,
51 Wait = 4,
52 ReverseArrow = 7,
53 };
54
55 enum class MarkerSymbol {
56 Circle = 0,
57 RoundRect = 1,
58 Arrow = 2,
59 SmallRect = 3,
60 ShortArrow = 4,
61 Empty = 5,
62 ArrowDown = 6,
63 Minus = 7,
64 Plus = 8,
65 VLine = 9,
66 LCorner = 10,
67 TCorner = 11,
68 BoxPlus = 12,
69 BoxPlusConnected = 13,
70 BoxMinus = 14,
71 BoxMinusConnected = 15,
72 LCornerCurve = 16,
73 TCornerCurve = 17,
74 CirclePlus = 18,
75 CirclePlusConnected = 19,
76 CircleMinus = 20,
77 CircleMinusConnected = 21,
78 Background = 22,
79 DotDotDot = 23,
80 Arrows = 24,
81 Pixmap = 25,
82 FullRect = 26,
83 LeftRect = 27,
84 Available = 28,
85 Underline = 29,
86 RgbaImage = 30,
87 Bookmark = 31,
88 VerticalBookmark = 32,
89 Character = 10000,
90 };
91
92 enum class MarkerOutline {
93 FolderEnd = 25,
94 FolderOpenMid = 26,
95 FolderMidTail = 27,
96 FolderTail = 28,
97 FolderSub = 29,
98 Folder = 30,
99 FolderOpen = 31,
100 };
101
102 enum class MarginType {
103 Symbol = 0,
104 Number = 1,
105 Back = 2,
106 Fore = 3,
107 Text = 4,
108 RText = 5,
109 Colour = 6,
110 };
111
112 enum class StylesCommon {
113 Default = 32,
114 LineNumber = 33,
115 BraceLight = 34,
116 BraceBad = 35,
117 ControlChar = 36,
118 IndentGuide = 37,
119 CallTip = 38,
120 FoldDisplayText = 39,
121 LastPredefined = 39,
122 Max = 255,
123 };
124
125 enum class CharacterSet {
126 Ansi = 0,
127 Default = 1,
128 Baltic = 186,
129 ChineseBig5 = 136,
130 EastEurope = 238,
131 GB2312 = 134,
132 Greek = 161,
133 Hangul = 129,
134 Mac = 77,
135 Oem = 255,
136 Russian = 204,
137 Oem866 = 866,
138 Cyrillic = 1251,
139 ShiftJis = 128,
140 Symbol = 2,
141 Turkish = 162,
142 Johab = 130,
143 Hebrew = 177,
144 Arabic = 178,
145 Vietnamese = 163,
146 Thai = 222,
147 Iso8859_15 = 1000,
148 };
149
150 enum class CaseVisible {
151 Mixed = 0,
152 Upper = 1,
153 Lower = 2,
154 Camel = 3,
155 };
156
157 enum class FontWeight {
158 Normal = 400,
159 SemiBold = 600,
160 Bold = 700,
161 };
162
163 enum class IndicatorStyle {
164 Plain = 0,
165 Squiggle = 1,
166 TT = 2,
167 Diagonal = 3,
168 Strike = 4,
169 Hidden = 5,
170 Box = 6,
171 RoundBox = 7,
172 StraightBox = 8,
173 Dash = 9,
174 Dots = 10,
175 SquiggleLow = 11,
176 DotBox = 12,
177 SquigglePixmap = 13,
178 CompositionThick = 14,
179 CompositionThin = 15,
180 FullBox = 16,
181 TextFore = 17,
182 Point = 18,
183 PointCharacter = 19,
184 Gradient = 20,
185 GradientCentre = 21,
186 Container = 8,
187 Ime = 32,
188 ImeMax = 35,
189 Max = 35,
190 };
191
192 enum class IndicatorNumbers {
193 Container = 8,
194 Ime = 32,
195 ImeMax = 35,
196 Max = 35,
197 };
198
199 enum class IndicValue {
200 Bit = 0x1000000,
201 Mask = 0xFFFFFF,
202 };
203
204 enum class IndicFlag {
205 ValueFore = 1,
206 };
207
208 enum class IndentView {
209 None = 0,
210 Real = 1,
211 LookForward = 2,
212 LookBoth = 3,
213 };
214
215 enum class PrintOption {
216 Normal = 0,
217 InvertLight = 1,
218 BlackOnWhite = 2,
219 ColourOnWhite = 3,
220 ColourOnWhiteDefaultBG = 4,
221 ScreenColours = 5,
222 };
223
224 enum class FindOption {
225 None = 0x0,
226 WholeWord = 0x2,
227 MatchCase = 0x4,
228 WordStart = 0x00100000,
229 RegExp = 0x00200000,
230 Posix = 0x00400000,
231 Cxx11RegEx = 0x00800000,
232 };
233
234 enum class FoldLevel {
235 Base = 0x400,
236 WhiteFlag = 0x1000,
237 HeaderFlag = 0x2000,
238 NumberMask = 0x0FFF,
239 };
240
241 enum class FoldDisplayTextStyle {
242 Hidden = 0,
243 Standard = 1,
244 Boxed = 2,
245 };
246
247 enum class FoldAction {
248 Contract = 0,
249 Expand = 1,
250 Toggle = 2,
251 };
252
253 enum class AutomaticFold {
254 Show = 0x0001,
255 Click = 0x0002,
256 Change = 0x0004,
257 };
258
259 enum class FoldFlag {
260 LineBeforeExpanded = 0x0002,
261 LineBeforeContracted = 0x0004,
262 LineAfterExpanded = 0x0008,
263 LineAfterContracted = 0x0010,
264 LevelNumbers = 0x0040,
265 LineState = 0x0080,
266 };
267
268 enum class IdleStyling {
269 None = 0,
270 ToVisible = 1,
271 AfterVisible = 2,
272 All = 3,
273 };
274
275 enum class Wrap {
276 None = 0,
277 Word = 1,
278 Char = 2,
279 WhiteSpace = 3,
280 };
281
282 enum class WrapVisualFlag {
283 None = 0x0000,
284 End = 0x0001,
285 Start = 0x0002,
286 Margin = 0x0004,
287 };
288
289 enum class WrapVisualLocation {
290 Default = 0x0000,
291 EndByText = 0x0001,
292 StartByText = 0x0002,
293 };
294
295 enum class WrapIndentMode {
296 Fixed = 0,
297 Same = 1,
298 Indent = 2,
299 DeepIndent = 3,
300 };
301
302 enum class LineCache {
303 None = 0,
304 Caret = 1,
305 Page = 2,
306 Document = 3,
307 };
308
309 enum class PhasesDraw {
310 One = 0,
311 Two = 1,
312 Multiple = 2,
313 };
314
315 enum class FontQuality {
316 QualityMask = 0xF,
317 QualityDefault = 0,
318 QualityNonAntialiased = 1,
319 QualityAntialiased = 2,
320 QualityLcdOptimized = 3,
321 };
322
323 enum class MultiPaste {
324 Once = 0,
325 Each = 1,
326 };
327
328 enum class Accessibility {
329 Disabled = 0,
330 Enabled = 1,
331 };
332
333 enum class EdgeVisualStyle {
334 None = 0,
335 Line = 1,
336 Background = 2,
337 MultiLine = 3,
338 };
339
340 enum class PopUp {
341 Never = 0,
342 All = 1,
343 Text = 2,
344 };
345
346 enum class DocumentOption {
347 Default = 0,
348 StylesNone = 0x1,
349 TextLarge = 0x100,
350 };
351
352 enum class Status {
353 Ok = 0,
354 Failure = 1,
355 BadAlloc = 2,
356 WarnStart = 1000,
357 RegEx = 1001,
358 };
359
360 enum class VisiblePolicy {
361 Slop = 0x01,
362 Strict = 0x04,
363 };
364
365 enum class CaretPolicy {
366 Slop = 0x01,
367 Strict = 0x04,
368 Jumps = 0x10,
369 Even = 0x08,
370 };
371
372 enum class SelectionMode {
373 Stream = 0,
374 Rectangle = 1,
375 Lines = 2,
376 Thin = 3,
377 };
378
379 enum class CaseInsensitiveBehaviour {
380 RespectCase = 0,
381 IgnoreCase = 1,
382 };
383
384 enum class MultiAutoComplete {
385 Once = 0,
386 Each = 1,
387 };
388
389 enum class Ordering {
390 PreSorted = 0,
391 PerformSort = 1,
392 Custom = 2,
393 };
394
395 enum class CaretSticky {
396 Off = 0,
397 On = 1,
398 WhiteSpace = 2,
399 };
400
401 enum class CaretStyle {
402 Invisible = 0,
403 Line = 1,
404 Block = 2,
405 OverstrikeBar = 0,
406 OverstrikeBlock = 0x10,
407 InsMask = 0xF,
408 BlockAfter = 0x100,
409 };
410
411 enum class MarginOption {
412 None = 0,
413 SubLineSelect = 1,
414 };
415
416 enum class AnnotationVisible {
417 Hidden = 0,
418 Standard = 1,
419 Boxed = 2,
420 Indented = 3,
421 };
422
423 enum class UndoFlags {
424 None = 0,
425 MayCoalesce = 1,
426 };
427
428 enum class VirtualSpace {
429 None = 0,
430 RectangularSelection = 1,
431 UserAccessible = 2,
432 NoWrapLineStart = 4,
433 };
434
435 enum class Technology {
436 Default = 0,
437 DirectWrite = 1,
438 DirectWriteRetain = 2,
439 DirectWriteDC = 3,
440 };
441
442 enum class LineEndType {
443 Default = 0,
444 Unicode = 1,
445 };
446
447 enum class EOLAnnotationVisible {
448 Hidden = 0,
449 Standard = 1,
450 Boxed = 2,
451 };
452
453 enum class TypeProperty {
454 Boolean = 0,
455 Integer = 1,
456 String = 2,
457 };
458
459 enum class ModificationFlags {
460 None = 0x0,
461 InsertText = 0x1,
462 DeleteText = 0x2,
463 ChangeStyle = 0x4,
464 ChangeFold = 0x8,
465 User = 0x10,
466 Undo = 0x20,
467 Redo = 0x40,
468 MultiStepUndoRedo = 0x80,
469 LastStepInUndoRedo = 0x100,
470 ChangeMarker = 0x200,
471 BeforeInsert = 0x400,
472 BeforeDelete = 0x800,
473 MultilineUndoRedo = 0x1000,
474 StartAction = 0x2000,
475 ChangeIndicator = 0x4000,
476 ChangeLineState = 0x8000,
477 ChangeMargin = 0x10000,
478 ChangeAnnotation = 0x20000,
479 Container = 0x40000,
480 LexerState = 0x80000,
481 InsertCheck = 0x100000,
482 ChangeTabStops = 0x200000,
483 ChangeEOLAnnotation = 0x400000,
484 EventMaskAll = 0x7FFFFF,
485 };
486
487 enum class Update {
488 Content = 0x1,
489 Selection = 0x2,
490 VScroll = 0x4,
491 HScroll = 0x8,
492 };
493
494 enum class Keys {
495 Down = 300,
496 Up = 301,
497 Left = 302,
498 Right = 303,
499 Home = 304,
500 End = 305,
501 Prior = 306,
502 Next = 307,
503 Delete = 308,
504 Insert = 309,
505 Escape = 7,
506 Back = 8,
507 Tab = 9,
508 Return = 13,
509 Add = 310,
510 Subtract = 311,
511 Divide = 312,
512 Win = 313,
513 RWin = 314,
514 Menu = 315,
515 };
516
517 enum class KeyMod {
518 Norm = 0,
519 Shift = 1,
520 Ctrl = 2,
521 Alt = 4,
522 Super = 8,
523 Meta = 16,
524 };
525
526 enum class CompletionMethods {
527 FillUp = 1,
528 DoubleClick = 2,
529 Tab = 3,
530 Newline = 4,
531 Command = 5,
532 };
533
534 enum class CharacterSource {
535 DirectInput = 0,
536 TentativeInput = 1,
537 ImeResult = 2,
538 };
539
540 enum class Bidirectional {
541 Disabled = 0,
542 L2R = 1,
543 R2L = 2,
544 };
545
546 enum class LineCharacterIndexType {
547 None = 0,
548 Utf32 = 1,
549 Utf16 = 2,
550 };
551
552 enum class Notification {
553 StyleNeeded = 2000,
554 CharAdded = 2001,
555 SavePointReached = 2002,
556 SavePointLeft = 2003,
557 ModifyAttemptRO = 2004,
558 Key = 2005,
559 DoubleClick = 2006,
560 UpdateUI = 2007,
561 Modified = 2008,
562 MacroRecord = 2009,
563 MarginClick = 2010,
564 NeedShown = 2011,
565 Painted = 2013,
566 UserListSelection = 2014,
567 URIDropped = 2015,
568 DwellStart = 2016,
569 DwellEnd = 2017,
570 Zoom = 2018,
571 HotSpotClick = 2019,
572 HotSpotDoubleClick = 2020,
573 CallTipClick = 2021,
574 AutoCSelection = 2022,
575 IndicatorClick = 2023,
576 IndicatorRelease = 2024,
577 AutoCCancelled = 2025,
578 AutoCCharDeleted = 2026,
579 HotSpotReleaseClick = 2027,
580 FocusIn = 2028,
581 FocusOut = 2029,
582 AutoCCompleted = 2030,
583 MarginRightClick = 2031,
584 AutoCSelectionChange = 2032,
585 };
586 //--Autogenerated -- end of section automatically generated from Scintilla.iface
587
588 //++Autogenerated -- start of section automatically generated from Scintilla.iface
589 //**1 \(\*\n\)
590 constexpr int InvalidPosition = -1;
591 constexpr int CpUtf8 = 65001;
592 constexpr int MarkerMax = 31;
593 constexpr int MaskFolders = 0xFE000000;
594 constexpr int MaxMargin = 4;
595 constexpr int FontSizeMultiplier = 100;
596 constexpr int TimeForever = 10000000;
597 constexpr int KeywordsetMax = 8;
598
599 //--Autogenerated -- end of section automatically generated from Scintilla.iface
600
601 struct Failure {
602 Status status;
FailureFailure603 explicit Failure(Status status_) noexcept : status(status_) {
604 }
605 };
606
607 using Position = intptr_t;
608 using Line = intptr_t;
609 using Colour = int;
610 struct Range {
611 // An ordered range
612 // end may be less than start when, for example, searching backwards
613 Position start;
614 Position end;
RangeRange615 explicit Range(Position position) noexcept : start(position), end(position) {
616 }
RangeRange617 Range(Position start_, Position end_) noexcept : start(start_), end(end_) {
618 }
LengthRange619 Position Length() const noexcept {
620 if (end > start)
621 return end - start;
622 else
623 return start - end;
624 }
625 bool operator==(const Range &other) const noexcept {
626 return (other.start == start) && (other.end == end);
627 }
628 };
629
630 // Functions to manipulate fields from a ModificationFlags
631
632 constexpr ModificationFlags operator|(ModificationFlags a, ModificationFlags b) noexcept {
633 return static_cast<ModificationFlags>(static_cast<int>(a) | static_cast<int>(b));
634 }
635
636 // Functions to manipulate fields from a KeyMod
637
638 constexpr KeyMod operator|(KeyMod a, KeyMod b) noexcept {
639 return static_cast<KeyMod>(static_cast<int>(a) | static_cast<int>(b));
640 }
641
642 // Functions to retrieve and manipulate fields from a FoldLevel
643
644 constexpr FoldLevel operator&(FoldLevel lhs, FoldLevel rhs) noexcept {
645 return static_cast<FoldLevel>(static_cast<int>(lhs) & static_cast<int>(rhs));
646 }
647
LevelNumberPart(FoldLevel level)648 constexpr FoldLevel LevelNumberPart(FoldLevel level) noexcept {
649 return level & FoldLevel::NumberMask;
650 }
651
LevelNumber(FoldLevel level)652 constexpr int LevelNumber(FoldLevel level) noexcept {
653 return static_cast<int>(LevelNumberPart(level));
654 }
655
LevelIsHeader(FoldLevel level)656 constexpr bool LevelIsHeader(FoldLevel level) noexcept {
657 return (level & FoldLevel::HeaderFlag) == FoldLevel::HeaderFlag;
658 }
659
LevelIsWhitespace(FoldLevel level)660 constexpr bool LevelIsWhitespace(FoldLevel level) noexcept {
661 return (level & FoldLevel::WhiteFlag) == FoldLevel::WhiteFlag;
662 }
663
664 // Functions to manipulate fields from a FindOption
665
666 constexpr FindOption operator|(FindOption a, FindOption b) noexcept {
667 return static_cast<FindOption>(static_cast<int>(a) | static_cast<int>(b));
668 }
669
670 inline FindOption &operator|=(FindOption &self, FindOption a) noexcept {
671 self = self | a;
672 return self;
673 }
674
675 }
676
677 #endif
678