forked from bruderstein/PythonScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScintillaWrapper.h
More file actions
2980 lines (2272 loc) · 87.4 KB
/
ScintillaWrapper.h
File metadata and controls
2980 lines (2272 loc) · 87.4 KB
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
#ifndef _SCINTILLAWRAPPER_H
#define _SCINTILLAWRAPPER_H
#ifndef _SCINTILLACELL_H
#include "ScintillaCells.h"
#endif
#ifndef _PYPRODUCER_H
#include "PyProducerConsumer.h"
#endif
#ifndef REPLACER_20140209_H
#include "Replacer.h"
#endif
#ifndef CALLBACKEXECARGS_20140217_H
#include "CallbackExecArgs.h"
#endif
#include "MutexHolder.h"
#include "GILManager.h"
struct SCNotification;
#define COLOUR_RED(x) (x & 0x0000FF)
#define COLOUR_GREEN(x) ((x & 0x00FF00) >> 8)
#define COLOUR_BLUE(x) ((x & 0xFF0000) >> 16)
#define MAKECOLOUR(x) RGB(boost::python::extract<int>(x[0]),boost::python::extract<int>(x[1]),boost::python::extract<int>(x[2]))
struct out_of_bounds_exception : public std::exception
{
const char * what() const throw() { return "Out of bounds exception"; }
};
namespace NppPythonScript
{
void translateOutOfBounds(out_of_bounds_exception const& e);
class Match;
class ReplaceEntry;
class ScintillaCallback;
// Function that throws a notsupported exception, with the message about the method being deprecated
boost::python::object deprecated_replace_function(boost::python::tuple args, boost::python::dict kwargs);
class ScintillaWrapper : public PyProducerConsumer<CallbackExecArgs>
{
public:
explicit ScintillaWrapper(HWND handle, HWND notepadHandle);
virtual ~ScintillaWrapper();
void setHandle(const HWND handle) { m_handle = handle; };
HWND getHandle() { return m_handle; };
void invalidateHandle() { m_handle = NULL; };
void notify(SCNotification *notifyCode);
bool addSyncCallback(PyObject* callback, boost::python::list events);
bool addAsyncCallback(PyObject *callback, boost::python::list events);
bool addCallbackImpl(PyObject *callback, boost::python::list events, bool isAsync);
void clearAllCallbacks();
void clearCallbackFunction(PyObject* callback);
void clearCallbackEvents(boost::python::list events);
void clearCallback(PyObject* callback, boost::python::list events);
/* Helper functions
* These functions are designed to make life easier for scripting,
* but don't perform any "magic"
*/
void forEachLine(PyObject* function);
void deleteLine(int lineNumber);
void replaceLine(int lineNumber, boost::python::object newContents);
void replaceWholeLine(int lineNumber, boost::python::object newContents);
boost::python::tuple getUserLineSelection();
boost::python::tuple getUserCharSelection();
void setTarget(int start, int end);
/** Returns the flag to be combined with the re flag constants, in order to set the
* re anchors to treat the document as a whole, a not per line. ie. ^ matches the start of the document,
* and $ matches the end. Default is ^ matches start of line, $ the end.
*/
static int getWholeDocFlag() { return python_re_flag_wholedoc; }
void replacePlain(boost::python::object searchStr, boost::python::object replaceStr);
void replacePlainFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags);
void replacePlainFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition);
void replacePlainFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition);
void replacePlainFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int startPosition, int endPosition, int maxCount);
void replaceRegex(boost::python::object searchStr, boost::python::object replaceStr);
void replaceRegexFlags(boost::python::object searchStr, boost::python::object replaceStr, int flags);
void replaceRegexFlagsStart(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start);
void replaceRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end);
void replaceRegexFlagsStartEndMaxCount(boost::python::object searchStr, boost::python::object replaceStr, int flags, int start, int end, int maxCount);
void replaceImpl(boost::python::object searchStr, boost::python::object replaceStr, int count, python_re_flags flags, int startPosition, int endPosition);
void searchPlain(boost::python::object searchStr, boost::python::object matchFunction);
void searchPlainFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags);
void searchPlainFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition);
void searchPlainFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition);
void searchPlainFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount);
void searchRegex(boost::python::object searchStr, boost::python::object matchFunction);
void searchRegexFlags(boost::python::object searchStr, boost::python::object matchFunction, int flags);
void searchRegexFlagsStart(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition);
void searchRegexFlagsStartEnd(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition);
void searchRegexFlagsStartEndCount(boost::python::object searchStr, boost::python::object matchFunction, int flags, int startPosition, int endPosition, int maxCount);
void searchPlainImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, int flags, int startPosition, int endPosition);
void searchImpl(boost::python::object searchStr, boost::python::object matchFunction, int maxCount, python_re_flags flags, int startPosition, int endPosition);
//static const int RE_INCLUDELINEENDINGS = 65536;
/*
void pyreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine, boost::python::object endLine);
void pyreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr)
{ pyreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); };
void pyreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count)
{ pyreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); };
void pyreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags)
{ pyreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); };
void pyreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startLine)
{ pyreplace(searchExp, replaceStr, count, flags, startLine, boost::python::object()); };
void pymlreplace(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition);
void pymlreplaceNoFlagsNoCount(boost::python::object searchExp, boost::python::object replaceStr)
{ pymlreplace(searchExp, replaceStr, boost::python::object(0), boost::python::object(0), boost::python::object(), boost::python::object()); };
void pymlreplaceNoFlags(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count)
{ pymlreplace(searchExp, replaceStr, count, boost::python::object(0), boost::python::object(), boost::python::object()); };
void pymlreplaceNoStartEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags)
{ pymlreplace(searchExp, replaceStr, count, flags, boost::python::object(), boost::python::object()); };
void pymlreplaceNoEnd(boost::python::object searchExp, boost::python::object replaceStr, boost::python::object count, boost::python::object flags, boost::python::object startPosition)
{ pymlreplace(searchExp, replaceStr, count, flags, startPosition, boost::python::object()); };
void pysearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine, boost::python::object endLine);
void pysearchNoFlags(boost::python::object searchExp, boost::python::object callback)
{ pysearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); };
void pysearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags)
{ pysearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); };
void pysearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startLine)
{ pysearch(searchExp, callback, flags, startLine, boost::python::object()); };
void pymlsearch(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition, boost::python::object endPosition);
void pymlsearchNoFlags(boost::python::object searchExp, boost::python::object callback)
{ pymlsearch(searchExp, callback, boost::python::object(0), boost::python::object(), boost::python::object()); };
void pymlsearchNoStartEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags)
{ pymlsearch(searchExp, callback, flags, boost::python::object(), boost::python::object()); };
void pymlsearchNoEnd(boost::python::object searchExp, boost::python::object callback, boost::python::object flags, boost::python::object startPosition)
{ pymlsearch(searchExp, callback, flags, startPosition, boost::python::object()); };
*/
boost::python::str getWord(boost::python::object position, boost::python::object useOnlyWordChars);
boost::python::str getWordNoFlags(boost::python::object position)
{ return getWord(position, boost::python::object(true)); };
boost::python::str getCurrentWord()
{ return getWord(boost::python::object(), boost::python::object(true)); };
// This "normal" Scintilla function has been implemented manually, as it returns a pointer, which we can convert to a string
boost::python::str GetCharacterPointer();
// This "normal" Scintilla function has been implemented manually, as it returns a pointer, which we can convert to a string
boost::python::str GetRangePointer(int position, int length);
/** This helper function gets a std::string from the given object.
* If the object is a unicode string, it converts the string to UTF-8.
* If it's an object, it calls the __str__ method to convert the object to a string
*/
std::string getStringFromObject(boost::python::object o);
/* ++Autogenerated ---------------------------------------------------- */
/** Add text to the document at current position.
*/
int AddText(boost::python::object text);
/** Add array of cells to document.
*/
int AddStyledText(ScintillaCells c);
/** Insert string at a position.
*/
void InsertText(int pos, boost::python::object text);
/** Delete all text in the document.
*/
void ClearAll();
/** Delete a range of text in the document.
*/
void DeleteRange(int pos, int deleteLength);
/** Set all style bytes to 0, remove all folding information.
*/
void ClearDocumentStyle();
/** Returns the number of bytes in the document.
*/
int GetLength();
/** Returns the character byte at the position.
*/
int GetCharAt(int pos);
/** Returns the position of the caret.
*/
int GetCurrentPos();
/** Returns the position of the opposite end of the selection to the caret.
*/
int GetAnchor();
/** Returns the style byte at the position.
*/
int GetStyleAt(int pos);
/** Redoes the next action on the undo history.
*/
void Redo();
/** Choose between collecting actions into the undo
* history and discarding them.
*/
void SetUndoCollection(bool collectUndo);
/** Select all the text in the document.
*/
void SelectAll();
/** Remember the current position in the undo history as the position
* at which the document was saved.
*/
void SetSavePoint();
/** Retrieve a buffer of cells.
* Returns the number of bytes in the buffer not including terminating NULs.
*/
boost::python::tuple GetStyledText(int start, int end);
/** Are there any redoable actions in the undo history?
*/
bool CanRedo();
/** Retrieve the line number at which a particular marker is located.
*/
int MarkerLineFromHandle(int handle);
/** Delete a marker.
*/
void MarkerDeleteHandle(int handle);
/** Is undo history being collected?
*/
bool GetUndoCollection();
/** Are white space characters currently visible?
* Returns one of SCWS_* constants.
*/
int GetViewWS();
/** Make white space characters invisible, always visible or visible outside indentation.
*/
void SetViewWS(int viewWS);
/** Find the position from a point within the window.
*/
int PositionFromPoint(int x, int y);
/** Find the position from a point within the window but return
* INVALID_POSITION if not close to text.
*/
int PositionFromPointClose(int x, int y);
/** Set caret to start of a line and ensure it is visible.
*/
void GotoLine(int line);
/** Set caret to a position and ensure it is visible.
*/
void GotoPos(int pos);
/** Set the selection anchor to a position. The anchor is the opposite
* end of the selection from the caret.
*/
void SetAnchor(int posAnchor);
/** Retrieve the text of the line containing the caret.
* Returns the index of the caret on the line.
*/
boost::python::str GetCurLine();
/** Retrieve the position of the last correctly styled character.
*/
int GetEndStyled();
/** Convert all line endings in the document to one mode.
*/
void ConvertEOLs(int eolMode);
/** Retrieve the current end of line mode - one of CRLF, CR, or LF.
*/
int GetEOLMode();
/** Set the current end of line mode.
*/
void SetEOLMode(int eolMode);
/** Set the current styling position to pos and the styling mask to mask.
* The styling mask can be used to protect some bits in each styling byte from modification.
*/
void StartStyling(int pos, int mask);
/** Change style from current styling position for length characters to a style
* and move the current styling position to after this newly styled segment.
*/
void SetStyling(int length, int style);
/** Is drawing done first into a buffer or direct to the screen?
*/
bool GetBufferedDraw();
/** If drawing is buffered then each line of text is drawn into a bitmap buffer
* before drawing it to the screen to avoid flicker.
*/
void SetBufferedDraw(bool buffered);
/** Change the visible size of a tab to be a multiple of the width of a space character.
*/
void SetTabWidth(int tabWidth);
/** Retrieve the visible size of a tab.
*/
int GetTabWidth();
/** 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.
*/
void SetCodePage(int codePage);
/** Set the symbol used for a particular marker number.
*/
void MarkerDefine(int markerNumber, int markerSymbol);
/** Set the foreground colour used for a particular marker number.
*/
void MarkerSetFore(int markerNumber, boost::python::tuple fore);
/** Set the background colour used for a particular marker number.
*/
void MarkerSetBack(int markerNumber, boost::python::tuple back);
/** Set the background colour used for a particular marker number when its folding block is selected.
*/
void MarkerSetBackSelected(int markerNumber, boost::python::tuple back);
/** Enable/disable highlight for current folding bloc (smallest one that contains the caret)
*/
void MarkerEnableHighlight(bool enabled);
/** Add a marker to a line, returning an ID which can be used to find or delete the marker.
*/
int MarkerAdd(int line, int markerNumber);
/** Delete a marker from a line.
*/
void MarkerDelete(int line, int markerNumber);
/** Delete all markers with a particular number from all lines.
*/
void MarkerDeleteAll(int markerNumber);
/** Get a bit mask of all the markers set on a line.
*/
int MarkerGet(int line);
/** Find the next line at or after lineStart that includes a marker in mask.
* Return -1 when no more lines.
*/
int MarkerNext(int lineStart, int markerMask);
/** Find the previous line before lineStart that includes a marker in mask.
*/
int MarkerPrevious(int lineStart, int markerMask);
/** Define a marker from a pixmap.
*/
void MarkerDefinePixmap(int markerNumber, boost::python::object pixmap);
/** Add a set of markers to a line.
*/
void MarkerAddSet(int line, int set);
/** Set the alpha used for a marker that is drawn in the text area, not the margin.
*/
void MarkerSetAlpha(int markerNumber, int alpha);
/** Set a margin to be either numeric or symbolic.
*/
void SetMarginTypeN(int margin, int marginType);
/** Retrieve the type of a margin.
*/
int GetMarginTypeN(int margin);
/** Set the width of a margin to a width expressed in pixels.
*/
void SetMarginWidthN(int margin, int pixelWidth);
/** Retrieve the width of a margin in pixels.
*/
int GetMarginWidthN(int margin);
/** Set a mask that determines which markers are displayed in a margin.
*/
void SetMarginMaskN(int margin, int mask);
/** Retrieve the marker mask of a margin.
*/
int GetMarginMaskN(int margin);
/** Make a margin sensitive or insensitive to mouse clicks.
*/
void SetMarginSensitiveN(int margin, bool sensitive);
/** Retrieve the mouse click sensitivity of a margin.
*/
bool GetMarginSensitiveN(int margin);
/** Set the cursor shown when the mouse is inside a margin.
*/
void SetMarginCursorN(int margin, int cursor);
/** Retrieve the cursor shown in a margin.
*/
int GetMarginCursorN(int margin);
/** Clear all the styles and make equivalent to the global default style.
*/
void StyleClearAll();
/** Set the foreground colour of a style.
*/
void StyleSetFore(int style, boost::python::tuple fore);
/** Set the background colour of a style.
*/
void StyleSetBack(int style, boost::python::tuple back);
/** Set a style to be bold or not.
*/
void StyleSetBold(int style, bool bold);
/** Set a style to be italic or not.
*/
void StyleSetItalic(int style, bool italic);
/** Set the size of characters of a style.
*/
void StyleSetSize(int style, int sizePoints);
/** Set the font of a style.
*/
void StyleSetFont(int style, boost::python::object fontName);
/** Set a style to have its end of line filled or not.
*/
void StyleSetEOLFilled(int style, bool filled);
/** Reset the default style to its state at startup
*/
void StyleResetDefault();
/** Set a style to be underlined or not.
*/
void StyleSetUnderline(int style, bool underline);
/** Get the foreground colour of a style.
*/
boost::python::tuple StyleGetFore(int style);
/** Get the background colour of a style.
*/
boost::python::tuple StyleGetBack(int style);
/** Get is a style bold or not.
*/
bool StyleGetBold(int style);
/** Get is a style italic or not.
*/
bool StyleGetItalic(int style);
/** Get the size of characters of a style.
*/
int StyleGetSize(int style);
/** Get the font of a style.
* Returns the length of the fontName
*/
boost::python::str StyleGetFont(int style);
/** Get is a style to have its end of line filled or not.
*/
bool StyleGetEOLFilled(int style);
/** Get is a style underlined or not.
*/
bool StyleGetUnderline(int style);
/** Get is a style mixed case, or to force upper or lower case.
*/
int StyleGetCase(int style);
/** Get the character get of the font in a style.
*/
int StyleGetCharacterSet(int style);
/** Get is a style visible or not.
*/
bool StyleGetVisible(int style);
/** Get is a style changeable or not (read only).
* Experimental feature, currently buggy.
*/
bool StyleGetChangeable(int style);
/** Get is a style a hotspot or not.
*/
bool StyleGetHotSpot(int style);
/** Set a style to be mixed case, or to force upper or lower case.
*/
void StyleSetCase(int style, int caseForce);
/** Set the size of characters of a style. Size is in points multiplied by 100.
*/
void StyleSetSizeFractional(int style, int caseForce);
/** Get the size of characters of a style in points multiplied by 100
*/
int StyleGetSizeFractional(int style);
/** Set the weight of characters of a style.
*/
void StyleSetWeight(int style, int weight);
/** Get the weight of characters of a style.
*/
int StyleGetWeight(int style);
/** Set the character set of the font in a style.
*/
void StyleSetCharacterSet(int style, int characterSet);
/** Set a style to be a hotspot or not.
*/
void StyleSetHotSpot(int style, bool hotspot);
/** Set the foreground colour of the main and additional selections and whether to use this setting.
*/
void SetSelFore(bool useSetting, boost::python::tuple fore);
/** Set the background colour of the main and additional selections and whether to use this setting.
*/
void SetSelBack(bool useSetting, boost::python::tuple back);
/** Get the alpha of the selection.
*/
int GetSelAlpha();
/** Set the alpha of the selection.
*/
void SetSelAlpha(int alpha);
/** Is the selection end of line filled?
*/
bool GetSelEOLFilled();
/** Set the selection to have its end of line filled or not.
*/
void SetSelEOLFilled(bool filled);
/** Set the foreground colour of the caret.
*/
void SetCaretFore(boost::python::tuple fore);
/** When key+modifier combination km is pressed perform msg.
*/
void AssignCmdKey(int km, int msg);
/** When key+modifier combination km is pressed do nothing.
*/
void ClearCmdKey(int km);
/** Drop all key mappings.
*/
void ClearAllCmdKeys();
/** Set the styles for a segment of the document.
*/
int SetStylingEx(boost::python::object styles);
/** Set a style to be visible or not.
*/
void StyleSetVisible(int style, bool visible);
/** Get the time in milliseconds that the caret is on and off.
*/
int GetCaretPeriod();
/** Get the time in milliseconds that the caret is on and off. 0 = steady on.
*/
void SetCaretPeriod(int periodMilliseconds);
/** Set the set of characters making up words for when moving or selecting by word.
* First sets defaults like SetCharsDefault.
*/
void SetWordChars(boost::python::object characters);
/** Get the set of characters making up words for when moving or selecting by word.
* Retuns the number of characters
*/
boost::python::str GetWordChars();
/** Start a sequence of actions that is undone and redone as a unit.
* May be nested.
*/
void BeginUndoAction();
/** End a sequence of actions that is undone and redone as a unit.
*/
void EndUndoAction();
/** Set an indicator to plain, squiggle or TT.
*/
void IndicSetStyle(int indic, int style);
/** Retrieve the style of an indicator.
*/
int IndicGetStyle(int indic);
/** Set the foreground colour of an indicator.
*/
void IndicSetFore(int indic, boost::python::tuple fore);
/** Retrieve the foreground colour of an indicator.
*/
boost::python::tuple IndicGetFore(int indic);
/** Set an indicator to draw under text or over(default).
*/
void IndicSetUnder(int indic, bool under);
/** Retrieve whether indicator drawn under or over text.
*/
bool IndicGetUnder(int indic);
/** Set the foreground colour of all whitespace and whether to use this setting.
*/
void SetWhitespaceFore(bool useSetting, boost::python::tuple fore);
/** Set the background colour of all whitespace and whether to use this setting.
*/
void SetWhitespaceBack(bool useSetting, boost::python::tuple back);
/** Set the size of the dots used to mark space characters.
*/
void SetWhitespaceSize(int size);
/** Get the size of the dots used to mark space characters.
*/
int GetWhitespaceSize();
/** Divide each styling byte into lexical class bits (default: 5) and indicator
* bits (default: 3). If a lexer requires more than 32 lexical states, then this
* is used to expand the possible states.
*/
void SetStyleBits(int bits);
/** Retrieve number of bits in style bytes used to hold the lexical state.
*/
int GetStyleBits();
/** Used to hold extra styling information for each line.
*/
void SetLineState(int line, int state);
/** Retrieve the extra styling information for a line.
*/
int GetLineState(int line);
/** Retrieve the last line number that has line state.
*/
int GetMaxLineState();
/** Is the background of the line containing the caret in a different colour?
*/
bool GetCaretLineVisible();
/** Display the background of the line containing the caret in a different colour.
*/
void SetCaretLineVisible(bool show);
/** Get the colour of the background of the line containing the caret.
*/
boost::python::tuple GetCaretLineBack();
/** Set the colour of the background of the line containing the caret.
*/
void SetCaretLineBack(boost::python::tuple back);
/** Set a style to be changeable or not (read only).
* Experimental feature, currently buggy.
*/
void StyleSetChangeable(int style, bool changeable);
/** Display a auto-completion list.
* The lenEntered parameter indicates how many characters before
* the caret should be used to provide context.
*/
void AutoCShow(int lenEntered, boost::python::object itemList);
/** Remove the auto-completion list from the screen.
*/
void AutoCCancel();
/** Is there an auto-completion list visible?
*/
bool AutoCActive();
/** Retrieve the position of the caret when the auto-completion list was displayed.
*/
int AutoCPosStart();
/** User has selected an item so remove the list and insert the selection.
*/
void AutoCComplete();
/** Define a set of character that when typed cancel the auto-completion list.
*/
void AutoCStops(boost::python::object characterSet);
/** Change the separator character in the string setting up an auto-completion list.
* Default is space but can be changed if items contain space.
*/
void AutoCSetSeparator(int separatorCharacter);
/** Retrieve the auto-completion list separator character.
*/
int AutoCGetSeparator();
/** Select the item in the auto-completion list that starts with a string.
*/
void AutoCSelect(boost::python::object text);
/** Should the auto-completion list be cancelled if the user backspaces to a
* position before where the box was created.
*/
void AutoCSetCancelAtStart(bool cancel);
/** Retrieve whether auto-completion cancelled by backspacing before start.
*/
bool AutoCGetCancelAtStart();
/** Define a set of characters that when typed will cause the autocompletion to
* choose the selected item.
*/
void AutoCSetFillUps(boost::python::object characterSet);
/** Should a single item auto-completion list automatically choose the item.
*/
void AutoCSetChooseSingle(bool chooseSingle);
/** Retrieve whether a single item auto-completion list automatically choose the item.
*/
bool AutoCGetChooseSingle();
/** Set whether case is significant when performing auto-completion searches.
*/
void AutoCSetIgnoreCase(bool ignoreCase);
/** Retrieve state of ignore case flag.
*/
bool AutoCGetIgnoreCase();
/** Display a list of strings and send notification when user chooses one.
*/
void UserListShow(int listType, boost::python::object itemList);
/** Set whether or not autocompletion is hidden automatically when nothing matches.
*/
void AutoCSetAutoHide(bool autoHide);
/** Retrieve whether or not autocompletion is hidden automatically when nothing matches.
*/
bool AutoCGetAutoHide();
/** Set whether or not autocompletion deletes any word characters
* after the inserted text upon completion.
*/
void AutoCSetDropRestOfWord(bool dropRestOfWord);
/** Retrieve whether or not autocompletion deletes any word characters
* after the inserted text upon completion.
*/
bool AutoCGetDropRestOfWord();
/** Register an XPM image for use in autocompletion lists.
*/
void RegisterImage(int type, boost::python::object xpmData);
/** Clear all the registered XPM images.
*/
void ClearRegisteredImages();
/** Retrieve the auto-completion list type-separator character.
*/
int AutoCGetTypeSeparator();
/** Change the type-separator character in the string setting up an auto-completion list.
* Default is '?' but can be changed if items contain '?'.
*/
void AutoCSetTypeSeparator(int separatorCharacter);
/** Set the maximum width, in characters, of auto-completion and user lists.
* Set to 0 to autosize to fit longest item, which is the default.
*/
void AutoCSetMaxWidth(int characterCount);
/** Get the maximum width, in characters, of auto-completion and user lists.
*/
int AutoCGetMaxWidth();
/** Set the maximum height, in rows, of auto-completion and user lists.
* The default is 5 rows.
*/
void AutoCSetMaxHeight(int rowCount);
/** Set the maximum height, in rows, of auto-completion and user lists.
*/
int AutoCGetMaxHeight();
/** Set the number of spaces used for one level of indentation.
*/
void SetIndent(int indentSize);
/** Retrieve indentation size.
*/
int GetIndent();
/** Indentation will only use space characters if useTabs is false, otherwise
* it will use a combination of tabs and spaces.
*/
void SetUseTabs(bool useTabs);
/** Retrieve whether tabs will be used in indentation.
*/
bool GetUseTabs();
/** Change the indentation of a line to a number of columns.
*/
void SetLineIndentation(int line, int indentSize);
/** Retrieve the number of columns that a line is indented.
*/
int GetLineIndentation(int line);
/** Retrieve the position before the first non indentation character on a line.
*/
int GetLineIndentPosition(int line);
/** Retrieve the column number of a position, taking tab width into account.
*/
int GetColumn(int pos);
/** Count characters between two positions.
*/
int CountCharacters(int startPos, int endPos);
/** Show or hide the horizontal scroll bar.
*/
void SetHScrollBar(bool show);
/** Is the horizontal scroll bar visible?
*/
bool GetHScrollBar();
/** Show or hide indentation guides.
*/
void SetIndentationGuides(int indentView);
/** Are the indentation guides visible?
*/
int GetIndentationGuides();
/** Set the highlighted indentation guide column.
* 0 = no highlighted guide.
*/
void SetHighlightGuide(int column);
/** Get the highlighted indentation guide column.
*/
int GetHighlightGuide();
/** Get the position after the last visible characters on a line.
*/
int GetLineEndPosition(int line);
/** Get the code page used to interpret the bytes of the document as characters.
*/
int GetCodePage();
/** Get the foreground colour of the caret.
*/
boost::python::tuple GetCaretFore();
/** In read-only mode?
*/
bool GetReadOnly();
/** Sets the position of the caret.
*/
void SetCurrentPos(int pos);
/** Sets the position that starts the selection - this becomes the anchor.
*/
void SetSelectionStart(int pos);
/** Returns the position at the start of the selection.
*/
int GetSelectionStart();
/** Sets the position that ends the selection - this becomes the currentPosition.
*/
void SetSelectionEnd(int pos);
/** Returns the position at the end of the selection.
*/
int GetSelectionEnd();
/** Set caret to a position, while removing any existing selection.
*/
void SetEmptySelection(int pos);
/** Sets the print magnification added to the point size of each style for printing.
*/
void SetPrintMagnification(int magnification);
/** Returns the print magnification.
*/
int GetPrintMagnification();
/** Modify colours when printing for clearer printed text.
*/
void SetPrintColourMode(int mode);
/** Returns the print colour mode.
*/
int GetPrintColourMode();
/** Find some text in the document.
*/
boost::python::object FindText(int flags, int start, int end, boost::python::object ft);
/** Retrieve the display line at the top of the display.
*/
int GetFirstVisibleLine();
/** Retrieve the contents of a line.
* Returns the length of the line.
*/
boost::python::str GetLine(int line);
/** Returns the number of lines in the document. There is always at least one.
*/
int GetLineCount();
/** Sets the size in pixels of the left margin.
*/
void SetMarginLeft(int pixelWidth);
/** Returns the size in pixels of the left margin.
*/
int GetMarginLeft();
/** Sets the size in pixels of the right margin.
*/
void SetMarginRight(int pixelWidth);
/** Returns the size in pixels of the right margin.
*/
int GetMarginRight();
/** Is the document different from when it was last saved?
*/
bool GetModify();