1 // Scintilla source code edit control
2 /** @file ScintillaBase.cxx
3 ** An enhanced subclass of Editor with calltips, autocomplete and context menu.
5 // Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
21 #include "Scintilla.h"
23 #include "PropSetSimple.h"
26 #include "LexerModule.h"
27 #include "Catalogue.h"
29 #include "SplitVector.h"
30 #include "Partitioning.h"
31 #include "RunStyles.h"
32 #include "ContractionState.h"
33 #include "CellBuffer.h"
36 #include "Indicator.h"
38 #include "LineMarker.h"
40 #include "ViewStyle.h"
41 #include "AutoComplete.h"
42 #include "CharClassify.h"
43 #include "Decoration.h"
45 #include "Selection.h"
46 #include "PositionCache.h"
48 #include "ScintillaBase.h"
51 using namespace Scintilla
;
54 ScintillaBase::ScintillaBase() {
55 displayPopupMenu
= true;
60 ScintillaBase::~ScintillaBase() {
63 void ScintillaBase::Finalise() {
68 void ScintillaBase::RefreshColourPalette(Palette
&pal
, bool want
) {
69 Editor::RefreshColourPalette(pal
, want
);
70 ct
.RefreshColourPalette(pal
, want
);
73 void ScintillaBase::AddCharUTF(char *s
, unsigned int len
, bool treatAsDBCS
) {
74 bool isFillUp
= ac
.Active() && ac
.IsFillUpChar(*s
);
76 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
79 AutoCompleteCharacterAdded(s
[0]);
80 // For fill ups add the character after the autocompletion has
81 // triggered so containers see the key so can display a calltip.
83 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
88 void ScintillaBase::Command(int cmdId
) {
92 case idAutoComplete
: // Nothing to do
96 case idCallTip
: // Nothing to do
101 WndProc(SCI_UNDO
, 0, 0);
105 WndProc(SCI_REDO
, 0, 0);
109 WndProc(SCI_CUT
, 0, 0);
113 WndProc(SCI_COPY
, 0, 0);
117 WndProc(SCI_PASTE
, 0, 0);
121 WndProc(SCI_CLEAR
, 0, 0);
125 WndProc(SCI_SELECTALL
, 0, 0);
130 int ScintillaBase::KeyCommand(unsigned int iMessage
) {
131 // Most key commands cancel autocompletion mode
139 AutoCompleteMove(-1);
145 AutoCompleteMove(-5);
148 AutoCompleteMove(-5000);
151 AutoCompleteMove(5000);
155 AutoCompleteCharacterDeleted();
156 EnsureCaretVisible();
158 case SCI_DELETEBACKNOTLINE
:
160 AutoCompleteCharacterDeleted();
161 EnsureCaretVisible();
164 AutoCompleteCompleted();
167 AutoCompleteCompleted();
171 AutoCompleteCancel();
175 if (ct
.inCallTipMode
) {
177 (iMessage
!= SCI_CHARLEFT
) &&
178 (iMessage
!= SCI_CHARLEFTEXTEND
) &&
179 (iMessage
!= SCI_CHARRIGHT
) &&
180 (iMessage
!= SCI_CHARRIGHTEXTEND
) &&
181 (iMessage
!= SCI_EDITTOGGLEOVERTYPE
) &&
182 (iMessage
!= SCI_DELETEBACK
) &&
183 (iMessage
!= SCI_DELETEBACKNOTLINE
)
187 if ((iMessage
== SCI_DELETEBACK
) || (iMessage
== SCI_DELETEBACKNOTLINE
)) {
188 if (sel
.MainCaret() <= ct
.posStartCallTip
) {
193 return Editor::KeyCommand(iMessage
);
196 void ScintillaBase::AutoCompleteDoubleClick(void *p
) {
197 ScintillaBase
*sci
= reinterpret_cast<ScintillaBase
*>(p
);
198 sci
->AutoCompleteCompleted();
201 void ScintillaBase::AutoCompleteStart(int lenEntered
, const char *list
) {
202 //Platform::DebugPrintf("AutoComplete %s\n", list);
205 if (ac
.chooseSingle
&& (listType
== 0)) {
206 if (list
&& !strchr(list
, ac
.GetSeparator())) {
207 const char *typeSep
= strchr(list
, ac
.GetTypesep());
208 int lenInsert
= typeSep
?
209 static_cast<int>(typeSep
-list
) : static_cast<int>(strlen(list
));
211 SetEmptySelection(sel
.MainCaret() - lenEntered
);
212 pdoc
->DeleteChars(sel
.MainCaret(), lenEntered
);
213 SetEmptySelection(sel
.MainCaret());
214 pdoc
->InsertString(sel
.MainCaret(), list
, lenInsert
);
215 SetEmptySelection(sel
.MainCaret() + lenInsert
);
217 SetEmptySelection(sel
.MainCaret());
218 pdoc
->InsertString(sel
.MainCaret(), list
+ lenEntered
, lenInsert
- lenEntered
);
219 SetEmptySelection(sel
.MainCaret() + lenInsert
- lenEntered
);
224 ac
.Start(wMain
, idAutoComplete
, sel
.MainCaret(), PointMainCaret(),
225 lenEntered
, vs
.lineHeight
, IsUnicodeMode());
227 PRectangle rcClient
= GetClientRectangle();
228 Point pt
= LocationFromPosition(sel
.MainCaret() - lenEntered
);
229 PRectangle rcPopupBounds
= wMain
.GetMonitorRect(pt
);
230 if (rcPopupBounds
.Height() == 0)
231 rcPopupBounds
= rcClient
;
235 if (pt
.x
>= rcClient
.right
- widthLB
) {
236 HorizontalScrollTo(xOffset
+ pt
.x
- rcClient
.right
+ widthLB
);
238 pt
= PointMainCaret();
241 rcac
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
242 if (pt
.y
>= rcPopupBounds
.bottom
- heightLB
&& // Wont fit below.
243 pt
.y
>= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2) { // and there is more room above.
244 rcac
.top
= pt
.y
- heightLB
;
245 if (rcac
.top
< rcPopupBounds
.top
) {
246 heightLB
-= (rcPopupBounds
.top
- rcac
.top
);
247 rcac
.top
= rcPopupBounds
.top
;
250 rcac
.top
= pt
.y
+ vs
.lineHeight
;
252 rcac
.right
= rcac
.left
+ widthLB
;
253 rcac
.bottom
= Platform::Minimum(rcac
.top
+ heightLB
, rcPopupBounds
.bottom
);
254 ac
.lb
->SetPositionRelative(rcac
, wMain
);
255 ac
.lb
->SetFont(vs
.styles
[STYLE_DEFAULT
].font
);
256 unsigned int aveCharWidth
= vs
.styles
[STYLE_DEFAULT
].aveCharWidth
;
257 ac
.lb
->SetAverageCharWidth(aveCharWidth
);
258 ac
.lb
->SetDoubleClickAction(AutoCompleteDoubleClick
, this);
262 // Fiddle the position of the list so it is right next to the target and wide enough for all its strings
263 PRectangle rcList
= ac
.lb
->GetDesiredRect();
264 int heightAlloced
= rcList
.bottom
- rcList
.top
;
265 widthLB
= Platform::Maximum(widthLB
, rcList
.right
- rcList
.left
);
266 if (maxListWidth
!= 0)
267 widthLB
= Platform::Minimum(widthLB
, aveCharWidth
*maxListWidth
);
268 // Make an allowance for large strings in list
269 rcList
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
270 rcList
.right
= rcList
.left
+ widthLB
;
271 if (((pt
.y
+ vs
.lineHeight
) >= (rcPopupBounds
.bottom
- heightAlloced
)) && // Wont fit below.
272 ((pt
.y
+ vs
.lineHeight
/ 2) >= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2)) { // and there is more room above.
273 rcList
.top
= pt
.y
- heightAlloced
;
275 rcList
.top
= pt
.y
+ vs
.lineHeight
;
277 rcList
.bottom
= rcList
.top
+ heightAlloced
;
278 ac
.lb
->SetPositionRelative(rcList
, wMain
);
280 if (lenEntered
!= 0) {
281 AutoCompleteMoveToCurrentWord();
285 void ScintillaBase::AutoCompleteCancel() {
287 SCNotification scn
= {0};
288 scn
.nmhdr
.code
= SCN_AUTOCCANCELLED
;
296 void ScintillaBase::AutoCompleteMove(int delta
) {
300 void ScintillaBase::AutoCompleteMoveToCurrentWord() {
301 char wordCurrent
[1000];
303 int startWord
= ac
.posStart
- ac
.startLen
;
304 for (i
= startWord
; i
< sel
.MainCaret() && i
- startWord
< 1000; i
++)
305 wordCurrent
[i
- startWord
] = pdoc
->CharAt(i
);
306 wordCurrent
[Platform::Minimum(i
- startWord
, 999)] = '\0';
307 ac
.Select(wordCurrent
);
310 void ScintillaBase::AutoCompleteCharacterAdded(char ch
) {
311 if (ac
.IsFillUpChar(ch
)) {
312 AutoCompleteCompleted();
313 } else if (ac
.IsStopChar(ch
)) {
314 AutoCompleteCancel();
316 AutoCompleteMoveToCurrentWord();
320 void ScintillaBase::AutoCompleteCharacterDeleted() {
321 if (sel
.MainCaret() < ac
.posStart
- ac
.startLen
) {
322 AutoCompleteCancel();
323 } else if (ac
.cancelAtStartPos
&& (sel
.MainCaret() <= ac
.posStart
)) {
324 AutoCompleteCancel();
326 AutoCompleteMoveToCurrentWord();
328 SCNotification scn
= {0};
329 scn
.nmhdr
.code
= SCN_AUTOCCHARDELETED
;
335 void ScintillaBase::AutoCompleteCompleted() {
336 int item
= ac
.lb
->GetSelection();
340 ac
.lb
->GetValue(item
, selected
, sizeof(selected
));
342 AutoCompleteCancel();
348 SCNotification scn
= {0};
349 scn
.nmhdr
.code
= listType
> 0 ? SCN_USERLISTSELECTION
: SCN_AUTOCSELECTION
;
351 scn
.wParam
= listType
;
352 scn
.listType
= listType
;
353 Position firstPos
= ac
.posStart
- ac
.startLen
;
354 scn
.position
= firstPos
;
355 scn
.lParam
= firstPos
;
366 Position endPos
= sel
.MainCaret();
367 if (ac
.dropRestOfWord
)
368 endPos
= pdoc
->ExtendWordSelect(endPos
, 1, true);
369 if (endPos
< firstPos
)
372 if (endPos
!= firstPos
) {
373 pdoc
->DeleteChars(firstPos
, endPos
- firstPos
);
375 SetEmptySelection(ac
.posStart
);
377 pdoc
->InsertCString(firstPos
, selected
);
378 SetEmptySelection(firstPos
+ static_cast<int>(strlen(selected
)));
383 int ScintillaBase::AutoCompleteGetCurrent() {
386 return ac
.lb
->GetSelection();
389 int ScintillaBase::AutoCompleteGetCurrentText(char *buffer
) {
391 int item
= ac
.lb
->GetSelection();
395 ac
.lb
->GetValue(item
, selected
, sizeof(selected
));
397 strcpy(buffer
, selected
);
398 return static_cast<int>(strlen(selected
));
406 void ScintillaBase::CallTipShow(Point pt
, const char *defn
) {
408 pt
.y
+= vs
.lineHeight
;
409 // If container knows about STYLE_CALLTIP then use it in place of the
410 // STYLE_DEFAULT for the face name, size and character set. Also use it
411 // for the foreground and background colour.
412 int ctStyle
= ct
.UseStyleCallTip() ? STYLE_CALLTIP
: STYLE_DEFAULT
;
413 if (ct
.UseStyleCallTip()) {
414 ct
.SetForeBack(vs
.styles
[STYLE_CALLTIP
].fore
, vs
.styles
[STYLE_CALLTIP
].back
);
416 PRectangle rc
= ct
.CallTipStart(sel
.MainCaret(), pt
,
418 vs
.styles
[ctStyle
].fontName
,
419 vs
.styles
[ctStyle
].sizeZoomed
,
421 vs
.styles
[ctStyle
].characterSet
,
423 // If the call-tip window would be out of the client
424 // space, adjust so it displays above the text.
425 PRectangle rcClient
= GetClientRectangle();
426 if (rc
.bottom
> rcClient
.bottom
) {
427 int offset
= vs
.lineHeight
+ rc
.Height();
431 // Now display the window.
432 CreateCallTipWindow(rc
);
433 ct
.wCallTip
.SetPositionRelative(rc
, wMain
);
437 void ScintillaBase::CallTipClick() {
438 SCNotification scn
= {0};
439 scn
.nmhdr
.code
= SCN_CALLTIPCLICK
;
440 scn
.position
= ct
.clickPlace
;
444 void ScintillaBase::ContextMenu(Point pt
) {
445 if (displayPopupMenu
) {
446 bool writable
= !WndProc(SCI_GETREADONLY
, 0, 0);
448 AddToPopUp("Undo", idcmdUndo
, writable
&& pdoc
->CanUndo());
449 AddToPopUp("Redo", idcmdRedo
, writable
&& pdoc
->CanRedo());
451 AddToPopUp("Cut", idcmdCut
, writable
&& !sel
.Empty());
452 AddToPopUp("Copy", idcmdCopy
, !sel
.Empty());
453 AddToPopUp("Paste", idcmdPaste
, writable
&& WndProc(SCI_CANPASTE
, 0, 0));
454 AddToPopUp("Delete", idcmdDelete
, writable
&& !sel
.Empty());
456 AddToPopUp("Select All", idcmdSelectAll
);
457 popup
.Show(pt
, wMain
);
461 void ScintillaBase::CancelModes() {
462 AutoCompleteCancel();
464 Editor::CancelModes();
467 void ScintillaBase::ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
) {
469 Editor::ButtonDown(pt
, curTime
, shift
, ctrl
, alt
);
475 namespace Scintilla
{
478 class LexState
: public LexInterface
{
479 const LexerModule
*lexCurrent
;
480 void SetLexerModule(const LexerModule
*lex
);
485 LexState(Document
*pdoc_
);
487 void SetLexer(uptr_t wParam
);
488 void SetLexerLanguage(const char *languageName
);
489 const char *DescribeWordListSets();
490 void SetWordList(int n
, const char *wl
);
491 int GetStyleBitsNeeded() const;
492 const char *GetName() const;
493 void *PrivateCall(int operation
, void *pointer
);
494 const char *PropertyNames();
495 int PropertyType(const char *name
);
496 const char *DescribeProperty(const char *name
);
497 void PropSet(const char *key
, const char *val
);
498 const char *PropGet(const char *key
) const;
499 int PropGetInt(const char *key
, int defaultValue
=0) const;
500 int PropGetExpanded(const char *key
, char *result
) const;
507 LexState::LexState(Document
*pdoc_
) : LexInterface(pdoc_
) {
509 performingStyle
= false;
510 lexLanguage
= SCLEX_CONTAINER
;
513 LexState::~LexState() {
520 LexState
*ScintillaBase::DocumentLexState() {
522 pdoc
->pli
= new LexState(pdoc
);
524 return static_cast<LexState
*>(pdoc
->pli
);
527 void LexState::SetLexerModule(const LexerModule
*lex
) {
528 if (lex
!= lexCurrent
) {
535 instance
= lexCurrent
->Create();
536 pdoc
->LexerChanged();
540 void LexState::SetLexer(uptr_t wParam
) {
541 lexLanguage
= wParam
;
542 if (lexLanguage
== SCLEX_CONTAINER
) {
545 const LexerModule
*lex
= Catalogue::Find(lexLanguage
);
547 lex
= Catalogue::Find(SCLEX_NULL
);
552 void LexState::SetLexerLanguage(const char *languageName
) {
553 const LexerModule
*lex
= Catalogue::Find(languageName
);
555 lex
= Catalogue::Find(SCLEX_NULL
);
557 lexLanguage
= lex
->GetLanguage();
561 const char *LexState::DescribeWordListSets() {
563 return instance
->DescribeWordListSets();
569 void LexState::SetWordList(int n
, const char *wl
) {
571 int firstModification
= instance
->WordListSet(n
, wl
);
572 if (firstModification
>= 0) {
573 pdoc
->ModifiedAt(firstModification
);
578 int LexState::GetStyleBitsNeeded() const {
579 return lexCurrent
? lexCurrent
->GetStyleBitsNeeded() : 5;
582 const char *LexState::GetName() const {
583 return lexCurrent
? lexCurrent
->languageName
: "";
586 void *LexState::PrivateCall(int operation
, void *pointer
) {
587 if (pdoc
&& instance
) {
588 return instance
->PrivateCall(operation
, pointer
);
594 const char *LexState::PropertyNames() {
596 return instance
->PropertyNames();
602 int LexState::PropertyType(const char *name
) {
604 return instance
->PropertyType(name
);
606 return SC_TYPE_BOOLEAN
;
610 const char *LexState::DescribeProperty(const char *name
) {
612 return instance
->DescribeProperty(name
);
618 void LexState::PropSet(const char *key
, const char *val
) {
621 int firstModification
= instance
->PropertySet(key
, val
);
622 if (firstModification
>= 0) {
623 pdoc
->ModifiedAt(firstModification
);
628 const char *LexState::PropGet(const char *key
) const {
629 return props
.Get(key
);
632 int LexState::PropGetInt(const char *key
, int defaultValue
) const {
633 return props
.GetInt(key
, defaultValue
);
636 int LexState::PropGetExpanded(const char *key
, char *result
) const {
637 return props
.GetExpanded(key
, result
);
642 void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded
) {
644 if (DocumentLexState()->lexLanguage
!= SCLEX_CONTAINER
) {
645 int lineEndStyled
= pdoc
->LineFromPosition(pdoc
->GetEndStyled());
646 int endStyled
= pdoc
->LineStart(lineEndStyled
);
647 DocumentLexState()->Colourise(endStyled
, endStyleNeeded
);
651 Editor::NotifyStyleToNeeded(endStyleNeeded
);
654 void ScintillaBase::NotifyLexerChanged(Document
*, void *) {
656 int bits
= DocumentLexState()->GetStyleBitsNeeded();
657 vs
.EnsureStyle((1 << bits
) - 1);
661 sptr_t
ScintillaBase::WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
) {
665 AutoCompleteStart(wParam
, reinterpret_cast<const char *>(lParam
));
668 case SCI_AUTOCCANCEL
:
672 case SCI_AUTOCACTIVE
:
675 case SCI_AUTOCPOSSTART
:
678 case SCI_AUTOCCOMPLETE
:
679 AutoCompleteCompleted();
682 case SCI_AUTOCSETSEPARATOR
:
683 ac
.SetSeparator(static_cast<char>(wParam
));
686 case SCI_AUTOCGETSEPARATOR
:
687 return ac
.GetSeparator();
690 ac
.SetStopChars(reinterpret_cast<char *>(lParam
));
693 case SCI_AUTOCSELECT
:
694 ac
.Select(reinterpret_cast<char *>(lParam
));
697 case SCI_AUTOCGETCURRENT
:
698 return AutoCompleteGetCurrent();
700 case SCI_AUTOCGETCURRENTTEXT
:
701 return AutoCompleteGetCurrentText(reinterpret_cast<char *>(lParam
));
703 case SCI_AUTOCSETCANCELATSTART
:
704 ac
.cancelAtStartPos
= wParam
!= 0;
707 case SCI_AUTOCGETCANCELATSTART
:
708 return ac
.cancelAtStartPos
;
710 case SCI_AUTOCSETFILLUPS
:
711 ac
.SetFillUpChars(reinterpret_cast<char *>(lParam
));
714 case SCI_AUTOCSETCHOOSESINGLE
:
715 ac
.chooseSingle
= wParam
!= 0;
718 case SCI_AUTOCGETCHOOSESINGLE
:
719 return ac
.chooseSingle
;
721 case SCI_AUTOCSETIGNORECASE
:
722 ac
.ignoreCase
= wParam
!= 0;
725 case SCI_AUTOCGETIGNORECASE
:
726 return ac
.ignoreCase
;
728 case SCI_USERLISTSHOW
:
730 AutoCompleteStart(0, reinterpret_cast<const char *>(lParam
));
733 case SCI_AUTOCSETAUTOHIDE
:
734 ac
.autoHide
= wParam
!= 0;
737 case SCI_AUTOCGETAUTOHIDE
:
740 case SCI_AUTOCSETDROPRESTOFWORD
:
741 ac
.dropRestOfWord
= wParam
!= 0;
744 case SCI_AUTOCGETDROPRESTOFWORD
:
745 return ac
.dropRestOfWord
;
747 case SCI_AUTOCSETMAXHEIGHT
:
748 ac
.lb
->SetVisibleRows(wParam
);
751 case SCI_AUTOCGETMAXHEIGHT
:
752 return ac
.lb
->GetVisibleRows();
754 case SCI_AUTOCSETMAXWIDTH
:
755 maxListWidth
= wParam
;
758 case SCI_AUTOCGETMAXWIDTH
:
761 case SCI_REGISTERIMAGE
:
762 ac
.lb
->RegisterImage(wParam
, reinterpret_cast<const char *>(lParam
));
765 case SCI_REGISTERRGBAIMAGE
:
766 ac
.lb
->RegisterRGBAImage(wParam
, sizeRGBAImage
.x
, sizeRGBAImage
.y
, reinterpret_cast<unsigned char *>(lParam
));
769 case SCI_CLEARREGISTEREDIMAGES
:
770 ac
.lb
->ClearRegisteredImages();
773 case SCI_AUTOCSETTYPESEPARATOR
:
774 ac
.SetTypesep(static_cast<char>(wParam
));
777 case SCI_AUTOCGETTYPESEPARATOR
:
778 return ac
.GetTypesep();
780 case SCI_CALLTIPSHOW
:
781 CallTipShow(LocationFromPosition(wParam
),
782 reinterpret_cast<const char *>(lParam
));
785 case SCI_CALLTIPCANCEL
:
789 case SCI_CALLTIPACTIVE
:
790 return ct
.inCallTipMode
;
792 case SCI_CALLTIPPOSSTART
:
793 return ct
.posStartCallTip
;
795 case SCI_CALLTIPSETHLT
:
796 ct
.SetHighlight(wParam
, lParam
);
799 case SCI_CALLTIPSETBACK
:
800 ct
.colourBG
= ColourDesired(wParam
);
801 vs
.styles
[STYLE_CALLTIP
].back
= ct
.colourBG
;
802 InvalidateStyleRedraw();
805 case SCI_CALLTIPSETFORE
:
806 ct
.colourUnSel
= ColourDesired(wParam
);
807 vs
.styles
[STYLE_CALLTIP
].fore
= ct
.colourUnSel
;
808 InvalidateStyleRedraw();
811 case SCI_CALLTIPSETFOREHLT
:
812 ct
.colourSel
= ColourDesired(wParam
);
813 InvalidateStyleRedraw();
816 case SCI_CALLTIPUSESTYLE
:
817 ct
.SetTabSize((int)wParam
);
818 InvalidateStyleRedraw();
822 displayPopupMenu
= wParam
!= 0;
827 DocumentLexState()->SetLexer(wParam
);
831 return DocumentLexState()->lexLanguage
;
834 if (DocumentLexState()->lexLanguage
== SCLEX_CONTAINER
) {
835 pdoc
->ModifiedAt(wParam
);
836 NotifyStyleToNeeded((lParam
== -1) ? pdoc
->Length() : lParam
);
838 DocumentLexState()->Colourise(wParam
, lParam
);
843 case SCI_SETPROPERTY
:
844 DocumentLexState()->PropSet(reinterpret_cast<const char *>(wParam
),
845 reinterpret_cast<const char *>(lParam
));
848 case SCI_GETPROPERTY
:
849 return StringResult(lParam
, DocumentLexState()->PropGet(reinterpret_cast<const char *>(wParam
)));
851 case SCI_GETPROPERTYEXPANDED
:
852 return DocumentLexState()->PropGetExpanded(reinterpret_cast<const char *>(wParam
),
853 reinterpret_cast<char *>(lParam
));
855 case SCI_GETPROPERTYINT
:
856 return DocumentLexState()->PropGetInt(reinterpret_cast<const char *>(wParam
), lParam
);
858 case SCI_SETKEYWORDS
:
859 DocumentLexState()->SetWordList(wParam
, reinterpret_cast<const char *>(lParam
));
862 case SCI_SETLEXERLANGUAGE
:
863 DocumentLexState()->SetLexerLanguage(reinterpret_cast<const char *>(lParam
));
866 case SCI_GETLEXERLANGUAGE
:
867 return StringResult(lParam
, DocumentLexState()->GetName());
869 case SCI_PRIVATELEXERCALL
:
870 return reinterpret_cast<sptr_t
>(
871 DocumentLexState()->PrivateCall(wParam
, reinterpret_cast<void *>(lParam
)));
873 case SCI_GETSTYLEBITSNEEDED
:
874 return DocumentLexState()->GetStyleBitsNeeded();
876 case SCI_PROPERTYNAMES
:
877 return StringResult(lParam
, DocumentLexState()->PropertyNames());
879 case SCI_PROPERTYTYPE
:
880 return DocumentLexState()->PropertyType(reinterpret_cast<const char *>(wParam
));
882 case SCI_DESCRIBEPROPERTY
:
883 return StringResult(lParam
, DocumentLexState()->DescribeProperty(reinterpret_cast<const char *>(wParam
)));
885 case SCI_DESCRIBEKEYWORDSETS
:
886 return StringResult(lParam
, DocumentLexState()->DescribeWordListSets());
891 return Editor::WndProc(iMessage
, wParam
, lParam
);