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::AddCharUTF(char *s
, unsigned int len
, bool treatAsDBCS
) {
69 bool isFillUp
= ac
.Active() && ac
.IsFillUpChar(*s
);
71 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
74 AutoCompleteCharacterAdded(s
[0]);
75 // For fill ups add the character after the autocompletion has
76 // triggered so containers see the key so can display a calltip.
78 Editor::AddCharUTF(s
, len
, treatAsDBCS
);
83 void ScintillaBase::Command(int cmdId
) {
87 case idAutoComplete
: // Nothing to do
91 case idCallTip
: // Nothing to do
96 WndProc(SCI_UNDO
, 0, 0);
100 WndProc(SCI_REDO
, 0, 0);
104 WndProc(SCI_CUT
, 0, 0);
108 WndProc(SCI_COPY
, 0, 0);
112 WndProc(SCI_PASTE
, 0, 0);
116 WndProc(SCI_CLEAR
, 0, 0);
120 WndProc(SCI_SELECTALL
, 0, 0);
125 int ScintillaBase::KeyCommand(unsigned int iMessage
) {
126 // Most key commands cancel autocompletion mode
134 AutoCompleteMove(-1);
137 AutoCompleteMove(ac
.lb
->GetVisibleRows());
140 AutoCompleteMove(-ac
.lb
->GetVisibleRows());
143 AutoCompleteMove(-5000);
146 AutoCompleteMove(5000);
150 AutoCompleteCharacterDeleted();
151 EnsureCaretVisible();
153 case SCI_DELETEBACKNOTLINE
:
155 AutoCompleteCharacterDeleted();
156 EnsureCaretVisible();
159 AutoCompleteCompleted();
162 AutoCompleteCompleted();
166 AutoCompleteCancel();
170 if (ct
.inCallTipMode
) {
172 (iMessage
!= SCI_CHARLEFT
) &&
173 (iMessage
!= SCI_CHARLEFTEXTEND
) &&
174 (iMessage
!= SCI_CHARRIGHT
) &&
175 (iMessage
!= SCI_CHARRIGHTEXTEND
) &&
176 (iMessage
!= SCI_EDITTOGGLEOVERTYPE
) &&
177 (iMessage
!= SCI_DELETEBACK
) &&
178 (iMessage
!= SCI_DELETEBACKNOTLINE
)
182 if ((iMessage
== SCI_DELETEBACK
) || (iMessage
== SCI_DELETEBACKNOTLINE
)) {
183 if (sel
.MainCaret() <= ct
.posStartCallTip
) {
188 return Editor::KeyCommand(iMessage
);
191 void ScintillaBase::AutoCompleteDoubleClick(void *p
) {
192 ScintillaBase
*sci
= reinterpret_cast<ScintillaBase
*>(p
);
193 sci
->AutoCompleteCompleted();
196 void ScintillaBase::AutoCompleteStart(int lenEntered
, const char *list
) {
197 //Platform::DebugPrintf("AutoComplete %s\n", list);
200 if (ac
.chooseSingle
&& (listType
== 0)) {
201 if (list
&& !strchr(list
, ac
.GetSeparator())) {
202 const char *typeSep
= strchr(list
, ac
.GetTypesep());
203 int lenInsert
= typeSep
?
204 static_cast<int>(typeSep
-list
) : static_cast<int>(strlen(list
));
206 SetEmptySelection(sel
.MainCaret() - lenEntered
);
207 pdoc
->DeleteChars(sel
.MainCaret(), lenEntered
);
208 SetEmptySelection(sel
.MainCaret());
209 pdoc
->InsertString(sel
.MainCaret(), list
, lenInsert
);
210 SetEmptySelection(sel
.MainCaret() + lenInsert
);
212 SetEmptySelection(sel
.MainCaret());
213 pdoc
->InsertString(sel
.MainCaret(), list
+ lenEntered
, lenInsert
- lenEntered
);
214 SetEmptySelection(sel
.MainCaret() + lenInsert
- lenEntered
);
220 ac
.Start(wMain
, idAutoComplete
, sel
.MainCaret(), PointMainCaret(),
221 lenEntered
, vs
.lineHeight
, IsUnicodeMode(), technology
);
223 PRectangle rcClient
= GetClientRectangle();
224 Point pt
= LocationFromPosition(sel
.MainCaret() - lenEntered
);
225 PRectangle rcPopupBounds
= wMain
.GetMonitorRect(pt
);
226 if (rcPopupBounds
.Height() == 0)
227 rcPopupBounds
= rcClient
;
231 if (pt
.x
>= rcClient
.right
- widthLB
) {
232 HorizontalScrollTo(xOffset
+ pt
.x
- rcClient
.right
+ widthLB
);
234 pt
= PointMainCaret();
237 rcac
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
238 if (pt
.y
>= rcPopupBounds
.bottom
- heightLB
&& // Wont fit below.
239 pt
.y
>= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2) { // and there is more room above.
240 rcac
.top
= pt
.y
- heightLB
;
241 if (rcac
.top
< rcPopupBounds
.top
) {
242 heightLB
-= (rcPopupBounds
.top
- rcac
.top
);
243 rcac
.top
= rcPopupBounds
.top
;
246 rcac
.top
= pt
.y
+ vs
.lineHeight
;
248 rcac
.right
= rcac
.left
+ widthLB
;
249 rcac
.bottom
= Platform::Minimum(rcac
.top
+ heightLB
, rcPopupBounds
.bottom
);
250 ac
.lb
->SetPositionRelative(rcac
, wMain
);
251 ac
.lb
->SetFont(vs
.styles
[STYLE_DEFAULT
].font
);
252 unsigned int aveCharWidth
= vs
.styles
[STYLE_DEFAULT
].aveCharWidth
;
253 ac
.lb
->SetAverageCharWidth(aveCharWidth
);
254 ac
.lb
->SetDoubleClickAction(AutoCompleteDoubleClick
, this);
258 // Fiddle the position of the list so it is right next to the target and wide enough for all its strings
259 PRectangle rcList
= ac
.lb
->GetDesiredRect();
260 int heightAlloced
= rcList
.bottom
- rcList
.top
;
261 widthLB
= Platform::Maximum(widthLB
, rcList
.right
- rcList
.left
);
262 if (maxListWidth
!= 0)
263 widthLB
= Platform::Minimum(widthLB
, aveCharWidth
*maxListWidth
);
264 // Make an allowance for large strings in list
265 rcList
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
266 rcList
.right
= rcList
.left
+ widthLB
;
267 if (((pt
.y
+ vs
.lineHeight
) >= (rcPopupBounds
.bottom
- heightAlloced
)) && // Wont fit below.
268 ((pt
.y
+ vs
.lineHeight
/ 2) >= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2)) { // and there is more room above.
269 rcList
.top
= pt
.y
- heightAlloced
;
271 rcList
.top
= pt
.y
+ vs
.lineHeight
;
273 rcList
.bottom
= rcList
.top
+ heightAlloced
;
274 ac
.lb
->SetPositionRelative(rcList
, wMain
);
276 if (lenEntered
!= 0) {
277 AutoCompleteMoveToCurrentWord();
281 void ScintillaBase::AutoCompleteCancel() {
283 SCNotification scn
= {0};
284 scn
.nmhdr
.code
= SCN_AUTOCCANCELLED
;
292 void ScintillaBase::AutoCompleteMove(int delta
) {
296 void ScintillaBase::AutoCompleteMoveToCurrentWord() {
297 std::string wordCurrent
= RangeText(ac
.posStart
- ac
.startLen
, sel
.MainCaret());
298 ac
.Select(wordCurrent
.c_str());
301 void ScintillaBase::AutoCompleteCharacterAdded(char ch
) {
302 if (ac
.IsFillUpChar(ch
)) {
303 AutoCompleteCompleted();
304 } else if (ac
.IsStopChar(ch
)) {
305 AutoCompleteCancel();
307 AutoCompleteMoveToCurrentWord();
311 void ScintillaBase::AutoCompleteCharacterDeleted() {
312 if (sel
.MainCaret() < ac
.posStart
- ac
.startLen
) {
313 AutoCompleteCancel();
314 } else if (ac
.cancelAtStartPos
&& (sel
.MainCaret() <= ac
.posStart
)) {
315 AutoCompleteCancel();
317 AutoCompleteMoveToCurrentWord();
319 SCNotification scn
= {0};
320 scn
.nmhdr
.code
= SCN_AUTOCCHARDELETED
;
326 void ScintillaBase::AutoCompleteCompleted() {
327 int item
= ac
.GetSelection();
329 AutoCompleteCancel();
332 const std::string selected
= ac
.GetValue(item
);
336 SCNotification scn
= {0};
337 scn
.nmhdr
.code
= listType
> 0 ? SCN_USERLISTSELECTION
: SCN_AUTOCSELECTION
;
339 scn
.wParam
= listType
;
340 scn
.listType
= listType
;
341 Position firstPos
= ac
.posStart
- ac
.startLen
;
342 scn
.position
= firstPos
;
343 scn
.lParam
= firstPos
;
344 scn
.text
= selected
.c_str();
354 Position endPos
= sel
.MainCaret();
355 if (ac
.dropRestOfWord
)
356 endPos
= pdoc
->ExtendWordSelect(endPos
, 1, true);
357 if (endPos
< firstPos
)
360 if (endPos
!= firstPos
) {
361 pdoc
->DeleteChars(firstPos
, endPos
- firstPos
);
363 SetEmptySelection(ac
.posStart
);
365 pdoc
->InsertCString(firstPos
, selected
.c_str());
366 SetEmptySelection(firstPos
+ static_cast<int>(selected
.length()));
371 int ScintillaBase::AutoCompleteGetCurrent() {
374 return ac
.GetSelection();
377 int ScintillaBase::AutoCompleteGetCurrentText(char *buffer
) {
379 int item
= ac
.GetSelection();
381 const std::string selected
= ac
.GetValue(item
);
383 strcpy(buffer
, selected
.c_str());
384 return static_cast<int>(selected
.length());
392 void ScintillaBase::CallTipShow(Point pt
, const char *defn
) {
394 // If container knows about STYLE_CALLTIP then use it in place of the
395 // STYLE_DEFAULT for the face name, size and character set. Also use it
396 // for the foreground and background colour.
397 int ctStyle
= ct
.UseStyleCallTip() ? STYLE_CALLTIP
: STYLE_DEFAULT
;
398 if (ct
.UseStyleCallTip()) {
399 ct
.SetForeBack(vs
.styles
[STYLE_CALLTIP
].fore
, vs
.styles
[STYLE_CALLTIP
].back
);
401 PRectangle rc
= ct
.CallTipStart(sel
.MainCaret(), pt
,
404 vs
.styles
[ctStyle
].fontName
,
405 vs
.styles
[ctStyle
].sizeZoomed
,
407 vs
.styles
[ctStyle
].characterSet
,
410 // If the call-tip window would be out of the client
412 PRectangle rcClient
= GetClientRectangle();
413 int offset
= vs
.lineHeight
+ rc
.Height();
414 // adjust so it displays below the text.
415 if (rc
.top
< rcClient
.top
) {
419 // adjust so it displays above the text.
420 if (rc
.bottom
> rcClient
.bottom
) {
424 // Now display the window.
425 CreateCallTipWindow(rc
);
426 ct
.wCallTip
.SetPositionRelative(rc
, wMain
);
430 void ScintillaBase::CallTipClick() {
431 SCNotification scn
= {0};
432 scn
.nmhdr
.code
= SCN_CALLTIPCLICK
;
433 scn
.position
= ct
.clickPlace
;
437 void ScintillaBase::ContextMenu(Point pt
) {
438 if (displayPopupMenu
) {
439 bool writable
= !WndProc(SCI_GETREADONLY
, 0, 0);
441 AddToPopUp("Undo", idcmdUndo
, writable
&& pdoc
->CanUndo());
442 AddToPopUp("Redo", idcmdRedo
, writable
&& pdoc
->CanRedo());
444 AddToPopUp("Cut", idcmdCut
, writable
&& !sel
.Empty());
445 AddToPopUp("Copy", idcmdCopy
, !sel
.Empty());
446 AddToPopUp("Paste", idcmdPaste
, writable
&& WndProc(SCI_CANPASTE
, 0, 0));
447 AddToPopUp("Delete", idcmdDelete
, writable
&& !sel
.Empty());
449 AddToPopUp("Select All", idcmdSelectAll
);
450 popup
.Show(pt
, wMain
);
454 void ScintillaBase::CancelModes() {
455 AutoCompleteCancel();
457 Editor::CancelModes();
460 void ScintillaBase::ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
) {
462 Editor::ButtonDown(pt
, curTime
, shift
, ctrl
, alt
);
468 namespace Scintilla
{
471 class LexState
: public LexInterface
{
472 const LexerModule
*lexCurrent
;
473 void SetLexerModule(const LexerModule
*lex
);
478 LexState(Document
*pdoc_
);
480 void SetLexer(uptr_t wParam
);
481 void SetLexerLanguage(const char *languageName
);
482 const char *DescribeWordListSets();
483 void SetWordList(int n
, const char *wl
);
484 int GetStyleBitsNeeded() const;
485 const char *GetName() const;
486 void *PrivateCall(int operation
, void *pointer
);
487 const char *PropertyNames();
488 int PropertyType(const char *name
);
489 const char *DescribeProperty(const char *name
);
490 void PropSet(const char *key
, const char *val
);
491 const char *PropGet(const char *key
) const;
492 int PropGetInt(const char *key
, int defaultValue
=0) const;
493 int PropGetExpanded(const char *key
, char *result
) const;
500 LexState::LexState(Document
*pdoc_
) : LexInterface(pdoc_
) {
502 performingStyle
= false;
503 lexLanguage
= SCLEX_CONTAINER
;
506 LexState::~LexState() {
513 LexState
*ScintillaBase::DocumentLexState() {
515 pdoc
->pli
= new LexState(pdoc
);
517 return static_cast<LexState
*>(pdoc
->pli
);
520 void LexState::SetLexerModule(const LexerModule
*lex
) {
521 if (lex
!= lexCurrent
) {
528 instance
= lexCurrent
->Create();
529 pdoc
->LexerChanged();
533 void LexState::SetLexer(uptr_t wParam
) {
534 lexLanguage
= wParam
;
535 if (lexLanguage
== SCLEX_CONTAINER
) {
538 const LexerModule
*lex
= Catalogue::Find(lexLanguage
);
540 lex
= Catalogue::Find(SCLEX_NULL
);
545 void LexState::SetLexerLanguage(const char *languageName
) {
546 const LexerModule
*lex
= Catalogue::Find(languageName
);
548 lex
= Catalogue::Find(SCLEX_NULL
);
550 lexLanguage
= lex
->GetLanguage();
554 const char *LexState::DescribeWordListSets() {
556 return instance
->DescribeWordListSets();
562 void LexState::SetWordList(int n
, const char *wl
) {
564 int firstModification
= instance
->WordListSet(n
, wl
);
565 if (firstModification
>= 0) {
566 pdoc
->ModifiedAt(firstModification
);
571 int LexState::GetStyleBitsNeeded() const {
572 return lexCurrent
? lexCurrent
->GetStyleBitsNeeded() : 5;
575 const char *LexState::GetName() const {
576 return lexCurrent
? lexCurrent
->languageName
: "";
579 void *LexState::PrivateCall(int operation
, void *pointer
) {
580 if (pdoc
&& instance
) {
581 return instance
->PrivateCall(operation
, pointer
);
587 const char *LexState::PropertyNames() {
589 return instance
->PropertyNames();
595 int LexState::PropertyType(const char *name
) {
597 return instance
->PropertyType(name
);
599 return SC_TYPE_BOOLEAN
;
603 const char *LexState::DescribeProperty(const char *name
) {
605 return instance
->DescribeProperty(name
);
611 void LexState::PropSet(const char *key
, const char *val
) {
614 int firstModification
= instance
->PropertySet(key
, val
);
615 if (firstModification
>= 0) {
616 pdoc
->ModifiedAt(firstModification
);
621 const char *LexState::PropGet(const char *key
) const {
622 return props
.Get(key
);
625 int LexState::PropGetInt(const char *key
, int defaultValue
) const {
626 return props
.GetInt(key
, defaultValue
);
629 int LexState::PropGetExpanded(const char *key
, char *result
) const {
630 return props
.GetExpanded(key
, result
);
635 void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded
) {
637 if (DocumentLexState()->lexLanguage
!= SCLEX_CONTAINER
) {
638 int lineEndStyled
= pdoc
->LineFromPosition(pdoc
->GetEndStyled());
639 int endStyled
= pdoc
->LineStart(lineEndStyled
);
640 DocumentLexState()->Colourise(endStyled
, endStyleNeeded
);
644 Editor::NotifyStyleToNeeded(endStyleNeeded
);
647 void ScintillaBase::NotifyLexerChanged(Document
*, void *) {
649 int bits
= DocumentLexState()->GetStyleBitsNeeded();
650 vs
.EnsureStyle((1 << bits
) - 1);
654 sptr_t
ScintillaBase::WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
) {
658 AutoCompleteStart(wParam
, reinterpret_cast<const char *>(lParam
));
661 case SCI_AUTOCCANCEL
:
665 case SCI_AUTOCACTIVE
:
668 case SCI_AUTOCPOSSTART
:
671 case SCI_AUTOCCOMPLETE
:
672 AutoCompleteCompleted();
675 case SCI_AUTOCSETSEPARATOR
:
676 ac
.SetSeparator(static_cast<char>(wParam
));
679 case SCI_AUTOCGETSEPARATOR
:
680 return ac
.GetSeparator();
683 ac
.SetStopChars(reinterpret_cast<char *>(lParam
));
686 case SCI_AUTOCSELECT
:
687 ac
.Select(reinterpret_cast<char *>(lParam
));
690 case SCI_AUTOCGETCURRENT
:
691 return AutoCompleteGetCurrent();
693 case SCI_AUTOCGETCURRENTTEXT
:
694 return AutoCompleteGetCurrentText(reinterpret_cast<char *>(lParam
));
696 case SCI_AUTOCSETCANCELATSTART
:
697 ac
.cancelAtStartPos
= wParam
!= 0;
700 case SCI_AUTOCGETCANCELATSTART
:
701 return ac
.cancelAtStartPos
;
703 case SCI_AUTOCSETFILLUPS
:
704 ac
.SetFillUpChars(reinterpret_cast<char *>(lParam
));
707 case SCI_AUTOCSETCHOOSESINGLE
:
708 ac
.chooseSingle
= wParam
!= 0;
711 case SCI_AUTOCGETCHOOSESINGLE
:
712 return ac
.chooseSingle
;
714 case SCI_AUTOCSETIGNORECASE
:
715 ac
.ignoreCase
= wParam
!= 0;
718 case SCI_AUTOCGETIGNORECASE
:
719 return ac
.ignoreCase
;
721 case SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR
:
722 ac
.ignoreCaseBehaviour
= wParam
;
725 case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR
:
726 return ac
.ignoreCaseBehaviour
;
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();
821 case SCI_CALLTIPSETPOSITION
:
822 ct
.SetPosition(wParam
!= 0);
823 InvalidateStyleRedraw();
827 displayPopupMenu
= wParam
!= 0;
832 DocumentLexState()->SetLexer(wParam
);
836 return DocumentLexState()->lexLanguage
;
839 if (DocumentLexState()->lexLanguage
== SCLEX_CONTAINER
) {
840 pdoc
->ModifiedAt(wParam
);
841 NotifyStyleToNeeded((lParam
== -1) ? pdoc
->Length() : lParam
);
843 DocumentLexState()->Colourise(wParam
, lParam
);
848 case SCI_SETPROPERTY
:
849 DocumentLexState()->PropSet(reinterpret_cast<const char *>(wParam
),
850 reinterpret_cast<const char *>(lParam
));
853 case SCI_GETPROPERTY
:
854 return StringResult(lParam
, DocumentLexState()->PropGet(reinterpret_cast<const char *>(wParam
)));
856 case SCI_GETPROPERTYEXPANDED
:
857 return DocumentLexState()->PropGetExpanded(reinterpret_cast<const char *>(wParam
),
858 reinterpret_cast<char *>(lParam
));
860 case SCI_GETPROPERTYINT
:
861 return DocumentLexState()->PropGetInt(reinterpret_cast<const char *>(wParam
), lParam
);
863 case SCI_SETKEYWORDS
:
864 DocumentLexState()->SetWordList(wParam
, reinterpret_cast<const char *>(lParam
));
867 case SCI_SETLEXERLANGUAGE
:
868 DocumentLexState()->SetLexerLanguage(reinterpret_cast<const char *>(lParam
));
871 case SCI_GETLEXERLANGUAGE
:
872 return StringResult(lParam
, DocumentLexState()->GetName());
874 case SCI_PRIVATELEXERCALL
:
875 return reinterpret_cast<sptr_t
>(
876 DocumentLexState()->PrivateCall(wParam
, reinterpret_cast<void *>(lParam
)));
878 case SCI_GETSTYLEBITSNEEDED
:
879 return DocumentLexState()->GetStyleBitsNeeded();
881 case SCI_PROPERTYNAMES
:
882 return StringResult(lParam
, DocumentLexState()->PropertyNames());
884 case SCI_PROPERTYTYPE
:
885 return DocumentLexState()->PropertyType(reinterpret_cast<const char *>(wParam
));
887 case SCI_DESCRIBEPROPERTY
:
888 return StringResult(lParam
, DocumentLexState()->DescribeProperty(reinterpret_cast<const char *>(wParam
)));
890 case SCI_DESCRIBEKEYWORDSETS
:
891 return StringResult(lParam
, DocumentLexState()->DescribeWordListSets());
896 return Editor::WndProc(iMessage
, wParam
, lParam
);