-
Notifications
You must be signed in to change notification settings - Fork 1
/
Style.cs
3521 lines (2856 loc) · 116 KB
/
Style.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ***********************************************************************
// Assembly : Zeroit.Framework.CodeBox
// Author : ZEROIT
// Created : 03-19-2019
//
// Last Modified By : ZEROIT
// Last Modified On : 01-05-2019
// ***********************************************************************
// <copyright file="Style.cs" company="Zeroit Dev">
// This program is for creating a Code Editor control.
// Copyright © 2017 Zeroit Dev Technologies
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// You can contact me at zeroitdevnet@gmail.com or zeroitdev@outlook.com
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Drawing;
using System.Text;
namespace Zeroit.Framework.CodeBox
{
/// <summary>
/// A style definition in a <see cref="Scintilla" /> control.
/// </summary>
public class Style
{
#region Constants
/// <summary>
/// Default style index. This style is used to define properties that all styles receive when calling <see cref="Scintilla.StyleClearAll" />.
/// </summary>
public const int Default = NativeMethods.STYLE_DEFAULT;
/// <summary>
/// Line number style index. This style is used for text in line number margins. The background color of this style also
/// sets the background color for all margins that do not have any folding mask set.
/// </summary>
public const int LineNumber = NativeMethods.STYLE_LINENUMBER;
/// <summary>
/// Call tip style index. Only font name, size, foreground color, background color, and character set attributes
/// can be used when displaying a call tip.
/// </summary>
public const int CallTip = NativeMethods.STYLE_CALLTIP;
/// <summary>
/// Indent guide style index. This style is used to specify the foreground and background colors of <see cref="Scintilla.IndentationGuides" />.
/// </summary>
public const int IndentGuide = NativeMethods.STYLE_INDENTGUIDE;
/// <summary>
/// Brace highlighting style index. This style is used on a brace character when set with the <see cref="Scintilla.BraceHighlight" /> method
/// or the indentation guide when used with the <see cref="Scintilla.HighlightGuide" /> property.
/// </summary>
public const int BraceLight = NativeMethods.STYLE_BRACELIGHT;
/// <summary>
/// Bad brace style index. This style is used on an unmatched brace character when set with the <see cref="Scintilla.BraceBadLight" /> method.
/// </summary>
public const int BraceBad = NativeMethods.STYLE_BRACEBAD;
/// <summary>
/// Fold text tag style index. This is the style used for drawing text tags attached to folded text when
/// <see cref="Scintilla.FoldDisplayTextSetStyle" /> and <see cref="Line.ToggleFoldShowText" /> are used.
/// </summary>
public const int FoldDisplayText = NativeMethods.STYLE_FOLDDISPLAYTEXT;
#endregion Constants
#region Fields
private readonly ZeroitCodeExplorer Scintilla;
#endregion Fields
#region Methods
/// <summary>
/// Copies the current style to another style.
/// </summary>
/// <param name="destination">The <see cref="Style" /> to which the current style should be copied.</param>
public void CopyTo(Style destination)
{
if (destination == null)
return;
destination.BackColor = BackColor;
// destination.Bold = Bold;
destination.Case = Case;
destination.FillLine = FillLine;
destination.Font = Font;
destination.ForeColor = ForeColor;
destination.Hotspot = Hotspot;
destination.Italic = Italic;
destination.Size = Size;
destination.SizeF = SizeF;
destination.Underline = Underline;
destination.Visible = Visible;
destination.Weight = Weight;
}
#endregion Methods
#region Properties
/// <summary>
/// Gets or sets the background color of the style.
/// </summary>
/// <returns>A Color object representing the style background color. The default is White.</returns>
/// <remarks>Alpha color values are ignored.</remarks>
public Color BackColor
{
get
{
var color = Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETBACK, new IntPtr(Index), IntPtr.Zero).ToInt32();
return ColorTranslator.FromWin32(color);
}
set
{
if (value.IsEmpty)
value = Color.White;
var color = ColorTranslator.ToWin32(value);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETBACK, new IntPtr(Index), new IntPtr(color));
}
}
/// <summary>
/// Gets or sets whether the style font is bold.
/// </summary>
/// <returns>true if bold; otherwise, false. The default is false.</returns>
/// <remarks>Setting this property affects the <see cref="Weight" /> property.</remarks>
public bool Bold
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETBOLD, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var bold = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETBOLD, new IntPtr(Index), bold);
}
}
/// <summary>
/// Gets or sets the casing used to display the styled text.
/// </summary>
/// <returns>One of the <see cref="StyleCase" /> enum values. The default is <see cref="StyleCase.Mixed" />.</returns>
/// <remarks>This does not affect how text is stored, only displayed.</remarks>
public StyleCase Case
{
get
{
var @case = Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETCASE, new IntPtr(Index), IntPtr.Zero).ToInt32();
return (StyleCase)@case;
}
set
{
// Just an excuse to use @... syntax
var @case = (int)value;
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETCASE, new IntPtr(Index), new IntPtr(@case));
}
}
/// <summary>
/// Gets or sets whether the remainder of the line is filled with the <see cref="BackColor" />
/// when this style is used on the last character of a line.
/// </summary>
/// <returns>true to fill the line; otherwise, false. The default is false.</returns>
public bool FillLine
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETEOLFILLED, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var fillLine = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETEOLFILLED, new IntPtr(Index), fillLine);
}
}
/// <summary>
/// Gets or sets the style font name.
/// </summary>
/// <returns>The style font name. The default is Verdana.</returns>
/// <remarks>Scintilla caches fonts by name so font names and casing should be consistent.</remarks>
public string Font
{
get
{
var length = Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETFONT, new IntPtr(Index), IntPtr.Zero).ToInt32();
var font = new byte[length];
unsafe
{
fixed (byte* bp = font)
Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETFONT, new IntPtr(Index), new IntPtr(bp));
}
var name = Encoding.UTF8.GetString(font, 0, length);
return name;
}
set
{
if (string.IsNullOrEmpty(value))
value = "Verdana";
// Scintilla expects UTF-8
var font = Helpers.GetBytes(value, Encoding.UTF8, true);
unsafe
{
fixed (byte* bp = font)
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETFONT, new IntPtr(Index), new IntPtr(bp));
}
}
}
/// <summary>
/// Gets or sets the foreground color of the style.
/// </summary>
/// <returns>A Color object representing the style foreground color. The default is Black.</returns>
/// <remarks>Alpha color values are ignored.</remarks>
public Color ForeColor
{
get
{
var color = Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETFORE, new IntPtr(Index), IntPtr.Zero).ToInt32();
return ColorTranslator.FromWin32(color);
}
set
{
if (value.IsEmpty)
value = Color.Black;
var color = ColorTranslator.ToWin32(value);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETFORE, new IntPtr(Index), new IntPtr(color));
}
}
/// <summary>
/// Gets or sets whether hovering the mouse over the style text exhibits hyperlink behavior.
/// </summary>
/// <returns>true to use hyperlink behavior; otherwise, false. The default is false.</returns>
public bool Hotspot
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETHOTSPOT, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var hotspot = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETHOTSPOT, new IntPtr(Index), hotspot);
}
}
/// <summary>
/// Gets the zero-based style definition index.
/// </summary>
/// <returns>The style definition index within the <see cref="StyleCollection" />.</returns>
public int Index { get; private set; }
/// <summary>
/// Gets or sets whether the style font is italic.
/// </summary>
/// <returns>true if italic; otherwise, false. The default is false.</returns>
public bool Italic
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETITALIC, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var italic = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETITALIC, new IntPtr(Index), italic);
}
}
/// <summary>
/// Gets or sets the size of the style font in points.
/// </summary>
/// <returns>The size of the style font as a whole number of points. The default is 8.</returns>
public int Size
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETSIZE, new IntPtr(Index), IntPtr.Zero).ToInt32();
}
set
{
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETSIZE, new IntPtr(Index), new IntPtr(value));
}
}
/// <summary>
/// Gets or sets the size of the style font in fractoinal points.
/// </summary>
/// <returns>The size of the style font in fractional number of points. The default is 8.</returns>
public float SizeF
{
get
{
var fraction = Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETSIZEFRACTIONAL, new IntPtr(Index), IntPtr.Zero).ToInt32();
return (float)fraction / NativeMethods.SC_FONT_SIZE_MULTIPLIER;
}
set
{
var fraction = (int)(value * NativeMethods.SC_FONT_SIZE_MULTIPLIER);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETSIZEFRACTIONAL, new IntPtr(Index), new IntPtr(fraction));
}
}
/// <summary>
/// Gets or sets whether the style is underlined.
/// </summary>
/// <returns>true if underlined; otherwise, false. The default is false.</returns>
public bool Underline
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETUNDERLINE, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var underline = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETUNDERLINE, new IntPtr(Index), underline);
}
}
/// <summary>
/// Gets or sets whether the style text is visible.
/// </summary>
/// <returns>true to display the style text; otherwise, false. The default is true.</returns>
public bool Visible
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETVISIBLE, new IntPtr(Index), IntPtr.Zero) != IntPtr.Zero;
}
set
{
var visible = (value ? new IntPtr(1) : IntPtr.Zero);
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETVISIBLE, new IntPtr(Index), visible);
}
}
/// <summary>
/// Gets or sets the style font weight.
/// </summary>
/// <returns>The font weight. The default is 400.</returns>
/// <remarks>Setting this property affects the <see cref="Bold" /> property.</remarks>
public int Weight
{
get
{
return Scintilla.DirectMessage(NativeMethods.SCI_STYLEGETWEIGHT, new IntPtr(Index), IntPtr.Zero).ToInt32();
}
set
{
Scintilla.DirectMessage(NativeMethods.SCI_STYLESETWEIGHT, new IntPtr(Index), new IntPtr(value));
}
}
#endregion Properties
#region Constructors
/// <summary>
/// Initializes a new instances of the <see cref="Style" /> class.
/// </summary>
/// <param name="Scintilla">The <see cref="Scintilla" /> control that created this style.</param>
/// <param name="index">The index of this style within the <see cref="StyleCollection" /> that created it.</param>
public Style(ZeroitCodeExplorer Scintilla, int index)
{
this.Scintilla = Scintilla;
Index = index;
}
#endregion Constructors
#region Ada
/// <summary>
/// Style constants for use with the <see cref="Lexer.Ada" /> lexer.
/// </summary>
public static class Ada
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_ADA_DEFAULT;
/// <summary>
/// Line comment style index.
/// </summary>
public const int CommentLine = NativeMethods.SCE_ADA_COMMENTLINE;
/// <summary>
/// Number style index.
/// </summary>
public const int Number = NativeMethods.SCE_ADA_NUMBER;
/// <summary>
/// Keyword style index.
/// </summary>
public const int Word = NativeMethods.SCE_ADA_WORD;
/// <summary>
/// Double-quoted string style index.
/// </summary>
public const int String = NativeMethods.SCE_ADA_STRING;
/// <summary>
/// Single-quoted string style index.
/// </summary>
public const int Character = NativeMethods.SCE_ADA_CHARACTER;
/// <summary>
/// Delimiter style index.
/// </summary>
public const int Delimiter = NativeMethods.SCE_ADA_DELIMITER;
/// <summary>
/// Label style index.
/// </summary>
public const int Label = NativeMethods.SCE_ADA_LABEL;
/// <summary>
/// Identifier style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_ADA_IDENTIFIER;
/// <summary>
/// Unclosed string EOL style index.
/// </summary>
public const int StringEol = NativeMethods.SCE_ADA_STRINGEOL;
/// <summary>
/// Unclosed character EOL style index.
/// </summary>
public const int CharacterEol = NativeMethods.SCE_ADA_CHARACTEREOL;
/// <summary>
/// Illegal identifier or keyword style index.
/// </summary>
public const int Illegal = NativeMethods.SCE_ADA_ILLEGAL;
}
#endregion Ada
#region Asm
/// <summary>
/// Style constants for use with the <see cref="Lexer.Asm" /> lexer.
/// </summary>
public static class Asm
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_ASM_DEFAULT;
/// <summary>
/// Comment style index.
/// </summary>
public const int Comment = NativeMethods.SCE_ASM_COMMENT;
/// <summary>
/// Comment block style index.
/// </summary>
public const int CommentBlock = NativeMethods.SCE_ASM_COMMENTBLOCK;
/// <summary>
/// Number style index.
/// </summary>
public const int Number = NativeMethods.SCE_ASM_NUMBER;
/// <summary>
/// Math instruction (keword list 1) style index.
/// </summary>
public const int MathInstruction = NativeMethods.SCE_ASM_MATHINSTRUCTION;
/// <summary>
/// Double-quoted string style index.
/// </summary>
public const int String = NativeMethods.SCE_ASM_STRING;
/// <summary>
/// Single-quoted string style index.
/// </summary>
public const int Character = NativeMethods.SCE_ASM_CHARACTER;
/// <summary>
/// CPU instruction (keyword list 0) style index.
/// </summary>
public const int CpuInstruction = NativeMethods.SCE_ASM_CPUINSTRUCTION;
/// <summary>
/// Register (keyword list 2) style index.
/// </summary>
public const int Register = NativeMethods.SCE_ASM_REGISTER;
/// <summary>
/// Operator style index.
/// </summary>
public const int Operator = NativeMethods.SCE_ASM_OPERATOR;
/// <summary>
/// Identifier style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_ASM_IDENTIFIER;
/// <summary>
/// Unclosed string EOL style index.
/// </summary>
public const int StringEol = NativeMethods.SCE_ASM_STRINGEOL;
/// <summary>
/// Directive (keyword list 3) string style index.
/// </summary>
public const int Directive = NativeMethods.SCE_ASM_DIRECTIVE;
/// <summary>
/// Directive operand (keyword list 4) style index.
/// </summary>
public const int DirectiveOperand = NativeMethods.SCE_ASM_DIRECTIVEOPERAND;
/// <summary>
/// Extended instruction (keyword list 5) style index.
/// </summary>
public const int ExtInstruction = NativeMethods.SCE_ASM_EXTINSTRUCTION;
/// <summary>
/// Comment directive style index.
/// </summary>
public const int CommentDirective = NativeMethods.SCE_ASM_COMMENTDIRECTIVE;
}
#endregion Asm
#region BlitzBasic
/// <summary>
/// Style constants for use with the <see cref="Lexer.BlitzBasic" /> lexer.
/// </summary>
public static class BlitzBasic
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_B_DEFAULT;
/// <summary>
/// Comment style index.
/// </summary>
public const int Comment = NativeMethods.SCE_B_COMMENT;
/// <summary>
/// Number style index.
/// </summary>
public const int Number = NativeMethods.SCE_B_NUMBER;
/// <summary>
/// Keyword style index.
/// </summary>
public const int Keyword = NativeMethods.SCE_B_KEYWORD;
/// <summary>
/// String style index.
/// </summary>
public const int String = NativeMethods.SCE_B_STRING;
/// <summary>
/// Preprocessor style index.
/// </summary>
public const int Preprocessor = NativeMethods.SCE_B_PREPROCESSOR;
/// <summary>
/// Operator style index.
/// </summary>
public const int Operator = NativeMethods.SCE_B_OPERATOR;
/// <summary>
/// Identifier style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_B_IDENTIFIER;
/// <summary>
/// Date style index.
/// </summary>
public const int Date = NativeMethods.SCE_B_DATE;
/// <summary>
/// Unclosed string EOL style index.
/// </summary>
public const int StringEol = NativeMethods.SCE_B_STRINGEOL;
/// <summary>
/// Keyword list 2 (index 1) style index.
/// </summary>
public const int Keyword2 = NativeMethods.SCE_B_KEYWORD2;
/// <summary>
/// Keyword list 3 (index 2) style index.
/// </summary>
public const int Keyword3 = NativeMethods.SCE_B_KEYWORD3;
/// <summary>
/// Keyword list 4 (index 3) style index.
/// </summary>
public const int Keyword4 = NativeMethods.SCE_B_KEYWORD4;
/// <summary>
/// Constant style index.
/// </summary>
public const int Constant = NativeMethods.SCE_B_CONSTANT;
/// <summary>
/// Inline assembler style index.
/// </summary>
public const int Asm = NativeMethods.SCE_B_ASM;
/// <summary>
/// Label style index.
/// </summary>
public const int Label = NativeMethods.SCE_B_LABEL;
/// <summary>
/// Error style index.
/// </summary>
public const int Error = NativeMethods.SCE_B_ERROR;
/// <summary>
/// Hexadecimal number style index.
/// </summary>
public const int HexNumber = NativeMethods.SCE_B_HEXNUMBER;
/// <summary>
/// Binary number style index.
/// </summary>
public const int BinNumber = NativeMethods.SCE_B_BINNUMBER;
/// <summary>
/// Block comment style index.
/// </summary>
public const int CommentBlock = NativeMethods.SCE_B_COMMENTBLOCK;
/// <summary>
/// Documentation line style index.
/// </summary>
public const int DocLine = NativeMethods.SCE_B_DOCLINE;
/// <summary>
/// Documentation block style index.
/// </summary>
public const int DocBlock = NativeMethods.SCE_B_DOCBLOCK;
/// <summary>
/// Documentation keyword style index.
/// </summary>
public const int DocKeyword = NativeMethods.SCE_B_DOCKEYWORD;
}
#endregion BlitzBasic
#region Batch
/// <summary>
/// Style constants for use with the <see cref="Lexer.Batch" /> lexer.
/// </summary>
public static class Batch
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_BAT_DEFAULT;
/// <summary>
/// Comment style index.
/// </summary>
public const int Comment = NativeMethods.SCE_BAT_COMMENT;
/// <summary>
/// Keyword (list 0) style index.
/// </summary>
public const int Word = NativeMethods.SCE_BAT_WORD;
/// <summary>
/// Label style index.
/// </summary>
public const int Label = NativeMethods.SCE_BAT_LABEL;
/// <summary>
/// Hide (@ECHO OFF/ON) style index.
/// </summary>
public const int Hide = NativeMethods.SCE_BAT_HIDE;
/// <summary>
/// External command (keyword list 1) style index.
/// </summary>
public const int Command = NativeMethods.SCE_BAT_COMMAND;
/// <summary>
/// Identifier string style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_BAT_IDENTIFIER;
/// <summary>
/// Operator style index.
/// </summary>
public const int Operator = NativeMethods.SCE_BAT_OPERATOR;
}
#endregion Batch
#region Cpp
/// <summary>
/// Style constants for use with the <see cref="Lexer.Cpp" /> lexer.
/// </summary>
public static class Cpp
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_C_DEFAULT;
/// <summary>
/// Comment style index.
/// </summary>
public const int Comment = NativeMethods.SCE_C_COMMENT;
/// <summary>
/// Line comment style index.
/// </summary>
public const int CommentLine = NativeMethods.SCE_C_COMMENTLINE;
/// <summary>
/// Documentation comment style index.
/// </summary>
public const int CommentDoc = NativeMethods.SCE_C_COMMENTDOC;
/// <summary>
/// Number style index.
/// </summary>
public const int Number = NativeMethods.SCE_C_NUMBER;
/// <summary>
/// Keyword style index.
/// </summary>
public const int Word = NativeMethods.SCE_C_WORD;
/// <summary>
/// Double-quoted string style index.
/// </summary>
public const int String = NativeMethods.SCE_C_STRING;
/// <summary>
/// Single-quoted string style index.
/// </summary>
public const int Character = NativeMethods.SCE_C_CHARACTER;
/// <summary>
/// UUID style index.
/// </summary>
public const int Uuid = NativeMethods.SCE_C_UUID;
/// <summary>
/// Preprocessor style index.
/// </summary>
public const int Preprocessor = NativeMethods.SCE_C_PREPROCESSOR;
/// <summary>
/// Operator style index.
/// </summary>
public const int Operator = NativeMethods.SCE_C_OPERATOR;
/// <summary>
/// Identifier style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_C_IDENTIFIER;
/// <summary>
/// Unclosed string EOL style index.
/// </summary>
public const int StringEol = NativeMethods.SCE_C_STRINGEOL;
/// <summary>
/// Verbatim string style index.
/// </summary>
public const int Verbatim = NativeMethods.SCE_C_VERBATIM;
/// <summary>
/// Regular expression style index.
/// </summary>
public const int Regex = NativeMethods.SCE_C_REGEX;
/// <summary>
/// Documentation comment line style index.
/// </summary>
public const int CommentLineDoc = NativeMethods.SCE_C_COMMENTLINEDOC;
/// <summary>
/// Keyword style 2 index.
/// </summary>
public const int Word2 = NativeMethods.SCE_C_WORD2;
/// <summary>
/// Comment keyword style index.
/// </summary>
public const int CommentDocKeyword = NativeMethods.SCE_C_COMMENTDOCKEYWORD;
/// <summary>
/// Comment keyword error style index.
/// </summary>
public const int CommentDocKeywordError = NativeMethods.SCE_C_COMMENTDOCKEYWORDERROR;
/// <summary>
/// Global class style index.
/// </summary>
public const int GlobalClass = NativeMethods.SCE_C_GLOBALCLASS;
/// <summary>
/// Raw string style index.
/// </summary>
public const int StringRaw = NativeMethods.SCE_C_STRINGRAW;
/// <summary>
/// Triple-quoted string style index.
/// </summary>
public const int TripleVerbatim = NativeMethods.SCE_C_TRIPLEVERBATIM;
/// <summary>
/// Hash-quoted string style index.
/// </summary>
public const int HashQuotedString = NativeMethods.SCE_C_HASHQUOTEDSTRING;
/// <summary>
/// Preprocessor comment style index.
/// </summary>
public const int PreprocessorComment = NativeMethods.SCE_C_PREPROCESSORCOMMENT;
/// <summary>
/// Preprocessor documentation comment style index.
/// </summary>
public const int PreprocessorCommentDoc = NativeMethods.SCE_C_PREPROCESSORCOMMENTDOC;
/// <summary>
/// User-defined literal style index.
/// </summary>
public const int UserLiteral = NativeMethods.SCE_C_USERLITERAL;
/// <summary>
/// Task marker style index.
/// </summary>
public const int TaskMarker = NativeMethods.SCE_C_TASKMARKER;
/// <summary>
/// Escape sequence style index.
/// </summary>
public const int EscapeSequence = NativeMethods.SCE_C_ESCAPESEQUENCE;
}
#endregion Cpp
#region Css
/// <summary>
/// Style constants for use with the <see cref="Lexer.Css" /> lexer.
/// </summary>
public static class Css
{
/// <summary>
/// Default (whitespace) style index.
/// </summary>
public const int Default = NativeMethods.SCE_CSS_DEFAULT;
/// <summary>
/// Tag style index.
/// </summary>
public const int Tag = NativeMethods.SCE_CSS_TAG;
/// <summary>
/// Class style index.
/// </summary>
public const int Class = NativeMethods.SCE_CSS_CLASS;
/// <summary>
/// Pseudo class style index.
/// </summary>
public const int PseudoClass = NativeMethods.SCE_CSS_PSEUDOCLASS;
/// <summary>
/// Unknown pseudo class style index.
/// </summary>
public const int UnknownPseudoClass = NativeMethods.SCE_CSS_UNKNOWN_PSEUDOCLASS;
/// <summary>
/// Operator style index.
/// </summary>
public const int Operator = NativeMethods.SCE_CSS_OPERATOR;
/// <summary>
/// Identifier style index.
/// </summary>
public const int Identifier = NativeMethods.SCE_CSS_IDENTIFIER;
/// <summary>
/// Unknown identifier style index.
/// </summary>
public const int UnknownIdentifier = NativeMethods.SCE_CSS_UNKNOWN_IDENTIFIER;
/// <summary>
/// Value style index.
/// </summary>
public const int Value = NativeMethods.SCE_CSS_VALUE;
/// <summary>
/// Comment style index.
/// </summary>
public const int Comment = NativeMethods.SCE_CSS_COMMENT;
/// <summary>
/// ID style index.
/// </summary>
public const int Id = NativeMethods.SCE_CSS_ID;
/// <summary>
/// Important style index.
/// </summary>
public const int Important = NativeMethods.SCE_CSS_IMPORTANT;
/// <summary>
/// Directive style index.
/// </summary>
public const int Directive = NativeMethods.SCE_CSS_DIRECTIVE;
/// <summary>
/// Double-quoted string style index.
/// </summary>
public const int DoubleString = NativeMethods.SCE_CSS_DOUBLESTRING;
/// <summary>
/// Single-quoted string style index.
/// </summary>
public const int SingleString = NativeMethods.SCE_CSS_SINGLESTRING;
/// <summary>
/// Identifier style 2 index.
/// </summary>
public const int Identifier2 = NativeMethods.SCE_CSS_IDENTIFIER2;
/// <summary>
/// Attribute style index.
/// </summary>
public const int Attribute = NativeMethods.SCE_CSS_ATTRIBUTE;
/// <summary>
/// Identifier style 3 index.
/// </summary>
public const int Identifier3 = NativeMethods.SCE_CSS_IDENTIFIER3;
/// <summary>
/// Pseudo element style index.
/// </summary>
public const int PseudoElement = NativeMethods.SCE_CSS_PSEUDOELEMENT;
/// <summary>
/// Extended identifier style index.
/// </summary>
public const int ExtendedIdentifier = NativeMethods.SCE_CSS_EXTENDED_IDENTIFIER;
/// <summary>
/// Extended pseudo class style index.
/// </summary>
public const int ExtendedPseudoClass = NativeMethods.SCE_CSS_EXTENDED_PSEUDOCLASS;
/// <summary>
/// Extended pseudo element style index.
/// </summary>
public const int ExtendedPseudoElement = NativeMethods.SCE_CSS_EXTENDED_PSEUDOELEMENT;
/// <summary>
/// Media style index.