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.
20 #include "Scintilla.h"
22 #include "PropSetSimple.h"
25 #include "LexerModule.h"
26 #include "Catalogue.h"
28 #include "SplitVector.h"
29 #include "Partitioning.h"
30 #include "RunStyles.h"
31 #include "ContractionState.h"
32 #include "CellBuffer.h"
35 #include "Indicator.h"
37 #include "LineMarker.h"
39 #include "ViewStyle.h"
40 #include "AutoComplete.h"
41 #include "CharClassify.h"
42 #include "Decoration.h"
44 #include "Selection.h"
45 #include "PositionCache.h"
47 #include "ScintillaBase.h"
50 using namespace Scintilla
;
53 ScintillaBase::ScintillaBase() {
54 displayPopupMenu
= true;
59 ScintillaBase::~ScintillaBase() {
62 void ScintillaBase::Finalise() {
67 void ScintillaBase::RefreshColourPalette(Palette
&pal
, bool want
) {
68 Editor::RefreshColourPalette(pal
, want
);
69 ct
.RefreshColourPalette(pal
, want
);
72 void ScintillaBase::AddCharUTF(char *s
, unsigned int len
, bool treatAsDBCS
) {
73 bool isFillUp
= ac
.Active() && ac
.IsFillUpChar(*s
);
75 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
78 AutoCompleteCharacterAdded(s
[0]);
79 // For fill ups add the character after the autocompletion has
80 // triggered so containers see the key so can display a calltip.
82 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
87 void ScintillaBase::Command(int cmdId
) {
91 case idAutoComplete
: // Nothing to do
95 case idCallTip
: // Nothing to do
100 WndProc(SCI_UNDO
, 0, 0);
104 WndProc(SCI_REDO
, 0, 0);
108 WndProc(SCI_CUT
, 0, 0);
112 WndProc(SCI_COPY
, 0, 0);
116 WndProc(SCI_PASTE
, 0, 0);
120 WndProc(SCI_CLEAR
, 0, 0);
124 WndProc(SCI_SELECTALL
, 0, 0);
129 int ScintillaBase::KeyCommand(unsigned int iMessage
) {
130 // Most key commands cancel autocompletion mode
138 AutoCompleteMove(-1);
144 AutoCompleteMove(-5);
147 AutoCompleteMove(-5000);
150 AutoCompleteMove(5000);
154 AutoCompleteCharacterDeleted();
155 EnsureCaretVisible();
157 case SCI_DELETEBACKNOTLINE
:
159 AutoCompleteCharacterDeleted();
160 EnsureCaretVisible();
163 AutoCompleteCompleted();
166 AutoCompleteCompleted();
170 AutoCompleteCancel();
174 if (ct
.inCallTipMode
) {
176 (iMessage
!= SCI_CHARLEFT
) &&
177 (iMessage
!= SCI_CHARLEFTEXTEND
) &&
178 (iMessage
!= SCI_CHARRIGHT
) &&
179 (iMessage
!= SCI_CHARRIGHTEXTEND
) &&
180 (iMessage
!= SCI_EDITTOGGLEOVERTYPE
) &&
181 (iMessage
!= SCI_DELETEBACK
) &&
182 (iMessage
!= SCI_DELETEBACKNOTLINE
)
186 if ((iMessage
== SCI_DELETEBACK
) || (iMessage
== SCI_DELETEBACKNOTLINE
)) {
187 if (sel
.MainCaret() <= ct
.posStartCallTip
) {
192 return Editor::KeyCommand(iMessage
);
195 void ScintillaBase::AutoCompleteDoubleClick(void *p
) {
196 ScintillaBase
*sci
= reinterpret_cast<ScintillaBase
*>(p
);
197 sci
->AutoCompleteCompleted();
200 void ScintillaBase::AutoCompleteStart(int lenEntered
, const char *list
) {
201 //Platform::DebugPrintf("AutoComplete %s\n", list);
204 if (ac
.chooseSingle
&& (listType
== 0)) {
205 if (list
&& !strchr(list
, ac
.GetSeparator())) {
206 const char *typeSep
= strchr(list
, ac
.GetTypesep());
207 size_t lenInsert
= (typeSep
) ? (typeSep
-list
) : strlen(list
);
209 SetEmptySelection(sel
.MainCaret() - lenEntered
);
210 pdoc
->DeleteChars(sel
.MainCaret(), lenEntered
);
211 SetEmptySelection(sel
.MainCaret());
212 pdoc
->InsertString(sel
.MainCaret(), list
, lenInsert
);
213 SetEmptySelection(sel
.MainCaret() + lenInsert
);
215 SetEmptySelection(sel
.MainCaret());
216 pdoc
->InsertString(sel
.MainCaret(), list
+ lenEntered
, lenInsert
- lenEntered
);
217 SetEmptySelection(sel
.MainCaret() + lenInsert
- lenEntered
);
222 ac
.Start(wMain
, idAutoComplete
, sel
.MainCaret(), PointMainCaret(),
223 lenEntered
, vs
.lineHeight
, IsUnicodeMode());
225 PRectangle rcClient
= GetClientRectangle();
226 Point pt
= LocationFromPosition(sel
.MainCaret() - lenEntered
);
227 PRectangle rcPopupBounds
= wMain
.GetMonitorRect(pt
);
228 if (rcPopupBounds
.Height() == 0)
229 rcPopupBounds
= rcClient
;
233 if (pt
.x
>= rcClient
.right
- widthLB
) {
234 HorizontalScrollTo(xOffset
+ pt
.x
- rcClient
.right
+ widthLB
);
236 pt
= PointMainCaret();
239 rcac
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
240 if (pt
.y
>= rcPopupBounds
.bottom
- heightLB
&& // Wont fit below.
241 pt
.y
>= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2) { // and there is more room above.
242 rcac
.top
= pt
.y
- heightLB
;
243 if (rcac
.top
< rcPopupBounds
.top
) {
244 heightLB
-= (rcPopupBounds
.top
- rcac
.top
);
245 rcac
.top
= rcPopupBounds
.top
;
248 rcac
.top
= pt
.y
+ vs
.lineHeight
;
250 rcac
.right
= rcac
.left
+ widthLB
;
251 rcac
.bottom
= Platform::Minimum(rcac
.top
+ heightLB
, rcPopupBounds
.bottom
);
252 ac
.lb
->SetPositionRelative(rcac
, wMain
);
253 ac
.lb
->SetFont(vs
.styles
[STYLE_DEFAULT
].font
);
254 unsigned int aveCharWidth
= vs
.styles
[STYLE_DEFAULT
].aveCharWidth
;
255 ac
.lb
->SetAverageCharWidth(aveCharWidth
);
256 ac
.lb
->SetDoubleClickAction(AutoCompleteDoubleClick
, this);
260 // Fiddle the position of the list so it is right next to the target and wide enough for all its strings
261 PRectangle rcList
= ac
.lb
->GetDesiredRect();
262 int heightAlloced
= rcList
.bottom
- rcList
.top
;
263 widthLB
= Platform::Maximum(widthLB
, rcList
.right
- rcList
.left
);
264 if (maxListWidth
!= 0)
265 widthLB
= Platform::Minimum(widthLB
, aveCharWidth
*maxListWidth
);
266 // Make an allowance for large strings in list
267 rcList
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
268 rcList
.right
= rcList
.left
+ widthLB
;
269 if (((pt
.y
+ vs
.lineHeight
) >= (rcPopupBounds
.bottom
- heightAlloced
)) && // Wont fit below.
270 ((pt
.y
+ vs
.lineHeight
/ 2) >= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2)) { // and there is more room above.
271 rcList
.top
= pt
.y
- heightAlloced
;
273 rcList
.top
= pt
.y
+ vs
.lineHeight
;
275 rcList
.bottom
= rcList
.top
+ heightAlloced
;
276 ac
.lb
->SetPositionRelative(rcList
, wMain
);
278 if (lenEntered
!= 0) {
279 AutoCompleteMoveToCurrentWord();
283 void ScintillaBase::AutoCompleteCancel() {
285 SCNotification scn
= {0};
286 scn
.nmhdr
.code
= SCN_AUTOCCANCELLED
;
294 void ScintillaBase::AutoCompleteMove(int delta
) {
298 void ScintillaBase::AutoCompleteMoveToCurrentWord() {
299 char wordCurrent
[1000];
301 int startWord
= ac
.posStart
- ac
.startLen
;
302 for (i
= startWord
; i
< sel
.MainCaret() && i
- startWord
< 1000; i
++)
303 wordCurrent
[i
- startWord
] = pdoc
->CharAt(i
);
304 wordCurrent
[Platform::Minimum(i
- startWord
, 999)] = '\0';
305 ac
.Select(wordCurrent
);
308 void ScintillaBase::AutoCompleteCharacterAdded(char ch
) {
309 if (ac
.IsFillUpChar(ch
)) {
310 AutoCompleteCompleted();
311 } else if (ac
.IsStopChar(ch
)) {
312 AutoCompleteCancel();
314 AutoCompleteMoveToCurrentWord();
318 void ScintillaBase::AutoCompleteCharacterDeleted() {
319 if (sel
.MainCaret() < ac
.posStart
- ac
.startLen
) {
320 AutoCompleteCancel();
321 } else if (ac
.cancelAtStartPos
&& (sel
.MainCaret() <= ac
.posStart
)) {
322 AutoCompleteCancel();
324 AutoCompleteMoveToCurrentWord();
326 SCNotification scn
= {0};
327 scn
.nmhdr
.code
= SCN_AUTOCCHARDELETED
;
333 void ScintillaBase::AutoCompleteCompleted() {
334 int item
= ac
.lb
->GetSelection();
338 ac
.lb
->GetValue(item
, selected
, sizeof(selected
));
340 AutoCompleteCancel();
346 SCNotification scn
= {0};
347 scn
.nmhdr
.code
= listType
> 0 ? SCN_USERLISTSELECTION
: SCN_AUTOCSELECTION
;
349 scn
.wParam
= listType
;
350 scn
.listType
= listType
;
351 Position firstPos
= ac
.posStart
- ac
.startLen
;
352 scn
.position
= firstPos
;
353 scn
.lParam
= firstPos
;
364 Position endPos
= sel
.MainCaret();
365 if (ac
.dropRestOfWord
)
366 endPos
= pdoc
->ExtendWordSelect(endPos
, 1, true);
367 if (endPos
< firstPos
)
370 if (endPos
!= firstPos
) {
371 pdoc
->DeleteChars(firstPos
, endPos
- firstPos
);
373 SetEmptySelection(ac
.posStart
);
375 pdoc
->InsertCString(firstPos
, selected
);
376 SetEmptySelection(firstPos
+ static_cast<int>(strlen(selected
)));
381 int ScintillaBase::AutoCompleteGetCurrent() {
384 return ac
.lb
->GetSelection();
387 int ScintillaBase::AutoCompleteGetCurrentText(char *buffer
) {
389 int item
= ac
.lb
->GetSelection();
393 ac
.lb
->GetValue(item
, selected
, sizeof(selected
));
395 strcpy(buffer
, selected
);
396 return strlen(selected
);
404 void ScintillaBase::CallTipShow(Point pt
, const char *defn
) {
406 pt
.y
+= vs
.lineHeight
;
407 // If container knows about STYLE_CALLTIP then use it in place of the
408 // STYLE_DEFAULT for the face name, size and character set. Also use it
409 // for the foreground and background colour.
410 int ctStyle
= ct
.UseStyleCallTip() ? STYLE_CALLTIP
: STYLE_DEFAULT
;
411 if (ct
.UseStyleCallTip()) {
412 ct
.SetForeBack(vs
.styles
[STYLE_CALLTIP
].fore
, vs
.styles
[STYLE_CALLTIP
].back
);
414 PRectangle rc
= ct
.CallTipStart(sel
.MainCaret(), pt
,
416 vs
.styles
[ctStyle
].fontName
,
417 vs
.styles
[ctStyle
].sizeZoomed
,
419 vs
.styles
[ctStyle
].characterSet
,
421 // If the call-tip window would be out of the client
422 // space, adjust so it displays above the text.
423 PRectangle rcClient
= GetClientRectangle();
424 if (rc
.bottom
> rcClient
.bottom
) {
425 int offset
= vs
.lineHeight
+ rc
.Height();
429 // Now display the window.
430 CreateCallTipWindow(rc
);
431 ct
.wCallTip
.SetPositionRelative(rc
, wMain
);
435 void ScintillaBase::CallTipClick() {
436 SCNotification scn
= {0};
437 scn
.nmhdr
.code
= SCN_CALLTIPCLICK
;
438 scn
.position
= ct
.clickPlace
;
442 void ScintillaBase::ContextMenu(Point pt
) {
443 if (displayPopupMenu
) {
444 bool writable
= !WndProc(SCI_GETREADONLY
, 0, 0);
446 AddToPopUp("Undo", idcmdUndo
, writable
&& pdoc
->CanUndo());
447 AddToPopUp("Redo", idcmdRedo
, writable
&& pdoc
->CanRedo());
449 AddToPopUp("Cut", idcmdCut
, writable
&& !sel
.Empty());
450 AddToPopUp("Copy", idcmdCopy
, !sel
.Empty());
451 AddToPopUp("Paste", idcmdPaste
, writable
&& WndProc(SCI_CANPASTE
, 0, 0));
452 AddToPopUp("Delete", idcmdDelete
, writable
&& !sel
.Empty());
454 AddToPopUp("Select All", idcmdSelectAll
);
455 popup
.Show(pt
, wMain
);
459 void ScintillaBase::CancelModes() {
460 AutoCompleteCancel();
462 Editor::CancelModes();
465 void ScintillaBase::ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
) {
467 Editor::ButtonDown(pt
, curTime
, shift
, ctrl
, alt
);
473 namespace Scintilla
{
476 class LexState
: public LexInterface
{
477 const LexerModule
*lexCurrent
;
478 void SetLexerModule(const LexerModule
*lex
);
483 LexState(Document
*pdoc_
);
485 void SetLexer(uptr_t wParam
);
486 void SetLexerLanguage(const char *languageName
);
487 const char *DescribeWordListSets();
488 void SetWordList(int n
, const char *wl
);
489 int GetStyleBitsNeeded() const;
490 const char *GetName() const;
491 void *PrivateCall(int operation
, void *pointer
);
492 const char *PropertyNames();
493 int PropertyType(const char *name
);
494 const char *DescribeProperty(const char *name
);
495 void PropSet(const char *key
, const char *val
);
496 const char *PropGet(const char *key
) const;
497 int PropGetInt(const char *key
, int defaultValue
=0) const;
498 int PropGetExpanded(const char *key
, char *result
) const;
505 LexState::LexState(Document
*pdoc_
) : LexInterface(pdoc_
) {
507 performingStyle
= false;
508 lexLanguage
= SCLEX_CONTAINER
;
511 LexState::~LexState() {
518 LexState
*ScintillaBase::DocumentLexState() {
520 pdoc
->pli
= new LexState(pdoc
);
522 return static_cast<LexState
*>(pdoc
->pli
);
525 void LexState::SetLexerModule(const LexerModule
*lex
) {
526 if (lex
!= lexCurrent
) {
533 instance
= lexCurrent
->Create();
534 pdoc
->LexerChanged();
538 void LexState::SetLexer(uptr_t wParam
) {
539 lexLanguage
= wParam
;
540 if (lexLanguage
== SCLEX_CONTAINER
) {
543 const LexerModule
*lex
= Catalogue::Find(lexLanguage
);
545 lex
= Catalogue::Find(SCLEX_NULL
);
550 void LexState::SetLexerLanguage(const char *languageName
) {
551 const LexerModule
*lex
= Catalogue::Find(languageName
);
553 lex
= Catalogue::Find(SCLEX_NULL
);
555 lexLanguage
= lex
->GetLanguage();
559 const char *LexState::DescribeWordListSets() {
561 return instance
->DescribeWordListSets();
567 void LexState::SetWordList(int n
, const char *wl
) {
569 int firstModification
= instance
->WordListSet(n
, wl
);
570 if (firstModification
>= 0) {
571 pdoc
->ModifiedAt(firstModification
);
576 int LexState::GetStyleBitsNeeded() const {
577 return lexCurrent
? lexCurrent
->GetStyleBitsNeeded() : 5;
580 const char *LexState::GetName() const {
581 return lexCurrent
? lexCurrent
->languageName
: "";
584 void *LexState::PrivateCall(int operation
, void *pointer
) {
585 if (pdoc
&& instance
) {
586 return instance
->PrivateCall(operation
, pointer
);
592 const char *LexState::PropertyNames() {
594 return instance
->PropertyNames();
600 int LexState::PropertyType(const char *name
) {
602 return instance
->PropertyType(name
);
604 return SC_TYPE_BOOLEAN
;
608 const char *LexState::DescribeProperty(const char *name
) {
610 return instance
->DescribeProperty(name
);
616 void LexState::PropSet(const char *key
, const char *val
) {
619 int firstModification
= instance
->PropertySet(key
, val
);
620 if (firstModification
>= 0) {
621 pdoc
->ModifiedAt(firstModification
);
626 const char *LexState::PropGet(const char *key
) const {
627 return props
.Get(key
);
630 int LexState::PropGetInt(const char *key
, int defaultValue
) const {
631 return props
.GetInt(key
, defaultValue
);
634 int LexState::PropGetExpanded(const char *key
, char *result
) const {
635 return props
.GetExpanded(key
, result
);
640 void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded
) {
642 if (DocumentLexState()->lexLanguage
!= SCLEX_CONTAINER
) {
643 int lineEndStyled
= pdoc
->LineFromPosition(pdoc
->GetEndStyled());
644 int endStyled
= pdoc
->LineStart(lineEndStyled
);
645 DocumentLexState()->Colourise(endStyled
, endStyleNeeded
);
649 Editor::NotifyStyleToNeeded(endStyleNeeded
);
652 void ScintillaBase::NotifyLexerChanged(Document
*, void *) {
654 int bits
= DocumentLexState()->GetStyleBitsNeeded();
655 vs
.EnsureStyle((1 << bits
) - 1);
659 sptr_t
ScintillaBase::WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
) {
663 AutoCompleteStart(wParam
, reinterpret_cast<const char *>(lParam
));
666 case SCI_AUTOCCANCEL
:
670 case SCI_AUTOCACTIVE
:
673 case SCI_AUTOCPOSSTART
:
676 case SCI_AUTOCCOMPLETE
:
677 AutoCompleteCompleted();
680 case SCI_AUTOCSETSEPARATOR
:
681 ac
.SetSeparator(static_cast<char>(wParam
));
684 case SCI_AUTOCGETSEPARATOR
:
685 return ac
.GetSeparator();
688 ac
.SetStopChars(reinterpret_cast<char *>(lParam
));
691 case SCI_AUTOCSELECT
:
692 ac
.Select(reinterpret_cast<char *>(lParam
));
695 case SCI_AUTOCGETCURRENT
:
696 return AutoCompleteGetCurrent();
698 case SCI_AUTOCGETCURRENTTEXT
:
699 return AutoCompleteGetCurrentText(reinterpret_cast<char *>(lParam
));
701 case SCI_AUTOCSETCANCELATSTART
:
702 ac
.cancelAtStartPos
= wParam
!= 0;
705 case SCI_AUTOCGETCANCELATSTART
:
706 return ac
.cancelAtStartPos
;
708 case SCI_AUTOCSETFILLUPS
:
709 ac
.SetFillUpChars(reinterpret_cast<char *>(lParam
));
712 case SCI_AUTOCSETCHOOSESINGLE
:
713 ac
.chooseSingle
= wParam
!= 0;
716 case SCI_AUTOCGETCHOOSESINGLE
:
717 return ac
.chooseSingle
;
719 case SCI_AUTOCSETIGNORECASE
:
720 ac
.ignoreCase
= wParam
!= 0;
723 case SCI_AUTOCGETIGNORECASE
:
724 return ac
.ignoreCase
;
726 case SCI_USERLISTSHOW
:
728 AutoCompleteStart(0, reinterpret_cast<const char *>(lParam
));
731 case SCI_AUTOCSETAUTOHIDE
:
732 ac
.autoHide
= wParam
!= 0;
735 case SCI_AUTOCGETAUTOHIDE
:
738 case SCI_AUTOCSETDROPRESTOFWORD
:
739 ac
.dropRestOfWord
= wParam
!= 0;
742 case SCI_AUTOCGETDROPRESTOFWORD
:
743 return ac
.dropRestOfWord
;
745 case SCI_AUTOCSETMAXHEIGHT
:
746 ac
.lb
->SetVisibleRows(wParam
);
749 case SCI_AUTOCGETMAXHEIGHT
:
750 return ac
.lb
->GetVisibleRows();
752 case SCI_AUTOCSETMAXWIDTH
:
753 maxListWidth
= wParam
;
756 case SCI_AUTOCGETMAXWIDTH
:
759 case SCI_REGISTERIMAGE
:
760 ac
.lb
->RegisterImage(wParam
, reinterpret_cast<const char *>(lParam
));
763 case SCI_CLEARREGISTEREDIMAGES
:
764 ac
.lb
->ClearRegisteredImages();
767 case SCI_AUTOCSETTYPESEPARATOR
:
768 ac
.SetTypesep(static_cast<char>(wParam
));
771 case SCI_AUTOCGETTYPESEPARATOR
:
772 return ac
.GetTypesep();
774 case SCI_CALLTIPSHOW
:
775 CallTipShow(LocationFromPosition(wParam
),
776 reinterpret_cast<const char *>(lParam
));
779 case SCI_CALLTIPCANCEL
:
783 case SCI_CALLTIPACTIVE
:
784 return ct
.inCallTipMode
;
786 case SCI_CALLTIPPOSSTART
:
787 return ct
.posStartCallTip
;
789 case SCI_CALLTIPSETHLT
:
790 ct
.SetHighlight(wParam
, lParam
);
793 case SCI_CALLTIPSETBACK
:
794 ct
.colourBG
= ColourDesired(wParam
);
795 vs
.styles
[STYLE_CALLTIP
].back
= ct
.colourBG
;
796 InvalidateStyleRedraw();
799 case SCI_CALLTIPSETFORE
:
800 ct
.colourUnSel
= ColourDesired(wParam
);
801 vs
.styles
[STYLE_CALLTIP
].fore
= ct
.colourUnSel
;
802 InvalidateStyleRedraw();
805 case SCI_CALLTIPSETFOREHLT
:
806 ct
.colourSel
= ColourDesired(wParam
);
807 InvalidateStyleRedraw();
810 case SCI_CALLTIPUSESTYLE
:
811 ct
.SetTabSize((int)wParam
);
812 InvalidateStyleRedraw();
816 displayPopupMenu
= wParam
!= 0;
821 DocumentLexState()->SetLexer(wParam
);
825 return DocumentLexState()->lexLanguage
;
828 if (DocumentLexState()->lexLanguage
== SCLEX_CONTAINER
) {
829 pdoc
->ModifiedAt(wParam
);
830 NotifyStyleToNeeded((lParam
== -1) ? pdoc
->Length() : lParam
);
832 DocumentLexState()->Colourise(wParam
, lParam
);
837 case SCI_SETPROPERTY
:
838 DocumentLexState()->PropSet(reinterpret_cast<const char *>(wParam
),
839 reinterpret_cast<const char *>(lParam
));
842 case SCI_GETPROPERTY
:
843 return StringResult(lParam
, DocumentLexState()->PropGet(reinterpret_cast<const char *>(wParam
)));
845 case SCI_GETPROPERTYEXPANDED
:
846 return DocumentLexState()->PropGetExpanded(reinterpret_cast<const char *>(wParam
),
847 reinterpret_cast<char *>(lParam
));
849 case SCI_GETPROPERTYINT
:
850 return DocumentLexState()->PropGetInt(reinterpret_cast<const char *>(wParam
), lParam
);
852 case SCI_SETKEYWORDS
:
853 DocumentLexState()->SetWordList(wParam
, reinterpret_cast<const char *>(lParam
));
856 case SCI_SETLEXERLANGUAGE
:
857 DocumentLexState()->SetLexerLanguage(reinterpret_cast<const char *>(lParam
));
860 case SCI_GETLEXERLANGUAGE
:
861 return StringResult(lParam
, DocumentLexState()->GetName());
863 case SCI_PRIVATELEXERCALL
:
864 return reinterpret_cast<sptr_t
>(
865 DocumentLexState()->PrivateCall(wParam
, reinterpret_cast<void *>(lParam
)));
867 case SCI_GETSTYLEBITSNEEDED
:
868 return DocumentLexState()->GetStyleBitsNeeded();
870 case SCI_PROPERTYNAMES
:
871 return StringResult(lParam
, DocumentLexState()->PropertyNames());
873 case SCI_PROPERTYTYPE
:
874 return DocumentLexState()->PropertyType(reinterpret_cast<const char *>(wParam
));
876 case SCI_DESCRIBEPROPERTY
:
877 return StringResult(lParam
, DocumentLexState()->DescribeProperty(reinterpret_cast<const char *>(wParam
)));
879 case SCI_DESCRIBEKEYWORDSETS
:
880 return StringResult(lParam
, DocumentLexState()->DescribeWordListSets());
885 return Editor::WndProc(iMessage
, wParam
, lParam
);