1 | // Scintilla source code edit control |
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. ScintillaAPIFacer.py does the generation. */ |
10 | |
11 | #ifndef SCINTILLATYPES_H |
12 | #define SCINTILLATYPES_H |
13 | |
14 | namespace Scintilla { |
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 Element { |
164 | List = 0, |
165 | ListBack = 1, |
166 | ListSelected = 2, |
167 | ListSelectedBack = 3, |
168 | SelectionText = 10, |
169 | SelectionBack = 11, |
170 | SelectionAdditionalText = 12, |
171 | SelectionAdditionalBack = 13, |
172 | SelectionSecondaryText = 14, |
173 | SelectionSecondaryBack = 15, |
174 | SelectionInactiveText = 16, |
175 | SelectionInactiveBack = 17, |
176 | Caret = 40, |
177 | CaretAdditional = 41, |
178 | CaretLineBack = 50, |
179 | WhiteSpace = 60, |
180 | WhiteSpaceBack = 61, |
181 | HotSpotActive = 70, |
182 | HotSpotActiveBack = 71, |
183 | FoldLine = 80, |
184 | HiddenLine = 81, |
185 | }; |
186 | |
187 | enum class Layer { |
188 | Base = 0, |
189 | UnderText = 1, |
190 | OverText = 2, |
191 | }; |
192 | |
193 | enum class IndicatorStyle { |
194 | Plain = 0, |
195 | Squiggle = 1, |
196 | TT = 2, |
197 | Diagonal = 3, |
198 | Strike = 4, |
199 | Hidden = 5, |
200 | Box = 6, |
201 | RoundBox = 7, |
202 | StraightBox = 8, |
203 | Dash = 9, |
204 | Dots = 10, |
205 | SquiggleLow = 11, |
206 | DotBox = 12, |
207 | SquigglePixmap = 13, |
208 | CompositionThick = 14, |
209 | CompositionThin = 15, |
210 | FullBox = 16, |
211 | TextFore = 17, |
212 | Point = 18, |
213 | PointCharacter = 19, |
214 | Gradient = 20, |
215 | GradientCentre = 21, |
216 | }; |
217 | |
218 | enum class IndicatorNumbers { |
219 | Container = 8, |
220 | Ime = 32, |
221 | ImeMax = 35, |
222 | Max = 35, |
223 | }; |
224 | |
225 | enum class IndicValue { |
226 | Bit = 0x1000000, |
227 | Mask = 0xFFFFFF, |
228 | }; |
229 | |
230 | enum class IndicFlag { |
231 | None = 0, |
232 | ValueFore = 1, |
233 | }; |
234 | |
235 | enum class AutoCompleteOption { |
236 | Normal = 0, |
237 | FixedSize = 1, |
238 | }; |
239 | |
240 | enum class IndentView { |
241 | None = 0, |
242 | Real = 1, |
243 | LookForward = 2, |
244 | LookBoth = 3, |
245 | }; |
246 | |
247 | enum class PrintOption { |
248 | Normal = 0, |
249 | InvertLight = 1, |
250 | BlackOnWhite = 2, |
251 | ColourOnWhite = 3, |
252 | ColourOnWhiteDefaultBG = 4, |
253 | ScreenColours = 5, |
254 | }; |
255 | |
256 | enum class FindOption { |
257 | None = 0x0, |
258 | WholeWord = 0x2, |
259 | MatchCase = 0x4, |
260 | WordStart = 0x00100000, |
261 | RegExp = 0x00200000, |
262 | Posix = 0x00400000, |
263 | Cxx11RegEx = 0x00800000, |
264 | }; |
265 | |
266 | enum class FoldLevel { |
267 | None = 0x0, |
268 | Base = 0x400, |
269 | WhiteFlag = 0x1000, |
270 | = 0x2000, |
271 | NumberMask = 0x0FFF, |
272 | }; |
273 | |
274 | enum class FoldDisplayTextStyle { |
275 | Hidden = 0, |
276 | Standard = 1, |
277 | Boxed = 2, |
278 | }; |
279 | |
280 | enum class FoldAction { |
281 | Contract = 0, |
282 | Expand = 1, |
283 | Toggle = 2, |
284 | }; |
285 | |
286 | enum class AutomaticFold { |
287 | None = 0x0000, |
288 | Show = 0x0001, |
289 | Click = 0x0002, |
290 | Change = 0x0004, |
291 | }; |
292 | |
293 | enum class FoldFlag { |
294 | None = 0x0000, |
295 | LineBeforeExpanded = 0x0002, |
296 | LineBeforeContracted = 0x0004, |
297 | LineAfterExpanded = 0x0008, |
298 | LineAfterContracted = 0x0010, |
299 | LevelNumbers = 0x0040, |
300 | LineState = 0x0080, |
301 | }; |
302 | |
303 | enum class IdleStyling { |
304 | None = 0, |
305 | ToVisible = 1, |
306 | AfterVisible = 2, |
307 | All = 3, |
308 | }; |
309 | |
310 | enum class Wrap { |
311 | None = 0, |
312 | Word = 1, |
313 | Char = 2, |
314 | WhiteSpace = 3, |
315 | }; |
316 | |
317 | enum class WrapVisualFlag { |
318 | None = 0x0000, |
319 | End = 0x0001, |
320 | Start = 0x0002, |
321 | Margin = 0x0004, |
322 | }; |
323 | |
324 | enum class WrapVisualLocation { |
325 | Default = 0x0000, |
326 | EndByText = 0x0001, |
327 | StartByText = 0x0002, |
328 | }; |
329 | |
330 | enum class WrapIndentMode { |
331 | Fixed = 0, |
332 | Same = 1, |
333 | Indent = 2, |
334 | DeepIndent = 3, |
335 | }; |
336 | |
337 | enum class LineCache { |
338 | None = 0, |
339 | Caret = 1, |
340 | Page = 2, |
341 | Document = 3, |
342 | }; |
343 | |
344 | enum class PhasesDraw { |
345 | One = 0, |
346 | Two = 1, |
347 | Multiple = 2, |
348 | }; |
349 | |
350 | enum class FontQuality { |
351 | QualityMask = 0xF, |
352 | QualityDefault = 0, |
353 | QualityNonAntialiased = 1, |
354 | QualityAntialiased = 2, |
355 | QualityLcdOptimized = 3, |
356 | }; |
357 | |
358 | enum class MultiPaste { |
359 | Once = 0, |
360 | Each = 1, |
361 | }; |
362 | |
363 | enum class Accessibility { |
364 | Disabled = 0, |
365 | Enabled = 1, |
366 | }; |
367 | |
368 | enum class EdgeVisualStyle { |
369 | None = 0, |
370 | Line = 1, |
371 | Background = 2, |
372 | MultiLine = 3, |
373 | }; |
374 | |
375 | enum class { |
376 | = 0, |
377 | = 1, |
378 | = 2, |
379 | }; |
380 | |
381 | enum class DocumentOption { |
382 | Default = 0, |
383 | StylesNone = 0x1, |
384 | TextLarge = 0x100, |
385 | }; |
386 | |
387 | enum class Status { |
388 | Ok = 0, |
389 | Failure = 1, |
390 | BadAlloc = 2, |
391 | WarnStart = 1000, |
392 | RegEx = 1001, |
393 | }; |
394 | |
395 | enum class VisiblePolicy { |
396 | Slop = 0x01, |
397 | Strict = 0x04, |
398 | }; |
399 | |
400 | enum class CaretPolicy { |
401 | Slop = 0x01, |
402 | Strict = 0x04, |
403 | Jumps = 0x10, |
404 | Even = 0x08, |
405 | }; |
406 | |
407 | enum class SelectionMode { |
408 | Stream = 0, |
409 | Rectangle = 1, |
410 | Lines = 2, |
411 | Thin = 3, |
412 | }; |
413 | |
414 | enum class CaseInsensitiveBehaviour { |
415 | RespectCase = 0, |
416 | IgnoreCase = 1, |
417 | }; |
418 | |
419 | enum class MultiAutoComplete { |
420 | Once = 0, |
421 | Each = 1, |
422 | }; |
423 | |
424 | enum class Ordering { |
425 | PreSorted = 0, |
426 | PerformSort = 1, |
427 | Custom = 2, |
428 | }; |
429 | |
430 | enum class CaretSticky { |
431 | Off = 0, |
432 | On = 1, |
433 | WhiteSpace = 2, |
434 | }; |
435 | |
436 | enum class CaretStyle { |
437 | Invisible = 0, |
438 | Line = 1, |
439 | Block = 2, |
440 | OverstrikeBar = 0, |
441 | OverstrikeBlock = 0x10, |
442 | Curses = 0x20, |
443 | InsMask = 0xF, |
444 | BlockAfter = 0x100, |
445 | }; |
446 | |
447 | enum class MarginOption { |
448 | None = 0, |
449 | SubLineSelect = 1, |
450 | }; |
451 | |
452 | enum class AnnotationVisible { |
453 | Hidden = 0, |
454 | Standard = 1, |
455 | Boxed = 2, |
456 | Indented = 3, |
457 | }; |
458 | |
459 | enum class UndoFlags { |
460 | None = 0, |
461 | MayCoalesce = 1, |
462 | }; |
463 | |
464 | enum class VirtualSpace { |
465 | None = 0, |
466 | RectangularSelection = 1, |
467 | UserAccessible = 2, |
468 | NoWrapLineStart = 4, |
469 | }; |
470 | |
471 | enum class Technology { |
472 | Default = 0, |
473 | DirectWrite = 1, |
474 | DirectWriteRetain = 2, |
475 | DirectWriteDC = 3, |
476 | }; |
477 | |
478 | enum class LineEndType { |
479 | Default = 0, |
480 | Unicode = 1, |
481 | }; |
482 | |
483 | enum class RepresentationAppearance { |
484 | Plain = 0, |
485 | Blob = 1, |
486 | Colour = 0x10, |
487 | }; |
488 | |
489 | enum class EOLAnnotationVisible { |
490 | Hidden = 0x0, |
491 | Standard = 0x1, |
492 | Boxed = 0x2, |
493 | Stadium = 0x100, |
494 | FlatCircle = 0x101, |
495 | AngleCircle = 0x102, |
496 | CircleFlat = 0x110, |
497 | Flats = 0x111, |
498 | AngleFlat = 0x112, |
499 | CircleAngle = 0x120, |
500 | FlatAngle = 0x121, |
501 | Angles = 0x122, |
502 | }; |
503 | |
504 | enum class Supports { |
505 | LineDrawsFinal = 0, |
506 | PixelDivisions = 1, |
507 | FractionalStrokeWidth = 2, |
508 | TranslucentStroke = 3, |
509 | PixelModification = 4, |
510 | }; |
511 | |
512 | enum class LineCharacterIndexType { |
513 | None = 0, |
514 | Utf32 = 1, |
515 | Utf16 = 2, |
516 | }; |
517 | |
518 | enum class TypeProperty { |
519 | Boolean = 0, |
520 | Integer = 1, |
521 | String = 2, |
522 | }; |
523 | |
524 | enum class ModificationFlags { |
525 | None = 0x0, |
526 | InsertText = 0x1, |
527 | DeleteText = 0x2, |
528 | ChangeStyle = 0x4, |
529 | ChangeFold = 0x8, |
530 | User = 0x10, |
531 | Undo = 0x20, |
532 | Redo = 0x40, |
533 | MultiStepUndoRedo = 0x80, |
534 | LastStepInUndoRedo = 0x100, |
535 | ChangeMarker = 0x200, |
536 | BeforeInsert = 0x400, |
537 | BeforeDelete = 0x800, |
538 | MultilineUndoRedo = 0x1000, |
539 | StartAction = 0x2000, |
540 | ChangeIndicator = 0x4000, |
541 | ChangeLineState = 0x8000, |
542 | ChangeMargin = 0x10000, |
543 | ChangeAnnotation = 0x20000, |
544 | Container = 0x40000, |
545 | LexerState = 0x80000, |
546 | InsertCheck = 0x100000, |
547 | ChangeTabStops = 0x200000, |
548 | ChangeEOLAnnotation = 0x400000, |
549 | EventMaskAll = 0x7FFFFF, |
550 | }; |
551 | |
552 | enum class Update { |
553 | None = 0x0, |
554 | Content = 0x1, |
555 | Selection = 0x2, |
556 | VScroll = 0x4, |
557 | HScroll = 0x8, |
558 | }; |
559 | |
560 | enum class FocusChange { |
561 | Change = 768, |
562 | Setfocus = 512, |
563 | Killfocus = 256, |
564 | }; |
565 | |
566 | enum class Keys { |
567 | Down = 300, |
568 | Up = 301, |
569 | Left = 302, |
570 | Right = 303, |
571 | Home = 304, |
572 | End = 305, |
573 | Prior = 306, |
574 | Next = 307, |
575 | Delete = 308, |
576 | Insert = 309, |
577 | Escape = 7, |
578 | Back = 8, |
579 | Tab = 9, |
580 | Return = 13, |
581 | Add = 310, |
582 | Subtract = 311, |
583 | Divide = 312, |
584 | Win = 313, |
585 | RWin = 314, |
586 | = 315, |
587 | }; |
588 | |
589 | enum class KeyMod { |
590 | Norm = 0, |
591 | Shift = 1, |
592 | Ctrl = 2, |
593 | Alt = 4, |
594 | Super = 8, |
595 | Meta = 16, |
596 | }; |
597 | |
598 | enum class CompletionMethods { |
599 | FillUp = 1, |
600 | DoubleClick = 2, |
601 | Tab = 3, |
602 | Newline = 4, |
603 | Command = 5, |
604 | }; |
605 | |
606 | enum class CharacterSource { |
607 | DirectInput = 0, |
608 | TentativeInput = 1, |
609 | ImeResult = 2, |
610 | }; |
611 | |
612 | enum class Bidirectional { |
613 | Disabled = 0, |
614 | L2R = 1, |
615 | R2L = 2, |
616 | }; |
617 | |
618 | enum class Notification { |
619 | StyleNeeded = 2000, |
620 | CharAdded = 2001, |
621 | SavePointReached = 2002, |
622 | SavePointLeft = 2003, |
623 | ModifyAttemptRO = 2004, |
624 | Key = 2005, |
625 | DoubleClick = 2006, |
626 | UpdateUI = 2007, |
627 | Modified = 2008, |
628 | MacroRecord = 2009, |
629 | MarginClick = 2010, |
630 | NeedShown = 2011, |
631 | Painted = 2013, |
632 | UserListSelection = 2014, |
633 | URIDropped = 2015, |
634 | DwellStart = 2016, |
635 | DwellEnd = 2017, |
636 | Zoom = 2018, |
637 | HotSpotClick = 2019, |
638 | HotSpotDoubleClick = 2020, |
639 | CallTipClick = 2021, |
640 | AutoCSelection = 2022, |
641 | IndicatorClick = 2023, |
642 | IndicatorRelease = 2024, |
643 | AutoCCancelled = 2025, |
644 | AutoCCharDeleted = 2026, |
645 | HotSpotReleaseClick = 2027, |
646 | FocusIn = 2028, |
647 | FocusOut = 2029, |
648 | AutoCCompleted = 2030, |
649 | MarginRightClick = 2031, |
650 | AutoCSelectionChange = 2032, |
651 | }; |
652 | //--Autogenerated -- end of section automatically generated from Scintilla.iface |
653 | |
654 | using Position = intptr_t; |
655 | using Line = intptr_t; |
656 | using Colour = int; |
657 | using ColourAlpha = int; |
658 | using uptr_t = uintptr_t; |
659 | using sptr_t = intptr_t; |
660 | |
661 | //++Autogenerated -- start of section automatically generated from Scintilla.iface |
662 | //**1 \(\*\n\) |
663 | constexpr Position InvalidPosition = -1; |
664 | constexpr int CpUtf8 = 65001; |
665 | constexpr int MarkerMax = 31; |
666 | constexpr int MaskFolders = 0xFE000000; |
667 | constexpr int MaxMargin = 4; |
668 | constexpr int FontSizeMultiplier = 100; |
669 | constexpr int TimeForever = 10000000; |
670 | constexpr int KeywordsetMax = 8; |
671 | |
672 | //--Autogenerated -- end of section automatically generated from Scintilla.iface |
673 | |
674 | constexpr int IndicatorMax = static_cast<int>(IndicatorNumbers::Max); |
675 | |
676 | // Functions to manipulate fields from a MarkerOutline |
677 | |
678 | inline int operator<<(int i, MarkerOutline marker) noexcept { |
679 | return i << static_cast<int>(marker); |
680 | } |
681 | |
682 | // Functions to manipulate fields from a FindOption |
683 | |
684 | constexpr FindOption operator|(FindOption a, FindOption b) noexcept { |
685 | return static_cast<FindOption>(static_cast<int>(a) | static_cast<int>(b)); |
686 | } |
687 | |
688 | inline FindOption &operator|=(FindOption &self, FindOption a) noexcept { |
689 | self = self | a; |
690 | return self; |
691 | } |
692 | |
693 | // Functions to retrieve and manipulate fields from a FoldLevel |
694 | |
695 | constexpr FoldLevel operator&(FoldLevel lhs, FoldLevel rhs) noexcept { |
696 | return static_cast<FoldLevel>(static_cast<int>(lhs) & static_cast<int>(rhs)); |
697 | } |
698 | |
699 | constexpr FoldLevel LevelNumberPart(FoldLevel level) noexcept { |
700 | return level & FoldLevel::NumberMask; |
701 | } |
702 | |
703 | constexpr int LevelNumber(FoldLevel level) noexcept { |
704 | return static_cast<int>(LevelNumberPart(level)); |
705 | } |
706 | |
707 | constexpr bool (FoldLevel level) noexcept { |
708 | return (level & FoldLevel::HeaderFlag) == FoldLevel::HeaderFlag; |
709 | } |
710 | |
711 | constexpr bool LevelIsWhitespace(FoldLevel level) noexcept { |
712 | return (level & FoldLevel::WhiteFlag) == FoldLevel::WhiteFlag; |
713 | } |
714 | |
715 | // Functions to manipulate fields from a FoldFlag |
716 | |
717 | constexpr FoldFlag operator|(FoldFlag a, FoldFlag b) noexcept { |
718 | return static_cast<FoldFlag>(static_cast<int>(a) | static_cast<int>(b)); |
719 | } |
720 | |
721 | // Functions to manipulate fields from a FontQuality |
722 | |
723 | constexpr FontQuality operator&(FontQuality a, FontQuality b) noexcept { |
724 | return static_cast<FontQuality>(static_cast<int>(a) & static_cast<int>(b)); |
725 | } |
726 | |
727 | // Functions to manipulate fields from a DocumentOption |
728 | |
729 | constexpr DocumentOption operator|(DocumentOption a, DocumentOption b) noexcept { |
730 | return static_cast<DocumentOption>(static_cast<int>(a) | static_cast<int>(b)); |
731 | } |
732 | |
733 | // Functions to manipulate fields from a CaretPolicy |
734 | |
735 | constexpr CaretPolicy operator|(CaretPolicy a, CaretPolicy b) noexcept { |
736 | return static_cast<CaretPolicy>(static_cast<int>(a) | static_cast<int>(b)); |
737 | } |
738 | |
739 | // Functions to manipulate fields from a CaretStyle |
740 | |
741 | constexpr CaretStyle operator|(CaretStyle a, CaretStyle b) noexcept { |
742 | return static_cast<CaretStyle>(static_cast<int>(a) | static_cast<int>(b)); |
743 | } |
744 | |
745 | constexpr CaretStyle operator&(CaretStyle a, CaretStyle b) noexcept { |
746 | return static_cast<CaretStyle>(static_cast<int>(a) & static_cast<int>(b)); |
747 | } |
748 | |
749 | // Functions to manipulate fields from a LineEndType |
750 | |
751 | constexpr LineEndType operator&(LineEndType a, LineEndType b) noexcept { |
752 | return static_cast<LineEndType>(static_cast<int>(a) & static_cast<int>(b)); |
753 | } |
754 | |
755 | // Functions to manipulate fields from a RepresentationAppearance |
756 | |
757 | constexpr RepresentationAppearance operator|(RepresentationAppearance a, RepresentationAppearance b) noexcept { |
758 | return static_cast<RepresentationAppearance>(static_cast<int>(a) | static_cast<int>(b)); |
759 | } |
760 | |
761 | // Functions to manipulate fields from a LineCharacterIndexType |
762 | |
763 | constexpr LineCharacterIndexType operator|(LineCharacterIndexType a, LineCharacterIndexType b) noexcept { |
764 | return static_cast<LineCharacterIndexType>(static_cast<int>(a) | static_cast<int>(b)); |
765 | } |
766 | |
767 | // Functions to manipulate fields from a ModificationFlags |
768 | |
769 | constexpr ModificationFlags operator|(ModificationFlags a, ModificationFlags b) noexcept { |
770 | return static_cast<ModificationFlags>(static_cast<int>(a) | static_cast<int>(b)); |
771 | } |
772 | |
773 | constexpr ModificationFlags operator&(ModificationFlags a, ModificationFlags b) noexcept { |
774 | return static_cast<ModificationFlags>(static_cast<int>(a) & static_cast<int>(b)); |
775 | } |
776 | |
777 | inline ModificationFlags &operator|=(ModificationFlags &self, ModificationFlags a) noexcept { |
778 | self = self | a; |
779 | return self; |
780 | } |
781 | |
782 | // Functions to manipulate fields from a Update |
783 | |
784 | constexpr Update operator|(Update a, Update b) noexcept { |
785 | return static_cast<Update>(static_cast<int>(a) | static_cast<int>(b)); |
786 | } |
787 | |
788 | // Functions to manipulate fields from a KeyMod |
789 | |
790 | constexpr KeyMod operator|(KeyMod a, KeyMod b) noexcept { |
791 | return static_cast<KeyMod>(static_cast<int>(a) | static_cast<int>(b)); |
792 | } |
793 | |
794 | constexpr KeyMod operator&(KeyMod a, KeyMod b) noexcept { |
795 | return static_cast<KeyMod>(static_cast<int>(a) & static_cast<int>(b)); |
796 | } |
797 | |
798 | // Test if an enum class value has some bit flag(s) of test set. |
799 | template <typename T> |
800 | constexpr bool FlagSet(T value, T test) { |
801 | return (static_cast<int>(value) & static_cast<int>(test)) != 0; |
802 | } |
803 | |
804 | } |
805 | |
806 | #endif |
807 | |