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
));
207 SetEmptySelection(sel
.MainCaret() - lenEntered
);
208 pdoc
->DeleteChars(sel
.MainCaret(), lenEntered
);
209 SetEmptySelection(sel
.MainCaret());
210 pdoc
->InsertString(sel
.MainCaret(), list
, lenInsert
);
211 SetEmptySelection(sel
.MainCaret() + lenInsert
);
213 SetEmptySelection(sel
.MainCaret());
214 pdoc
->InsertString(sel
.MainCaret(), list
+ lenEntered
, lenInsert
- lenEntered
);
215 SetEmptySelection(sel
.MainCaret() + lenInsert
- lenEntered
);
221 ac
.Start(wMain
, idAutoComplete
, sel
.MainCaret(), PointMainCaret(),
222 lenEntered
, vs
.lineHeight
, IsUnicodeMode(), technology
);
224 PRectangle rcClient
= GetClientRectangle();
225 Point pt
= LocationFromPosition(sel
.MainCaret() - lenEntered
);
226 PRectangle rcPopupBounds
= wMain
.GetMonitorRect(pt
);
227 if (rcPopupBounds
.Height() == 0)
228 rcPopupBounds
= rcClient
;
230 int heightLB
= ac
.heightLBDefault
;
231 int widthLB
= ac
.widthLBDefault
;
232 if (pt
.x
>= rcClient
.right
- widthLB
) {
233 HorizontalScrollTo(xOffset
+ pt
.x
- rcClient
.right
+ widthLB
);
235 pt
= PointMainCaret();
238 rcac
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
239 if (pt
.y
>= rcPopupBounds
.bottom
- heightLB
&& // Wont fit below.
240 pt
.y
>= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2) { // and there is more room above.
241 rcac
.top
= pt
.y
- heightLB
;
242 if (rcac
.top
< rcPopupBounds
.top
) {
243 heightLB
-= (rcPopupBounds
.top
- rcac
.top
);
244 rcac
.top
= rcPopupBounds
.top
;
247 rcac
.top
= pt
.y
+ vs
.lineHeight
;
249 rcac
.right
= rcac
.left
+ widthLB
;
250 rcac
.bottom
= Platform::Minimum(rcac
.top
+ heightLB
, rcPopupBounds
.bottom
);
251 ac
.lb
->SetPositionRelative(rcac
, wMain
);
252 ac
.lb
->SetFont(vs
.styles
[STYLE_DEFAULT
].font
);
253 unsigned int aveCharWidth
= vs
.styles
[STYLE_DEFAULT
].aveCharWidth
;
254 ac
.lb
->SetAverageCharWidth(aveCharWidth
);
255 ac
.lb
->SetDoubleClickAction(AutoCompleteDoubleClick
, this);
259 // Fiddle the position of the list so it is right next to the target and wide enough for all its strings
260 PRectangle rcList
= ac
.lb
->GetDesiredRect();
261 int heightAlloced
= rcList
.bottom
- rcList
.top
;
262 widthLB
= Platform::Maximum(widthLB
, rcList
.right
- rcList
.left
);
263 if (maxListWidth
!= 0)
264 widthLB
= Platform::Minimum(widthLB
, aveCharWidth
*maxListWidth
);
265 // Make an allowance for large strings in list
266 rcList
.left
= pt
.x
- ac
.lb
->CaretFromEdge();
267 rcList
.right
= rcList
.left
+ widthLB
;
268 if (((pt
.y
+ vs
.lineHeight
) >= (rcPopupBounds
.bottom
- heightAlloced
)) && // Wont fit below.
269 ((pt
.y
+ vs
.lineHeight
/ 2) >= (rcPopupBounds
.bottom
+ rcPopupBounds
.top
) / 2)) { // and there is more room above.
270 rcList
.top
= pt
.y
- heightAlloced
;
272 rcList
.top
= pt
.y
+ vs
.lineHeight
;
274 rcList
.bottom
= rcList
.top
+ heightAlloced
;
275 ac
.lb
->SetPositionRelative(rcList
, wMain
);
277 if (lenEntered
!= 0) {
278 AutoCompleteMoveToCurrentWord();
282 void ScintillaBase::AutoCompleteCancel() {
284 SCNotification scn
= {0};
285 scn
.nmhdr
.code
= SCN_AUTOCCANCELLED
;
293 void ScintillaBase::AutoCompleteMove(int delta
) {
297 void ScintillaBase::AutoCompleteMoveToCurrentWord() {
298 std::string wordCurrent
= RangeText(ac
.posStart
- ac
.startLen
, sel
.MainCaret());
299 ac
.Select(wordCurrent
.c_str());
302 void ScintillaBase::AutoCompleteCharacterAdded(char ch
) {
303 if (ac
.IsFillUpChar(ch
)) {
304 AutoCompleteCompleted();
305 } else if (ac
.IsStopChar(ch
)) {
306 AutoCompleteCancel();
308 AutoCompleteMoveToCurrentWord();
312 void ScintillaBase::AutoCompleteCharacterDeleted() {
313 if (sel
.MainCaret() < ac
.posStart
- ac
.startLen
) {
314 AutoCompleteCancel();
315 } else if (ac
.cancelAtStartPos
&& (sel
.MainCaret() <= ac
.posStart
)) {
316 AutoCompleteCancel();
318 AutoCompleteMoveToCurrentWord();
320 SCNotification scn
= {0};
321 scn
.nmhdr
.code
= SCN_AUTOCCHARDELETED
;
327 void ScintillaBase::AutoCompleteCompleted() {
328 int item
= ac
.GetSelection();
330 AutoCompleteCancel();
333 const std::string selected
= ac
.GetValue(item
);
337 SCNotification scn
= {0};
338 scn
.nmhdr
.code
= listType
> 0 ? SCN_USERLISTSELECTION
: SCN_AUTOCSELECTION
;
340 scn
.wParam
= listType
;
341 scn
.listType
= listType
;
342 Position firstPos
= ac
.posStart
- ac
.startLen
;
343 scn
.position
= firstPos
;
344 scn
.lParam
= firstPos
;
345 scn
.text
= selected
.c_str();
355 Position endPos
= sel
.MainCaret();
356 if (ac
.dropRestOfWord
)
357 endPos
= pdoc
->ExtendWordSelect(endPos
, 1, true);
358 if (endPos
< firstPos
)
361 if (endPos
!= firstPos
) {
362 pdoc
->DeleteChars(firstPos
, endPos
- firstPos
);
364 SetEmptySelection(ac
.posStart
);
366 pdoc
->InsertCString(firstPos
, selected
.c_str());
367 SetEmptySelection(firstPos
+ static_cast<int>(selected
.length()));
372 int ScintillaBase::AutoCompleteGetCurrent() {
375 return ac
.GetSelection();
378 int ScintillaBase::AutoCompleteGetCurrentText(char *buffer
) {
380 int item
= ac
.GetSelection();
382 const std::string selected
= ac
.GetValue(item
);
384 strcpy(buffer
, selected
.c_str());
385 return static_cast<int>(selected
.length());
393 void ScintillaBase::CallTipShow(Point pt
, const char *defn
) {
395 // If container knows about STYLE_CALLTIP then use it in place of the
396 // STYLE_DEFAULT for the face name, size and character set. Also use it
397 // for the foreground and background colour.
398 int ctStyle
= ct
.UseStyleCallTip() ? STYLE_CALLTIP
: STYLE_DEFAULT
;
399 if (ct
.UseStyleCallTip()) {
400 ct
.SetForeBack(vs
.styles
[STYLE_CALLTIP
].fore
, vs
.styles
[STYLE_CALLTIP
].back
);
402 PRectangle rc
= ct
.CallTipStart(sel
.MainCaret(), pt
,
405 vs
.styles
[ctStyle
].fontName
,
406 vs
.styles
[ctStyle
].sizeZoomed
,
408 vs
.styles
[ctStyle
].characterSet
,
411 // If the call-tip window would be out of the client
413 PRectangle rcClient
= GetClientRectangle();
414 int offset
= vs
.lineHeight
+ rc
.Height();
415 // adjust so it displays below the text.
416 if (rc
.top
< rcClient
.top
) {
420 // adjust so it displays above the text.
421 if (rc
.bottom
> rcClient
.bottom
) {
425 // Now display the window.
426 CreateCallTipWindow(rc
);
427 ct
.wCallTip
.SetPositionRelative(rc
, wMain
);
431 void ScintillaBase::CallTipClick() {
432 SCNotification scn
= {0};
433 scn
.nmhdr
.code
= SCN_CALLTIPCLICK
;
434 scn
.position
= ct
.clickPlace
;
438 void ScintillaBase::ContextMenu(Point pt
) {
439 if (displayPopupMenu
) {
440 bool writable
= !WndProc(SCI_GETREADONLY
, 0, 0);
442 AddToPopUp("Undo", idcmdUndo
, writable
&& pdoc
->CanUndo());
443 AddToPopUp("Redo", idcmdRedo
, writable
&& pdoc
->CanRedo());
445 AddToPopUp("Cut", idcmdCut
, writable
&& !sel
.Empty());
446 AddToPopUp("Copy", idcmdCopy
, !sel
.Empty());
447 AddToPopUp("Paste", idcmdPaste
, writable
&& WndProc(SCI_CANPASTE
, 0, 0));
448 AddToPopUp("Delete", idcmdDelete
, writable
&& !sel
.Empty());
450 AddToPopUp("Select All", idcmdSelectAll
);
451 popup
.Show(pt
, wMain
);
455 void ScintillaBase::CancelModes() {
456 AutoCompleteCancel();
458 Editor::CancelModes();
461 void ScintillaBase::ButtonDown(Point pt
, unsigned int curTime
, bool shift
, bool ctrl
, bool alt
) {
463 Editor::ButtonDown(pt
, curTime
, shift
, ctrl
, alt
);
469 namespace Scintilla
{
472 class LexState
: public LexInterface
{
473 const LexerModule
*lexCurrent
;
474 void SetLexerModule(const LexerModule
*lex
);
479 LexState(Document
*pdoc_
);
481 void SetLexer(uptr_t wParam
);
482 void SetLexerLanguage(const char *languageName
);
483 const char *DescribeWordListSets();
484 void SetWordList(int n
, const char *wl
);
485 int GetStyleBitsNeeded() const;
486 const char *GetName() const;
487 void *PrivateCall(int operation
, void *pointer
);
488 const char *PropertyNames();
489 int PropertyType(const char *name
);
490 const char *DescribeProperty(const char *name
);
491 void PropSet(const char *key
, const char *val
);
492 const char *PropGet(const char *key
) const;
493 int PropGetInt(const char *key
, int defaultValue
=0) const;
494 int PropGetExpanded(const char *key
, char *result
) const;
501 LexState::LexState(Document
*pdoc_
) : LexInterface(pdoc_
) {
503 performingStyle
= false;
504 lexLanguage
= SCLEX_CONTAINER
;
507 LexState::~LexState() {
514 LexState
*ScintillaBase::DocumentLexState() {
516 pdoc
->pli
= new LexState(pdoc
);
518 return static_cast<LexState
*>(pdoc
->pli
);
521 void LexState::SetLexerModule(const LexerModule
*lex
) {
522 if (lex
!= lexCurrent
) {
529 instance
= lexCurrent
->Create();
530 pdoc
->LexerChanged();
534 void LexState::SetLexer(uptr_t wParam
) {
535 lexLanguage
= wParam
;
536 if (lexLanguage
== SCLEX_CONTAINER
) {
539 const LexerModule
*lex
= Catalogue::Find(lexLanguage
);
541 lex
= Catalogue::Find(SCLEX_NULL
);
546 void LexState::SetLexerLanguage(const char *languageName
) {
547 const LexerModule
*lex
= Catalogue::Find(languageName
);
549 lex
= Catalogue::Find(SCLEX_NULL
);
551 lexLanguage
= lex
->GetLanguage();
555 const char *LexState::DescribeWordListSets() {
557 return instance
->DescribeWordListSets();
563 void LexState::SetWordList(int n
, const char *wl
) {
565 int firstModification
= instance
->WordListSet(n
, wl
);
566 if (firstModification
>= 0) {
567 pdoc
->ModifiedAt(firstModification
);
572 int LexState::GetStyleBitsNeeded() const {
573 return lexCurrent
? lexCurrent
->GetStyleBitsNeeded() : 5;
576 const char *LexState::GetName() const {
577 return lexCurrent
? lexCurrent
->languageName
: "";
580 void *LexState::PrivateCall(int operation
, void *pointer
) {
581 if (pdoc
&& instance
) {
582 return instance
->PrivateCall(operation
, pointer
);
588 const char *LexState::PropertyNames() {
590 return instance
->PropertyNames();
596 int LexState::PropertyType(const char *name
) {
598 return instance
->PropertyType(name
);
600 return SC_TYPE_BOOLEAN
;
604 const char *LexState::DescribeProperty(const char *name
) {
606 return instance
->DescribeProperty(name
);
612 void LexState::PropSet(const char *key
, const char *val
) {
615 int firstModification
= instance
->PropertySet(key
, val
);
616 if (firstModification
>= 0) {
617 pdoc
->ModifiedAt(firstModification
);
622 const char *LexState::PropGet(const char *key
) const {
623 return props
.Get(key
);
626 int LexState::PropGetInt(const char *key
, int defaultValue
) const {
627 return props
.GetInt(key
, defaultValue
);
630 int LexState::PropGetExpanded(const char *key
, char *result
) const {
631 return props
.GetExpanded(key
, result
);
636 void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded
) {
638 if (DocumentLexState()->lexLanguage
!= SCLEX_CONTAINER
) {
639 int lineEndStyled
= pdoc
->LineFromPosition(pdoc
->GetEndStyled());
640 int endStyled
= pdoc
->LineStart(lineEndStyled
);
641 DocumentLexState()->Colourise(endStyled
, endStyleNeeded
);
645 Editor::NotifyStyleToNeeded(endStyleNeeded
);
648 void ScintillaBase::NotifyLexerChanged(Document
*, void *) {
650 int bits
= DocumentLexState()->GetStyleBitsNeeded();
651 vs
.EnsureStyle((1 << bits
) - 1);
655 sptr_t
ScintillaBase::WndProc(unsigned int iMessage
, uptr_t wParam
, sptr_t lParam
) {
659 AutoCompleteStart(wParam
, reinterpret_cast<const char *>(lParam
));
662 case SCI_AUTOCCANCEL
:
666 case SCI_AUTOCACTIVE
:
669 case SCI_AUTOCPOSSTART
:
672 case SCI_AUTOCCOMPLETE
:
673 AutoCompleteCompleted();
676 case SCI_AUTOCSETSEPARATOR
:
677 ac
.SetSeparator(static_cast<char>(wParam
));
680 case SCI_AUTOCGETSEPARATOR
:
681 return ac
.GetSeparator();
684 ac
.SetStopChars(reinterpret_cast<char *>(lParam
));
687 case SCI_AUTOCSELECT
:
688 ac
.Select(reinterpret_cast<char *>(lParam
));
691 case SCI_AUTOCGETCURRENT
:
692 return AutoCompleteGetCurrent();
694 case SCI_AUTOCGETCURRENTTEXT
:
695 return AutoCompleteGetCurrentText(reinterpret_cast<char *>(lParam
));
697 case SCI_AUTOCSETCANCELATSTART
:
698 ac
.cancelAtStartPos
= wParam
!= 0;
701 case SCI_AUTOCGETCANCELATSTART
:
702 return ac
.cancelAtStartPos
;
704 case SCI_AUTOCSETFILLUPS
:
705 ac
.SetFillUpChars(reinterpret_cast<char *>(lParam
));
708 case SCI_AUTOCSETCHOOSESINGLE
:
709 ac
.chooseSingle
= wParam
!= 0;
712 case SCI_AUTOCGETCHOOSESINGLE
:
713 return ac
.chooseSingle
;
715 case SCI_AUTOCSETIGNORECASE
:
716 ac
.ignoreCase
= wParam
!= 0;
719 case SCI_AUTOCGETIGNORECASE
:
720 return ac
.ignoreCase
;
722 case SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR
:
723 ac
.ignoreCaseBehaviour
= wParam
;
726 case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR
:
727 return ac
.ignoreCaseBehaviour
;
729 case SCI_USERLISTSHOW
:
731 AutoCompleteStart(0, reinterpret_cast<const char *>(lParam
));
734 case SCI_AUTOCSETAUTOHIDE
:
735 ac
.autoHide
= wParam
!= 0;
738 case SCI_AUTOCGETAUTOHIDE
:
741 case SCI_AUTOCSETDROPRESTOFWORD
:
742 ac
.dropRestOfWord
= wParam
!= 0;
745 case SCI_AUTOCGETDROPRESTOFWORD
:
746 return ac
.dropRestOfWord
;
748 case SCI_AUTOCSETMAXHEIGHT
:
749 ac
.lb
->SetVisibleRows(wParam
);
752 case SCI_AUTOCGETMAXHEIGHT
:
753 return ac
.lb
->GetVisibleRows();
755 case SCI_AUTOCSETMAXWIDTH
:
756 maxListWidth
= wParam
;
759 case SCI_AUTOCGETMAXWIDTH
:
762 case SCI_REGISTERIMAGE
:
763 ac
.lb
->RegisterImage(wParam
, reinterpret_cast<const char *>(lParam
));
766 case SCI_REGISTERRGBAIMAGE
:
767 ac
.lb
->RegisterRGBAImage(wParam
, sizeRGBAImage
.x
, sizeRGBAImage
.y
, reinterpret_cast<unsigned char *>(lParam
));
770 case SCI_CLEARREGISTEREDIMAGES
:
771 ac
.lb
->ClearRegisteredImages();
774 case SCI_AUTOCSETTYPESEPARATOR
:
775 ac
.SetTypesep(static_cast<char>(wParam
));
778 case SCI_AUTOCGETTYPESEPARATOR
:
779 return ac
.GetTypesep();
781 case SCI_CALLTIPSHOW
:
782 CallTipShow(LocationFromPosition(wParam
),
783 reinterpret_cast<const char *>(lParam
));
786 case SCI_CALLTIPCANCEL
:
790 case SCI_CALLTIPACTIVE
:
791 return ct
.inCallTipMode
;
793 case SCI_CALLTIPPOSSTART
:
794 return ct
.posStartCallTip
;
796 case SCI_CALLTIPSETHLT
:
797 ct
.SetHighlight(wParam
, lParam
);
800 case SCI_CALLTIPSETBACK
:
801 ct
.colourBG
= ColourDesired(wParam
);
802 vs
.styles
[STYLE_CALLTIP
].back
= ct
.colourBG
;
803 InvalidateStyleRedraw();
806 case SCI_CALLTIPSETFORE
:
807 ct
.colourUnSel
= ColourDesired(wParam
);
808 vs
.styles
[STYLE_CALLTIP
].fore
= ct
.colourUnSel
;
809 InvalidateStyleRedraw();
812 case SCI_CALLTIPSETFOREHLT
:
813 ct
.colourSel
= ColourDesired(wParam
);
814 InvalidateStyleRedraw();
817 case SCI_CALLTIPUSESTYLE
:
818 ct
.SetTabSize((int)wParam
);
819 InvalidateStyleRedraw();
822 case SCI_CALLTIPSETPOSITION
:
823 ct
.SetPosition(wParam
!= 0);
824 InvalidateStyleRedraw();
828 displayPopupMenu
= wParam
!= 0;
833 DocumentLexState()->SetLexer(wParam
);
837 return DocumentLexState()->lexLanguage
;
840 if (DocumentLexState()->lexLanguage
== SCLEX_CONTAINER
) {
841 pdoc
->ModifiedAt(wParam
);
842 NotifyStyleToNeeded((lParam
== -1) ? pdoc
->Length() : lParam
);
844 DocumentLexState()->Colourise(wParam
, lParam
);
849 case SCI_SETPROPERTY
:
850 DocumentLexState()->PropSet(reinterpret_cast<const char *>(wParam
),
851 reinterpret_cast<const char *>(lParam
));
854 case SCI_GETPROPERTY
:
855 return StringResult(lParam
, DocumentLexState()->PropGet(reinterpret_cast<const char *>(wParam
)));
857 case SCI_GETPROPERTYEXPANDED
:
858 return DocumentLexState()->PropGetExpanded(reinterpret_cast<const char *>(wParam
),
859 reinterpret_cast<char *>(lParam
));
861 case SCI_GETPROPERTYINT
:
862 return DocumentLexState()->PropGetInt(reinterpret_cast<const char *>(wParam
), lParam
);
864 case SCI_SETKEYWORDS
:
865 DocumentLexState()->SetWordList(wParam
, reinterpret_cast<const char *>(lParam
));
868 case SCI_SETLEXERLANGUAGE
:
869 DocumentLexState()->SetLexerLanguage(reinterpret_cast<const char *>(lParam
));
872 case SCI_GETLEXERLANGUAGE
:
873 return StringResult(lParam
, DocumentLexState()->GetName());
875 case SCI_PRIVATELEXERCALL
:
876 return reinterpret_cast<sptr_t
>(
877 DocumentLexState()->PrivateCall(wParam
, reinterpret_cast<void *>(lParam
)));
879 case SCI_GETSTYLEBITSNEEDED
:
880 return DocumentLexState()->GetStyleBitsNeeded();
882 case SCI_PROPERTYNAMES
:
883 return StringResult(lParam
, DocumentLexState()->PropertyNames());
885 case SCI_PROPERTYTYPE
:
886 return DocumentLexState()->PropertyType(reinterpret_cast<const char *>(wParam
));
888 case SCI_DESCRIBEPROPERTY
:
889 return StringResult(lParam
, DocumentLexState()->DescribeProperty(reinterpret_cast<const char *>(wParam
)));
891 case SCI_DESCRIBEKEYWORDSETS
:
892 return StringResult(lParam
, DocumentLexState()->DescribeWordListSets());
897 return Editor::WndProc(iMessage
, wParam
, lParam
);