/
ScintillaGateway.cs
5116 lines (4382 loc) · 229 KB
/
ScintillaGateway.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
// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
using System;
using System.Runtime.InteropServices;
using System.Text;
using static Kbg.NppPluginNET.PluginInfrastructure.Win32;
namespace Kbg.NppPluginNET.PluginInfrastructure
{
/// <summary>
/// This it the plugin-writers primary interface to Notepad++/Scintilla.
/// It takes away all the complexity with command numbers and Int-pointer casting.
///
/// See http://www.scintilla.org/ScintillaDoc.html for further details.
/// </summary>
public class ScintillaGateway : IScintillaGateway
{
private const int Unused = 0;
private readonly IntPtr scintilla;
public static readonly int LengthZeroTerminator = "\0".Length;
/// <summary>
/// returns bytes decoded from UTF-8 as a string, with all trailing NULL bytes stripped off.
/// </summary>
public static string Utf8BytesToNullStrippedString(byte[] bytes)
{
int lastNullCharPos = bytes.Length - 1;
// this only bypasses NULL chars because no char
// other than NULL can have any 0-valued bytes in UTF-8.
// See https://en.wikipedia.org/wiki/UTF-8#Encoding
for (; lastNullCharPos >= 0 && bytes[lastNullCharPos] == '\x00'; lastNullCharPos--) { }
return Encoding.UTF8.GetString(bytes, 0, lastNullCharPos + 1);
}
/// <summary>
/// Recall that all Scintilla methods have the signature
/// (scintilla* scin, SciMsg msg, void* wParam, void* lParam) -> void*<br></br>
/// Many of these scintilla methods are bimodal in the following way<br></br>
/// * if lParam is 0, return the length of the buffer to be filled and have no side effects. The wParam may be involved in telling Scintilla how big the buffer needs to be.<br></br>
/// * if lParam is greater than 0, it is assumed to be a pointer to a buffer. Now the wParam indicates what the text will need to be.<br></br><br></br>
/// This sets lParam to 0 to get the length, allocates a buffer of that length,<br></br>
/// uses the second mode to fill a buffer,<br></br>
/// and returns a string of the UTF8-decoded buffer with all trailing '\x00' chars stripped off.
/// </summary>
/// <param name="msg">message to send</param>
/// <param name="wParam">another parameter for defining what the buffer should contain</param>
/// <returns></returns>
private unsafe string GetNullStrippedStringFromMessageThatReturnsLength(SciMsg msg, IntPtr wParam=default)
{
int length = Win32.SendMessage(scintilla, msg, wParam, (IntPtr)Unused).ToInt32();
byte[] textBuffer = new byte[length];
fixed (byte* textPtr = textBuffer)
{
Win32.SendMessage(scintilla, msg, wParam, (IntPtr)textPtr);
return Utf8BytesToNullStrippedString(textBuffer);
}
}
public ScintillaGateway(IntPtr scintilla)
{
this.scintilla = scintilla;
}
public int GetSelectionLength()
{
var selectionLength = (int) Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused) - LengthZeroTerminator;
return selectionLength;
}
public void AppendTextAndMoveCursor(string text)
{
AppendText(text.Length, text);
GotoPos(GetCurrentPos() + text.Length);
}
public void InsertTextAndMoveCursor(string text)
{
var currentPos = GetCurrentPos();
InsertText(currentPos, text);
GotoPos(currentPos + text.Length);
}
public void SelectCurrentLine()
{
int line = GetCurrentLineNumber();
SetSelection(PositionFromLine(line), PositionFromLine(line + 1));
}
/// <summary>
/// clears the selection without changing the position of the cursor
/// </summary>
public void ClearSelectionToCursor()
{
var pos = GetCurrentPos();
SetSelection(pos, pos);
}
/// <summary>
/// Get the current line from the current position
/// </summary>
public int GetCurrentLineNumber()
{
return LineFromPosition(GetCurrentPos());
}
/// <summary>
/// Get the scroll information for the current Scintilla window.
/// </summary>
/// <param name="mask">Arguments for the scroll information such as tracking</param>
/// <param name="scrollBar">Which scroll bar information are you looking for</param>
/// <returns>A ScrollInfo struct with information of the current scroll state</returns>
public ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH)
{
ScrollInfo scrollInfo = new ScrollInfo();
scrollInfo.cbSize = (uint)Marshal.SizeOf(scrollInfo);
scrollInfo.fMask = (uint)mask;
Win32.GetScrollInfo(scintilla, (int)scrollBar, ref scrollInfo);
return scrollInfo;
}
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
/// <summary>Add text to the document at current position. (Scintilla feature 2001)</summary>
public unsafe void AddText(int length, string text)
{
fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
{
Win32.SendMessage(scintilla, SciMsg.SCI_ADDTEXT, (IntPtr) length, (IntPtr) textPtr);
}
}
/// <summary>Add array of cells to document. (Scintilla feature 2002)</summary>
public unsafe void AddStyledText(int length, Cells c)
{
fixed (char* cPtr = c.Value)
{
Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, (IntPtr) length, (IntPtr) cPtr);
}
}
/// <summary>Insert string at a position. (Scintilla feature 2003)</summary>
public unsafe void InsertText(int pos, string text)
{
fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
{
Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, (IntPtr) pos, (IntPtr) textPtr);
}
}
/// <summary>Change the text that is being inserted in response to SC_MOD_INSERTCHECK (Scintilla feature 2672)</summary>
public unsafe void ChangeInsertion(int length, string text)
{
fixed (byte* textPtr = Encoding.UTF8.GetBytes(text))
{
Win32.SendMessage(scintilla, SciMsg.SCI_CHANGEINSERTION, (IntPtr) length, (IntPtr) textPtr);
}
}
/// <summary>Delete all text in the document. (Scintilla feature 2004)</summary>
public void ClearAll()
{
Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Delete a range of text in the document. (Scintilla feature 2645)</summary>
public void DeleteRange(int start, int lengthDelete)
{
Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, (IntPtr) start, (IntPtr) lengthDelete);
}
/// <summary>Set all style bytes to 0, remove all folding information. (Scintilla feature 2005)</summary>
public void ClearDocumentStyle()
{
Win32.SendMessage(scintilla, SciMsg.SCI_CLEARDOCUMENTSTYLE, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Returns the number of bytes in the document. (Scintilla feature 2006)</summary>
public int GetLength()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLENGTH, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Returns the character byte at the position. (Scintilla feature 2007)</summary>
public int GetCharAt(int pos)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, (IntPtr) pos, (IntPtr) Unused);
}
/// <summary>Returns the position of the caret. (Scintilla feature 2008)</summary>
public int GetCurrentPos()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009)</summary>
public int GetAnchor()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Returns the style byte at the position. (Scintilla feature 2010)</summary>
public int GetStyleAt(int pos)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, (IntPtr) pos, (IntPtr) Unused);
}
/// <summary>Redoes the next action on the undo history. (Scintilla feature 2011)</summary>
public void Redo()
{
Win32.SendMessage(scintilla, SciMsg.SCI_REDO, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// Choose between collecting actions into the undo
/// history and discarding them.
/// (Scintilla feature 2012)
/// </summary>
public void SetUndoCollection(bool collectUndo)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, new IntPtr(collectUndo ? 1 : 0), (IntPtr) Unused);
}
/// <summary>Select all the text in the document. (Scintilla feature 2013)</summary>
public void SelectAll()
{
Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// Remember the current position in the undo history as the position
/// at which the document was saved.
/// (Scintilla feature 2014)
/// </summary>
public void SetSavePoint()
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// Retrieve a buffer of cells.
/// Returns the number of bytes in the buffer not including terminating NULs.
/// (Scintilla feature 2015)
/// </summary>
public int GetStyledText(TextRange tr)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, (IntPtr) Unused, tr.NativePointer);
}
/// <summary>Are there any redoable actions in the undo history? (Scintilla feature 2016)</summary>
public bool CanRedo()
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_CANREDO, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Retrieve the line number at which a particular marker is located. (Scintilla feature 2017)</summary>
public int MarkerLineFromHandle(int markerHandle)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, (IntPtr) markerHandle, (IntPtr) Unused);
}
/// <summary>Delete a marker. (Scintilla feature 2018)</summary>
public void MarkerDeleteHandle(int markerHandle)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, (IntPtr) markerHandle, (IntPtr) Unused);
}
/// <summary>Is undo history being collected? (Scintilla feature 2019)</summary>
public bool GetUndoCollection()
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETUNDOCOLLECTION, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// Are white space characters currently visible?
/// Returns one of SCWS_* constants.
/// (Scintilla feature 2020)
/// </summary>
public WhiteSpace GetViewWS()
{
return (WhiteSpace)Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021)</summary>
public void SetViewWS(WhiteSpace viewWS)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, (IntPtr) viewWS, (IntPtr) Unused);
}
/// <summary>
/// Retrieve the current tab draw mode.
/// Returns one of SCTD_* constants.
/// (Scintilla feature 2698)
/// </summary>
public TabDrawMode GetTabDrawMode()
{
return (TabDrawMode)Win32.SendMessage(scintilla, SciMsg.SCI_GETTABDRAWMODE, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set how tabs are drawn when visible. (Scintilla feature 2699)</summary>
public void SetTabDrawMode(TabDrawMode tabDrawMode)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETTABDRAWMODE, (IntPtr) tabDrawMode, (IntPtr) Unused);
}
/// <summary>Find the position from a point within the window. (Scintilla feature 2022)</summary>
public int PositionFromPoint(int x, int y)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, (IntPtr) x, (IntPtr) y);
}
/// <summary>
/// Find the position from a point within the window but return
/// INVALID_POSITION if not close to text.
/// (Scintilla feature 2023)
/// </summary>
public int PositionFromPointClose(int x, int y)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, (IntPtr) x, (IntPtr) y);
}
/// <summary>Set caret to start of a line and ensure it is visible. (Scintilla feature 2024)</summary>
public void GotoLine(int line)
{
Win32.SendMessage(scintilla, SciMsg.SCI_GOTOLINE, (IntPtr) line, (IntPtr) Unused);
}
/// <summary>Set caret to a position and ensure it is visible. (Scintilla feature 2025)</summary>
public void GotoPos(int caret)
{
Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, (IntPtr) caret, (IntPtr) Unused);
}
/// <summary>
/// Set the selection anchor to a position. The anchor is the opposite
/// end of the selection from the caret.
/// (Scintilla feature 2026)
/// </summary>
public void SetAnchor(int anchor)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, (IntPtr) anchor, (IntPtr) Unused);
}
/// <summary>
/// Retrieve the text of the line containing the caret.
/// Returns the index of the caret on the line.
/// Result is NUL-terminated.
/// (Scintilla feature 2027)
/// </summary>
public unsafe string GetCurLine()
{
return GetNullStrippedStringFromMessageThatReturnsLength(SciMsg.SCI_GETCURLINE);
}
/// <summary>Retrieve the position of the last correctly styled character. (Scintilla feature 2028)</summary>
public int GetEndStyled()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Convert all line endings in the document to one mode. (Scintilla feature 2029)</summary>
public void ConvertEOLs(EndOfLine eolMode)
{
Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, (IntPtr) eolMode, (IntPtr) Unused);
}
/// <summary>Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030)</summary>
public EndOfLine GetEOLMode()
{
return (EndOfLine)Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set the current end of line mode. (Scintilla feature 2031)</summary>
public void SetEOLMode(EndOfLine eolMode)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, (IntPtr) eolMode, (IntPtr) Unused);
}
/// <summary>
/// Set the current styling position to start.
/// The unused parameter is no longer used and should be set to 0.
/// (Scintilla feature 2032)
/// </summary>
public void StartStyling(int start, int unused)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, (IntPtr) start, (IntPtr) unused);
}
/// <summary>
/// Change style from current styling position for length characters to a style
/// and move the current styling position to after this newly styled segment.
/// (Scintilla feature 2033)
/// </summary>
public void SetStyling(int length, int style)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, (IntPtr) length, (IntPtr) style);
}
/// <summary>Is drawing done first into a buffer or direct to the screen? (Scintilla feature 2034)</summary>
public bool GetBufferedDraw()
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETBUFFEREDDRAW, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// If drawing is buffered then each line of text is drawn into a bitmap buffer
/// before drawing it to the screen to avoid flicker.
/// (Scintilla feature 2035)
/// </summary>
public void SetBufferedDraw(bool buffered)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, new IntPtr(buffered ? 1 : 0), (IntPtr) Unused);
}
/// <summary>Change the visible size of a tab to be a multiple of the width of a space character. (Scintilla feature 2036)</summary>
public void SetTabWidth(int tabWidth)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETTABWIDTH, (IntPtr) tabWidth, (IntPtr) Unused);
}
/// <summary>Retrieve the visible size of a tab. (Scintilla feature 2121)</summary>
public int GetTabWidth()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTABWIDTH, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Clear explicit tabstops on a line. (Scintilla feature 2675)</summary>
public void ClearTabStops(int line)
{
Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, (IntPtr) line, (IntPtr) Unused);
}
/// <summary>Add an explicit tab stop for a line. (Scintilla feature 2676)</summary>
public void AddTabStop(int line, int x)
{
Win32.SendMessage(scintilla, SciMsg.SCI_ADDTABSTOP, (IntPtr) line, (IntPtr) x);
}
/// <summary>Find the next explicit tab stop position on a line after a position. (Scintilla feature 2677)</summary>
public int GetNextTabStop(int line, int x)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETNEXTTABSTOP, (IntPtr) line, (IntPtr) x);
}
/// <summary>
/// Set the code page used to interpret the bytes of the document as characters.
/// The SC_CP_UTF8 value can be used to enter Unicode mode.
/// (Scintilla feature 2037)
/// </summary>
public void SetCodePage(int codePage)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, (IntPtr) codePage, (IntPtr) Unused);
}
/// <summary>Is the IME displayed in a window or inline? (Scintilla feature 2678)</summary>
public IMEInteraction GetIMEInteraction()
{
return (IMEInteraction)Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Choose to display the the IME in a winow or inline. (Scintilla feature 2679)</summary>
public void SetIMEInteraction(IMEInteraction imeInteraction)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, (IntPtr) imeInteraction, (IntPtr) Unused);
}
/// <summary>Set the symbol used for a particular marker number. (Scintilla feature 2040)</summary>
public void MarkerDefine(int markerNumber, MarkerSymbol markerSymbol)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, (IntPtr) markerNumber, (IntPtr) markerSymbol);
}
/// <summary>Set the foreground colour used for a particular marker number. (Scintilla feature 2041)</summary>
public void MarkerSetFore(int markerNumber, Colour fore)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETFORE, (IntPtr) markerNumber, fore.Value);
}
/// <summary>Set the background colour used for a particular marker number. (Scintilla feature 2042)</summary>
public void MarkerSetBack(int markerNumber, Colour back)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACK, (IntPtr) markerNumber, back.Value);
}
/// <summary>Set the background colour used for a particular marker number when its folding block is selected. (Scintilla feature 2292)</summary>
public void MarkerSetBackSelected(int markerNumber, Colour back)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACKSELECTED, (IntPtr) markerNumber, back.Value);
}
/// <summary>Enable/disable highlight for current folding bloc (smallest one that contains the caret) (Scintilla feature 2293)</summary>
public void MarkerEnableHighlight(bool enabled)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERENABLEHIGHLIGHT, new IntPtr(enabled ? 1 : 0), (IntPtr) Unused);
}
/// <summary>Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043)</summary>
public int MarkerAdd(int line, int markerNumber)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADD, (IntPtr) line, (IntPtr) markerNumber);
}
/// <summary>Delete a marker from a line. (Scintilla feature 2044)</summary>
public void MarkerDelete(int line, int markerNumber)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETE, (IntPtr) line, (IntPtr) markerNumber);
}
/// <summary>Delete all markers with a particular number from all lines. (Scintilla feature 2045)</summary>
public void MarkerDeleteAll(int markerNumber)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEALL, (IntPtr) markerNumber, (IntPtr) Unused);
}
/// <summary>Get a bit mask of all the markers set on a line. (Scintilla feature 2046)</summary>
public int MarkerGet(int line)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERGET, (IntPtr) line, (IntPtr) Unused);
}
/// <summary>
/// Find the next line at or after lineStart that includes a marker in mask.
/// Return -1 when no more lines.
/// (Scintilla feature 2047)
/// </summary>
public int MarkerNext(int lineStart, int markerMask)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, (IntPtr) lineStart, (IntPtr) markerMask);
}
/// <summary>Find the previous line before lineStart that includes a marker in mask. (Scintilla feature 2048)</summary>
public int MarkerPrevious(int lineStart, int markerMask)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERPREVIOUS, (IntPtr) lineStart, (IntPtr) markerMask);
}
/// <summary>Define a marker from a pixmap. (Scintilla feature 2049)</summary>
public unsafe void MarkerDefinePixmap(int markerNumber, string pixmap)
{
fixed (byte* pixmapPtr = Encoding.UTF8.GetBytes(pixmap))
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINEPIXMAP, (IntPtr) markerNumber, (IntPtr) pixmapPtr);
}
}
/// <summary>Add a set of markers to a line. (Scintilla feature 2466)</summary>
public void MarkerAddSet(int line, int markerSet)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, (IntPtr) line, (IntPtr) markerSet);
}
/// <summary>Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature 2476)</summary>
public void MarkerSetAlpha(int markerNumber, Alpha alpha)
{
Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, (IntPtr) markerNumber, (IntPtr) alpha);
}
/// <summary>Set a margin to be either numeric or symbolic. (Scintilla feature 2240)</summary>
public void SetMarginTypeN(int margin, MarginType marginType)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, (IntPtr) margin, (IntPtr) marginType);
}
/// <summary>Retrieve the type of a margin. (Scintilla feature 2241)</summary>
public MarginType GetMarginTypeN(int margin)
{
return (MarginType)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, (IntPtr) margin, (IntPtr) Unused);
}
/// <summary>Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242)</summary>
public void SetMarginWidthN(int margin, int pixelWidth)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINWIDTHN, (IntPtr) margin, (IntPtr) pixelWidth);
}
/// <summary>Retrieve the width of a margin in pixels. (Scintilla feature 2243)</summary>
public int GetMarginWidthN(int margin)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINWIDTHN, (IntPtr) margin, (IntPtr) Unused);
}
/// <summary>Set a mask that determines which markers are displayed in a margin. (Scintilla feature 2244)</summary>
public void SetMarginMaskN(int margin, int mask)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINMASKN, (IntPtr) margin, (IntPtr) mask);
}
/// <summary>Retrieve the marker mask of a margin. (Scintilla feature 2245)</summary>
public int GetMarginMaskN(int margin)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINMASKN, (IntPtr) margin, (IntPtr) Unused);
}
/// <summary>Make a margin sensitive or insensitive to mouse clicks. (Scintilla feature 2246)</summary>
public void SetMarginSensitiveN(int margin, bool sensitive)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINSENSITIVEN, (IntPtr) margin, new IntPtr(sensitive ? 1 : 0));
}
/// <summary>Retrieve the mouse click sensitivity of a margin. (Scintilla feature 2247)</summary>
public bool GetMarginSensitiveN(int margin)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINSENSITIVEN, (IntPtr) margin, (IntPtr) Unused);
}
/// <summary>Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248)</summary>
public void SetMarginCursorN(int margin, CursorShape cursor)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, (IntPtr) margin, (IntPtr) cursor);
}
/// <summary>Retrieve the cursor shown in a margin. (Scintilla feature 2249)</summary>
public CursorShape GetMarginCursorN(int margin)
{
return (CursorShape)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, (IntPtr) margin, (IntPtr) Unused);
}
/// <summary>Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. (Scintilla feature 2250)</summary>
public void SetMarginBackN(int margin, Colour back)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINBACKN, (IntPtr) margin, back.Value);
}
/// <summary>Retrieve the background colour of a margin (Scintilla feature 2251)</summary>
public Colour GetMarginBackN(int margin)
{
return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINBACKN, (IntPtr) margin, (IntPtr) Unused));
}
/// <summary>Allocate a non-standard number of margins. (Scintilla feature 2252)</summary>
public void SetMargins(int margins)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINS, (IntPtr) margins, (IntPtr) Unused);
}
/// <summary>How many margins are there?. (Scintilla feature 2253)</summary>
public int GetMargins()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINS, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050)</summary>
public void StyleClearAll()
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLECLEARALL, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set the foreground colour of a style. (Scintilla feature 2051)</summary>
public void StyleSetFore(int style, Colour fore)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFORE, (IntPtr) style, fore.Value);
}
/// <summary>Set the background colour of a style. (Scintilla feature 2052)</summary>
public void StyleSetBack(int style, Colour back)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBACK, (IntPtr) style, back.Value);
}
/// <summary>Set a style to be bold or not. (Scintilla feature 2053)</summary>
public void StyleSetBold(int style, bool bold)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBOLD, (IntPtr) style, new IntPtr(bold ? 1 : 0));
}
/// <summary>Set a style to be italic or not. (Scintilla feature 2054)</summary>
public void StyleSetItalic(int style, bool italic)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETITALIC, (IntPtr) style, new IntPtr(italic ? 1 : 0));
}
/// <summary>Set the size of characters of a style. (Scintilla feature 2055)</summary>
public void StyleSetSize(int style, int sizePoints)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZE, (IntPtr) style, (IntPtr) sizePoints);
}
/// <summary>Set the font of a style. (Scintilla feature 2056)</summary>
public unsafe void StyleSetFont(int style, string fontName)
{
fixed (byte* fontNamePtr = Encoding.UTF8.GetBytes(fontName))
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFONT, (IntPtr) style, (IntPtr) fontNamePtr);
}
}
/// <summary>Set a style to have its end of line filled or not. (Scintilla feature 2057)</summary>
public void StyleSetEOLFilled(int style, bool eolFilled)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, (IntPtr) style, new IntPtr(eolFilled ? 1 : 0));
}
/// <summary>Reset the default style to its state at startup (Scintilla feature 2058)</summary>
public void StyleResetDefault()
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLERESETDEFAULT, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set a style to be underlined or not. (Scintilla feature 2059)</summary>
public void StyleSetUnderline(int style, bool underline)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETUNDERLINE, (IntPtr) style, new IntPtr(underline ? 1 : 0));
}
/// <summary>Get the foreground colour of a style. (Scintilla feature 2481)</summary>
public Colour StyleGetFore(int style)
{
return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFORE, (IntPtr) style, (IntPtr) Unused));
}
/// <summary>Get the background colour of a style. (Scintilla feature 2482)</summary>
public Colour StyleGetBack(int style)
{
return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBACK, (IntPtr) style, (IntPtr) Unused));
}
/// <summary>Get is a style bold or not. (Scintilla feature 2483)</summary>
public bool StyleGetBold(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBOLD, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get is a style italic or not. (Scintilla feature 2484)</summary>
public bool StyleGetItalic(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETITALIC, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get the size of characters of a style. (Scintilla feature 2485)</summary>
public int StyleGetSize(int style)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZE, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>
/// Get the font of a style.
/// Returns the length of the fontName
/// Result is NUL-terminated.
/// (Scintilla feature 2486)
/// </summary>
public unsafe string StyleGetFont(int style)
{
return GetNullStrippedStringFromMessageThatReturnsLength(SciMsg.SCI_STYLEGETFONT, (IntPtr)style);
}
/// <summary>Get is a style to have its end of line filled or not. (Scintilla feature 2487)</summary>
public bool StyleGetEOLFilled(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETEOLFILLED, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get is a style underlined or not. (Scintilla feature 2488)</summary>
public bool StyleGetUnderline(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETUNDERLINE, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489)</summary>
public CaseVisible StyleGetCase(int style)
{
return (CaseVisible)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get the character get of the font in a style. (Scintilla feature 2490)</summary>
public CharacterSet StyleGetCharacterSet(int style)
{
return (CharacterSet)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get is a style visible or not. (Scintilla feature 2491)</summary>
public bool StyleGetVisible(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETVISIBLE, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>
/// Get is a style changeable or not (read only).
/// Experimental feature, currently buggy.
/// (Scintilla feature 2492)
/// </summary>
public bool StyleGetChangeable(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Get is a style a hotspot or not. (Scintilla feature 2493)</summary>
public bool StyleGetHotSpot(int style)
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETHOTSPOT, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060)</summary>
public void StyleSetCase(int style, CaseVisible caseVisible)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, (IntPtr) style, (IntPtr) caseVisible);
}
/// <summary>Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061)</summary>
public void StyleSetSizeFractional(int style, int sizeHundredthPoints)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, (IntPtr) style, (IntPtr) sizeHundredthPoints);
}
/// <summary>Get the size of characters of a style in points multiplied by 100 (Scintilla feature 2062)</summary>
public int StyleGetSizeFractional(int style)
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZEFRACTIONAL, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Set the weight of characters of a style. (Scintilla feature 2063)</summary>
public void StyleSetWeight(int style, FontWeight weight)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, (IntPtr) style, (IntPtr) weight);
}
/// <summary>Get the weight of characters of a style. (Scintilla feature 2064)</summary>
public FontWeight StyleGetWeight(int style)
{
return (FontWeight)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, (IntPtr) style, (IntPtr) Unused);
}
/// <summary>Set the character set of the font in a style. (Scintilla feature 2066)</summary>
public void StyleSetCharacterSet(int style, CharacterSet characterSet)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, (IntPtr) style, (IntPtr) characterSet);
}
/// <summary>Set a style to be a hotspot or not. (Scintilla feature 2409)</summary>
public void StyleSetHotSpot(int style, bool hotspot)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETHOTSPOT, (IntPtr) style, new IntPtr(hotspot ? 1 : 0));
}
/// <summary>Set the foreground colour of the main and additional selections and whether to use this setting. (Scintilla feature 2067)</summary>
public void SetSelFore(bool useSetting, Colour fore)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSELFORE, new IntPtr(useSetting ? 1 : 0), fore.Value);
}
/// <summary>Set the background colour of the main and additional selections and whether to use this setting. (Scintilla feature 2068)</summary>
public void SetSelBack(bool useSetting, Colour back)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSELBACK, new IntPtr(useSetting ? 1 : 0), back.Value);
}
/// <summary>Get the alpha of the selection. (Scintilla feature 2477)</summary>
public Alpha GetSelAlpha()
{
return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set the alpha of the selection. (Scintilla feature 2478)</summary>
public void SetSelAlpha(Alpha alpha)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, (IntPtr) alpha, (IntPtr) Unused);
}
/// <summary>Is the selection end of line filled? (Scintilla feature 2479)</summary>
public bool GetSelEOLFilled()
{
return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELEOLFILLED, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set the selection to have its end of line filled or not. (Scintilla feature 2480)</summary>
public void SetSelEOLFilled(bool filled)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSELEOLFILLED, new IntPtr(filled ? 1 : 0), (IntPtr) Unused);
}
/// <summary>Set the foreground colour of the caret. (Scintilla feature 2069)</summary>
public void SetCaretFore(Colour fore)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETFORE, fore.Value, (IntPtr) Unused);
}
/// <summary>When key+modifier combination keyDefinition is pressed perform sciCommand. (Scintilla feature 2070)</summary>
public void AssignCmdKey(KeyModifier keyDefinition, int sciCommand)
{
Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, keyDefinition.Value, (IntPtr) sciCommand);
}
/// <summary>When key+modifier combination keyDefinition is pressed do nothing. (Scintilla feature 2071)</summary>
public void ClearCmdKey(KeyModifier keyDefinition)
{
Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, keyDefinition.Value, (IntPtr) Unused);
}
/// <summary>Drop all key mappings. (Scintilla feature 2072)</summary>
public void ClearAllCmdKeys()
{
Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set the styles for a segment of the document. (Scintilla feature 2073)</summary>
public unsafe void SetStylingEx(int length, string styles)
{
fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles))
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLINGEX, (IntPtr) length, (IntPtr) stylesPtr);
}
}
/// <summary>Set a style to be visible or not. (Scintilla feature 2074)</summary>
public void StyleSetVisible(int style, bool visible)
{
Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETVISIBLE, (IntPtr) style, new IntPtr(visible ? 1 : 0));
}
/// <summary>Get the time in milliseconds that the caret is on and off. (Scintilla feature 2075)</summary>
public int GetCaretPeriod()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETPERIOD, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Get the time in milliseconds that the caret is on and off. 0 = steady on. (Scintilla feature 2076)</summary>
public void SetCaretPeriod(int periodMilliseconds)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETPERIOD, (IntPtr) periodMilliseconds, (IntPtr) Unused);
}
/// <summary>
/// Set the set of characters making up words for when moving or selecting by word.
/// First sets defaults like SetCharsDefault.
/// (Scintilla feature 2077)
/// </summary>
public unsafe void SetWordChars(string characters)
{
fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters))
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, (IntPtr) Unused, (IntPtr) charactersPtr);
}
}
/// <summary>
/// Get the set of characters making up words for when moving or selecting by word.
/// Returns the number of characters
/// (Scintilla feature 2646)
/// </summary>
public unsafe string GetWordChars()
{
return GetNullStrippedStringFromMessageThatReturnsLength(SciMsg.SCI_GETWORDCHARS);
}
/// <summary>Set the number of characters to have directly indexed categories (Scintilla feature 2720)</summary>
public void SetCharacterCategoryOptimization(int countCharacters)
{
Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARACTERCATEGORYOPTIMIZATION, (IntPtr) countCharacters, (IntPtr) Unused);
}
/// <summary>Get the number of characters to have directly indexed categories (Scintilla feature 2721)</summary>
public int GetCharacterCategoryOptimization()
{
return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERCATEGORYOPTIMIZATION, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>
/// Start a sequence of actions that is undone and redone as a unit.
/// May be nested.
/// (Scintilla feature 2078)
/// </summary>
public void BeginUndoAction()
{
Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>End a sequence of actions that is undone and redone as a unit. (Scintilla feature 2079)</summary>
public void EndUndoAction()
{
Win32.SendMessage(scintilla, SciMsg.SCI_ENDUNDOACTION, (IntPtr) Unused, (IntPtr) Unused);
}
/// <summary>Set an indicator to plain, squiggle or TT. (Scintilla feature 2080)</summary>
public void IndicSetStyle(int indicator, IndicatorStyle indicatorStyle)
{
Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, (IntPtr) indicator, (IntPtr) indicatorStyle);
}
/// <summary>Retrieve the style of an indicator. (Scintilla feature 2081)</summary>
public IndicatorStyle IndicGetStyle(int indicator)
{
return (IndicatorStyle)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, (IntPtr) indicator, (IntPtr) Unused);
}
/// <summary>Set the foreground colour of an indicator. (Scintilla feature 2082)</summary>
public void IndicSetFore(int indicator, Colour fore)
{
Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, (IntPtr) indicator, fore.Value);
}
/// <summary>Retrieve the foreground colour of an indicator. (Scintilla feature 2083)</summary>
public Colour IndicGetFore(int indicator)
{
return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, (IntPtr) indicator, (IntPtr) Unused));
}
/// <summary>Set an indicator to draw under text or over(default). (Scintilla feature 2510)</summary>
public void IndicSetUnder(int indicator, bool under)
{
Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, (IntPtr) indicator, new IntPtr(under ? 1 : 0));
}