scintilla/License.txt0000644000175000017500000000154412075650364013637 0ustar neilneilLicense for Scintilla and SciTE Copyright 1998-2003 by Neil Hodgson All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. scintilla/README0000644000175000017500000000407212210260370012354 0ustar neilneilREADME for building of Scintilla and SciTE Scintilla can be built by itself. To build SciTE, Scintilla must first be built. *** GTK+/Linux version *** You must first have GTK+ 2.0 or later and GCC (4.1 or better) installed. GTK+ 1.x will not work. Other C++ compilers may work but may require tweaking the make file. To build Scintilla, use the makefile located in the scintilla/gtk directory cd scintilla/gtk make cd ../.. To build and install SciTE, use the makefile located in the scite/gtk directory cd scite/gtk make make install This installs SciTE into $prefix/bin. The value of $prefix is determined from the location of Gnome if it is installed. This is usually /usr if installed with Linux or /usr/local if built from source. If Gnome is not installed /usr/bin is used as the prefix. The prefix can be overridden on the command line like "make prefix=/opt" but the same value should be used for both make and make install as this location is compiled into the executable. The global properties file is installed at $prefix/share/scite/SciTEGlobal.properties. The language specific properties files are also installed into this directory. To remove SciTE make uninstall To clean the object files which may be needed to change $prefix make clean The current make file only supports static linking between SciTE and Scintilla. *** Windows version *** A C++ compiler is required. Visual Studio 2010 is the development system used for most development although TDM Mingw32 4.7.1 is also supported. To build Scintilla, make in the scintilla/win32 directory cd scintilla\win32 GCC: mingw32-make VS .NET: nmake -f scintilla.mak cd ..\.. To build SciTE, use the makefiles located in the scite/win32 directory cd scite\win32 GCC: mingw32-make VS .NET: nmake -f scite.mak An executable SciTE will now be in scite/bin. *** GTK+/Windows version *** Mingw32 is known to work. Other compilers will probably not work. Only Scintilla will build with GTK+ on Windows. SciTE will not work. To build Scintilla, make in the scintilla/gtk directory cd scintilla\gtk mingw32-make scintilla/bin/0000755000175000017500000000000012557523047012262 5ustar neilneilscintilla/bin/__init__.py0000644000175000017500000000000112075650364014360 0ustar neilneil scintilla/bin/empty.txt0000644000175000017500000000006712075650364014162 0ustar neilneilThis empty files ensures that the directory is created.scintilla/cocoa/0000755000175000017500000000000012557522743012600 5ustar neilneilscintilla/cocoa/QuartzTextStyle.h0000644000175000017500000000400512477041066016117 0ustar neilneil/* * QuartzTextStyle.h * * Created by Evan Jones on Wed Oct 02 2002. * */ #ifndef _QUARTZ_TEXT_STYLE_H #define _QUARTZ_TEXT_STYLE_H #include "QuartzTextStyleAttribute.h" class QuartzTextStyle { public: QuartzTextStyle() { fontRef = NULL; styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); characterSet = 0; } QuartzTextStyle(const QuartzTextStyle &other) { // Does not copy font colour attribute fontRef = static_cast(CFRetain(other.fontRef)); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); characterSet = other.characterSet; } ~QuartzTextStyle() { if (styleDict != NULL) { CFRelease(styleDict); styleDict = NULL; } if (fontRef) { CFRelease(fontRef); fontRef = NULL; } } CFMutableDictionaryRef getCTStyle() const { return styleDict; } void setCTStyleColor(CGColor *inColor) { CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, inColor); } float getAscent() const { return static_cast(::CTFontGetAscent(fontRef)); } float getDescent() const { return static_cast(::CTFontGetDescent(fontRef)); } float getLeading() const { return static_cast(::CTFontGetLeading(fontRef)); } void setFontRef(CTFontRef inRef, int characterSet_) { fontRef = inRef; characterSet = characterSet_; if (styleDict != NULL) CFRelease(styleDict); styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); } CTFontRef getFontRef() { return fontRef; } int getCharacterSet() { return characterSet; } private: CFMutableDictionaryRef styleDict; CTFontRef fontRef; int characterSet; }; #endif scintilla/cocoa/ScintillaView.h0000644000175000017500000001551212501420262015510 0ustar neilneil /** * Declaration of the native Cocoa View that serves as container for the scintilla parts. * * Created by Mike Lischke. * * Copyright 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2009, 2011 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import #import "Scintilla.h" #import "SciLexer.h" #import "InfoBarCommunicator.h" /** * Scintilla sends these two messages to the notify handler. Please refer * to the Windows API doc for details about the message format. */ #define WM_COMMAND 1001 #define WM_NOTIFY 1002 namespace Scintilla { /** * On the Mac, there is no WM_COMMAND or WM_NOTIFY message that can be sent * back to the parent. Therefore, there must be a callback handler that acts * like a Windows WndProc, where Scintilla can send notifications to. Use * ScintillaView registerNotifyCallback() to register such a handler. * Message format is: *
* WM_COMMAND: HIWORD (wParam) = notification code, LOWORD (wParam) = control ID, lParam = ScintillaCocoa* *
* WM_NOTIFY: wParam = control ID, lParam = ptr to SCNotification structure, with hwndFrom set to ScintillaCocoa* */ typedef void(*SciNotifyFunc) (intptr_t windowid, unsigned int iMessage, uintptr_t wParam, uintptr_t lParam); class ScintillaCocoa; } @class ScintillaView; extern NSString *const SCIUpdateUINotification; @protocol ScintillaNotificationProtocol - (void)notification: (Scintilla::SCNotification*)notification; @end /** * SCIMarginView draws line numbers and other margins next to the text view. */ @interface SCIMarginView : NSRulerView { @private int marginWidth; ScintillaView *owner; NSMutableArray *currentCursors; } @property (assign) int marginWidth; @property (assign) ScintillaView *owner; - (id)initWithScrollView:(NSScrollView *)aScrollView; @end /** * SCIContentView is the Cocoa interface to the Scintilla backend. It handles text input and * provides a canvas for painting the output. */ @interface SCIContentView : NSView < NSTextInputClient, NSUserInterfaceValidations, NSDraggingSource, NSDraggingDestination> { @private ScintillaView* mOwner; NSCursor* mCurrentCursor; NSTrackingArea *trackingArea; // Set when we are in composition mode and partial input is displayed. NSRange mMarkedTextRange; } @property (nonatomic, assign) ScintillaView* owner; - (void) setCursor: (int) cursor; - (BOOL) canUndo; - (BOOL) canRedo; @end @interface ScintillaView : NSView { @private // The back end is kind of a controller and model in one. // It uses the content view for display. Scintilla::ScintillaCocoa* mBackend; // This is the actual content to which the backend renders itself. SCIContentView* mContent; NSScrollView *scrollView; SCIMarginView *marginView; CGFloat zoomDelta; // Area to display additional controls (e.g. zoom info, caret position, status info). NSView * mInfoBar; BOOL mInfoBarAtTop; id mDelegate; } @property (nonatomic, readonly) Scintilla::ScintillaCocoa* backend; @property (nonatomic, assign) id delegate; @property (nonatomic, readonly) NSScrollView *scrollView; + (Class) contentViewClass; - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location value: (float) value; - (void) setCallback: (id ) callback; - (void) suspendDrawing: (BOOL) suspend; - (void) notification: (Scintilla::SCNotification*) notification; // Scroller handling - (void) setMarginWidth: (int) width; - (SCIContentView*) content; - (void) updateMarginCursors; // NSTextView compatibility layer. - (NSString*) string; - (void) setString: (NSString*) aString; - (void) insertText: (id) aString; - (void) setEditable: (BOOL) editable; - (BOOL) isEditable; - (NSRange) selectedRange; - (NSString*) selectedString; - (void) deleteRange: (NSRange) range; - (void)setFontName: (NSString*) font size: (int) size bold: (BOOL) bold italic: (BOOL) italic; // Native call through to the backend. + (sptr_t) directCall: (ScintillaView*) sender message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam; - (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam; - (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam; - (sptr_t) message: (unsigned int) message; // Back end properties getters and setters. - (void) setGeneralProperty: (int) property parameter: (long) parameter value: (long) value; - (void) setGeneralProperty: (int) property value: (long) value; - (long) getGeneralProperty: (int) property; - (long) getGeneralProperty: (int) property parameter: (long) parameter; - (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra; - (long) getGeneralProperty: (int) property ref: (const void*) ref; - (void) setColorProperty: (int) property parameter: (long) parameter value: (NSColor*) value; - (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString*) fromHTML; - (NSColor*) getColorProperty: (int) property parameter: (long) parameter; - (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void*) value; - (const void*) getReferenceProperty: (int) property parameter: (long) parameter; - (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString*) value; - (NSString*) getStringProperty: (int) property parameter: (long) parameter; - (void) setLexerProperty: (NSString*) name value: (NSString*) value; - (NSString*) getLexerProperty: (NSString*) name; // The delegate property should be used instead of registerNotifyCallback which is deprecated. - (void) registerNotifyCallback: (intptr_t) windowid value: (Scintilla::SciNotifyFunc) callback __attribute__((deprecated)); - (void) setInfoBar: (NSView *) aView top: (BOOL) top; - (void) setStatusText: (NSString*) text; - (BOOL) findAndHighlightText: (NSString*) searchText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord scrollTo: (BOOL) scrollTo wrap: (BOOL) wrap; - (BOOL) findAndHighlightText: (NSString*) searchText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord scrollTo: (BOOL) scrollTo wrap: (BOOL) wrap backwards: (BOOL) backwards; - (int) findAndReplaceText: (NSString*) searchText byText: (NSString*) newText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord doAll: (BOOL) doAll; @end scintilla/cocoa/res/0000755000175000017500000000000012252163016013353 5ustar neilneilscintilla/cocoa/res/info_bar_bg.png0000644000175000017500000000601112075650364016320 0ustar neilneilPNG  IHDRM.Հ pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F4IDATxVK0'q,j_d0AIqG繞 I86Om0 ]cM3c*G#>ugqJ -nhirxGƪwRJ;fwu88joR? XGůUS[IJ*$:7鶪O{7@Hkk?<kktq݋m6nƶد-mR;`zv x#=\% oYRڱ#&?>ҹЪn_;j;$}*}+(}'}/LtY"$].9⦅%{_a݊]hk5'SN{<_ t jM{-4%TńtY۟R6#v\喊x:'HO3^&0::m,L%3:qVE t]~Iv6Wٯ) |ʸ2]G4(6w‹$"AEv m[D;Vh[}چN|3HS:KtxU'D;77;_"e?Yqxl+ pHYs  0iTXtXML:com.adobe.xmp Acorn version 4.1.2 5 72 72 5 eWIDATxZR0U/!7 6q#5u`^==3/;Zˮ)0 E߁|hHlU;qp^rvsq޵ԗrZfw=w{\}h\sKmIkNXHhŻx+om?]_gMƔ57{,ox}}`)QB G/W$(_؇jKDZ|/,/yaB3e@/ / O^h[g;0|NuD^jxyك|.7^Q[kxsڟZ_K///MT[~u׏4^<+ˏy3QT]\U;k깸]}w\<ۯNm9xX1R \;g+wSwJG.NI %kaFV*?6'cX׸W||:4A+ 5&$6\J`JzG,/lꐥ \Zr0jS^GךZZu>gԛ7!| ECbe1)q.Fs[9~~[Q>W޷N IX<.\_v\*Arf`6eqA2/-F:/GϘZ%_ǸMц'/:6!Pwxw|4,-ǯq8\/ݿ$J%l=g-q'{|u2uJb~R^S1[K=}wꔥ1Fr <9ƷN'1!# ]o.Ƴ|Z_m7-@CZ]\P>Ԣ^Le].On`Fk~jgxv/zjgxv䛼u1zbx~M=֥dOCbeIOM?4kC(Y6Gg3rTȿQA1ꔀ/PT(pL`09>`"2ƨuJ`JzG(t|e['Ł_tQ/7z:%1=U7ho9IENDB`scintilla/cocoa/res/mac_cursor_flipped@2x.png0000644000175000017500000001322312252163016020274 0ustar neilneilPNG  IHDR@@iq AiCCPICC ProfileH wTSϽ7" %z ;HQIP&vDF)VdTG"cE b PQDE݌k 5ޚYg}׺PtX4X\XffGD=HƳ.d,P&s"7C$ E6<~&S2)212 "įl+ɘ&Y4Pޚ%ᣌ\%g|eTI(L0_&l2E9r9hxgIbטifSb1+MxL 0oE%YmhYh~S=zU&ϞAYl/$ZUm@O ޜl^ ' lsk.+7oʿ9V;?#I3eE妧KD d9i,UQ h A1vjpԁzN6p\W p G@ K0ށiABZyCAP8C@&*CP=#t] 4}a ٰ;GDxJ>,_“@FXDBX$!k"EHqaYbVabJ0՘cVL6f3bձX'?v 6-V``[a;p~\2n5׌ &x*sb|! ߏƿ' Zk! $l$T4QOt"y\b)AI&NI$R$)TIj"]&=&!:dGrY@^O$ _%?P(&OJEBN9J@y@yCR nXZOD}J}/G3ɭk{%Oחw_.'_!JQ@SVF=IEbbbb5Q%O@%!BӥyҸM:e0G7ӓ e%e[(R0`3R46i^)*n*|"fLUo՝mO0j&jajj.ϧwϝ_4갺zj=U45nɚ4ǴhZ ZZ^0Tf%9->ݫ=cXgN].[7A\SwBOK/X/_Q>QG[ `Aaac#*Z;8cq>[&IIMST`ϴ kh&45ǢYYF֠9<|y+ =X_,,S-,Y)YXmĚk]c}džjcΦ浭-v};]N"&1=xtv(}'{'IߝY) Σ -rqr.d._xpUەZM׍vm=+KGǔ ^WWbj>:>>>v}/avO8 FV> 2 u/_$\BCv< 5 ]s.,4&yUx~xw-bEDCĻHGKwFGEGME{EEKX,YFZ ={$vrK .3\rϮ_Yq*©L_wד+]eD]cIIIOAu_䩔)3ѩiB%a+]3='/40CiU@ёL(sYfLH$%Y jgGeQn~5f5wugv5k֮\۹Nw]m mHFˍenQQ`hBBQ-[lllfjۗ"^bO%ܒY}WwvwXbY^Ю]WVa[q`id2JjGէ{׿m>PkAma꺿g_DHGGu;776ƱqoC{P38!9 ҝˁ^r۽Ug9];}}_~imp㭎}]/}.{^=}^?z8hc' O*?f`ϳgC/Oϩ+FFGGόzˌㅿ)ѫ~wgbk?Jި9mdwi獵ޫ?cǑOO?w| x&mf2:Y~ pHYs  iTXtXML:com.adobe.xmp 2013-11-11T09:11:91 Acorn version 4.1.2 1 72 5 1 72 64 1 64 dAIDATxZ[LW&w!J )6w/IMC_`k/VXQj6jj<4b**"DMRPD~qf3"l'9gf?gW1(3,O>c3&LC d2@hc>>>mKKK*2!(D= #W8Wo߾-?z&{ÌOT$9ot1"EI]Bzgp#/6\>t yMJ0O _dK^O p)2!{yWF+> ?޽+f FLo5péT7|yykkk%ooo ]lVÙSǼ=xXo y#: ?{̩D^X[ DƋ ҪUad/5rCMKógڽQT ͕ slLzDeǎDA P߿/W^-+_LxqT+]U@o <}Fi0x ,j$9^j 1֭[\6#fpx&};wy(\SgblAxyE>gaz8{޽9X؝Ow\J{mx0G}$,  OHH8 fơ͔:d1ׯ_~+̘ PG( ɓ'+s٨}a!(uЉ' 3AW,8X =焹'k럟A3w܃K6a;T~FW AVX `NLLdgg$r7QkC"@`Ϝ9S^\\7V!8'8.F %44FŋqB=ږBM$Ġ^IMMMG ! Zq޽$ s%))IINNyˣ@M2e&jhѨa0vՅX^b?'W]]ƫ> ! j~T "=ɔbkDm:u'̙fc/\e?lRE *A @=qVHPDGc(z܅mu3dzu>|!RO |%ށq''0j.G2`kaaU0eh`4"n #`Lv`0X.QFJJO: xsuшx]"G= p3f̀7n p3f9JFIENDB`scintilla/cocoa/res/mac_cursor_flipped.png0000644000175000017500000001063212252163016017723 0ustar neilneilPNG  IHDR szz AiCCPICC ProfileH wTSϽ7" %z ;HQIP&vDF)VdTG"cE b PQDE݌k 5ޚYg}׺PtX4X\XffGD=HƳ.d,P&s"7C$ E6<~&S2)212 "įl+ɘ&Y4Pޚ%ᣌ\%g|eTI(L0_&l2E9r9hxgIbטifSb1+MxL 0oE%YmhYh~S=zU&ϞAYl/$ZUm@O ޜl^ ' lsk.+7oʿ9V;?#I3eE妧KD d9i,UQ h A1vjpԁzN6p\W p G@ K0ށiABZyCAP8C@&*CP=#t] 4}a ٰ;GDxJ>,_“@FXDBX$!k"EHqaYbVabJ0՘cVL6f3bձX'?v 6-V``[a;p~\2n5׌ &x*sb|! ߏƿ' Zk! $l$T4QOt"y\b)AI&NI$R$)TIj"]&=&!:dGrY@^O$ _%?P(&OJEBN9J@y@yCR nXZOD}J}/G3ɭk{%Oחw_.'_!JQ@SVF=IEbbbb5Q%O@%!BӥyҸM:e0G7ӓ e%e[(R0`3R46i^)*n*|"fLUo՝mO0j&jajj.ϧwϝ_4갺zj=U45nɚ4ǴhZ ZZ^0Tf%9->ݫ=cXgN].[7A\SwBOK/X/_Q>QG[ `Aaac#*Z;8cq>[&IIMST`ϴ kh&45ǢYYF֠9<|y+ =X_,,S-,Y)YXmĚk]c}džjcΦ浭-v};]N"&1=xtv(}'{'IߝY) Σ -rqr.d._xpUەZM׍vm=+KGǔ ^WWbj>:>>>v}/avO8 FV> 2 u/_$\BCv< 5 ]s.,4&yUx~xw-bEDCĻHGKwFGEGME{EEKX,YFZ ={$vrK .3\rϮ_Yq*©L_wד+]eD]cIIIOAu_䩔)3ѩiB%a+]3='/40CiU@ёL(sYfLH$%Y jgGeQn~5f5wugv5k֮\۹Nw]m mHFˍenQQ`hBBQ-[lllfjۗ"^bO%ܒY}WwvwXbY^Ю]WVa[q`id2JjGէ{׿m>PkAma꺿g_DHGGu;776ƱqoC{P38!9 ҝˁ^r۽Ug9];}}_~imp㭎}]/}.{^=}^?z8hc' O*?f`ϳgC/Oϩ+FFGGόzˌㅿ)ѫ~wgbk?Jި9mdwi獵ޫ?cǑOO?w| x&mf2:Y~ pHYs  iTXtXML:com.adobe.xmp 2013-11-11T09:11:91 Acorn version 4.1.2 1 72 5 1 72 64 1 64 dHIDATX VKQf&M(AK>4E)=$"H?,H\Po,AZPRb[!xRk  fw_vk79fc~3cb߄1v8ɲ矛'3AX׽4^/Ϊ77~; A$8 kh^TJ(b^Z6FI@ eŷtŝy.Ҟ[c,>%VQiNn4}ط NKbbBB@m苋w <p+e bii3Irܫv%8UO!"ͥd[ ߿_f*J}f4gZO\FGG!>~<N#?̮U`lffbj'J~0tØ9wM\{jD\6g%$"n*;jv\81h4jYD;Nh~U]YIENDB`scintilla/cocoa/res/mac_cursor_busy@2x.png0000644000175000017500000002136612252163016017642 0ustar neilneilPNG  IHDR@@iq AiCCPICC ProfileH wTSϽ7" %z ;HQIP&vDF)VdTG"cE b PQDE݌k 5ޚYg}׺PtX4X\XffGD=HƳ.d,P&s"7C$ E6<~&S2)212 "įl+ɘ&Y4Pޚ%ᣌ\%g|eTI(L0_&l2E9r9hxgIbטifSb1+MxL 0oE%YmhYh~S=zU&ϞAYl/$ZUm@O ޜl^ ' lsk.+7oʿ9V;?#I3eE妧KD d9i,UQ h A1vjpԁzN6p\W p G@ K0ށiABZyCAP8C@&*CP=#t] 4}a ٰ;GDxJ>,_“@FXDBX$!k"EHqaYbVabJ0՘cVL6f3bձX'?v 6-V``[a;p~\2n5׌ &x*sb|! ߏƿ' Zk! $l$T4QOt"y\b)AI&NI$R$)TIj"]&=&!:dGrY@^O$ _%?P(&OJEBN9J@y@yCR nXZOD}J}/G3ɭk{%Oחw_.'_!JQ@SVF=IEbbbb5Q%O@%!BӥyҸM:e0G7ӓ e%e[(R0`3R46i^)*n*|"fLUo՝mO0j&jajj.ϧwϝ_4갺zj=U45nɚ4ǴhZ ZZ^0Tf%9->ݫ=cXgN].[7A\SwBOK/X/_Q>QG[ `Aaac#*Z;8cq>[&IIMST`ϴ kh&45ǢYYF֠9<|y+ =X_,,S-,Y)YXmĚk]c}džjcΦ浭-v};]N"&1=xtv(}'{'IߝY) Σ -rqr.d._xpUەZM׍vm=+KGǔ ^WWbj>:>>>v}/avO8 FV> 2 u/_$\BCv< 5 ]s.,4&yUx~xw-bEDCĻHGKwFGEGME{EEKX,YFZ ={$vrK .3\rϮ_Yq*©L_wד+]eD]cIIIOAu_䩔)3ѩiB%a+]3='/40CiU@ёL(sYfLH$%Y jgGeQn~5f5wugv5k֮\۹Nw]m mHFˍenQQ`hBBQ-[lllfjۗ"^bO%ܒY}WwvwXbY^Ю]WVa[q`id2JjGէ{׿m>PkAma꺿g_DHGGu;776ƱqoC{P38!9 ҝˁ^r۽Ug9];}}_~imp㭎}]/}.{^=}^?z8hc' O*?f`ϳgC/Oϩ+FFGGόzˌㅿ)ѫ~wgbk?Jި9mdwi獵ޫ?cǑOO?w| x&mf2:Y~ pHYs  iTXtXML:com.adobe.xmp 2013-11-11T09:11:91 Acorn version 4.1.2 1 72 5 1 72 64 1 64 dIDATx[ p]y]"==-,ْl˒R01N 4KP@v4a@CbZbcP.[d-Ozzr]NJ0=9W JI\.kܫ~ <܄ʹ3)@XKE|A8[fAQMG0;iYqZg^ƘØx[lasX:1B@8wݱXZ1]c?ޅ>>5,UUe8֭0 V 8Dn۶3/7N8 3́}oEϏ'N(8' OޡG  K\3 `B {|Ïp ^a_s54i$* l`J&P*t w^J{`XpAXs̡zhX ߻}n_p\pԞ>}:577|pD,?frY c "`GX>T*RRR]  7X7X}+7M&NHB!jmm%heJs=G/`W_=`ȑ1Q SQQ .؆PixyBn/ 2xcxXϏS{: zFG{n?k\b{#$&LQQʟx^eQjj1jhT{<{cr25ϥ~m: =C˖-sw,`O K~뭷J/_9 n{ 3f4ϳqj1n2%/* Q25Du"5SH6^mdSWWڝ.$j[>|9+x#ŝ0r.sooo\ͯXݳgO Ã+?0=csd VZ%ϟ/2/|w} Aȏº:nf)|KUee%eEO@Űv SfSEjgHlX=`/.}#4w /^0屖+iʙ׷83k8"XSJ*,0Uń2*\0Z2Փ,dûKt3,>&wy5uuuӘ]w:u+<~Rp7 gxG" ,W%:shƌ ̼߿zx e6\(eaUU7r_g|Ì3_zV7!` H)l[R/BńG2G\e~'S(<.jےjPL9\ n V իWa 9syfW.O>$ksD(nii19j/?Vz_6̞9O?5mQ)o ;#k(+hV:iʡSLS׉XM1bVjM6un鷿XogSA/eG9G^{^{,_Bcf#S۟zdVZZ*#Cx,@K_^^e 7܀a<26čBu)--gY\vBRɌ 9BR}IrzKH:uZ*-EP$ͺ֪o?᛽`*m[)a^yc!W),8EF~_"Cpn|~~oLyvG0t#<<@`G}]57M}cwiBdţҊu9x(})i&F荣&(3'iVDpwy)-"էMbTθnf1MM В%KtMrCqq:¦Q =`GF` < 3@#w<`KyBjkk9fIjn54.%焕|m@ })SHQ?A, H֦H^R)(1E`LLJhb\P3>cx|Ԑ[Y,zv\WdeeemD؅N.$@pyYF)p aR+Ԝ3k͓gM+Q'UBJJk(cdbJlA%hh,2Q|"XΦAK2ʞNJ PQ8\d c~/Yc1@ +nƷ'\{³Z8D,a/̹]pB48OXt ;vBHG}-դGlع + b|2Cv};NLd 2YTRW2yPn>$ߦ]oh#)A5-gܨ3+ E`m\΢z F';:::ٳ^#8Otڍ`֮]ڐTXrawΝr}SkIòҎtd)ryrrE1!:E++iӼ(UZ tQMnC*l0AYj0C07!p_,,d o3,ltbϡ~Ix,@Xd{'VCPxb ]_vmgsG3_Tʰ9RcdQ!!eH)ˑH^Bwդ>j: *۾7mPdT@>/Z rm,T.bq|:v d!W^ye l\p(7!{\?CC\z0h)5KNZ/`{VM/V@ȷC&yRQA+WQaI?0,2aNTc^{.Oh^ ncE'?o2[U L|gœF T2k:)jI٠3 Gj[ptXu mw%)y6MX$8Kp`#_4%"GQ*1/?&wW)spn=pj o9n˂Ap=GKE )%yż]p#|pqQEy㠤ФAr*lMU =FsU|K|&>$[8A j?᭽/݃ޣ{&QY2)ȭ;R/+^j_!8lQB*IHMV +^BKP LbG?`1gϾ`&P7ϬFG!+VRU ( [H8BU4h! (>Q, i&B(rTq,6!c v.h]*p{" Fe!e{3KģLYF-33MS͏H&7 ٤'`_;S2FOZ4&QV#X\ŁcV>ߍIx=n=Q `x@8S& ƀ9:m?h& g8pzz9:W[`lVhKq&jdgaO! Pâ` 3f:cdn^ eX>|vke,qn*|)A \AI5eYr䰯cPm)~l:bS+V!lGEk"W;K>yQ]OFa[]8؝|.E9 Mk+HAd PִPFf5p0*AA< NfI LOJ3BV]FI;_p~OSBs~ALDȒzR:ĠUt0S4S :%ϟL yƇ:l^t=1OY jù@HrMRQa)l~P @sҨgTI͵wĖbG8"@HƩ-< wj!PC8X 7Q4ufKj\\Lպ)<l A1vjpԁzN6p\W p G@ K0ށiABZyCAP8C@&*CP=#t] 4}a ٰ;GDxJ>,_“@FXDBX$!k"EHqaYbVabJ0՘cVL6f3bձX'?v 6-V``[a;p~\2n5׌ &x*sb|! ߏƿ' Zk! $l$T4QOt"y\b)AI&NI$R$)TIj"]&=&!:dGrY@^O$ _%?P(&OJEBN9J@y@yCR nXZOD}J}/G3ɭk{%Oחw_.'_!JQ@SVF=IEbbbb5Q%O@%!BӥyҸM:e0G7ӓ e%e[(R0`3R46i^)*n*|"fLUo՝mO0j&jajj.ϧwϝ_4갺zj=U45nɚ4ǴhZ ZZ^0Tf%9->ݫ=cXgN].[7A\SwBOK/X/_Q>QG[ `Aaac#*Z;8cq>[&IIMST`ϴ kh&45ǢYYF֠9<|y+ =X_,,S-,Y)YXmĚk]c}džjcΦ浭-v};]N"&1=xtv(}'{'IߝY) Σ -rqr.d._xpUەZM׍vm=+KGǔ ^WWbj>:>>>v}/avO8 FV> 2 u/_$\BCv< 5 ]s.,4&yUx~xw-bEDCĻHGKwFGEGME{EEKX,YFZ ={$vrK .3\rϮ_Yq*©L_wד+]eD]cIIIOAu_䩔)3ѩiB%a+]3='/40CiU@ёL(sYfLH$%Y jgGeQn~5f5wugv5k֮\۹Nw]m mHFˍenQQ`hBBQ-[lllfjۗ"^bO%ܒY}WwvwXbY^Ю]WVa[q`id2JjGէ{׿m>PkAma꺿g_DHGGu;776ƱqoC{P38!9 ҝˁ^r۽Ug9];}}_~imp㭎}]/}.{^=}^?z8hc' O*?f`ϳgC/Oϩ+FFGGόzˌㅿ)ѫ~wgbk?Jި9mdwi獵ޫ?cǑOO?w| x&mf2:Y~ pHYs  iTXtXML:com.adobe.xmp 2013-11-11T09:11:53 Acorn version 4.1.2 1 72 5 1 72 32 1 32 ZIDATX ]LW˯R MI۴И& &}C`EMM $iֈKjʢkD( ²̲?;3L\@FΙ{9;Dx<ߴ[^p=߶Yޭ_;CAO|>ߩx~C0٬A`:.^R`ٴ(TVVz{{WB :dLUU8i_n d2ĦMHՕ5Lnݺ\D k"m9 O bӑ!(*qnذAׯg=K{4UuG  Xff&ñ k׷YAqsjj*P`$n>-D]@=x: ^/@(RMMM.ӹL?%~]Q>fq6(]1TuoT m`iW]C#@  re8҂Oqlhn2:](ygXʇ|7׭~π"ZgmXWW׊[[[E"7('NPi99;{yد';b?7 rQeӞ4U6:]v;vZ>|oGQJW@MMm4s޼or5K~)2p71 !Ies9 _)?~P5y)޽̩S]JssOqRx 011A?|˫UUs^*LQw.wca١; `'$ (@h^^t9嗊yȑ^I'^/V\"v@h6`r>nKn10\dkB-;qHf|ABu ^r姆71=[)EmlltCqQ{֬$g Qe/k z uAAH4V3r< |M(СC×bmcnL$0E`V:w҇ڌKZ  ysHW^=JAuj>C"UτTz 1fځNn03IBy:JS' 1[r!f4(̚.y˄K̃"Ќo'$!eEc-iv^(Zgn|XңoCP̬996=8?Wn|UŐYePHq, ~x0E * * Based on ScintillaMacOSX.h * Original code by Evan Jones on Sun Sep 01 2002. * Contributors: * Shane Caraveo, ActiveState * Bernd Paradies, Adobe * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #include #include #include #include #include #include #include #include #include "ILexer.h" #ifdef SCI_LEXER #include "SciLexer.h" #include "PropSetSimple.h" #endif #include "Position.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "ContractionState.h" #include "CellBuffer.h" #include "CallTip.h" #include "KeyMap.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "ViewStyle.h" #include "CharClassify.h" #include "Decoration.h" #include "CaseFolder.h" #include "Document.h" #include "CaseConvert.h" #include "Selection.h" #include "PositionCache.h" #include "EditModel.h" #include "MarginView.h" #include "EditView.h" #include "Editor.h" #include "AutoComplete.h" #include "ScintillaBase.h" extern "C" NSString* ScintillaRecPboardType; @class SCIContentView; @class SCIMarginView; @class ScintillaView; @class FindHighlightLayer; /** * Helper class to be used as timer target (NSTimer). */ @interface TimerTarget : NSObject { void* mTarget; NSNotificationQueue* notificationQueue; } - (id) init: (void*) target; - (void) timerFired: (NSTimer*) timer; - (void) idleTimerFired: (NSTimer*) timer; - (void) idleTriggered: (NSNotification*) notification; @end namespace Scintilla { /** * Main scintilla class, implemented for OS X (Cocoa). */ class ScintillaCocoa : public ScintillaBase { private: TimerTarget* timerTarget; NSEvent* lastMouseEvent; id delegate; SciNotifyFunc notifyProc; intptr_t notifyObj; bool capturedMouse; bool enteredSetScrollingSize; // Private so ScintillaCocoa objects can not be copied ScintillaCocoa(const ScintillaCocoa &) : ScintillaBase() {} ScintillaCocoa &operator=(const ScintillaCocoa &) { return * this; } bool GetPasteboardData(NSPasteboard* board, SelectionText* selectedText); void SetPasteboardData(NSPasteboard* board, const SelectionText& selectedText); int TargetAsUTF8(char *text); int EncodedFromUTF8(char *utf8, char *encoded) const; int scrollSpeed; int scrollTicks; NSTimer* tickTimer; NSTimer* idleTimer; CFRunLoopObserverRef observer; FindHighlightLayer *layerFindIndicator; protected: Point GetVisibleOriginInMain() const; PRectangle GetClientRectangle() const; virtual PRectangle GetClientDrawingRectangle(); Point ConvertPoint(NSPoint point); virtual void RedrawRect(PRectangle rc); virtual void DiscardOverdraw(); virtual void Redraw(); virtual void Initialise(); virtual void Finalise(); virtual CaseFolder *CaseFolderForEncoding(); virtual std::string CaseMapString(const std::string &s, int caseMapping); virtual void CancelModes(); public: ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin); virtual ~ScintillaCocoa(); void SetDelegate(id delegate_); void RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback); sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); NSScrollView* ScrollContainer() const; SCIContentView* ContentView(); bool SyncPaint(void* gc, PRectangle rc); bool Draw(NSRect rect, CGContextRef gc); void PaintMargin(NSRect aRect); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); void TickFor(TickReason reason); bool FineTickerAvailable(); bool FineTickerRunning(TickReason reason); void FineTickerStart(TickReason reason, int millis, int tolerance); void FineTickerCancel(TickReason reason); bool SetIdle(bool on); void SetMouseCapture(bool on); bool HaveMouseCapture(); void WillDraw(NSRect rect); void ScrollText(int linesToMove); void SetVerticalScrollPos(); void SetHorizontalScrollPos(); bool ModifyScrollBars(int nMax, int nPage); bool SetScrollingSize(void); void Resize(); void UpdateForScroll(); // Notifications for the owner. void NotifyChange(); void NotifyFocus(bool focus); void NotifyParent(SCNotification scn); void NotifyURIDropped(const char *uri); bool HasSelection(); bool CanUndo(); bool CanRedo(); virtual void CopyToClipboard(const SelectionText &selectedText); virtual void Copy(); virtual bool CanPaste(); virtual void Paste(); virtual void Paste(bool rectangular); void CTPaint(void* gc, NSRect rc); void CallTipMouseDown(NSPoint pt); virtual void CreateCallTipWindow(PRectangle rc); virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); virtual void ClaimSelection(); NSPoint GetCaretPosition(); static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); NSTimer *timers[tickPlatform+1]; void TimerFired(NSTimer* timer); void IdleTimerFired(); static void UpdateObserver(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *sci); void ObserverAdd(); void ObserverRemove(); virtual void IdleWork(); virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo); int InsertText(NSString* input); NSRange PositionsFromCharacters(NSRange range) const; NSRange CharactersFromPositions(NSRange range) const; void SelectOnlyMainSelection(); void ConvertSelectionVirtualSpace(); bool ClearAllSelections(); void CompositionStart(); void CompositionCommit(); void CompositionUndo(); virtual void SetDocPointer(Document *document); bool KeyboardInput(NSEvent* event); void MouseDown(NSEvent* event); void MouseMove(NSEvent* event); void MouseUp(NSEvent* event); void MouseEntered(NSEvent* event); void MouseExited(NSEvent* event); void MouseWheel(NSEvent* event); // Drag and drop void StartDrag(); bool GetDragData(id info, NSPasteboard &pasteBoard, SelectionText* selectedText); NSDragOperation DraggingEntered(id info); NSDragOperation DraggingUpdated(id info); void DraggingExited(id info); bool PerformDragOperation(id info); void DragScroll(); // Promote some methods needed for NSResponder actions. virtual void SelectAll(); void DeleteBackward(); virtual void Cut(); virtual void Undo(); virtual void Redo(); virtual NSMenu* CreateContextMenu(NSEvent* event); void HandleCommand(NSInteger command); virtual void ActiveStateChanged(bool isActive); void WindowWillMove(); // Find indicator void ShowFindIndicatorForRange(NSRange charRange, BOOL retaining); void MoveFindIndicatorWithBounce(BOOL bounce); void HideFindIndicator(); }; } scintilla/cocoa/ScintillaTest/0000755000175000017500000000000012533717246015360 5ustar neilneilscintilla/cocoa/ScintillaTest/Info.plist0000644000175000017500000000151712075650364017332 0ustar neilneil CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sun.${PRODUCT_NAME:identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType APPL CFBundleSignature ???? CFBundleVersion 1.0 NSMainNibFile MainMenu NSPrincipalClass NSApplication scintilla/cocoa/ScintillaTest/English.lproj/0000755000175000017500000000000012146776656020110 5ustar neilneilscintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib0000644000175000017500000052221612146776656022335 0ustar neilneil 1050 10D573 762 1038.29 460.00 com.apple.InterfaceBuilder.CocoaPlugin 762 YES YES com.apple.InterfaceBuilder.CocoaPlugin YES YES YES YES NSApplication FirstResponder NSApplication AMainMenu YES NewApplication 1048576 2147483647 NSImage NSMenuCheckmark NSImage NSMenuMixedState submenuAction: NewApplication YES About NewApplication 2147483647 YES YES 1048576 2147483647 Preferences… , 1048576 2147483647 YES YES 1048576 2147483647 Services 1048576 2147483647 submenuAction: Services YES _NSServicesMenu YES YES 1048576 2147483647 Hide NewApplication h 1048576 2147483647 Hide Others h 1572864 2147483647 Show All 1048576 2147483647 YES YES 1048576 2147483647 Quit NewApplication q 1048576 2147483647 _NSAppleMenu File 1048576 2147483647 submenuAction: File YES New n 1048576 2147483647 Open… o 1048576 2147483647 Open Recent 1048576 2147483647 submenuAction: Open Recent YES Clear Menu 1048576 2147483647 _NSRecentDocumentsMenu YES YES 1048576 2147483647 Close w 1048576 2147483647 Save s 1048576 2147483647 Save As… S 1179648 2147483647 Revert to Saved 2147483647 YES YES 1048576 2147483647 Page Setup... P 1179648 2147483647 Print… p 1048576 2147483647 Edit 1048576 2147483647 submenuAction: Edit YES Undo z 1048576 2147483647 Redo Z 1179648 2147483647 YES YES 1048576 2147483647 Cut x 1048576 2147483647 Copy c 1048576 2147483647 Paste v 1048576 2147483647 Delete 1048576 2147483647 Select All a 1048576 2147483647 YES YES 1048576 2147483647 Find 1048576 2147483647 submenuAction: Find YES Find… f 1048576 2147483647 1 Find Next g 1048576 2147483647 2 Find Previous G 1179648 2147483647 3 Use Selection for Find e 1048576 2147483647 7 Jump to Selection j 1048576 2147483647 Spelling and Grammar 1048576 2147483647 submenuAction: Spelling and Grammar YES Show Spelling… : 1048576 2147483647 Check Spelling ; 1048576 2147483647 Check Spelling While Typing 1048576 2147483647 Check Grammar With Spelling 1048576 2147483647 Substitutions 1048576 2147483647 submenuAction: Substitutions YES Smart Copy/Paste f 1048576 2147483647 1 Smart Quotes g 1048576 2147483647 2 Smart Links G 1179648 2147483647 3 Speech 1048576 2147483647 submenuAction: Speech YES Start Speaking 1048576 2147483647 Stop Speaking 1048576 2147483647 Format 2147483647 submenuAction: Format YES Font 2147483647 submenuAction: Font YES Show Fonts t 1048576 2147483647 Bold b 1048576 2147483647 2 Italic i 1048576 2147483647 1 Underline u 1048576 2147483647 YES YES 2147483647 Bigger + 1048576 2147483647 3 Smaller - 1048576 2147483647 4 YES YES 2147483647 Kern 2147483647 submenuAction: Kern YES Use Default 2147483647 Use None 2147483647 Tighten 2147483647 Loosen 2147483647 Ligature 2147483647 submenuAction: Ligature YES Use Default 2147483647 Use None 2147483647 Use All 2147483647 Baseline 2147483647 submenuAction: Baseline YES Use Default 2147483647 Superscript 2147483647 Subscript 2147483647 Raise 2147483647 Lower 2147483647 Font Quality 2147483647 submenuAction: Font Quality YES Default 2147483647 Non-antialiased 2147483647 1 Antialiased 2147483647 2 LCD Optimized 2147483647 3 YES YES 2147483647 Show Colors C 1048576 2147483647 YES YES 2147483647 Copy Style c 1572864 2147483647 Paste Style v 1572864 2147483647 _NSFontMenu Text 2147483647 submenuAction: Text YES Align Left { 1048576 2147483647 Center | 1048576 2147483647 Justify 2147483647 Align Right } 1048576 2147483647 YES YES 2147483647 Show Ruler 2147483647 Copy Ruler c 1310720 2147483647 Paste Ruler v 1310720 2147483647 View 1048576 2147483647 submenuAction: View YES Show Toolbar t 1572864 2147483647 Customize Toolbar… 1048576 2147483647 Window 1048576 2147483647 submenuAction: Window YES Minimize m 1048576 2147483647 Zoom 1048576 2147483647 YES YES 1048576 2147483647 Bring All to Front 1048576 2147483647 _NSWindowsMenu Help 1048576 2147483647 submenuAction: Help YES NewApplication Help ? 1048576 2147483647 _NSMainMenu 15 2 {{335, 58}, {982, 692}} 1946157056 Window NSWindow {1.79769e+308, 1.79769e+308} 319 YES 18 YES 256 {{1, 1}, {842, 590}} {{17, 16}, {844, 606}} {0, 0} 67239424 0 Scintilla Editor LucidaGrande 11 3100 6 System textBackgroundColor 3 MQA 3 MCAwLjgwMDAwMDAxAA 1 0 2 NO 289 {{872, 12}, {96, 32}} YES 67239424 134217728 Quit LucidaGrande 13 1044 -2038284033 129 200 25 268 {{20, 630}, {287, 22}} YES 343014976 268436480 YES 1 6 System controlTextColor 3 MAA 130560 0 search _searchFieldSearch: 138690815 0 400 75 130560 0 clear YES YES YES AXDescription NSAccessibilityEncodedAttributesValueType YES cancel _searchFieldCancel: 138690815 0 400 75 255 {982, 692} {{0, 0}, {1440, 878}} {1.79769e+308, 1.79769e+308} NSFontManager AppController YES performMiniaturize: 37 arrangeInFront: 39 print: 86 runPageLayout: 87 clearRecentDocuments: 127 orderFrontStandardAboutPanel: 142 performClose: 193 toggleContinuousSpellChecking: 222 undo: 223 copy: 224 checkSpelling: 225 paste: 226 stopSpeaking: 227 cut: 228 showGuessPanel: 230 redo: 231 selectAll: 232 startSpeaking: 233 delete: 235 performZoom: 240 performFindPanelAction: 241 centerSelectionInVisibleArea: 245 toggleGrammarChecking: 347 toggleSmartInsertDelete: 355 toggleAutomaticQuoteSubstitution: 356 toggleAutomaticLinkDetection: 357 showHelp: 360 saveDocument: 362 saveDocumentAs: 363 revertDocumentToSaved: 364 runToolbarCustomizationPalette: 365 toggleToolbarShown: 366 hide: 367 hideOtherApplications: 368 unhideAllApplications: 370 newDocument: 373 openDocument: 374 addFontTrait: 421 addFontTrait: 422 modifyFont: 423 orderFrontFontPanel: 424 modifyFont: 425 raiseBaseline: 426 lowerBaseline: 427 copyFont: 428 subscript: 429 superscript: 430 tightenKerning: 431 underline: 432 orderFrontColorPanel: 433 useAllLigatures: 434 loosenKerning: 435 pasteFont: 436 unscript: 437 useStandardKerning: 438 useStandardLigatures: 439 turnOffLigatures: 440 turnOffKerning: 441 alignLeft: 442 alignJustified: 443 copyRuler: 444 alignCenter: 445 toggleRuler: 446 alignRight: 447 pasteRuler: 448 terminate: 449 mEditHost 454 terminate: 455 searchText: 468 setFontQuality: 475 setFontQuality: 476 setFontQuality: 477 setFontQuality: 478 YES 0 -2 File's Owner -1 First Responder -3 Application 29 YES MainMenu 19 YES 56 YES 103 YES 1 217 YES 83 YES 81 YES 75 3 80 8 78 6 72 82 9 124 YES 77 5 73 1 79 7 112 10 74 2 125 YES 126 205 YES 202 198 207 214 199 203 197 206 215 218 YES 216 YES 200 YES 219 201 204 220 YES 213 210 221 208 209 106 YES 2 111 57 YES 58 134 150 136 1111 144 129 121 143 236 131 YES 149 145 130 24 YES 92 5 239 23 295 YES 296 YES 297 298 211 YES 212 YES 195 196 346 348 YES 349 YES 350 351 354 371 YES 372 YES 375 YES 376 YES 377 YES 378 YES 379 YES 380 381 382 383 384 385 386 387 388 YES 389 390 391 392 393 394 395 396 397 YES 398 YES 399 YES 400 401 402 403 404 405 YES 406 407 408 409 410 411 YES 412 413 414 415 YES 416 417 418 419 420 450 451 452 YES 453 466 YES 467 469 YES 470 YES 471 472 473 474 YES YES -3.IBPluginDependency 103.IBPluginDependency 103.ImportedFromIB2 106.IBPluginDependency 106.ImportedFromIB2 106.editorWindowContentRectSynchronizationRect 111.IBPluginDependency 111.ImportedFromIB2 112.IBPluginDependency 112.ImportedFromIB2 124.IBPluginDependency 124.ImportedFromIB2 125.IBPluginDependency 125.ImportedFromIB2 125.editorWindowContentRectSynchronizationRect 126.IBPluginDependency 126.ImportedFromIB2 129.IBPluginDependency 129.ImportedFromIB2 130.IBPluginDependency 130.ImportedFromIB2 130.editorWindowContentRectSynchronizationRect 131.IBPluginDependency 131.ImportedFromIB2 134.IBPluginDependency 134.ImportedFromIB2 136.IBPluginDependency 136.ImportedFromIB2 143.IBPluginDependency 143.ImportedFromIB2 144.IBPluginDependency 144.ImportedFromIB2 145.IBPluginDependency 145.ImportedFromIB2 149.IBPluginDependency 149.ImportedFromIB2 150.IBPluginDependency 150.ImportedFromIB2 19.IBPluginDependency 19.ImportedFromIB2 195.IBPluginDependency 195.ImportedFromIB2 196.IBPluginDependency 196.ImportedFromIB2 197.IBPluginDependency 197.ImportedFromIB2 198.IBPluginDependency 198.ImportedFromIB2 199.IBPluginDependency 199.ImportedFromIB2 200.IBPluginDependency 200.ImportedFromIB2 200.editorWindowContentRectSynchronizationRect 201.IBPluginDependency 201.ImportedFromIB2 202.IBPluginDependency 202.ImportedFromIB2 203.IBPluginDependency 203.ImportedFromIB2 204.IBPluginDependency 204.ImportedFromIB2 205.IBPluginDependency 205.ImportedFromIB2 205.editorWindowContentRectSynchronizationRect 206.IBPluginDependency 206.ImportedFromIB2 207.IBPluginDependency 207.ImportedFromIB2 208.IBPluginDependency 208.ImportedFromIB2 209.IBPluginDependency 209.ImportedFromIB2 210.IBPluginDependency 210.ImportedFromIB2 211.IBPluginDependency 211.ImportedFromIB2 212.IBPluginDependency 212.ImportedFromIB2 212.editorWindowContentRectSynchronizationRect 213.IBPluginDependency 213.ImportedFromIB2 214.IBPluginDependency 214.ImportedFromIB2 215.IBPluginDependency 215.ImportedFromIB2 216.IBPluginDependency 216.ImportedFromIB2 217.IBPluginDependency 217.ImportedFromIB2 218.IBPluginDependency 218.ImportedFromIB2 219.IBPluginDependency 219.ImportedFromIB2 220.IBPluginDependency 220.ImportedFromIB2 220.editorWindowContentRectSynchronizationRect 221.IBPluginDependency 221.ImportedFromIB2 23.IBPluginDependency 23.ImportedFromIB2 236.IBPluginDependency 236.ImportedFromIB2 239.IBPluginDependency 239.ImportedFromIB2 24.IBPluginDependency 24.ImportedFromIB2 24.editorWindowContentRectSynchronizationRect 29.IBEditorWindowLastContentRect 29.IBPluginDependency 29.ImportedFromIB2 29.WindowOrigin 29.editorWindowContentRectSynchronizationRect 295.IBPluginDependency 296.IBPluginDependency 296.editorWindowContentRectSynchronizationRect 297.IBPluginDependency 298.IBPluginDependency 346.IBPluginDependency 346.ImportedFromIB2 348.IBPluginDependency 348.ImportedFromIB2 349.IBPluginDependency 349.ImportedFromIB2 349.editorWindowContentRectSynchronizationRect 350.IBPluginDependency 350.ImportedFromIB2 351.IBPluginDependency 351.ImportedFromIB2 354.IBPluginDependency 354.ImportedFromIB2 371.IBEditorWindowLastContentRect 371.IBPluginDependency 371.IBWindowTemplateEditedContentRect 371.NSWindowTemplate.visibleAtLaunch 371.editorWindowContentRectSynchronizationRect 371.windowTemplate.maxSize 372.IBPluginDependency 375.IBPluginDependency 376.IBEditorWindowLastContentRect 376.IBPluginDependency 377.IBPluginDependency 378.IBPluginDependency 379.IBPluginDependency 380.IBPluginDependency 381.IBPluginDependency 382.IBPluginDependency 383.IBPluginDependency 384.IBPluginDependency 385.IBPluginDependency 386.IBPluginDependency 387.IBPluginDependency 388.IBEditorWindowLastContentRect 388.IBPluginDependency 389.IBPluginDependency 390.IBPluginDependency 391.IBPluginDependency 392.IBPluginDependency 393.IBPluginDependency 394.IBPluginDependency 395.IBPluginDependency 396.IBPluginDependency 397.IBPluginDependency 398.IBPluginDependency 399.IBPluginDependency 400.IBPluginDependency 401.IBPluginDependency 402.IBPluginDependency 403.IBPluginDependency 404.IBPluginDependency 405.IBPluginDependency 406.IBPluginDependency 407.IBPluginDependency 408.IBPluginDependency 409.IBPluginDependency 410.IBPluginDependency 411.IBPluginDependency 412.IBPluginDependency 413.IBPluginDependency 414.IBPluginDependency 415.IBPluginDependency 416.IBPluginDependency 417.IBPluginDependency 418.IBPluginDependency 419.IBPluginDependency 451.IBPluginDependency 452.IBPluginDependency 453.IBPluginDependency 466.IBPluginDependency 467.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 56.IBPluginDependency 56.ImportedFromIB2 57.IBEditorWindowLastContentRect 57.IBPluginDependency 57.ImportedFromIB2 57.editorWindowContentRectSynchronizationRect 58.IBPluginDependency 58.ImportedFromIB2 72.IBPluginDependency 72.ImportedFromIB2 73.IBPluginDependency 73.ImportedFromIB2 74.IBPluginDependency 74.ImportedFromIB2 75.IBPluginDependency 75.ImportedFromIB2 77.IBPluginDependency 77.ImportedFromIB2 78.IBPluginDependency 78.ImportedFromIB2 79.IBPluginDependency 79.ImportedFromIB2 80.IBPluginDependency 80.ImportedFromIB2 81.IBPluginDependency 81.ImportedFromIB2 81.editorWindowContentRectSynchronizationRect 82.IBPluginDependency 82.ImportedFromIB2 83.IBPluginDependency 83.ImportedFromIB2 92.IBPluginDependency 92.ImportedFromIB2 YES com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{596, 852}, {216, 23}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{522, 812}, {146, 23}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{436, 809}, {64, 6}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{608, 612}, {275, 83}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{187, 434}, {243, 243}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{608, 612}, {167, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{608, 612}, {241, 103}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{525, 802}, {197, 73}} {{207, 285}, {478, 20}} com.apple.InterfaceBuilder.CocoaPlugin {74, 862} {{6, 978}, {478, 20}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{475, 832}, {234, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{608, 612}, {215, 63}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{274, 370}, {982, 692}} com.apple.InterfaceBuilder.CocoaPlugin {{274, 370}, {982, 692}} {{33, 99}, {480, 360}} {3.40282e+38, 3.40282e+38} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{437, 242}, {86, 43}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{523, 2}, {178, 283}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{219, 102}, {245, 183}} com.apple.InterfaceBuilder.CocoaPlugin {{23, 794}, {245, 183}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{145, 474}, {199, 203}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin YES YES YES YES 468 YES AppController NSObject searchText: id mEditHost NSBox IBProjectSource AppController.h YES NSActionCell NSCell IBFrameworkSource AppKit.framework/Headers/NSActionCell.h NSApplication NSResponder IBFrameworkSource AppKit.framework/Headers/NSApplication.h NSApplication IBFrameworkSource AppKit.framework/Headers/NSApplicationScripting.h NSApplication IBFrameworkSource AppKit.framework/Headers/NSColorPanel.h NSApplication IBFrameworkSource AppKit.framework/Headers/NSHelpManager.h NSApplication IBFrameworkSource AppKit.framework/Headers/NSPageLayout.h NSApplication IBFrameworkSource AppKit.framework/Headers/NSUserInterfaceItemSearching.h NSBox NSView IBFrameworkSource AppKit.framework/Headers/NSBox.h NSBrowser NSControl IBFrameworkSource AppKit.framework/Headers/NSBrowser.h NSButton NSControl IBFrameworkSource AppKit.framework/Headers/NSButton.h NSButtonCell NSActionCell IBFrameworkSource AppKit.framework/Headers/NSButtonCell.h NSCell NSObject IBFrameworkSource AppKit.framework/Headers/NSCell.h NSControl NSView IBFrameworkSource AppKit.framework/Headers/NSControl.h NSDocument NSObject YES YES printDocument: revertDocumentToSaved: runPageLayout: saveDocument: saveDocumentAs: saveDocumentTo: YES id id id id id id IBFrameworkSource AppKit.framework/Headers/NSDocument.h NSDocument IBFrameworkSource AppKit.framework/Headers/NSDocumentScripting.h NSDocumentController NSObject YES YES clearRecentDocuments: newDocument: openDocument: saveAllDocuments: YES id id id id IBFrameworkSource AppKit.framework/Headers/NSDocumentController.h NSFontManager NSObject IBFrameworkSource AppKit.framework/Headers/NSFontManager.h NSFormatter NSObject IBFrameworkSource Foundation.framework/Headers/NSFormatter.h NSMatrix NSControl IBFrameworkSource AppKit.framework/Headers/NSMatrix.h NSMenu NSObject IBFrameworkSource AppKit.framework/Headers/NSMenu.h NSMenuItem NSObject IBFrameworkSource AppKit.framework/Headers/NSMenuItem.h NSMovieView NSView IBFrameworkSource AppKit.framework/Headers/NSMovieView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSAccessibility.h NSObject NSObject NSObject NSObject NSObject IBFrameworkSource AppKit.framework/Headers/NSDictionaryController.h NSObject IBFrameworkSource AppKit.framework/Headers/NSDragging.h NSObject NSObject IBFrameworkSource AppKit.framework/Headers/NSFontPanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSKeyValueBinding.h NSObject NSObject IBFrameworkSource AppKit.framework/Headers/NSNibLoading.h NSObject IBFrameworkSource AppKit.framework/Headers/NSOutlineView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSPasteboard.h NSObject IBFrameworkSource AppKit.framework/Headers/NSSavePanel.h NSObject IBFrameworkSource AppKit.framework/Headers/NSTableView.h NSObject IBFrameworkSource AppKit.framework/Headers/NSToolbarItem.h NSObject IBFrameworkSource AppKit.framework/Headers/NSView.h NSObject IBFrameworkSource Foundation.framework/Headers/NSArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSError.h NSObject IBFrameworkSource Foundation.framework/Headers/NSFileManager.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyValueObserving.h NSObject IBFrameworkSource Foundation.framework/Headers/NSKeyedArchiver.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObject.h NSObject IBFrameworkSource Foundation.framework/Headers/NSObjectScripting.h NSObject IBFrameworkSource Foundation.framework/Headers/NSPortCoder.h NSObject IBFrameworkSource Foundation.framework/Headers/NSRunLoop.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptClassDescription.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptKeyValueCoding.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptObjectSpecifiers.h NSObject IBFrameworkSource Foundation.framework/Headers/NSScriptWhoseTests.h NSObject IBFrameworkSource Foundation.framework/Headers/NSThread.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURL.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLConnection.h NSObject IBFrameworkSource Foundation.framework/Headers/NSURLDownload.h NSResponder IBFrameworkSource AppKit.framework/Headers/NSInterfaceStyle.h NSResponder NSObject IBFrameworkSource AppKit.framework/Headers/NSResponder.h NSSearchField NSTextField IBFrameworkSource AppKit.framework/Headers/NSSearchField.h NSSearchFieldCell NSTextFieldCell IBFrameworkSource AppKit.framework/Headers/NSSearchFieldCell.h NSTableView NSControl NSText NSView IBFrameworkSource AppKit.framework/Headers/NSText.h NSTextField NSControl IBFrameworkSource AppKit.framework/Headers/NSTextField.h NSTextFieldCell NSActionCell IBFrameworkSource AppKit.framework/Headers/NSTextFieldCell.h NSTextView NSText IBFrameworkSource AppKit.framework/Headers/NSTextView.h NSView IBFrameworkSource AppKit.framework/Headers/NSClipView.h NSView NSView IBFrameworkSource AppKit.framework/Headers/NSRulerView.h NSView NSResponder NSWindow IBFrameworkSource AppKit.framework/Headers/NSDrawer.h NSWindow NSResponder IBFrameworkSource AppKit.framework/Headers/NSWindow.h NSWindow IBFrameworkSource AppKit.framework/Headers/NSWindowScripting.h 0 IBCocoaFramework com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.macosx com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3 YES ../ScintillaTest.xcodeproj 3 YES YES NSMenuCheckmark NSMenuMixedState YES {9, 8} {7, 2} scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings0000644000175000017500000000013412075650364023414 0ustar neilneil/* Localized versions of Info.plist keys */ scintilla/cocoa/ScintillaTest/AppController.h0000644000175000017500000000102512364434234020306 0ustar neilneil/** * AppController.h * SciTest * * Created by Mike Lischke on 01.04.09. * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import #import "Scintilla/ScintillaView.h" #import "Scintilla/InfoBar.h" @interface AppController : NSObject { IBOutlet NSBox *mEditHost; ScintillaView* mEditor; } - (void) awakeFromNib; - (void) setupEditor; - (IBAction) searchText: (id) sender; @end scintilla/cocoa/ScintillaTest/Scintilla-Info.plist0000644000175000017500000000116212075650364021246 0ustar neilneil CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier com.sun.${PRODUCT_NAME:identifier} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType FMWK CFBundleSignature ???? CFBundleVersion 1.0 scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/0000755000175000017500000000000012540700503022120 5ustar neilneilscintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj0000644000175000017500000003703412540700503025203 0ustar neilneil// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58140DA1D0A300B32029 /* MainMenu.xib */; }; 271FA52C0F850BE20033D021 /* AppController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 271FA52B0F850BE20033D021 /* AppController.mm */; }; 2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */ = {isa = PBXBuildFile; fileRef = 2791F4480FC1A8E9009DBCF9 /* TestData.sql */; }; 27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; }; 27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */; }; 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; 8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ 2744E5E90FC16BE200E85C33 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */; proxyType = 2; remoteGlobalIDString = 8DC2EF5B0486A6940098B216; remoteInfo = Scintilla; }; 27AF7EC60FC2C36A007160EF /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */; proxyType = 1; remoteGlobalIDString = 8DC2EF4F0486A6940098B216; remoteInfo = Scintilla; }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ 272133C20F973596006BE49A /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( 27AF7ECA0FC2C388007160EF /* Scintilla.framework in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; 1DDD58150DA1D0A300B32029 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = ""; }; 271FA52A0F850BE20033D021 /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppController.h; sourceTree = ""; }; 271FA52B0F850BE20033D021 /* AppController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppController.mm; sourceTree = ""; wrapsLines = 0; }; 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ScintillaFramework.xcodeproj; path = ../ScintillaFramework/ScintillaFramework.xcodeproj; sourceTree = SOURCE_ROOT; }; 2791F4480FC1A8E9009DBCF9 /* TestData.sql */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = TestData.sql; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* ScintillaTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScintillaTest_Prefix.pch; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* ScintillaTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ScintillaTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 27AF7EC30FC2C351007160EF /* Scintilla.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( 271FA52A0F850BE20033D021 /* AppController.h */, 271FA52B0F850BE20033D021 /* AppController.mm */, ); name = Classes; sourceTree = ""; }; 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( 8D1107320486CEB800E47090 /* ScintillaTest.app */, ); name = Products; sourceTree = ""; }; 2744E5E30FC16BE200E85C33 /* Products */ = { isa = PBXGroup; children = ( 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */, ); name = Products; sourceTree = ""; }; 29B97314FDCFA39411CA2CEA /* ScintillaTest */ = { isa = PBXGroup; children = ( 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */, 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = ScintillaTest; sourceTree = ""; }; 29B97315FDCFA39411CA2CEA /* Other Sources */ = { isa = PBXGroup; children = ( 32CA4F630368D1EE00C91783 /* ScintillaTest_Prefix.pch */, 29B97316FDCFA39411CA2CEA /* main.m */, ); name = "Other Sources"; sourceTree = ""; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( 2791F4480FC1A8E9009DBCF9 /* TestData.sql */, 8D1107310486CEB800E47090 /* Info.plist */, 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, 1DDD58140DA1D0A300B32029 /* MainMenu.xib */, ); name = Resources; sourceTree = ""; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 8D1107260486CEB800E47090 /* ScintillaTest */ = { isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ScintillaTest" */; buildPhases = ( 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, 272133C20F973596006BE49A /* CopyFiles */, ); buildRules = ( ); dependencies = ( 27AF7EC70FC2C36A007160EF /* PBXTargetDependency */, ); name = ScintillaTest; productInstallPath = "$(HOME)/Applications"; productName = ScintillaTest; productReference = 8D1107320486CEB800E47090 /* ScintillaTest.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0630; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 29B97314FDCFA39411CA2CEA /* ScintillaTest */; projectDirPath = ""; projectReferences = ( { ProductGroup = 2744E5E30FC16BE200E85C33 /* Products */; ProjectRef = 2744E5E20FC16BE200E85C33 /* ScintillaFramework.xcodeproj */; }, ); projectRoot = ""; targets = ( 8D1107260486CEB800E47090 /* ScintillaTest */, ); }; /* End PBXProject section */ /* Begin PBXReferenceProxy section */ 2744E5EA0FC16BE200E85C33 /* Scintilla.framework */ = { isa = PBXReferenceProxy; fileType = wrapper.framework; path = Scintilla.framework; remoteRef = 2744E5E90FC16BE200E85C33 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ 8D1107290486CEB800E47090 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */, 1DDD58160DA1D0A300B32029 /* MainMenu.xib in Resources */, 2791F4490FC1A8E9009DBCF9 /* TestData.sql in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, 271FA52C0F850BE20033D021 /* AppController.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ 27AF7EC70FC2C36A007160EF /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = Scintilla; targetProxy = 27AF7EC60FC2C36A007160EF /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 089C165DFE840E0CC02AAC07 /* English */, ); name = InfoPlist.strings; sourceTree = ""; }; 1DDD58140DA1D0A300B32029 /* MainMenu.xib */ = { isa = PBXVariantGroup; children = ( 1DDD58150DA1D0A300B32029 /* English */, ); name = MainMenu.xib; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( SCI_LEXER, SCI_NAMESPACE, ); HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ""; PRODUCT_NAME = ScintillaTest; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = ""; }; name = Debug; }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = ScintillaTest_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( SCI_LEXER, SCI_NAMESPACE, ); HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = "$(inherited)"; OTHER_LDFLAGS = ""; PRODUCT_NAME = ScintillaTest; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = ""; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_NO_COMMON_BLOCKS = YES; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_LDFLAGS = ""; SDKROOT = macosx; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "ScintillaTest" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4B08A954540054247B /* Debug */, C01FCF4C08A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ScintillaTest" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch0000644000175000017500000000023512075650364022151 0ustar neilneil// // Prefix header for all source files of the 'ScintillaTest' target in the 'ScintillaTest' project // #ifdef __OBJC__ #import #endif scintilla/cocoa/ScintillaTest/TestData.sql0000644000175000017500000002020412075650364017606 0ustar neilneil-- MySQL Administrator dump 1.4 -- -- ------------------------------------------------------ -- Server version 5.0.45 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI_QUOTES' */; /** * Foldable multiline comment. */ -- { -- Create schema sakila -- } CREATE DATABASE IF NOT EXISTS sakila; USE sakila; DROP TABLE IF EXISTS "sakila"."actor_info"; DROP VIEW IF EXISTS "sakila"."actor_info"; CREATE TABLE "sakila"."actor_info" ( "actor_id" smallint(5) unsigned, "first_name" varchar(45), "last_name" varchar(45), "film_info" varchar(341) ); DROP TABLE IF EXISTS "sakila"."actor"; CREATE TABLE "sakila"."actor" ( "actor_id" smallint(5) unsigned NOT NULL auto_increment, "first_name" varchar(45) NOT NULL, "last_name" varchar(45) NOT NULL, "last_update" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, PRIMARY KEY ("actor_id"), KEY "idx_actor_last_name" ("last_name") ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8; INSERT INTO "sakila"."actor" VALUES (1,'PENELOPE','GUINESS','2006-02-15 04:34:33'), (2,'NICK','WAHLBERG','2006-02-15 04:34:33'), (3,'ED','CHASE','2006-02-15 04:34:33'), (4,'JENNIFER','DAVIS','2006-02-15 04:34:33'), (149,'RUSSELL','TEMPLE','2006-02-15 04:34:33'), (150,'JAYNE','NOLTE','2006-02-15 04:34:33'), (151,'GEOFFREY','HESTON','2006-02-15 04:34:33'), (152,'BEN','HARRIS','2006-02-15 04:34:33'), (153,'MINNIE','KILMER','2006-02-15 04:34:33'), (154,'MERYL','GIBSON','2006-02-15 04:34:33'), (155,'IAN','TANDY','2006-02-15 04:34:33'), (156,'FAY','WOOD','2006-02-15 04:34:33'), (157,'GRETA','MALDEN','2006-02-15 04:34:33'), (158,'VIVIEN','BASINGER','2006-02-15 04:34:33'), (159,'LAURA','BRODY','2006-02-15 04:34:33'), (160,'CHRIS','DEPP','2006-02-15 04:34:33'), (161,'HARVEY','HOPE','2006-02-15 04:34:33'), (162,'OPRAH','KILMER','2006-02-15 04:34:33'), (163,'CHRISTOPHER','WEST','2006-02-15 04:34:33'), (164,'HUMPHREY','WILLIS','2006-02-15 04:34:33'), (165,'AL','GARLAND','2006-02-15 04:34:33'), (166,'NICK','DEGENERES','2006-02-15 04:34:33'), (167,'LAURENCE','BULLOCK','2006-02-15 04:34:33'), (168,'WILL','WILSON','2006-02-15 04:34:33'), (169,'KENNETH','HOFFMAN','2006-02-15 04:34:33'), (170,'MENA','HOPPER','2006-02-15 04:34:33'), (171,'OLYMPIA','PFEIFFER','2006-02-15 04:34:33'), (190,'AUDREY','BAILEY','2006-02-15 04:34:33'), (191,'GREGORY','GOODING','2006-02-15 04:34:33'), (192,'JOHN','SUVARI','2006-02-15 04:34:33'), (193,'BURT','TEMPLE','2006-02-15 04:34:33'), (194,'MERYL','ALLEN','2006-02-15 04:34:33'), (195,'JAYNE','SILVERSTONE','2006-02-15 04:34:33'), (196,'BELA','WALKEN','2006-02-15 04:34:33'), (197,'REESE','WEST','2006-02-15 04:34:33'), (198,'MARY','KEITEL','2006-02-15 04:34:33'), (199,'JULIA','FAWCETT','2006-02-15 04:34:33'), (200,'THORA','TEMPLE','2006-02-15 04:34:33'); DROP TRIGGER /*!50030 IF EXISTS */ "sakila"."payment_date"; DELIMITER $$ CREATE DEFINER = "root"@"localhost" TRIGGER "sakila"."payment_date" BEFORE INSERT ON "payment" FOR EACH ROW SET NEW.payment_date = NOW() $$ DELIMITER ; DROP TABLE IF EXISTS "sakila"."sales_by_store"; DROP VIEW IF EXISTS "sakila"."sales_by_store"; CREATE ALGORITHM=UNDEFINED DEFINER="root"@"localhost" SQL SECURITY DEFINER VIEW "sakila"."sales_by_store" AS select concat("c"."city",_utf8',',"cy"."country") AS "store",concat("m"."first_name",_utf8' ',"m"."last_name") AS "manager",sum("p"."amount") AS "total_sales" from ((((((("sakila"."payment" "p" join "sakila"."rental" "r" on(("p"."rental_id" = "r"."rental_id"))) join "sakila"."inventory" "i" on(("r"."inventory_id" = "i"."inventory_id"))) join "sakila"."store" "s" on(("i"."store_id" = "s"."store_id"))) join "sakila"."address" "a" on(("s"."address_id" = "a"."address_id"))) join "sakila"."city" "c" on(("a"."city_id" = "c"."city_id"))) join "sakila"."country" "cy" on(("c"."country_id" = "cy"."country_id"))) join "sakila"."staff" "m" on(("s"."manager_staff_id" = "m"."staff_id"))) group by "s"."store_id" order by "cy"."country","c"."city"; -- -- View structure for view `staff_list` -- CREATE VIEW staff_list AS SELECT s.staff_id AS ID, CONCAT(s.first_name, _utf8' ', s.last_name) AS name, a.address AS address, a.postal_code AS `zip code`, a.phone AS phone, city.city AS city, country.country AS country, s.store_id AS SID FROM staff AS s JOIN address AS a ON s.address_id = a.address_id JOIN city ON a.city_id = city.city_id JOIN country ON city.country_id = country.country_id; -- -- View structure for view `actor_info` -- CREATE DEFINER=CURRENT_USER SQL SECURITY INVOKER VIEW actor_info AS SELECT a.actor_id, a.first_name, a.last_name, GROUP_CONCAT(DISTINCT CONCAT(c.name, ': ', (SELECT GROUP_CONCAT(f.title ORDER BY f.title SEPARATOR ', ') FROM sakila.film f INNER JOIN sakila.film_category fc ON f.film_id = fc.film_id INNER JOIN sakila.film_actor fa ON f.film_id = fa.film_id WHERE fc.category_id = c.category_id AND fa.actor_id = a.actor_id ) ) ORDER BY c.name SEPARATOR '; ') AS film_info FROM sakila.actor a LEFT JOIN sakila.film_actor fa ON a.actor_id = fa.actor_id LEFT JOIN sakila.film_category fc ON fa.film_id = fc.film_id LEFT JOIN sakila.category c ON fc.category_id = c.category_id GROUP BY a.actor_id, a.first_name, a.last_name; DELIMITER $$ CREATE FUNCTION get_customer_balance(p_customer_id INT, p_effective_date DATETIME) RETURNS DECIMAL(5,2) DETERMINISTIC READS SQL DATA BEGIN #OK, WE NEED TO CALCULATE THE CURRENT BALANCE GIVEN A CUSTOMER_ID AND A DATE #THAT WE WANT THE BALANCE TO BE EFFECTIVE FOR. THE BALANCE IS: # 1) RENTAL FEES FOR ALL PREVIOUS RENTALS # 2) ONE DOLLAR FOR EVERY DAY THE PREVIOUS RENTALS ARE OVERDUE # 3) IF A FILM IS MORE THAN RENTAL_DURATION * 2 OVERDUE, CHARGE THE REPLACEMENT_COST # 4) SUBTRACT ALL PAYMENTS MADE BEFORE THE DATE SPECIFIED DECLARE v_rentfees DECIMAL(5,2); #FEES PAID TO RENT THE VIDEOS INITIALLY DECLARE v_overfees INTEGER; #LATE FEES FOR PRIOR RENTALS DECLARE v_payments DECIMAL(5,2); #SUM OF PAYMENTS MADE PREVIOUSLY SELECT IFNULL(SUM(film.rental_rate),0) INTO v_rentfees FROM film, inventory, rental WHERE film.film_id = inventory.film_id AND inventory.inventory_id = rental.inventory_id AND rental.rental_date <= p_effective_date AND rental.customer_id = p_customer_id; SELECT IFNULL(SUM(IF((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) > film.rental_duration, ((TO_DAYS(rental.return_date) - TO_DAYS(rental.rental_date)) - film.rental_duration),0)),0) INTO v_overfees FROM rental, inventory, film WHERE film.film_id = inventory.film_id AND inventory.inventory_id = rental.inventory_id AND rental.rental_date <= p_effective_date AND rental.customer_id = p_customer_id; SELECT IFNULL(SUM(payment.amount),0) INTO v_payments FROM payment WHERE payment.payment_date <= p_effective_date AND payment.customer_id = p_customer_id; RETURN v_rentfees + v_overfees - v_payments; END $$ DELIMITER ; DELIMITER $$ CREATE FUNCTION inventory_in_stock(p_inventory_id INT) RETURNS BOOLEAN READS SQL DATA BEGIN DECLARE v_rentals INT; DECLARE v_out INT; #AN ITEM IS IN-STOCK IF THERE ARE EITHER NO ROWS IN THE rental TABLE #FOR THE ITEM OR ALL ROWS HAVE return_date POPULATED SELECT COUNT(*) INTO v_rentals FROM rental WHERE inventory_id = p_inventory_id; IF v_rentals = 0 THEN RETURN TRUE; END IF; SELECT COUNT(rental_id) INTO v_out FROM inventory LEFT JOIN rental USING(inventory_id) WHERE inventory.inventory_id = p_inventory_id AND rental.return_date IS NULL; IF v_out > 0 THEN RETURN FALSE; ELSE RETURN TRUE; END IF; END $$ DELIMITER ; scintilla/cocoa/ScintillaTest/main.m0000644000175000017500000000056612075650364016467 0ustar neilneil/** * main.m * ScintillaTest * * Created by Mike Lischke on 02.04.09. * Copyright Sun Microsystems, Inc 2009. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **) argv); } scintilla/cocoa/ScintillaTest/AppController.mm0000644000175000017500000003257212533717246020510 0ustar neilneil/** * AppController.m * ScintillaTest * * Created by Mike Lischke on 01.04.09. * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import "AppController.h" const char major_keywords[] = "accessible add all alter analyze and as asc asensitive " "before between bigint binary blob both by " "call cascade case change char character check collate column condition connection constraint " "continue convert create cross current_date current_time current_timestamp current_user cursor " "database databases day_hour day_microsecond day_minute day_second dec decimal declare default " "delayed delete desc describe deterministic distinct distinctrow div double drop dual " "each else elseif enclosed escaped exists exit explain " "false fetch float float4 float8 for force foreign from fulltext " "goto grant group " "having high_priority hour_microsecond hour_minute hour_second " "if ignore in index infile inner inout insensitive insert int int1 int2 int3 int4 int8 integer " "interval into is iterate " "join " "key keys kill " "label leading leave left like limit linear lines load localtime localtimestamp lock long " "longblob longtext loop low_priority " "master_ssl_verify_server_cert match mediumblob mediumint mediumtext middleint minute_microsecond " "minute_second mod modifies " "natural not no_write_to_binlog null numeric " "on optimize option optionally or order out outer outfile " "precision primary procedure purge " "range read reads read_only read_write real references regexp release rename repeat replace " "require restrict return revoke right rlike " "schema schemas second_microsecond select sensitive separator set show smallint spatial specific " "sql sqlexception sqlstate sqlwarning sql_big_result sql_calc_found_rows sql_small_result ssl " "starting straight_join " "table terminated then tinyblob tinyint tinytext to trailing trigger true " "undo union unique unlock unsigned update upgrade usage use using utc_date utc_time utc_timestamp " "values varbinary varchar varcharacter varying " "when where while with write " "xor " "year_month " "zerofill"; const char procedure_keywords[] = // Not reserved words but intrinsic part of procedure definitions. "begin comment end"; const char client_keywords[] = // Definition of keywords only used by clients, not the server itself. "delimiter"; const char user_keywords[] = // Definition of own keywords, not used by MySQL. "edit"; //-------------------------------------------------------------------------------------------------- @implementation AppController - (void) awakeFromNib { // Manually set up the scintilla editor. Create an instance and dock it to our edit host. // Leave some free space around the new view to avoid overlapping with the box borders. NSRect newFrame = mEditHost.frame; newFrame.size.width -= 2 * newFrame.origin.x; newFrame.size.height -= 3 * newFrame.origin.y; mEditor = [[[ScintillaView alloc] initWithFrame: newFrame] autorelease]; [mEditHost.contentView addSubview: mEditor]; [mEditor setAutoresizesSubviews: YES]; [mEditor setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; // Let's load some text for the editor, as initial content. NSError* error = nil; NSString* path = [[NSBundle mainBundle] pathForResource: @"TestData" ofType: @"sql" inDirectory: nil]; NSString* sql = [NSString stringWithContentsOfFile: path encoding: NSUTF8StringEncoding error: &error]; if (error && [[error domain] isEqual: NSCocoaErrorDomain]) NSLog(@"%@", error); [mEditor setString: sql]; [self setupEditor]; } //-------------------------------------------------------------------------------------------------- /** * Initialize scintilla editor (styles, colors, markers, folding etc.]. */ - (void) setupEditor { // Lexer type is MySQL. [mEditor setGeneralProperty: SCI_SETLEXER parameter: SCLEX_MYSQL value: 0]; // alternatively: [mEditor setEditorProperty: SCI_SETLEXERLANGUAGE parameter: nil value: (sptr_t) "mysql"]; // Number of styles we use with this lexer. [mEditor setGeneralProperty: SCI_SETSTYLEBITS value: [mEditor getGeneralProperty: SCI_GETSTYLEBITSNEEDED]]; // Keywords to highlight. Indices are: // 0 - Major keywords (reserved keywords) // 1 - Normal keywords (everything not reserved but integral part of the language) // 2 - Database objects // 3 - Function keywords // 4 - System variable keywords // 5 - Procedure keywords (keywords used in procedures like "begin" and "end") // 6..8 - User keywords 1..3 [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 0 value: major_keywords]; [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 5 value: procedure_keywords]; [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 6 value: client_keywords]; [mEditor setReferenceProperty: SCI_SETKEYWORDS parameter: 7 value: user_keywords]; // Colors and styles for various syntactic elements. First the default style. [mEditor setStringProperty: SCI_STYLESETFONT parameter: STYLE_DEFAULT value: @"Helvetica"]; // [mEditor setStringProperty: SCI_STYLESETFONT parameter: STYLE_DEFAULT value: @"Monospac821 BT"]; // Very pleasing programmer's font. [mEditor setGeneralProperty: SCI_STYLESETSIZE parameter: STYLE_DEFAULT value: 14]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: STYLE_DEFAULT value: [NSColor blackColor]]; [mEditor setGeneralProperty: SCI_STYLECLEARALL parameter: 0 value: 0]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DEFAULT value: [NSColor blackColor]]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_COMMENT fromHTML: @"#097BF7"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_COMMENTLINE fromHTML: @"#097BF7"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_HIDDENCOMMAND fromHTML: @"#097BF7"]; [mEditor setColorProperty: SCI_STYLESETBACK parameter: SCE_MYSQL_HIDDENCOMMAND fromHTML: @"#F0F0F0"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_VARIABLE fromHTML: @"378EA5"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_SYSTEMVARIABLE fromHTML: @"378EA5"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_KNOWNSYSTEMVARIABLE fromHTML: @"#3A37A5"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_NUMBER fromHTML: @"#7F7F00"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_SQSTRING fromHTML: @"#FFAA3E"]; // Note: if we were using ANSI quotes we would set the DQSTRING to the same color as the // the back tick string. [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DQSTRING fromHTML: @"#274A6D"]; // Keyword highlighting. [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_MAJORKEYWORD fromHTML: @"#007F00"]; [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_MAJORKEYWORD value: 1]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_KEYWORD fromHTML: @"#007F00"]; [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_KEYWORD value: 1]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_PROCEDUREKEYWORD fromHTML: @"#56007F"]; [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_MYSQL_PROCEDUREKEYWORD value: 1]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_USER1 fromHTML: @"#808080"]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_USER2 fromHTML: @"#808080"]; [mEditor setColorProperty: SCI_STYLESETBACK parameter: SCE_MYSQL_USER2 fromHTML: @"#F0E0E0"]; // The following 3 styles have no impact as we did not set a keyword list for any of them. [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_DATABASEOBJECT value: [NSColor redColor]]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_FUNCTION value: [NSColor redColor]]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_IDENTIFIER value: [NSColor blackColor]]; [mEditor setColorProperty: SCI_STYLESETFORE parameter: SCE_MYSQL_QUOTEDIDENTIFIER fromHTML: @"#274A6D"]; [mEditor setGeneralProperty: SCI_STYLESETBOLD parameter: SCE_SQL_OPERATOR value: 1]; // Line number style. [mEditor setColorProperty: SCI_STYLESETFORE parameter: STYLE_LINENUMBER fromHTML: @"#F0F0F0"]; [mEditor setColorProperty: SCI_STYLESETBACK parameter: STYLE_LINENUMBER fromHTML: @"#808080"]; [mEditor setGeneralProperty: SCI_SETMARGINTYPEN parameter: 0 value: SC_MARGIN_NUMBER]; [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 0 value: 35]; // Markers. [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 1 value: 16]; // Some special lexer properties. [mEditor setLexerProperty: @"fold" value: @"1"]; [mEditor setLexerProperty: @"fold.compact" value: @"0"]; [mEditor setLexerProperty: @"fold.comment" value: @"1"]; [mEditor setLexerProperty: @"fold.preprocessor" value: @"1"]; // Folder setup. [mEditor setGeneralProperty: SCI_SETMARGINWIDTHN parameter: 2 value: 16]; [mEditor setGeneralProperty: SCI_SETMARGINMASKN parameter: 2 value: SC_MASK_FOLDERS]; [mEditor setGeneralProperty: SCI_SETMARGINSENSITIVEN parameter: 2 value: 1]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEROPEN value: SC_MARK_BOXMINUS]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDER value: SC_MARK_BOXPLUS]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERSUB value: SC_MARK_VLINE]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERTAIL value: SC_MARK_LCORNER]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEREND value: SC_MARK_BOXPLUSCONNECTED]; [mEditor setGeneralProperty: SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDEROPENMID value: SC_MARK_BOXMINUSCONNECTED]; [mEditor setGeneralProperty : SCI_MARKERDEFINE parameter: SC_MARKNUM_FOLDERMIDTAIL value: SC_MARK_TCORNER]; for (int n= 25; n < 32; ++n) // Markers 25..31 are reserved for folding. { [mEditor setColorProperty: SCI_MARKERSETFORE parameter: n value: [NSColor whiteColor]]; [mEditor setColorProperty: SCI_MARKERSETBACK parameter: n value: [NSColor blackColor]]; } // Init markers & indicators for highlighting of syntax errors. [mEditor setColorProperty: SCI_INDICSETFORE parameter: 0 value: [NSColor redColor]]; [mEditor setGeneralProperty: SCI_INDICSETUNDER parameter: 0 value: 1]; [mEditor setGeneralProperty: SCI_INDICSETSTYLE parameter: 0 value: INDIC_SQUIGGLE]; [mEditor setColorProperty: SCI_MARKERSETBACK parameter: 0 fromHTML: @"#B1151C"]; [mEditor setColorProperty: SCI_SETSELBACK parameter: 1 value: [NSColor selectedTextBackgroundColor]]; // Uncomment if you wanna see auto wrapping in action. //[mEditor setGeneralProperty: SCI_SETWRAPMODE parameter: SC_WRAP_WORD value: 0]; InfoBar* infoBar = [[[InfoBar alloc] initWithFrame: NSMakeRect(0, 0, 400, 0)] autorelease]; [infoBar setDisplay: IBShowAll]; [mEditor setInfoBar: infoBar top: NO]; [mEditor setStatusText: @"Operation complete"]; } //-------------------------------------------------------------------------------------------------- /* XPM */ static const char * box_xpm[] = { "12 12 2 1", " c None", ". c #800000", " .........", " . . ..", " . . . .", "......... .", ". . . .", ". . . ..", ". . .. .", "......... .", ". . . .", ". . . . ", ". . .. ", "......... "}; - (void) showAutocompletion { const char *words = "Babylon-5?1 Battlestar-Galactica Millennium-Falcon?2 Moya?2 Serenity Voyager"; [mEditor setGeneralProperty: SCI_AUTOCSETIGNORECASE parameter: 1 value:0]; [mEditor setGeneralProperty: SCI_REGISTERIMAGE parameter: 1 value:(sptr_t)box_xpm]; const int imSize = 12; [mEditor setGeneralProperty: SCI_RGBAIMAGESETWIDTH parameter: imSize value:0]; [mEditor setGeneralProperty: SCI_RGBAIMAGESETHEIGHT parameter: imSize value:0]; char image[imSize * imSize * 4]; for (size_t y = 0; y < imSize; y++) { for (size_t x = 0; x < imSize; x++) { char *p = image + (y * imSize + x) * 4; p[0] = 0xFF; p[1] = 0xA0; p[2] = 0; p[3] = x * 23; } } [mEditor setGeneralProperty: SCI_REGISTERRGBAIMAGE parameter: 2 value:(sptr_t)image]; [mEditor setGeneralProperty: SCI_AUTOCSHOW parameter: 0 value:(sptr_t)words]; } - (IBAction) searchText: (id) sender { NSSearchField* searchField = (NSSearchField*) sender; [mEditor findAndHighlightText: [searchField stringValue] matchCase: NO wholeWord: NO scrollTo: YES wrap: YES]; long matchStart = [mEditor getGeneralProperty: SCI_GETSELECTIONSTART parameter: 0]; long matchEnd = [mEditor getGeneralProperty: SCI_GETSELECTIONEND parameter: 0]; [mEditor setGeneralProperty: SCI_FINDINDICATORFLASH parameter: matchStart value:matchEnd]; if ([[searchField stringValue] isEqualToString: @"XX"]) [self showAutocompletion]; } -(IBAction) setFontQuality: (id) sender { [ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0]; } @end //-------------------------------------------------------------------------------------------------- scintilla/cocoa/ScintillaCocoa.mm0000644000175000017500000024437112557522743016035 0ustar neilneil /** * Scintilla source code edit control * ScintillaCocoa.mm - Cocoa subclass of ScintillaBase * * Written by Mike Lischke * * Loosely based on ScintillaMacOSX.cxx. * Copyright 2003 by Evan Jones * Based on ScintillaGTK.cxx Copyright 1998-2002 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. * * Copyright (c) 2009, 2010 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 #import #endif #import #import #import "Platform.h" #import "ScintillaView.h" #import "ScintillaCocoa.h" #import "PlatCocoa.h" using namespace Scintilla; NSString* ScintillaRecPboardType = @"com.scintilla.utf16-plain-text.rectangular"; //-------------------------------------------------------------------------------------------------- // Define keyboard shortcuts (equivalents) the Mac way. #define SCI_CMD ( SCI_CTRL) #define SCI_SCMD ( SCI_CMD | SCI_SHIFT) #define SCI_SMETA ( SCI_META | SCI_SHIFT) static const KeyToCommand macMapDefault[] = { // OS X specific {SCK_DOWN, SCI_CTRL, SCI_DOCUMENTEND}, {SCK_DOWN, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, {SCK_UP, SCI_CTRL, SCI_DOCUMENTSTART}, {SCK_UP, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, {SCK_LEFT, SCI_CTRL, SCI_VCHOME}, {SCK_LEFT, SCI_CSHIFT, SCI_VCHOMEEXTEND}, {SCK_RIGHT, SCI_CTRL, SCI_LINEEND}, {SCK_RIGHT, SCI_CSHIFT, SCI_LINEENDEXTEND}, // Similar to Windows and GTK+ // Where equivalent clashes with OS X standard, use Meta instead {SCK_DOWN, SCI_NORM, SCI_LINEDOWN}, {SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND}, {SCK_DOWN, SCI_META, SCI_LINESCROLLDOWN}, {SCK_DOWN, SCI_ASHIFT, SCI_LINEDOWNRECTEXTEND}, {SCK_UP, SCI_NORM, SCI_LINEUP}, {SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND}, {SCK_UP, SCI_META, SCI_LINESCROLLUP}, {SCK_UP, SCI_ASHIFT, SCI_LINEUPRECTEXTEND}, {'[', SCI_CTRL, SCI_PARAUP}, {'[', SCI_CSHIFT, SCI_PARAUPEXTEND}, {']', SCI_CTRL, SCI_PARADOWN}, {']', SCI_CSHIFT, SCI_PARADOWNEXTEND}, {SCK_LEFT, SCI_NORM, SCI_CHARLEFT}, {SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND}, {SCK_LEFT, SCI_ALT, SCI_WORDLEFT}, {SCK_LEFT, SCI_META, SCI_WORDLEFT}, {SCK_LEFT, SCI_SMETA, SCI_WORDLEFTEXTEND}, {SCK_LEFT, SCI_ASHIFT, SCI_CHARLEFTRECTEXTEND}, {SCK_RIGHT, SCI_NORM, SCI_CHARRIGHT}, {SCK_RIGHT, SCI_SHIFT, SCI_CHARRIGHTEXTEND}, {SCK_RIGHT, SCI_ALT, SCI_WORDRIGHT}, {SCK_RIGHT, SCI_META, SCI_WORDRIGHT}, {SCK_RIGHT, SCI_SMETA, SCI_WORDRIGHTEXTEND}, {SCK_RIGHT, SCI_ASHIFT, SCI_CHARRIGHTRECTEXTEND}, {'/', SCI_CTRL, SCI_WORDPARTLEFT}, {'/', SCI_CSHIFT, SCI_WORDPARTLEFTEXTEND}, {'\\', SCI_CTRL, SCI_WORDPARTRIGHT}, {'\\', SCI_CSHIFT, SCI_WORDPARTRIGHTEXTEND}, {SCK_HOME, SCI_NORM, SCI_VCHOME}, {SCK_HOME, SCI_SHIFT, SCI_VCHOMEEXTEND}, {SCK_HOME, SCI_CTRL, SCI_DOCUMENTSTART}, {SCK_HOME, SCI_CSHIFT, SCI_DOCUMENTSTARTEXTEND}, {SCK_HOME, SCI_ALT, SCI_HOMEDISPLAY}, {SCK_HOME, SCI_ASHIFT, SCI_VCHOMERECTEXTEND}, {SCK_END, SCI_NORM, SCI_LINEEND}, {SCK_END, SCI_SHIFT, SCI_LINEENDEXTEND}, {SCK_END, SCI_CTRL, SCI_DOCUMENTEND}, {SCK_END, SCI_CSHIFT, SCI_DOCUMENTENDEXTEND}, {SCK_END, SCI_ALT, SCI_LINEENDDISPLAY}, {SCK_END, SCI_ASHIFT, SCI_LINEENDRECTEXTEND}, {SCK_PRIOR, SCI_NORM, SCI_PAGEUP}, {SCK_PRIOR, SCI_SHIFT, SCI_PAGEUPEXTEND}, {SCK_PRIOR, SCI_ASHIFT, SCI_PAGEUPRECTEXTEND}, {SCK_NEXT, SCI_NORM, SCI_PAGEDOWN}, {SCK_NEXT, SCI_SHIFT, SCI_PAGEDOWNEXTEND}, {SCK_NEXT, SCI_ASHIFT, SCI_PAGEDOWNRECTEXTEND}, {SCK_DELETE, SCI_NORM, SCI_CLEAR}, {SCK_DELETE, SCI_SHIFT, SCI_CUT}, {SCK_DELETE, SCI_CTRL, SCI_DELWORDRIGHT}, {SCK_DELETE, SCI_CSHIFT, SCI_DELLINERIGHT}, {SCK_INSERT, SCI_NORM, SCI_EDITTOGGLEOVERTYPE}, {SCK_INSERT, SCI_SHIFT, SCI_PASTE}, {SCK_INSERT, SCI_CTRL, SCI_COPY}, {SCK_ESCAPE, SCI_NORM, SCI_CANCEL}, {SCK_BACK, SCI_NORM, SCI_DELETEBACK}, {SCK_BACK, SCI_SHIFT, SCI_DELETEBACK}, {SCK_BACK, SCI_CTRL, SCI_DELWORDLEFT}, {SCK_BACK, SCI_ALT, SCI_DELWORDLEFT}, {SCK_BACK, SCI_CSHIFT, SCI_DELLINELEFT}, {'z', SCI_CMD, SCI_UNDO}, {'z', SCI_SCMD, SCI_REDO}, {'x', SCI_CMD, SCI_CUT}, {'c', SCI_CMD, SCI_COPY}, {'v', SCI_CMD, SCI_PASTE}, {'a', SCI_CMD, SCI_SELECTALL}, {SCK_TAB, SCI_NORM, SCI_TAB}, {SCK_TAB, SCI_SHIFT, SCI_BACKTAB}, {SCK_RETURN, SCI_NORM, SCI_NEWLINE}, {SCK_RETURN, SCI_SHIFT, SCI_NEWLINE}, {SCK_ADD, SCI_CMD, SCI_ZOOMIN}, {SCK_SUBTRACT, SCI_CMD, SCI_ZOOMOUT}, {SCK_DIVIDE, SCI_CMD, SCI_SETZOOM}, {'l', SCI_CMD, SCI_LINECUT}, {'l', SCI_CSHIFT, SCI_LINEDELETE}, {'t', SCI_CSHIFT, SCI_LINECOPY}, {'t', SCI_CTRL, SCI_LINETRANSPOSE}, {'d', SCI_CTRL, SCI_SELECTIONDUPLICATE}, {'u', SCI_CTRL, SCI_LOWERCASE}, {'u', SCI_CSHIFT, SCI_UPPERCASE}, {0, 0, 0}, }; //-------------------------------------------------------------------------------------------------- #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 // Only implement FindHighlightLayer on OS X 10.6+ /** * Class to display the animated gold roundrect used on OS X for matches. */ @interface FindHighlightLayer : CAGradientLayer { @private NSString *sFind; int positionFind; BOOL retaining; CGFloat widthText; CGFloat heightLine; NSString *sFont; CGFloat fontSize; } @property (copy) NSString *sFind; @property (assign) int positionFind; @property (assign) BOOL retaining; @property (assign) CGFloat widthText; @property (assign) CGFloat heightLine; @property (copy) NSString *sFont; @property (assign) CGFloat fontSize; - (void) animateMatch: (CGPoint)ptText bounce:(BOOL)bounce; - (void) hideMatch; @end //-------------------------------------------------------------------------------------------------- @implementation FindHighlightLayer @synthesize sFind, positionFind, retaining, widthText, heightLine, sFont, fontSize; -(id) init { if (self = [super init]) { [self setNeedsDisplayOnBoundsChange: YES]; // A gold to slightly redder gradient to match other applications CGColorRef colGold = CGColorCreateGenericRGB(1.0, 1.0, 0, 1.0); CGColorRef colGoldRed = CGColorCreateGenericRGB(1.0, 0.8, 0, 1.0); self.colors = [NSArray arrayWithObjects:(id)colGoldRed, (id)colGold, nil]; CGColorRelease(colGoldRed); CGColorRelease(colGold); CGColorRef colGreyBorder = CGColorCreateGenericGray(0.756f, 0.5f); self.borderColor = colGreyBorder; CGColorRelease(colGreyBorder); self.borderWidth = 1.0; self.cornerRadius = 5.0f; self.shadowRadius = 1.0f; self.shadowOpacity = 0.9f; self.shadowOffset = CGSizeMake(0.0f, -2.0f); self.anchorPoint = CGPointMake(0.5, 0.5); } return self; } const CGFloat paddingHighlightX = 4; const CGFloat paddingHighlightY = 2; -(void) drawInContext:(CGContextRef)context { if (!sFind || !sFont) return; CFStringRef str = CFStringRef(sFind); CFMutableDictionaryRef styleDict = CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); CGColorRef color = CGColorCreateGenericRGB(0.0, 0.0, 0.0, 1.0); CFDictionarySetValue(styleDict, kCTForegroundColorAttributeName, color); CTFontRef fontRef = ::CTFontCreateWithName((CFStringRef)sFont, fontSize, NULL); CFDictionaryAddValue(styleDict, kCTFontAttributeName, fontRef); CFAttributedStringRef attrString = ::CFAttributedStringCreate(NULL, str, styleDict); CTLineRef textLine = ::CTLineCreateWithAttributedString(attrString); // Indent from corner of bounds CGContextSetTextPosition(context, paddingHighlightX, 3 + paddingHighlightY); CTLineDraw(textLine, context); CFRelease(textLine); CFRelease(attrString); CFRelease(fontRef); CGColorRelease(color); CFRelease(styleDict); } - (void) animateMatch: (CGPoint)ptText bounce:(BOOL)bounce { if (!self.sFind || ![self.sFind length]) { [self hideMatch]; return; } CGFloat width = self.widthText + paddingHighlightX * 2; CGFloat height = self.heightLine + paddingHighlightY * 2; CGFloat flipper = self.geometryFlipped ? -1.0 : 1.0; // Adjust for padding ptText.x -= paddingHighlightX; ptText.y += flipper * paddingHighlightY; // Shift point to centre as expanding about centre ptText.x += width / 2.0; ptText.y -= flipper * height / 2.0; [CATransaction begin]; [CATransaction setValue:[NSNumber numberWithFloat:0.0] forKey:kCATransactionAnimationDuration]; self.bounds = CGRectMake(0,0, width, height); self.position = ptText; if (bounce) { // Do not reset visibility when just moving self.hidden = NO; self.opacity = 1.0; } [self setNeedsDisplay]; [CATransaction commit]; if (bounce) { CABasicAnimation *animBounce = [CABasicAnimation animationWithKeyPath:@"transform.scale"]; animBounce.duration = 0.15; animBounce.autoreverses = YES; animBounce.removedOnCompletion = NO; animBounce.fromValue = [NSNumber numberWithFloat: 1.0]; animBounce.toValue = [NSNumber numberWithFloat: 1.25]; if (self.retaining) { [self addAnimation: animBounce forKey:@"animateFound"]; } else { CABasicAnimation *animFade = [CABasicAnimation animationWithKeyPath:@"opacity"]; animFade.duration = 0.1; animFade.beginTime = 0.4; animFade.removedOnCompletion = NO; animFade.fromValue = [NSNumber numberWithFloat: 1.0]; animFade.toValue = [NSNumber numberWithFloat: 0.0]; CAAnimationGroup *group = [CAAnimationGroup animation]; [group setDuration:0.5]; group.removedOnCompletion = NO; group.fillMode = kCAFillModeForwards; [group setAnimations:[NSArray arrayWithObjects:animBounce, animFade, nil]]; [self addAnimation:group forKey:@"animateFound"]; } } } - (void) hideMatch { self.sFind = @""; self.positionFind = INVALID_POSITION; self.hidden = YES; } @end #endif //-------------------------------------------------------------------------------------------------- @implementation TimerTarget - (id) init: (void*) target { self = [super init]; if (self != nil) { mTarget = target; // Get the default notification queue for the thread which created the instance (usually the // main thread). We need that later for idle event processing. NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; notificationQueue = [[NSNotificationQueue alloc] initWithNotificationCenter: center]; [center addObserver: self selector: @selector(idleTriggered:) name: @"Idle" object: nil]; } return self; } //-------------------------------------------------------------------------------------------------- - (void) dealloc { NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; [center removeObserver:self]; [notificationQueue release]; [super dealloc]; } //-------------------------------------------------------------------------------------------------- /** * Method called by a timer installed by ScintillaCocoa. This two step approach is needed because * a native Obj-C class is required as target for the timer. */ - (void) timerFired: (NSTimer*) timer { reinterpret_cast(mTarget)->TimerFired(timer); } //-------------------------------------------------------------------------------------------------- /** * Another timer callback for the idle timer. */ - (void) idleTimerFired: (NSTimer*) timer { #pragma unused(timer) // Idle timer event. // Post a new idle notification, which gets executed when the run loop is idle. // Since we are coalescing on name and sender there will always be only one actual notification // even for multiple requests. NSNotification *notification = [NSNotification notificationWithName: @"Idle" object: self]; [notificationQueue enqueueNotification: notification postingStyle: NSPostWhenIdle coalesceMask: (NSNotificationCoalescingOnName | NSNotificationCoalescingOnSender) forModes: nil]; } //-------------------------------------------------------------------------------------------------- /** * Another step for idle events. The timer (for idle events) simply requests a notification on * idle time. Only when this notification is send we actually call back the editor. */ - (void) idleTriggered: (NSNotification*) notification { #pragma unused(notification) reinterpret_cast(mTarget)->IdleTimerFired(); } @end //----------------- ScintillaCocoa ----------------------------------------------------------------- ScintillaCocoa::ScintillaCocoa(SCIContentView* view, SCIMarginView* viewMargin) { vs.marginInside = false; wMain = view; // Don't retain since we're owned by view, which would cause a cycle wMargin = viewMargin; timerTarget = [[TimerTarget alloc] init: this]; lastMouseEvent = NULL; delegate = NULL; notifyObj = NULL; notifyProc = NULL; capturedMouse = false; enteredSetScrollingSize = false; scrollSpeed = 1; scrollTicks = 2000; tickTimer = NULL; idleTimer = NULL; observer = NULL; layerFindIndicator = NULL; imeInteraction = imeInline; for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast(tr+1)) { timers[tr] = nil; } Initialise(); } //-------------------------------------------------------------------------------------------------- ScintillaCocoa::~ScintillaCocoa() { Finalise(); [timerTarget release]; } //-------------------------------------------------------------------------------------------------- /** * Core initialization of the control. Everything that needs to be set up happens here. */ void ScintillaCocoa::Initialise() { Scintilla_LinkLexers(); // Tell Scintilla not to buffer: Quartz buffers drawing for us. WndProc(SCI_SETBUFFEREDDRAW, 0, 0); // We are working with Unicode exclusively. WndProc(SCI_SETCODEPAGE, SC_CP_UTF8, 0); // Add Mac specific key bindings. for (int i = 0; macMapDefault[i].key; i++) kmap.AssignCmdKey(macMapDefault[i].key, macMapDefault[i].modifiers, macMapDefault[i].msg); } //-------------------------------------------------------------------------------------------------- /** * We need some clean up. Do it here. */ void ScintillaCocoa::Finalise() { ObserverRemove(); for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast(tr+1)) { FineTickerCancel(tr); } ScintillaBase::Finalise(); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::UpdateObserver(CFRunLoopObserverRef /* observer */, CFRunLoopActivity /* activity */, void *info) { ScintillaCocoa* sci = reinterpret_cast(info); sci->IdleWork(); } //-------------------------------------------------------------------------------------------------- /** * Add an observer to the run loop to perform styling as high-priority idle task. */ void ScintillaCocoa::ObserverAdd() { if (!observer) { CFRunLoopObserverContext context; context.version = 0; context.info = this; context.retain = NULL; context.release = NULL; context.copyDescription = NULL; CFRunLoopRef mainRunLoop = CFRunLoopGetMain(); observer = CFRunLoopObserverCreate(NULL, kCFRunLoopEntry | kCFRunLoopBeforeWaiting, true, 0, UpdateObserver, &context); CFRunLoopAddObserver(mainRunLoop, observer, kCFRunLoopCommonModes); } } //-------------------------------------------------------------------------------------------------- /** * Remove the run loop observer. */ void ScintillaCocoa::ObserverRemove() { if (observer) { CFRunLoopRef mainRunLoop = CFRunLoopGetMain(); CFRunLoopRemoveObserver(mainRunLoop, observer, kCFRunLoopCommonModes); CFRelease(observer); } observer = NULL; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::IdleWork() { Editor::IdleWork(); ObserverRemove(); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::QueueIdleWork(WorkNeeded::workItems items, int upTo) { Editor::QueueIdleWork(items, upTo); ObserverAdd(); } //-------------------------------------------------------------------------------------------------- /** * Convert a core foundation string into an array of bytes in a particular encoding */ static char *EncodedBytes(CFStringRef cfsRef, CFStringEncoding encoding) { CFRange rangeAll = {0, CFStringGetLength(cfsRef)}; CFIndex usedLen = 0; CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false, NULL, 0, &usedLen); char *buffer = new char[usedLen+1]; CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false, (UInt8 *)buffer,usedLen, NULL); buffer[usedLen] = '\0'; return buffer; } //-------------------------------------------------------------------------------------------------- /** * Convert a core foundation string into a std::string in a particular encoding */ static std::string EncodedBytesString(CFStringRef cfsRef, CFStringEncoding encoding) { const CFRange rangeAll = {0, CFStringGetLength(cfsRef)}; CFIndex usedLen = 0; CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false, NULL, 0, &usedLen); std::string buffer(usedLen, '\0'); if (usedLen > 0) { CFStringGetBytes(cfsRef, rangeAll, encoding, '?', false, reinterpret_cast(&buffer[0]), usedLen, NULL); } return buffer; } //-------------------------------------------------------------------------------------------------- /** * Case folders. */ class CaseFolderDBCS : public CaseFolderTable { CFStringEncoding encoding; public: explicit CaseFolderDBCS(CFStringEncoding encoding_) : encoding(encoding_) { StandardASCII(); } virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) { if ((lenMixed == 1) && (sizeFolded > 0)) { folded[0] = mapping[static_cast(mixed[0])]; return 1; } else { CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(mixed), lenMixed, encoding, false); NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch locale:[NSLocale currentLocale]]; char *encoded = EncodedBytes((CFStringRef)sMapped, encoding); size_t lenMapped = strlen(encoded); if (lenMapped < sizeFolded) { memcpy(folded, encoded, lenMapped); } else { folded[0] = '\0'; lenMapped = 1; } delete []encoded; CFRelease(cfsVal); return lenMapped; } } }; CaseFolder *ScintillaCocoa::CaseFolderForEncoding() { if (pdoc->dbcsCodePage == SC_CP_UTF8) { return new CaseFolderUnicode(); } else { CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); if (pdoc->dbcsCodePage == 0) { CaseFolderTable *pcf = new CaseFolderTable(); pcf->StandardASCII(); // Only for single byte encodings for (int i=0x80; i<0x100; i++) { char sCharacter[2] = "A"; sCharacter[0] = static_cast(i); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(sCharacter), 1, encoding, false); if (!cfsVal) continue; NSString *sMapped = [(NSString *)cfsVal stringByFoldingWithOptions:NSCaseInsensitiveSearch locale:[NSLocale currentLocale]]; char *encoded = EncodedBytes((CFStringRef)sMapped, encoding); if (strlen(encoded) == 1) { pcf->SetTranslation(sCharacter[0], encoded[0]); } delete []encoded; CFRelease(cfsVal); } return pcf; } else { return new CaseFolderDBCS(encoding); } return 0; } } //-------------------------------------------------------------------------------------------------- /** * Case-fold the given string depending on the specified case mapping type. */ std::string ScintillaCocoa::CaseMapString(const std::string &s, int caseMapping) { if ((s.size() == 0) || (caseMapping == cmSame)) return s; if (IsUnicodeMode()) { std::string retMapped(s.length() * maxExpansionCaseConversion, 0); size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(), (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower); retMapped.resize(lenMapped); return retMapped; } CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(s.c_str()), s.length(), encoding, false); NSString *sMapped; switch (caseMapping) { case cmUpper: sMapped = [(NSString *)cfsVal uppercaseString]; break; case cmLower: sMapped = [(NSString *)cfsVal lowercaseString]; break; default: sMapped = (NSString *)cfsVal; } // Back to encoding char *encoded = EncodedBytes((CFStringRef)sMapped, encoding); std::string result(encoded); delete []encoded; CFRelease(cfsVal); return result; } //-------------------------------------------------------------------------------------------------- /** * Cancel all modes, both for base class and any find indicator. */ void ScintillaCocoa::CancelModes() { ScintillaBase::CancelModes(); HideFindIndicator(); } //-------------------------------------------------------------------------------------------------- /** * Helper function to get the scrolling view. */ NSScrollView* ScintillaCocoa::ScrollContainer() const { NSView* container = static_cast(wMain.GetID()); return static_cast([[container superview] superview]); } //-------------------------------------------------------------------------------------------------- /** * Helper function to get the inner container which represents the actual "canvas" we work with. */ SCIContentView* ScintillaCocoa::ContentView() { return static_cast(wMain.GetID()); } //-------------------------------------------------------------------------------------------------- /** * Return the top left visible point relative to the origin point of the whole document. */ Scintilla::Point ScintillaCocoa::GetVisibleOriginInMain() const { NSScrollView *scrollView = ScrollContainer(); NSRect contentRect = [[scrollView contentView] bounds]; return Point(static_cast(contentRect.origin.x), static_cast(contentRect.origin.y)); } //-------------------------------------------------------------------------------------------------- /** * Instead of returning the size of the inner view we have to return the visible part of it * in order to make scrolling working properly. * The returned value is in document coordinates. */ PRectangle ScintillaCocoa::GetClientRectangle() const { NSScrollView *scrollView = ScrollContainer(); NSSize size = [[scrollView contentView] bounds].size; Point origin = GetVisibleOriginInMain(); return PRectangle(origin.x, origin.y, static_cast(origin.x+size.width), static_cast(origin.y + size.height)); } //-------------------------------------------------------------------------------------------------- /** * Allow for prepared rectangle */ PRectangle ScintillaCocoa::GetClientDrawingRectangle() { #if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 NSView *content = ContentView(); if ([content respondsToSelector: @selector(setPreparedContentRect:)]) { NSRect rcPrepared = [content preparedContentRect]; if (!NSIsEmptyRect(rcPrepared)) return NSRectToPRectangle(rcPrepared); } #endif return ScintillaCocoa::GetClientRectangle(); } //-------------------------------------------------------------------------------------------------- /** * Converts the given point from base coordinates to local coordinates and at the same time into * a native Point structure. Base coordinates are used for the top window used in the view hierarchy. * Returned value is in view coordinates. */ Scintilla::Point ScintillaCocoa::ConvertPoint(NSPoint point) { NSView* container = ContentView(); NSPoint result = [container convertPoint: point fromView: nil]; Scintilla::Point ptOrigin = GetVisibleOriginInMain(); return Point(static_cast(result.x - ptOrigin.x), static_cast(result.y - ptOrigin.y)); } //-------------------------------------------------------------------------------------------------- /** * Do not clip like superclass as Cocoa is not reporting all of prepared area. */ void ScintillaCocoa::RedrawRect(PRectangle rc) { if (!rc.Empty()) wMain.InvalidateRectangle(rc); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::DiscardOverdraw() { #if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 // If running on 10.9, reset prepared area to visible area NSView *content = ContentView(); if ([content respondsToSelector: @selector(setPreparedContentRect:)]) { content.preparedContentRect = [content visibleRect]; } #endif } //-------------------------------------------------------------------------------------------------- /** * Ensure all of prepared content is also redrawn. */ void ScintillaCocoa::Redraw() { wMargin.InvalidateAll(); DiscardOverdraw(); wMain.InvalidateAll(); } //-------------------------------------------------------------------------------------------------- /** * A function to directly execute code that would usually go the long way via window messages. * However this is a Windows metaphor and not used here, hence we just call our fake * window proc. The given parameters directly reflect the message parameters used on Windows. * * @param ptr The target which is to be called. * @param iMessage A code that indicates which message was sent. * @param wParam One of the two free parameters for the message. Traditionally a word sized parameter * (hence the w prefix). * @param lParam The other of the two free parameters. A signed long. */ sptr_t ScintillaCocoa::DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return reinterpret_cast(ptr)->WndProc(iMessage, wParam, lParam); } //-------------------------------------------------------------------------------------------------- /** * This method is very similar to DirectFunction. On Windows it sends a message (not in the Obj-C sense) * to the target window. Here we simply call our fake window proc. */ sptr_t scintilla_send_message(void* sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { ScintillaView *control = reinterpret_cast(sci); return [control message:iMessage wParam:wParam lParam:lParam]; } //-------------------------------------------------------------------------------------------------- /** * That's our fake window procedure. On Windows each window has a dedicated procedure to handle * commands (also used to synchronize UI and background threads), which is not the case in Cocoa. * * Messages handled here are almost solely for special commands of the backend. Everything which * would be system messages on Windows (e.g. for key down, mouse move etc.) are handled by * directly calling appropriate handlers. */ sptr_t ScintillaCocoa::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { try { switch (iMessage) { case SCI_GETDIRECTFUNCTION: return reinterpret_cast(DirectFunction); case SCI_GETDIRECTPOINTER: return reinterpret_cast(this); case SCI_TARGETASUTF8: return TargetAsUTF8(reinterpret_cast(lParam)); case SCI_ENCODEDFROMUTF8: return EncodedFromUTF8(reinterpret_cast(wParam), reinterpret_cast(lParam)); case SCI_SETIMEINTERACTION: // Only inline IME supported on Cocoa break; case SCI_GRABFOCUS: [[ContentView() window] makeFirstResponder:ContentView()]; break; case SCI_SETBUFFEREDDRAW: // Buffered drawing not supported on Cocoa view.bufferedDraw = false; break; case SCI_FINDINDICATORSHOW: ShowFindIndicatorForRange(NSMakeRange(wParam, lParam-wParam), YES); return 0; case SCI_FINDINDICATORFLASH: ShowFindIndicatorForRange(NSMakeRange(wParam, lParam-wParam), NO); return 0; case SCI_FINDINDICATORHIDE: HideFindIndicator(); return 0; default: sptr_t r = ScintillaBase::WndProc(iMessage, wParam, lParam); return r; } } catch (std::bad_alloc &) { errorStatus = SC_STATUS_BADALLOC; } catch (...) { errorStatus = SC_STATUS_FAILURE; } return 0l; } //-------------------------------------------------------------------------------------------------- /** * In Windows lingo this is the handler which handles anything that wasn't handled in the normal * window proc which would usually send the message back to generic window proc that Windows uses. */ sptr_t ScintillaCocoa::DefWndProc(unsigned int, uptr_t, sptr_t) { return 0; } //-------------------------------------------------------------------------------------------------- /** * Handle any ScintillaCocoa-specific ticking or call superclass. */ void ScintillaCocoa::TickFor(TickReason reason) { if (reason == tickPlatform) { DragScroll(); } else { Editor::TickFor(reason); } } //-------------------------------------------------------------------------------------------------- /** * Report that this Editor subclass has a working implementation of FineTickerStart. */ bool ScintillaCocoa::FineTickerAvailable() { return true; } //-------------------------------------------------------------------------------------------------- /** * Is a particular timer currently running? */ bool ScintillaCocoa::FineTickerRunning(TickReason reason) { return timers[reason] != nil; } //-------------------------------------------------------------------------------------------------- /** * Start a fine-grained timer. */ void ScintillaCocoa::FineTickerStart(TickReason reason, int millis, int tolerance) { FineTickerCancel(reason); NSTimer *fineTimer = [NSTimer scheduledTimerWithTimeInterval: millis / 1000.0 target: timerTarget selector: @selector(timerFired:) userInfo: nil repeats: YES]; if (tolerance && [fineTimer respondsToSelector: @selector(setTolerance:)]) { [fineTimer setTolerance: tolerance / 1000.0]; } timers[reason] = fineTimer; } //-------------------------------------------------------------------------------------------------- /** * Cancel a fine-grained timer. */ void ScintillaCocoa::FineTickerCancel(TickReason reason) { if (timers[reason]) { [timers[reason] invalidate]; timers[reason] = nil; } } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::SetIdle(bool on) { if (idler.state != on) { idler.state = on; if (idler.state) { // Scintilla ticks = milliseconds idleTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 target: timerTarget selector: @selector(idleTimerFired:) userInfo: nil repeats: YES]; idler.idlerID = reinterpret_cast(idleTimer); } else if (idler.idlerID != NULL) { [reinterpret_cast(idler.idlerID) invalidate]; idler.idlerID = 0; } } return true; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::CopyToClipboard(const SelectionText &selectedText) { SetPasteboardData([NSPasteboard generalPasteboard], selectedText); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::Copy() { if (!sel.Empty()) { SelectionText selectedText; CopySelectionRange(&selectedText); CopyToClipboard(selectedText); } } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::CanPaste() { if (!Editor::CanPaste()) return false; return GetPasteboardData([NSPasteboard generalPasteboard], NULL); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::Paste() { Paste(false); } //-------------------------------------------------------------------------------------------------- /** * Pastes data from the paste board into the editor. */ void ScintillaCocoa::Paste(bool forceRectangular) { SelectionText selectedText; bool ok = GetPasteboardData([NSPasteboard generalPasteboard], &selectedText); if (forceRectangular) selectedText.rectangular = forceRectangular; if (!ok || selectedText.Empty()) // No data or no flavor we support. return; pdoc->BeginUndoAction(); ClearSelection(false); InsertPasteShape(selectedText.Data(), static_cast(selectedText.Length()), selectedText.rectangular ? pasteRectangular : pasteStream); pdoc->EndUndoAction(); Redraw(); EnsureCaretVisible(); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::CTPaint(void* gc, NSRect rc) { #pragma unused(rc) Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceWindow) { surfaceWindow->Init(gc, wMain.GetID()); surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ct.codePage); surfaceWindow->SetDBCSMode(ct.codePage); ct.PaintCT(surfaceWindow); surfaceWindow->Release(); delete surfaceWindow; } } @interface CallTipView : NSControl { ScintillaCocoa *sci; } @end @implementation CallTipView - (NSView*) initWithFrame: (NSRect) frame { self = [super initWithFrame: frame]; if (self) { sci = NULL; } return self; } - (void) dealloc { [super dealloc]; } - (BOOL) isFlipped { return YES; } - (void) setSci: (ScintillaCocoa *) sci_ { sci = sci_; } - (void) drawRect: (NSRect) needsDisplayInRect { if (sci) { CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; sci->CTPaint(context, needsDisplayInRect); } } - (void) mouseDown: (NSEvent *) event { if (sci) { sci->CallTipMouseDown([event locationInWindow]); } } // On OS X, only the key view should modify the cursor so the calltip can't. // This view does not become key so resetCursorRects never called. - (void) resetCursorRects { //[super resetCursorRects]; //[self addCursorRect: [self bounds] cursor: [NSCursor arrowCursor]]; } @end void ScintillaCocoa::CallTipMouseDown(NSPoint pt) { NSRect rectBounds = [(NSView *)(ct.wDraw.GetID()) bounds]; Point location(static_cast(pt.x), static_cast(rectBounds.size.height - pt.y)); ct.MouseClick(location); CallTipClick(); } static bool HeightDifferent(WindowID wCallTip, PRectangle rc) { NSWindow *callTip = (NSWindow *)wCallTip; CGFloat height = NSHeight([callTip frame]); return height != rc.Height(); } void ScintillaCocoa::CreateCallTipWindow(PRectangle rc) { if (ct.wCallTip.Created() && HeightDifferent(ct.wCallTip.GetID(), rc)) { ct.wCallTip.Destroy(); } if (!ct.wCallTip.Created()) { NSRect ctRect = NSMakeRect(rc.top,rc.bottom, rc.Width(), rc.Height()); NSWindow *callTip = [[NSWindow alloc] initWithContentRect: ctRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: NO]; [callTip setLevel:NSFloatingWindowLevel]; [callTip setHasShadow:YES]; NSRect ctContent = NSMakeRect(0,0, rc.Width(), rc.Height()); CallTipView *caption = [[CallTipView alloc] initWithFrame: ctContent]; [caption setAutoresizingMask: NSViewWidthSizable | NSViewMaxYMargin]; [caption setSci: this]; [[callTip contentView] addSubview: caption]; [callTip orderFront:caption]; ct.wCallTip = callTip; ct.wDraw = caption; } } void ScintillaCocoa::AddToPopUp(const char *label, int cmd, bool enabled) { NSMenuItem* item; ScintillaContextMenu *menu= reinterpret_cast(popup.GetID()); [menu setOwner: this]; [menu setAutoenablesItems: NO]; if (cmd == 0) { item = [NSMenuItem separatorItem]; } else { item = [[[NSMenuItem alloc] init] autorelease]; [item setTitle: [NSString stringWithUTF8String: label]]; } [item setTarget: menu]; [item setAction: @selector(handleCommand:)]; [item setTag: cmd]; [item setEnabled: enabled]; [menu addItem: item]; } // ------------------------------------------------------------------------------------------------- void ScintillaCocoa::ClaimSelection() { // Mac OS X does not have a primary selection. } // ------------------------------------------------------------------------------------------------- /** * Returns the current caret position (which is tracked as an offset into the entire text string) * as a row:column pair. The result is zero-based. */ NSPoint ScintillaCocoa::GetCaretPosition() { const int line = pdoc->LineFromPosition(sel.RangeMain().caret.Position()); NSPoint result; result.y = line; result.x = sel.RangeMain().caret.Position() - pdoc->LineStart(line); return result; } // ------------------------------------------------------------------------------------------------- #pragma mark Drag /** * Triggered by the tick timer on a regular basis to scroll the content during a drag operation. */ void ScintillaCocoa::DragScroll() { if (!posDrag.IsValid()) { scrollSpeed = 1; scrollTicks = 2000; return; } // TODO: does not work for wrapped lines, fix it. int line = pdoc->LineFromPosition(posDrag.Position()); int currentVisibleLine = cs.DisplayFromDoc(line); int lastVisibleLine = Platform::Minimum(topLine + LinesOnScreen(), cs.LinesDisplayed()) - 2; if (currentVisibleLine <= topLine && topLine > 0) ScrollTo(topLine - scrollSpeed); else if (currentVisibleLine >= lastVisibleLine) ScrollTo(topLine + scrollSpeed); else { scrollSpeed = 1; scrollTicks = 2000; return; } // TODO: also handle horizontal scrolling. if (scrollSpeed == 1) { scrollTicks -= timer.tickSize; if (scrollTicks <= 0) { scrollSpeed = 5; scrollTicks = 2000; } } } //----------------- DragProviderSource ------------------------------------------------------- @interface DragProviderSource : NSObject { SelectionText selectedText; } @end @implementation DragProviderSource - (id)initWithSelectedText:(const SelectionText *)other { self = [super init]; if (self) { selectedText.Copy(*other); } return self; } - (void)pasteboard:(NSPasteboard *)pasteboard item:(NSPasteboardItem *)item provideDataForType:(NSString *)type { if (selectedText.Length() == 0) return; if (([type compare: NSPasteboardTypeString] != NSOrderedSame) && ([type compare: ScintillaRecPboardType] != NSOrderedSame)) return; CFStringEncoding encoding = EncodingFromCharacterSet(selectedText.codePage == SC_CP_UTF8, selectedText.characterSet); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(selectedText.Data()), selectedText.Length(), encoding, false); if ([type compare: NSPasteboardTypeString] == NSOrderedSame) { [pasteboard setString:(NSString *)cfsVal forType: NSStringPboardType]; } else if ([type compare: ScintillaRecPboardType] == NSOrderedSame) { // This is specific to scintilla, allows us to drag rectangular selections around the document. if (selectedText.rectangular) [pasteboard setString:(NSString *)cfsVal forType: ScintillaRecPboardType]; } if (cfsVal) CFRelease(cfsVal); } @end //-------------------------------------------------------------------------------------------------- /** * Called when a drag operation was initiated from within Scintilla. */ void ScintillaCocoa::StartDrag() { if (sel.Empty()) return; inDragDrop = ddDragging; FineTickerStart(tickPlatform, timer.tickSize, 0); // Put the data to be dragged on the drag pasteboard. SelectionText selectedText; NSPasteboard* pasteboard = [NSPasteboard pasteboardWithName: NSDragPboard]; CopySelectionRange(&selectedText); SetPasteboardData(pasteboard, selectedText); // calculate the bounds of the selection PRectangle client = GetTextRectangle(); int selStart = sel.RangeMain().Start().Position(); int selEnd = sel.RangeMain().End().Position(); int startLine = pdoc->LineFromPosition(selStart); int endLine = pdoc->LineFromPosition(selEnd); Point pt; long startPos, endPos, ep; PRectangle rcSel; if (startLine==endLine && WndProc(SCI_GETWRAPMODE, 0, 0) != SC_WRAP_NONE) { // Komodo bug http://bugs.activestate.com/show_bug.cgi?id=87571 // Scintilla bug https://sourceforge.net/tracker/?func=detail&atid=102439&aid=3040200&group_id=2439 // If the width on a wrapped-line selection is negative, // find a better bounding rectangle. Point ptStart, ptEnd; startPos = WndProc(SCI_GETLINESELSTARTPOSITION, startLine, 0); endPos = WndProc(SCI_GETLINESELENDPOSITION, startLine, 0); // step back a position if we're counting the newline ep = WndProc(SCI_GETLINEENDPOSITION, startLine, 0); if (endPos > ep) endPos = ep; ptStart = LocationFromPosition(static_cast(startPos)); ptEnd = LocationFromPosition(static_cast(endPos)); if (ptStart.y == ptEnd.y) { // We're just selecting part of one visible line rcSel.left = ptStart.x; rcSel.right = ptEnd.x < client.right ? ptEnd.x : client.right; } else { // Find the bounding box. startPos = WndProc(SCI_POSITIONFROMLINE, startLine, 0); rcSel.left = LocationFromPosition(static_cast(startPos)).x; rcSel.right = client.right; } rcSel.top = ptStart.y; rcSel.bottom = ptEnd.y + vs.lineHeight; if (rcSel.bottom > client.bottom) { rcSel.bottom = client.bottom; } } else { rcSel.top = rcSel.bottom = rcSel.right = rcSel.left = -1; for (int l = startLine; l <= endLine; l++) { startPos = WndProc(SCI_GETLINESELSTARTPOSITION, l, 0); endPos = WndProc(SCI_GETLINESELENDPOSITION, l, 0); if (endPos == startPos) continue; // step back a position if we're counting the newline ep = WndProc(SCI_GETLINEENDPOSITION, l, 0); if (endPos > ep) endPos = ep; pt = LocationFromPosition(static_cast(startPos)); // top left of line selection if (pt.x < rcSel.left || rcSel.left < 0) rcSel.left = pt.x; if (pt.y < rcSel.top || rcSel.top < 0) rcSel.top = pt.y; pt = LocationFromPosition(static_cast(endPos)); // top right of line selection pt.y += vs.lineHeight; // get to the bottom of the line if (pt.x > rcSel.right || rcSel.right < 0) { if (pt.x > client.right) rcSel.right = client.right; else rcSel.right = pt.x; } if (pt.y > rcSel.bottom || rcSel.bottom < 0) { if (pt.y > client.bottom) rcSel.bottom = client.bottom; else rcSel.bottom = pt.y; } } } // must convert to global coordinates for drag regions, but also save the // image rectangle for further calculations and copy operations // Prepare drag image. NSRect selectionRectangle = PRectangleToNSRect(rcSel); SCIContentView* content = ContentView(); // To get a bitmap of the text we're dragging, we just use Paint on a pixmap surface. SurfaceImpl *sw = new SurfaceImpl(); SurfaceImpl *pixmap = NULL; bool lastHideSelection = view.hideSelection; view.hideSelection = true; if (sw) { pixmap = new SurfaceImpl(); if (pixmap) { PRectangle imageRect = rcSel; paintState = painting; sw->InitPixMap(static_cast(client.Width()), static_cast(client.Height()), NULL, NULL); paintingAllText = true; // Have to create a new context and make current as text drawing goes // to the current context, not a passed context. CGContextRef gcsw = sw->GetContext(); NSGraphicsContext *nsgc = [NSGraphicsContext graphicsContextWithGraphicsPort: gcsw flipped: YES]; [NSGraphicsContext setCurrentContext:nsgc]; CGContextTranslateCTM(gcsw, -client.left, -client.top); Paint(sw, client); paintState = notPainting; pixmap->InitPixMap(static_cast(imageRect.Width()), static_cast(imageRect.Height()), NULL, NULL); pixmap->SetUnicodeMode(IsUnicodeMode()); pixmap->SetDBCSMode(CodePage()); CGContextRef gc = pixmap->GetContext(); // To make Paint() work on a bitmap, we have to flip our coordinates and translate the origin CGContextTranslateCTM(gc, 0, imageRect.Height()); CGContextScaleCTM(gc, 1.0, -1.0); pixmap->CopyImageRectangle(*sw, imageRect, PRectangle(0.0f, 0.0f, imageRect.Width(), imageRect.Height())); // XXX TODO: overwrite any part of the image that is not part of the // selection to make it transparent. right now we just use // the full rectangle which may include non-selected text. } sw->Release(); delete sw; } view.hideSelection = lastHideSelection; NSBitmapImageRep* bitmap = NULL; if (pixmap) { CGImageRef imagePixmap = pixmap->GetImage(); if (imagePixmap) bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap] autorelease]; CGImageRelease(imagePixmap); pixmap->Release(); delete pixmap; } NSImage* image = [[[NSImage alloc] initWithSize: selectionRectangle.size] autorelease]; [image addRepresentation: bitmap]; NSImage* dragImage = [[[NSImage alloc] initWithSize: selectionRectangle.size] autorelease]; [dragImage setBackgroundColor: [NSColor clearColor]]; [dragImage lockFocus]; [image drawAtPoint: NSZeroPoint fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 0.5]; [dragImage unlockFocus]; NSPoint startPoint; startPoint.x = selectionRectangle.origin.x + client.left; startPoint.y = selectionRectangle.origin.y + selectionRectangle.size.height + client.top; NSPasteboardItem *pbItem = [NSPasteboardItem new]; DragProviderSource *dps = [[[DragProviderSource alloc] initWithSelectedText:&selectedText] autorelease]; NSArray *pbTypes = selectedText.rectangular ? @[NSPasteboardTypeString, ScintillaRecPboardType] : @[NSPasteboardTypeString]; [pbItem setDataProvider:dps forTypes:pbTypes]; NSDraggingItem *dragItem = [[NSDraggingItem alloc ]initWithPasteboardWriter:pbItem]; [pbItem release]; NSScrollView *scrollContainer = ScrollContainer(); NSRect contentRect = [[scrollContainer contentView] bounds]; NSRect draggingRect = NSOffsetRect(selectionRectangle, contentRect.origin.x, contentRect.origin.y); [dragItem setDraggingFrame:draggingRect contents:dragImage]; NSDraggingSession *dragSession = [content beginDraggingSessionWithItems:@[[dragItem autorelease]] event:lastMouseEvent source:content]; dragSession.animatesToStartingPositionsOnCancelOrFail = YES; dragSession.draggingFormation = NSDraggingFormationNone; } //-------------------------------------------------------------------------------------------------- /** * Called when a drag operation reaches the control which was initiated outside. */ NSDragOperation ScintillaCocoa::DraggingEntered(id info) { FineTickerStart(tickPlatform, timer.tickSize, 0); return DraggingUpdated(info); } //-------------------------------------------------------------------------------------------------- /** * Called frequently during a drag operation if we are the target. Keep telling the caller * what drag operation we accept and update the drop caret position to indicate the * potential insertion point of the dragged data. */ NSDragOperation ScintillaCocoa::DraggingUpdated(id info) { // Convert the drag location from window coordinates to view coordinates and // from there to a text position to finally set the drag position. Point location = ConvertPoint([info draggingLocation]); SetDragPosition(SPositionFromLocation(location)); NSDragOperation sourceDragMask = [info draggingSourceOperationMask]; if (sourceDragMask == NSDragOperationNone) return sourceDragMask; NSPasteboard* pasteboard = [info draggingPasteboard]; // Return what type of operation we will perform. Prefer move over copy. if ([[pasteboard types] containsObject: NSStringPboardType] || [[pasteboard types] containsObject: ScintillaRecPboardType]) return (sourceDragMask & NSDragOperationMove) ? NSDragOperationMove : NSDragOperationCopy; if ([[pasteboard types] containsObject: NSFilenamesPboardType]) return (sourceDragMask & NSDragOperationGeneric); return NSDragOperationNone; } //-------------------------------------------------------------------------------------------------- /** * Resets the current drag position as we are no longer the drag target. */ void ScintillaCocoa::DraggingExited(id info) { #pragma unused(info) SetDragPosition(SelectionPosition(invalidPosition)); FineTickerCancel(tickPlatform); inDragDrop = ddNone; } //-------------------------------------------------------------------------------------------------- /** * Here is where the real work is done. Insert the text from the pasteboard. */ bool ScintillaCocoa::PerformDragOperation(id info) { NSPasteboard* pasteboard = [info draggingPasteboard]; if ([[pasteboard types] containsObject: NSFilenamesPboardType]) { NSArray* files = [pasteboard propertyListForType: NSFilenamesPboardType]; for (NSString* uri in files) NotifyURIDropped([uri UTF8String]); } else { SelectionText text; GetPasteboardData(pasteboard, &text); if (text.Length() > 0) { NSDragOperation operation = [info draggingSourceOperationMask]; bool moving = (operation & NSDragOperationMove) != 0; DropAt(posDrag, text.Data(), text.Length(), moving, text.rectangular); }; } return true; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::SetPasteboardData(NSPasteboard* board, const SelectionText &selectedText) { if (selectedText.Length() == 0) return; CFStringEncoding encoding = EncodingFromCharacterSet(selectedText.codePage == SC_CP_UTF8, selectedText.characterSet); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(selectedText.Data()), selectedText.Length(), encoding, false); NSArray *pbTypes = selectedText.rectangular ? [NSArray arrayWithObjects: NSStringPboardType, ScintillaRecPboardType, nil] : [NSArray arrayWithObjects: NSStringPboardType, nil]; [board declareTypes:pbTypes owner:nil]; if (selectedText.rectangular) { // This is specific to scintilla, allows us to drag rectangular selections around the document. [board setString: (NSString *)cfsVal forType: ScintillaRecPboardType]; } [board setString: (NSString *)cfsVal forType: NSStringPboardType]; if (cfsVal) CFRelease(cfsVal); } //-------------------------------------------------------------------------------------------------- /** * Helper method to retrieve the best fitting alternative from the general pasteboard. */ bool ScintillaCocoa::GetPasteboardData(NSPasteboard* board, SelectionText* selectedText) { NSArray* supportedTypes = [NSArray arrayWithObjects: ScintillaRecPboardType, NSStringPboardType, nil]; NSString *bestType = [board availableTypeFromArray: supportedTypes]; NSString* data = [board stringForType: bestType]; if (data != nil) { if (selectedText != nil) { CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); CFRange rangeAll = {0, static_cast([data length])}; CFIndex usedLen = 0; CFStringGetBytes((CFStringRef)data, rangeAll, encoding, '?', false, NULL, 0, &usedLen); std::vector buffer(usedLen); CFStringGetBytes((CFStringRef)data, rangeAll, encoding, '?', false, buffer.data(),usedLen, NULL); bool rectangular = bestType == ScintillaRecPboardType; std::string dest(reinterpret_cast(buffer.data()), usedLen); selectedText->Copy(dest, pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet , rectangular, false); } return true; } return false; } //-------------------------------------------------------------------------------------------------- // Returns the target converted to UTF8. // Return the length in bytes. int ScintillaCocoa::TargetAsUTF8(char *text) { const int targetLength = targetEnd - targetStart; if (IsUnicodeMode()) { if (text) pdoc->GetCharRange(text, targetStart, targetLength); } else { // Need to convert const CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); const std::string s = RangeText(targetStart, targetEnd); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(s.c_str()), s.length(), encoding, false); const std::string tmputf = EncodedBytesString(cfsVal, kCFStringEncodingUTF8); if (text) memcpy(text, tmputf.c_str(), tmputf.length()); CFRelease(cfsVal); return tmputf.length(); } return targetLength; } //-------------------------------------------------------------------------------------------------- // Translates a UTF8 string into the document encoding. // Return the length of the result in bytes. int ScintillaCocoa::EncodedFromUTF8(char *utf8, char *encoded) const { const int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) memcpy(encoded, utf8, inputLength); return inputLength; } else { // Need to convert const CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); CFStringRef cfsVal = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(utf8), inputLength, kCFStringEncodingUTF8, false); const std::string sEncoded = EncodedBytesString(cfsVal, encoding); if (encoded) memcpy(encoded, sEncoded.c_str(), sEncoded.length()); CFRelease(cfsVal); return sEncoded.length(); } } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::SetMouseCapture(bool on) { capturedMouse = on; } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::HaveMouseCapture() { return capturedMouse; } //-------------------------------------------------------------------------------------------------- /** * Synchronously paint a rectangle of the window. */ bool ScintillaCocoa::SyncPaint(void* gc, PRectangle rc) { paintState = painting; rcPaint = rc; PRectangle rcText = GetTextRectangle(); paintingAllText = rcPaint.Contains(rcText); bool succeeded = true; Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (sw) { CGContextSetAllowsAntialiasing((CGContextRef)gc, vs.extraFontFlag != SC_EFF_QUALITY_NON_ANTIALIASED); CGContextSetAllowsFontSmoothing((CGContextRef)gc, vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED); CGContextSetAllowsFontSubpixelPositioning((CGContextRef)gc, vs.extraFontFlag == SC_EFF_QUALITY_DEFAULT || vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED); sw->Init(gc, wMain.GetID()); Paint(sw, rc); succeeded = paintState != paintAbandoned; sw->Release(); delete sw; } paintState = notPainting; if (!succeeded) { NSView *marginView = static_cast(wMargin.GetID()); [marginView setNeedsDisplay:YES]; } return succeeded; } //-------------------------------------------------------------------------------------------------- /** * Paint the margin into the SCIMarginView space. */ void ScintillaCocoa::PaintMargin(NSRect aRect) { CGContextRef gc = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; PRectangle rc = NSRectToPRectangle(aRect); rcPaint = rc; Surface *sw = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (sw) { CGContextSetAllowsAntialiasing(gc, vs.extraFontFlag != SC_EFF_QUALITY_NON_ANTIALIASED); CGContextSetAllowsFontSmoothing(gc, vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED); CGContextSetAllowsFontSubpixelPositioning(gc, vs.extraFontFlag == SC_EFF_QUALITY_DEFAULT || vs.extraFontFlag == SC_EFF_QUALITY_LCD_OPTIMIZED); sw->Init(gc, wMargin.GetID()); PaintSelMargin(sw, rc); sw->Release(); delete sw; } } //-------------------------------------------------------------------------------------------------- /** * Prepare for drawing. * * @param rect The area that will be drawn, given in the sender's coordinate system. */ void ScintillaCocoa::WillDraw(NSRect rect) { RefreshStyleData(); PRectangle rcWillDraw = NSRectToPRectangle(rect); int positionAfterRect = PositionAfterArea(rcWillDraw); pdoc->EnsureStyledTo(positionAfterRect); NotifyUpdateUI(); if (WrapLines(wsVisible)) { // Wrap may have reduced number of lines so more lines may need to be styled positionAfterRect = PositionAfterArea(rcWillDraw); pdoc->EnsureStyledTo(positionAfterRect); // The wrapping process has changed the height of some lines so redraw all. Redraw(); } } //-------------------------------------------------------------------------------------------------- /** * ScrollText is empty because scrolling is handled by the NSScrollView. */ void ScintillaCocoa::ScrollText(int) { } //-------------------------------------------------------------------------------------------------- /** * Modifies the vertical scroll position to make the current top line show up as such. */ void ScintillaCocoa::SetVerticalScrollPos() { NSScrollView *scrollView = ScrollContainer(); if (scrollView) { NSClipView *clipView = [scrollView contentView]; NSRect contentRect = [clipView bounds]; [clipView scrollToPoint: NSMakePoint(contentRect.origin.x, topLine * vs.lineHeight)]; [scrollView reflectScrolledClipView:clipView]; } } //-------------------------------------------------------------------------------------------------- /** * Modifies the horizontal scroll position to match xOffset. */ void ScintillaCocoa::SetHorizontalScrollPos() { PRectangle textRect = GetTextRectangle(); int maxXOffset = scrollWidth - static_cast(textRect.Width()); if (maxXOffset < 0) maxXOffset = 0; if (xOffset > maxXOffset) xOffset = maxXOffset; NSScrollView *scrollView = ScrollContainer(); if (scrollView) { NSClipView * clipView = [scrollView contentView]; NSRect contentRect = [clipView bounds]; [clipView scrollToPoint: NSMakePoint(xOffset, contentRect.origin.y)]; [scrollView reflectScrolledClipView:clipView]; } MoveFindIndicatorWithBounce(NO); } //-------------------------------------------------------------------------------------------------- /** * Used to adjust both scrollers to reflect the current scroll range and position in the editor. * Arguments no longer used as NSScrollView handles details of scroll bar sizes. * * @param nMax Number of lines in the editor. * @param nPage Number of lines per scroll page. * @return True if there was a change, otherwise false. */ bool ScintillaCocoa::ModifyScrollBars(int nMax, int nPage) { #pragma unused(nMax, nPage) return SetScrollingSize(); } bool ScintillaCocoa::SetScrollingSize(void) { bool changes = false; SCIContentView *inner = ContentView(); if (!enteredSetScrollingSize) { enteredSetScrollingSize = true; NSScrollView *scrollView = ScrollContainer(); NSClipView *clipView = [ScrollContainer() contentView]; NSRect clipRect = [clipView bounds]; CGFloat docHeight = cs.LinesDisplayed() * vs.lineHeight; if (!endAtLastLine) docHeight += (int([scrollView bounds].size.height / vs.lineHeight)-3) * vs.lineHeight; // Allow extra space so that last scroll position places whole line at top int clipExtra = int(clipRect.size.height) % vs.lineHeight; docHeight += clipExtra; // Ensure all of clipRect covered by Scintilla drawing if (docHeight < clipRect.size.height) docHeight = clipRect.size.height; CGFloat docWidth = scrollWidth; bool showHorizontalScroll = horizontalScrollBarVisible && !Wrapping(); if (!showHorizontalScroll) docWidth = clipRect.size.width; NSRect contentRect = {{0, 0}, {docWidth, docHeight}}; NSRect contentRectNow = [inner frame]; changes = (contentRect.size.width != contentRectNow.size.width) || (contentRect.size.height != contentRectNow.size.height); if (changes) { [inner setFrame: contentRect]; } [scrollView setHasVerticalScroller: verticalScrollBarVisible]; [scrollView setHasHorizontalScroller: showHorizontalScroll]; SetVerticalScrollPos(); enteredSetScrollingSize = false; } [inner.owner setMarginWidth: vs.fixedColumnWidth]; return changes; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::Resize() { SetScrollingSize(); ChangeSize(); } //-------------------------------------------------------------------------------------------------- /** * Update fields to match scroll position after receiving a notification that the user has scrolled. */ void ScintillaCocoa::UpdateForScroll() { Point ptOrigin = GetVisibleOriginInMain(); xOffset = static_cast(ptOrigin.x); int newTop = Platform::Minimum(static_cast(ptOrigin.y / vs.lineHeight), MaxScrollPos()); SetTopLine(newTop); } //-------------------------------------------------------------------------------------------------- /** * Register a delegate that will be called for notifications and commands. * This provides similar functionality to RegisterNotifyCallback but in an * Objective C way. * * @param delegate_ A pointer to an object that implements ScintillaNotificationProtocol. */ void ScintillaCocoa::SetDelegate(id delegate_) { delegate = delegate_; } //-------------------------------------------------------------------------------------------------- /** * Used to register a callback function for a given window. This is used to emulate the way * Windows notifies other controls (mainly up in the view hierarchy) about certain events. * * @param windowid A handle to a window. That value is generic and can be anything. It is passed * through to the callback. * @param callback The callback function to be used for future notifications. If NULL then no * notifications will be sent anymore. */ void ScintillaCocoa::RegisterNotifyCallback(intptr_t windowid, SciNotifyFunc callback) { notifyObj = windowid; notifyProc = callback; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::NotifyChange() { if (notifyProc != NULL) notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(static_cast(GetCtrlID()), SCEN_CHANGE), (uintptr_t) this); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::NotifyFocus(bool focus) { if (notifyProc != NULL) notifyProc(notifyObj, WM_COMMAND, Platform::LongFromTwoShorts(static_cast(GetCtrlID()), (focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS)), (uintptr_t) this); Editor::NotifyFocus(focus); } //-------------------------------------------------------------------------------------------------- /** * Used to send a notification (as WM_NOTIFY call) to the procedure, which has been set by the call * to RegisterNotifyCallback (so it is not necessarily the parent window). * * @param scn The notification to send. */ void ScintillaCocoa::NotifyParent(SCNotification scn) { scn.nmhdr.hwndFrom = (void*) this; scn.nmhdr.idFrom = GetCtrlID(); if (notifyProc != NULL) notifyProc(notifyObj, WM_NOTIFY, GetCtrlID(), (uintptr_t) &scn); if (delegate) [delegate notification:&scn]; } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::NotifyURIDropped(const char *uri) { SCNotification scn; scn.nmhdr.code = SCN_URIDROPPED; scn.text = uri; NotifyParent(scn); } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::HasSelection() { return !sel.Empty(); } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::CanUndo() { return pdoc->CanUndo(); } //-------------------------------------------------------------------------------------------------- bool ScintillaCocoa::CanRedo() { return pdoc->CanRedo(); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::TimerFired(NSTimer* timer) { for (TickReason tr=tickCaret; tr<=tickPlatform; tr = static_cast(tr+1)) { if (timers[tr] == timer) { TickFor(tr); } } } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::IdleTimerFired() { bool more = Idle(); if (!more) SetIdle(false); } //-------------------------------------------------------------------------------------------------- /** * Main entry point for drawing the control. * * @param rect The area to paint, given in the sender's coordinate system. * @param gc The context we can use to paint. */ bool ScintillaCocoa::Draw(NSRect rect, CGContextRef gc) { return SyncPaint(gc, NSRectToPRectangle(rect)); } //-------------------------------------------------------------------------------------------------- /** * Helper function to translate OS X key codes to Scintilla key codes. */ static inline UniChar KeyTranslate(UniChar unicodeChar) { switch (unicodeChar) { case NSDownArrowFunctionKey: return SCK_DOWN; case NSUpArrowFunctionKey: return SCK_UP; case NSLeftArrowFunctionKey: return SCK_LEFT; case NSRightArrowFunctionKey: return SCK_RIGHT; case NSHomeFunctionKey: return SCK_HOME; case NSEndFunctionKey: return SCK_END; case NSPageUpFunctionKey: return SCK_PRIOR; case NSPageDownFunctionKey: return SCK_NEXT; case NSDeleteFunctionKey: return SCK_DELETE; case NSInsertFunctionKey: return SCK_INSERT; case '\n': case 3: return SCK_RETURN; case 27: return SCK_ESCAPE; case 127: return SCK_BACK; case '\t': case 25: // Shift tab, return to unmodified tab and handle that via modifiers. return SCK_TAB; default: return unicodeChar; } } //-------------------------------------------------------------------------------------------------- /** * Translate NSEvent modifier flags into SCI_* modifier flags. * * @param modifiers An integer bit set of NSSEvent modifier flags. * @return A set of SCI_* modifier flags. */ static int TranslateModifierFlags(NSUInteger modifiers) { // Signal Control as SCI_META return (((modifiers & NSShiftKeyMask) != 0) ? SCI_SHIFT : 0) | (((modifiers & NSCommandKeyMask) != 0) ? SCI_CTRL : 0) | (((modifiers & NSAlternateKeyMask) != 0) ? SCI_ALT : 0) | (((modifiers & NSControlKeyMask) != 0) ? SCI_META : 0); } //-------------------------------------------------------------------------------------------------- /** * Main keyboard input handling method. It is called for any key down event, including function keys, * numeric keypad input and whatnot. * * @param event The event instance associated with the key down event. * @return True if the input was handled, false otherwise. */ bool ScintillaCocoa::KeyboardInput(NSEvent* event) { // For now filter out function keys. NSString* input = [event characters]; bool handled = false; // Handle each entry individually. Usually we only have one entry anyway. for (size_t i = 0; i < input.length; i++) { const UniChar originalKey = [input characterAtIndex: i]; UniChar key = KeyTranslate(originalKey); bool consumed = false; // Consumed as command? if (KeyDownWithModifiers(key, TranslateModifierFlags([event modifierFlags]), &consumed)) handled = true; if (consumed) handled = true; } return handled; } //-------------------------------------------------------------------------------------------------- /** * Used to insert already processed text provided by the Cocoa text input system. */ int ScintillaCocoa::InsertText(NSString* input) { CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); std::string encoded = EncodedBytesString((CFStringRef)input, encoding); if (encoded.length() > 0) { AddCharUTF((char*) encoded.c_str(), static_cast(encoded.length()), false); } return static_cast(encoded.length()); } //-------------------------------------------------------------------------------------------------- /** * Convert from a range of characters to a range of bytes. */ NSRange ScintillaCocoa::PositionsFromCharacters(NSRange range) const { long start = pdoc->GetRelativePositionUTF16(0, range.location); if (start == INVALID_POSITION) start = pdoc->Length(); long end = pdoc->GetRelativePositionUTF16(start, range.length); if (end == INVALID_POSITION) end = pdoc->Length(); return NSMakeRange(start, end - start); } //-------------------------------------------------------------------------------------------------- /** * Convert from a range of characters from a range of bytes. */ NSRange ScintillaCocoa::CharactersFromPositions(NSRange range) const { const long start = pdoc->CountUTF16(0, range.location); const long len = pdoc->CountUTF16(range.location, NSMaxRange(range)); return NSMakeRange(start, len); } //-------------------------------------------------------------------------------------------------- /** * Used to ensure that only one selection is active for input composition as composition * does not support multi-typing. */ void ScintillaCocoa::SelectOnlyMainSelection() { sel.SetSelection(sel.RangeMain()); Redraw(); } //-------------------------------------------------------------------------------------------------- /** * Convert virtual space before selection into real space. */ void ScintillaCocoa::ConvertSelectionVirtualSpace() { FillVirtualSpace(); } //-------------------------------------------------------------------------------------------------- /** * Erase all selected text and return whether the selection is now empty. * The selection may not be empty if the selection contained protected text. */ bool ScintillaCocoa::ClearAllSelections() { ClearSelection(true); return sel.Empty(); } //-------------------------------------------------------------------------------------------------- /** * Start composing for IME. */ void ScintillaCocoa::CompositionStart() { if (!sel.Empty()) { NSLog(@"Selection not empty when starting composition"); } pdoc->TentativeStart(); } //-------------------------------------------------------------------------------------------------- /** * Commit the IME text. */ void ScintillaCocoa::CompositionCommit() { pdoc->TentativeCommit(); pdoc->decorations.SetCurrentIndicator(INDIC_IME); pdoc->DecorationFillRange(0, 0, pdoc->Length()); } //-------------------------------------------------------------------------------------------------- /** * Remove the IME text. */ void ScintillaCocoa::CompositionUndo() { pdoc->TentativeUndo(); } //-------------------------------------------------------------------------------------------------- /** * When switching documents discard any incomplete character composition state as otherwise tries to * act on the new document. */ void ScintillaCocoa::SetDocPointer(Document *document) { // Drop input composition. NSTextInputContext *inctxt = [NSTextInputContext currentInputContext]; [inctxt discardMarkedText]; SCIContentView *inner = ContentView(); [inner unmarkText]; Editor::SetDocPointer(document); } //-------------------------------------------------------------------------------------------------- /** * Called by the owning view when the mouse pointer enters the control. */ void ScintillaCocoa::MouseEntered(NSEvent* event) { if (!HaveMouseCapture()) { WndProc(SCI_SETCURSOR, (long int)SC_CURSORNORMAL, 0); // Mouse location is given in screen coordinates and might also be outside of our bounds. Point location = ConvertPoint([event locationInWindow]); ButtonMove(location); } } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseExited(NSEvent* /* event */) { // Nothing to do here. } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseDown(NSEvent* event) { Point location = ConvertPoint([event locationInWindow]); NSTimeInterval time = [event timestamp]; bool command = ([event modifierFlags] & NSCommandKeyMask) != 0; bool shift = ([event modifierFlags] & NSShiftKeyMask) != 0; bool alt = ([event modifierFlags] & NSAlternateKeyMask) != 0; ButtonDown(Point(location.x, location.y), (int) (time * 1000), shift, command, alt); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseMove(NSEvent* event) { lastMouseEvent = event; ButtonMoveWithModifiers(ConvertPoint([event locationInWindow]), TranslateModifierFlags([event modifierFlags])); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseUp(NSEvent* event) { NSTimeInterval time = [event timestamp]; bool control = ([event modifierFlags] & NSControlKeyMask) != 0; ButtonUp(ConvertPoint([event locationInWindow]), (int) (time * 1000), control); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::MouseWheel(NSEvent* event) { bool command = ([event modifierFlags] & NSCommandKeyMask) != 0; int dY = 0; // In order to make scrolling with larger offset smoother we scroll less lines the larger the // delta value is. if ([event deltaY] < 0) dY = -(int) sqrt(-10.0 * [event deltaY]); else dY = (int) sqrt(10.0 * [event deltaY]); if (command) { // Zoom! We play with the font sizes in the styles. // Number of steps/line is ignored, we just care if sizing up or down. if (dY > 0.5) KeyCommand(SCI_ZOOMIN); else if (dY < -0.5) KeyCommand(SCI_ZOOMOUT); } else { } } //-------------------------------------------------------------------------------------------------- // Helper methods for NSResponder actions. void ScintillaCocoa::SelectAll() { Editor::SelectAll(); } void ScintillaCocoa::DeleteBackward() { KeyDown(SCK_BACK, false, false, false, nil); } void ScintillaCocoa::Cut() { Editor::Cut(); } void ScintillaCocoa::Undo() { Editor::Undo(); } void ScintillaCocoa::Redo() { Editor::Redo(); } //-------------------------------------------------------------------------------------------------- /** * Creates and returns a popup menu, which is then displayed by the Cocoa framework. */ NSMenu* ScintillaCocoa::CreateContextMenu(NSEvent* /* event */) { // Call ScintillaBase to create the context menu. ContextMenu(Point(0, 0)); return reinterpret_cast(popup.GetID()); } //-------------------------------------------------------------------------------------------------- /** * An intermediate function to forward context menu commands from the menu action handler to * scintilla. */ void ScintillaCocoa::HandleCommand(NSInteger command) { Command(static_cast(command)); } //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::ActiveStateChanged(bool isActive) { // If the window is being deactivated, lose the focus and turn off the ticking if (!isActive) { DropCaret(); //SetFocusState( false ); FineTickerCancel(tickCaret); } else { ShowCaretAtCurrentPosition(); } } //-------------------------------------------------------------------------------------------------- /** * When the window is about to move, the calltip and autcoimpletion stay in the same spot, * so cancel them. */ void ScintillaCocoa::WindowWillMove() { AutoCompleteCancel(); ct.CallTipCancel(); } // If building with old SDK, need to define version number for 10.8 #ifndef NSAppKitVersionNumber10_8 #define NSAppKitVersionNumber10_8 1187 #endif //-------------------------------------------------------------------------------------------------- void ScintillaCocoa::ShowFindIndicatorForRange(NSRange charRange, BOOL retaining) { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 NSView *content = ContentView(); if (!layerFindIndicator) { layerFindIndicator = [[FindHighlightLayer alloc] init]; [content setWantsLayer: YES]; layerFindIndicator.geometryFlipped = content.layer.geometryFlipped; if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_8) { // Content layer is unflipped on 10.9, but the indicator shows wrong unless flipped layerFindIndicator.geometryFlipped = YES; } [[content layer] addSublayer:layerFindIndicator]; } [layerFindIndicator removeAnimationForKey:@"animateFound"]; if (charRange.length) { CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), vs.styles[STYLE_DEFAULT].characterSet); std::vector buffer(charRange.length); pdoc->GetCharRange(&buffer[0], static_cast(charRange.location), static_cast(charRange.length)); CFStringRef cfsFind = CFStringCreateWithBytes(kCFAllocatorDefault, reinterpret_cast(&buffer[0]), charRange.length, encoding, false); layerFindIndicator.sFind = (NSString *)cfsFind; if (cfsFind) CFRelease(cfsFind); layerFindIndicator.retaining = retaining; layerFindIndicator.positionFind = static_cast(charRange.location); long style = WndProc(SCI_GETSTYLEAT, charRange.location, 0); std::vector bufferFontName(WndProc(SCI_STYLEGETFONT, style, 0) + 1); WndProc(SCI_STYLEGETFONT, style, (sptr_t)&bufferFontName[0]); layerFindIndicator.sFont = [NSString stringWithUTF8String: &bufferFontName[0]]; layerFindIndicator.fontSize = WndProc(SCI_STYLEGETSIZEFRACTIONAL, style, 0) / (float)SC_FONT_SIZE_MULTIPLIER; layerFindIndicator.widthText = WndProc(SCI_POINTXFROMPOSITION, 0, charRange.location + charRange.length) - WndProc(SCI_POINTXFROMPOSITION, 0, charRange.location); layerFindIndicator.heightLine = WndProc(SCI_TEXTHEIGHT, 0, 0); MoveFindIndicatorWithBounce(YES); } else { [layerFindIndicator hideMatch]; } #endif } void ScintillaCocoa::MoveFindIndicatorWithBounce(BOOL bounce) { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 if (layerFindIndicator) { CGPoint ptText = CGPointMake( WndProc(SCI_POINTXFROMPOSITION, 0, layerFindIndicator.positionFind), WndProc(SCI_POINTYFROMPOSITION, 0, layerFindIndicator.positionFind)); ptText.x = ptText.x - vs.fixedColumnWidth + xOffset; ptText.y += topLine * vs.lineHeight; if (!layerFindIndicator.geometryFlipped) { NSView *content = ContentView(); ptText.y = content.bounds.size.height - ptText.y; } [layerFindIndicator animateMatch:ptText bounce:bounce]; } #endif } void ScintillaCocoa::HideFindIndicator() { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 if (layerFindIndicator) { [layerFindIndicator hideMatch]; } #endif } scintilla/cocoa/PlatCocoa.h0000644000175000017500000001004012347445320014601 0ustar neilneil /** * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #ifndef PLATCOCOA_H #define PLATCOCOA_H #include #include #include #include #include #include #include "QuartzTextLayout.h" #include "Platform.h" #include "Scintilla.h" NSRect PRectangleToNSRect(Scintilla::PRectangle& rc); Scintilla::PRectangle NSRectToPRectangle(NSRect& rc); CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet); @interface ScintillaContextMenu : NSMenu { Scintilla::ScintillaCocoa* owner; } - (void) handleCommand: (NSMenuItem*) sender; - (void) setOwner: (Scintilla::ScintillaCocoa*) newOwner; @end namespace Scintilla { // A class to do the actual text rendering for us using Quartz 2D. class SurfaceImpl : public Surface { private: bool unicodeMode; float x; float y; CGContextRef gc; /** The text layout instance */ QuartzTextLayout* textLayout; int codePage; int verticalDeviceResolution; /** If the surface is a bitmap context, contains a reference to the bitmap data. */ uint8_t* bitmapData; /** If the surface is a bitmap context, stores the dimensions of the bitmap. */ int bitmapWidth; int bitmapHeight; /** Set the CGContext's fill colour to the specified desired colour. */ void FillColour( const ColourDesired& back ); // 24-bit RGB+A bitmap data constants static const int BITS_PER_COMPONENT = 8; static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4; static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8; public: SurfaceImpl(); ~SurfaceImpl(); void Init(WindowID wid); void Init(SurfaceID sid, WindowID wid); void InitPixMap(int width, int height, Surface *surface_, WindowID wid); CGContextRef GetContext() { return gc; } void Release(); bool Initialised(); void PenColour(ColourDesired fore); /** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */ CGImageRef GetImage(); void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect); int LogPixelsY(); int DeviceHeightFont(int points); void MoveTo(int x_, int y_); void LineTo(int x_, int y_); void Polygon(Scintilla::Point *pts, int npts, ColourDesired fore, ColourDesired back); void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back); void FillRectangle(PRectangle rc, ColourDesired back); void FillRectangle(PRectangle rc, Surface &surfacePattern); void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back); void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags); void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage); void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back); void Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource); void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore); void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions); XYPOSITION WidthText(Font &font_, const char *s, int len); XYPOSITION WidthChar(Font &font_, char ch); XYPOSITION Ascent(Font &font_); XYPOSITION Descent(Font &font_); XYPOSITION InternalLeading(Font &font_); XYPOSITION ExternalLeading(Font &font_); XYPOSITION Height(Font &font_); XYPOSITION AverageCharWidth(Font &font_); void SetClip(PRectangle rc); void FlushCachedState(); void SetUnicodeMode(bool unicodeMode_); void SetDBCSMode(int codePage_); }; // SurfaceImpl class } // Scintilla namespace #endif scintilla/cocoa/checkbuildosx.sh0000755000175000017500000000316412533717246015770 0ustar neilneil# Script to build Scintilla for OS X with most supported build files. # Current directory should be scintilla/cocoa before running. cd ../.. # ************************************************************ # Target 1: Unit tests echo Unit tests cd scintilla/test/unit make clean make test cd ../../.. # ************************************************************ # Target 2: build framework and test app with Xcode targeting OS X 10.n with n from 9 to 5 # Only SDK versions that are installed will be built # Clean both then build both -- if perform clean in ScintillaTest, also cleans ScintillaFramework # which can cause double build echo Building Cocoa-native ScintillaFramework and ScintillaTest for sdk in macosx10.9 macosx10.8 macosx10.7 macosx10.6 macosx10.5 do xcodebuild -showsdks | grep $sdk if [ "$(xcodebuild -showsdks | grep $sdk)" != "" ] then echo Building with $sdk cd scintilla/cocoa/ScintillaFramework xcodebuild clean cd ../ScintillaTest xcodebuild clean cd ../ScintillaFramework xcodebuild -sdk $sdk cd ../ScintillaTest xcodebuild -sdk $sdk cd ../../.. else echo Warning $sdk not available fi done # ************************************************************ # Target 3: Qt builds # Requires Qt development libraries and qmake to be installed echo Building Qt and PySide cd scintilla/qt cd ScintillaEditBase qmake -spec macx-xcode xcodebuild clean xcodebuild cd .. cd ScintillaEdit python WidgetGen.py qmake -spec macx-xcode xcodebuild clean xcodebuild cd .. cd ScintillaEditPy python sepbuild.py cd .. cd ../.. scintilla/cocoa/PlatCocoa.mm0000644000175000017500000017560212557522743015013 0ustar neilneil/** * Scintilla source code edit control * PlatCocoa.mm - implementation of platform facilities on MacOS X/Cocoa * * Written by Mike Lischke * Based on PlatMacOSX.cxx * Based on work by Evan Jones (c) 2002 * Based on PlatGTK.cxx Copyright 1998-2002 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #include #include #include #include #include #include #include #include #import #import "Platform.h" #import "ScintillaView.h" #import "ScintillaCocoa.h" #import "PlatCocoa.h" #include "StringCopy.h" #include "XPM.h" using namespace Scintilla; extern sptr_t scintilla_send_message(void* sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam); //-------------------------------------------------------------------------------------------------- /** * Converts a PRectangle as used by Scintilla to standard Obj-C NSRect structure . */ NSRect PRectangleToNSRect(PRectangle& rc) { return NSMakeRect(rc.left, rc.top, rc.Width(), rc.Height()); } //-------------------------------------------------------------------------------------------------- /** * Converts an NSRect as used by the system to a native Scintilla rectangle. */ PRectangle NSRectToPRectangle(NSRect& rc) { return PRectangle(static_cast(rc.origin.x), static_cast(rc.origin.y), static_cast(NSMaxX(rc)), static_cast(NSMaxY(rc))); } //-------------------------------------------------------------------------------------------------- /** * Converts a PRectangle as used by Scintilla to a Quartz-style rectangle. */ inline CGRect PRectangleToCGRect(PRectangle& rc) { return CGRectMake(rc.left, rc.top, rc.Width(), rc.Height()); } //-------------------------------------------------------------------------------------------------- /** * Converts a Quartz-style rectangle to a PRectangle structure as used by Scintilla. */ inline PRectangle CGRectToPRectangle(const CGRect& rect) { PRectangle rc; rc.left = (int)(rect.origin.x + 0.5); rc.top = (int)(rect.origin.y + 0.5); rc.right = (int)(rect.origin.x + rect.size.width + 0.5); rc.bottom = (int)(rect.origin.y + rect.size.height + 0.5); return rc; } //----------------- Point -------------------------------------------------------------------------- /** * Converts a point given as a long into a native Point structure. */ Scintilla::Point Scintilla::Point::FromLong(long lpoint) { return Scintilla::Point( Platform::LowShortFromLong(lpoint), Platform::HighShortFromLong(lpoint) ); } //----------------- Font --------------------------------------------------------------------------- Font::Font(): fid(0) { } //-------------------------------------------------------------------------------------------------- Font::~Font() { Release(); } //-------------------------------------------------------------------------------------------------- static int FontCharacterSet(Font &f) { return reinterpret_cast(f.GetID())->getCharacterSet(); } /** * Creates a CTFontRef with the given properties. */ void Font::Create(const FontParameters &fp) { Release(); QuartzTextStyle* style = new QuartzTextStyle(); fid = style; // Create the font with attributes QuartzFont font(fp.faceName, strlen(fp.faceName), fp.size, fp.weight, fp.italic); CTFontRef fontRef = font.getFontID(); style->setFontRef(fontRef, fp.characterSet); } //-------------------------------------------------------------------------------------------------- void Font::Release() { if (fid) delete reinterpret_cast( fid ); fid = 0; } //----------------- SurfaceImpl -------------------------------------------------------------------- SurfaceImpl::SurfaceImpl() { unicodeMode = true; x = 0; y = 0; gc = NULL; textLayout = new QuartzTextLayout(NULL); codePage = 0; verticalDeviceResolution = 0; bitmapData = NULL; // Release will try and delete bitmapData if != NULL bitmapWidth = 0; bitmapHeight = 0; Release(); } //-------------------------------------------------------------------------------------------------- SurfaceImpl::~SurfaceImpl() { Release(); delete textLayout; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::Release() { textLayout->setContext (NULL); if ( bitmapData != NULL ) { delete[] bitmapData; // We only "own" the graphics context if we are a bitmap context if (gc != NULL) CGContextRelease(gc); } bitmapData = NULL; gc = NULL; bitmapWidth = 0; bitmapHeight = 0; x = 0; y = 0; } //-------------------------------------------------------------------------------------------------- bool SurfaceImpl::Initialised() { // We are initalised if the graphics context is not null return gc != NULL;// || port != NULL; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::Init(WindowID) { // To be able to draw, the surface must get a CGContext handle. We save the graphics port, // then acquire/release the context on an as-need basis (see above). // XXX Docs on QDBeginCGContext are light, a better way to do this would be good. // AFAIK we should not hold onto a context retrieved this way, thus the need for // acquire/release of the context. Release(); } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::Init(SurfaceID sid, WindowID) { Release(); gc = reinterpret_cast(sid); CGContextSetLineWidth(gc, 1.0); textLayout->setContext(gc); } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::InitPixMap(int width, int height, Surface* surface_, WindowID /* wid */) { Release(); // Create a new bitmap context, along with the RAM for the bitmap itself bitmapWidth = width; bitmapHeight = height; const int bitmapBytesPerRow = (width * BYTES_PER_PIXEL); const int bitmapByteCount = (bitmapBytesPerRow * height); // Create an RGB color space. CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if (colorSpace == NULL) return; // Create the bitmap. bitmapData = new uint8_t[bitmapByteCount]; // create the context gc = CGBitmapContextCreate(bitmapData, width, height, BITS_PER_COMPONENT, bitmapBytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast); if (gc == NULL) { // the context couldn't be created for some reason, // and we have no use for the bitmap without the context delete[] bitmapData; bitmapData = NULL; } textLayout->setContext (gc); // the context retains the color space, so we can release it CGColorSpaceRelease(colorSpace); if (gc != NULL && bitmapData != NULL) { // "Erase" to white. CGContextClearRect( gc, CGRectMake( 0, 0, width, height ) ); CGContextSetRGBFillColor( gc, 1.0, 1.0, 1.0, 1.0 ); CGContextFillRect( gc, CGRectMake( 0, 0, width, height ) ); } if (surface_) { SurfaceImpl *psurfOther = static_cast(surface_); unicodeMode = psurfOther->unicodeMode; codePage = psurfOther->codePage; } else { unicodeMode = true; codePage = SC_CP_UTF8; } } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::PenColour(ColourDesired fore) { if (gc) { ColourDesired colour(fore.AsLong()); // Set the Stroke color to match CGContextSetRGBStrokeColor(gc, colour.GetRed() / 255.0, colour.GetGreen() / 255.0, colour.GetBlue() / 255.0, 1.0 ); } } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::FillColour(const ColourDesired& back) { if (gc) { ColourDesired colour(back.AsLong()); // Set the Fill color to match CGContextSetRGBFillColor(gc, colour.GetRed() / 255.0, colour.GetGreen() / 255.0, colour.GetBlue() / 255.0, 1.0 ); } } //-------------------------------------------------------------------------------------------------- CGImageRef SurfaceImpl::GetImage() { // For now, assume that GetImage can only be called on PixMap surfaces. if (bitmapData == NULL) return NULL; CGContextFlush(gc); // Create an RGB color space. CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if( colorSpace == NULL ) return NULL; const int bitmapBytesPerRow = ((int) bitmapWidth * BYTES_PER_PIXEL); const int bitmapByteCount = (bitmapBytesPerRow * (int) bitmapHeight); // Make a copy of the bitmap data for the image creation and divorce it // From the SurfaceImpl lifetime CFDataRef dataRef = CFDataCreate(kCFAllocatorDefault, bitmapData, bitmapByteCount); // Create a data provider. CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(dataRef); CGImageRef image = NULL; if (dataProvider != NULL) { // Create the CGImage. image = CGImageCreate(bitmapWidth, bitmapHeight, BITS_PER_COMPONENT, BITS_PER_PIXEL, bitmapBytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast, dataProvider, NULL, 0, kCGRenderingIntentDefault); } // The image retains the color space, so we can release it. CGColorSpaceRelease(colorSpace); colorSpace = NULL; // Done with the data provider. CGDataProviderRelease(dataProvider); dataProvider = NULL; // Done with the data provider. CFRelease(dataRef); return image; } //-------------------------------------------------------------------------------------------------- /** * Returns the vertical logical device resolution of the main monitor. * This is no longer called. * For Cocoa, all screens are treated as 72 DPI, even retina displays. */ int SurfaceImpl::LogPixelsY() { return 72; } //-------------------------------------------------------------------------------------------------- /** * Converts the logical font height in points into a device height. * For Cocoa, points are always used for the result even on retina displays. */ int SurfaceImpl::DeviceHeightFont(int points) { return points; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::MoveTo(int x_, int y_) { x = x_; y = y_; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::LineTo(int x_, int y_) { CGContextBeginPath( gc ); // Because Quartz is based on floating point, lines are drawn with half their colour // on each side of the line. Integer coordinates specify the INTERSECTION of the pixel // division lines. If you specify exact pixel values, you get a line that // is twice as thick but half as intense. To get pixel aligned rendering, // we render the "middle" of the pixels by adding 0.5 to the coordinates. CGContextMoveToPoint( gc, x + 0.5, y + 0.5 ); CGContextAddLineToPoint( gc, x_ + 0.5, y_ + 0.5 ); CGContextStrokePath( gc ); x = x_; y = y_; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::Polygon(Scintilla::Point *pts, int npts, ColourDesired fore, ColourDesired back) { // Allocate memory for the array of points. std::vector points(npts); for (int i = 0;i < npts;i++) { // Quartz floating point issues: plot the MIDDLE of the pixels points[i].x = pts[i].x + 0.5; points[i].y = pts[i].y + 0.5; } CGContextBeginPath(gc); // Set colours FillColour(back); PenColour(fore); // Draw the polygon CGContextAddLines(gc, points.data(), npts); // Explicitly close the path, so it is closed for stroking AND filling (implicit close = filling only) CGContextClosePath( gc ); CGContextDrawPath( gc, kCGPathFillStroke ); } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { if (gc) { CGContextBeginPath( gc ); FillColour(back); PenColour(fore); // Quartz integer -> float point conversion fun (see comment in SurfaceImpl::LineTo) // We subtract 1 from the Width() and Height() so that all our drawing is within the area defined // by the PRectangle. Otherwise, we draw one pixel too far to the right and bottom. CGContextAddRect( gc, CGRectMake( rc.left + 0.5, rc.top + 0.5, rc.Width() - 1, rc.Height() - 1 ) ); CGContextDrawPath( gc, kCGPathFillStroke ); } } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) { if (gc) { FillColour(back); // Snap rectangle boundaries to nearest int rc.left = lround(rc.left); rc.right = lround(rc.right); CGRect rect = PRectangleToCGRect(rc); CGContextFillRect(gc, rect); } } //-------------------------------------------------------------------------------------------------- void drawImageRefCallback(CGImageRef pattern, CGContextRef gc) { CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern); } //-------------------------------------------------------------------------------------------------- void releaseImageRefCallback(CGImageRef pattern) { CGImageRelease(pattern); } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { SurfaceImpl& patternSurface = static_cast(surfacePattern); // For now, assume that copy can only be called on PixMap surfaces. Shows up black. CGImageRef image = patternSurface.GetImage(); if (image == NULL) { FillRectangle(rc, ColourDesired(0)); return; } const CGPatternCallbacks drawImageCallbacks = { 0, reinterpret_cast(drawImageRefCallback), reinterpret_cast(releaseImageRefCallback) }; CGPatternRef pattern = CGPatternCreate(image, CGRectMake(0, 0, patternSurface.bitmapWidth, patternSurface.bitmapHeight), CGAffineTransformIdentity, patternSurface.bitmapWidth, patternSurface.bitmapHeight, kCGPatternTilingNoDistortion, true, &drawImageCallbacks ); if (pattern != NULL) { // Create a pattern color space CGColorSpaceRef colorSpace = CGColorSpaceCreatePattern( NULL ); if( colorSpace != NULL ) { CGContextSaveGState( gc ); CGContextSetFillColorSpace( gc, colorSpace ); // Unlike the documentation, you MUST pass in a "components" parameter: // For coloured patterns it is the alpha value. const CGFloat alpha = 1.0; CGContextSetFillPattern( gc, pattern, &alpha ); CGContextFillRect( gc, PRectangleToCGRect( rc ) ); CGContextRestoreGState( gc ); // Free the color space, the pattern and image CGColorSpaceRelease( colorSpace ); } /* colorSpace != NULL */ colorSpace = NULL; CGPatternRelease( pattern ); pattern = NULL; } /* pattern != NULL */ } void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) { // This is only called from the margin marker drawing code for SC_MARK_ROUNDRECT // The Win32 version does // ::RoundRect(hdc, rc.left + 1, rc.top, rc.right - 1, rc.bottom, 8, 8 ); // which is a rectangle with rounded corners each having a radius of 4 pixels. // It would be almost as good just cutting off the corners with lines at // 45 degrees as is done on GTK+. // Create a rectangle with semicircles at the corners const int MAX_RADIUS = 4; const int radius = std::min(MAX_RADIUS, static_cast(std::min(rc.Height()/2, rc.Width()/2))); // Points go clockwise, starting from just below the top left // Corners are kept together, so we can easily create arcs to connect them CGPoint corners[4][3] = { { { rc.left, rc.top + radius }, { rc.left, rc.top }, { rc.left + radius, rc.top }, }, { { rc.right - radius - 1, rc.top }, { rc.right - 1, rc.top }, { rc.right - 1, rc.top + radius }, }, { { rc.right - 1, rc.bottom - radius - 1 }, { rc.right - 1, rc.bottom - 1 }, { rc.right - radius - 1, rc.bottom - 1 }, }, { { rc.left + radius, rc.bottom - 1 }, { rc.left, rc.bottom - 1 }, { rc.left, rc.bottom - radius - 1 }, }, }; // Align the points in the middle of the pixels for( int i = 0; i < 4; ++ i ) { for( int j = 0; j < 3; ++ j ) { corners[i][j].x += 0.5; corners[i][j].y += 0.5; } } PenColour( fore ); FillColour( back ); // Move to the last point to begin the path CGContextBeginPath( gc ); CGContextMoveToPoint( gc, corners[3][2].x, corners[3][2].y ); for ( int i = 0; i < 4; ++ i ) { CGContextAddLineToPoint( gc, corners[i][0].x, corners[i][0].y ); CGContextAddArcToPoint( gc, corners[i][1].x, corners[i][1].y, corners[i][2].x, corners[i][2].y, radius ); } // Close the path to enclose it for stroking and for filling, then draw it CGContextClosePath( gc ); CGContextDrawPath( gc, kCGPathFillStroke ); } // DrawChamferedRectangle is a helper function for AlphaRectangle that either fills or strokes a // rectangle with its corners chamfered at 45 degrees. static void DrawChamferedRectangle(CGContextRef gc, PRectangle rc, int cornerSize, CGPathDrawingMode mode) { // Points go clockwise, starting from just below the top left CGPoint corners[4][2] = { { { rc.left, rc.top + cornerSize }, { rc.left + cornerSize, rc.top }, }, { { rc.right - cornerSize - 1, rc.top }, { rc.right - 1, rc.top + cornerSize }, }, { { rc.right - 1, rc.bottom - cornerSize - 1 }, { rc.right - cornerSize - 1, rc.bottom - 1 }, }, { { rc.left + cornerSize, rc.bottom - 1 }, { rc.left, rc.bottom - cornerSize - 1 }, }, }; // Align the points in the middle of the pixels for( int i = 0; i < 4; ++ i ) { for( int j = 0; j < 2; ++ j ) { corners[i][j].x += 0.5; corners[i][j].y += 0.5; } } // Move to the last point to begin the path CGContextBeginPath( gc ); CGContextMoveToPoint( gc, corners[3][1].x, corners[3][1].y ); for ( int i = 0; i < 4; ++ i ) { CGContextAddLineToPoint( gc, corners[i][0].x, corners[i][0].y ); CGContextAddLineToPoint( gc, corners[i][1].x, corners[i][1].y ); } // Close the path to enclose it for stroking and for filling, then draw it CGContextClosePath( gc ); CGContextDrawPath( gc, mode ); } void Scintilla::SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int /*flags*/) { if ( gc ) { // Snap rectangle boundaries to nearest int rc.left = lround(rc.left); rc.right = lround(rc.right); // Set the Fill color to match CGContextSetRGBFillColor( gc, fill.GetRed() / 255.0, fill.GetGreen() / 255.0, fill.GetBlue() / 255.0, alphaFill / 255.0 ); CGContextSetRGBStrokeColor( gc, outline.GetRed() / 255.0, outline.GetGreen() / 255.0, outline.GetBlue() / 255.0, alphaOutline / 255.0 ); PRectangle rcFill = rc; if (cornerSize == 0) { // A simple rectangle, no rounded corners if ((fill == outline) && (alphaFill == alphaOutline)) { // Optimization for simple case CGRect rect = PRectangleToCGRect( rcFill ); CGContextFillRect( gc, rect ); } else { rcFill.left += 1.0; rcFill.top += 1.0; rcFill.right -= 1.0; rcFill.bottom -= 1.0; CGRect rect = PRectangleToCGRect( rcFill ); CGContextFillRect( gc, rect ); CGContextAddRect( gc, CGRectMake( rc.left + 0.5, rc.top + 0.5, rc.Width() - 1, rc.Height() - 1 ) ); CGContextStrokePath( gc ); } } else { // Approximate rounded corners with 45 degree chamfers. // Drawing real circular arcs often leaves some over- or under-drawn pixels. if ((fill == outline) && (alphaFill == alphaOutline)) { // Specializing this case avoids a few stray light/dark pixels in corners. rcFill.left -= 0.5; rcFill.top -= 0.5; rcFill.right += 0.5; rcFill.bottom += 0.5; DrawChamferedRectangle( gc, rcFill, cornerSize, kCGPathFill ); } else { rcFill.left += 0.5; rcFill.top += 0.5; rcFill.right -= 0.5; rcFill.bottom -= 0.5; DrawChamferedRectangle( gc, rcFill, cornerSize-1, kCGPathFill ); DrawChamferedRectangle( gc, rc, cornerSize, kCGPathStroke ); } } } } static void ProviderReleaseData(void *, const void *data, size_t) { const unsigned char *pixels = reinterpret_cast(data); delete []pixels; } static CGImageRef ImageCreateFromRGBA(int width, int height, const unsigned char *pixelsImage, bool invert) { CGImageRef image = 0; // Create an RGB color space. CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); if (colorSpace) { const int bitmapBytesPerRow = ((int) width * 4); const int bitmapByteCount = (bitmapBytesPerRow * (int) height); // Create a data provider. CGDataProviderRef dataProvider = 0; if (invert) { unsigned char *pixelsUpsideDown = new unsigned char[bitmapByteCount]; for (int y=0; y(surfaceSource); CGImageRef image = source.GetImage(); CGRect src = PRectangleToCGRect(srcRect); CGRect dst = PRectangleToCGRect(dstRect); /* source from QuickDrawToQuartz2D.pdf on developer.apple.com */ float w = (float) CGImageGetWidth(image); float h = (float) CGImageGetHeight(image); CGRect drawRect = CGRectMake (0, 0, w, h); if (!CGRectEqualToRect (src, dst)) { CGFloat sx = CGRectGetWidth(dst) / CGRectGetWidth(src); CGFloat sy = CGRectGetHeight(dst) / CGRectGetHeight(src); CGFloat dx = CGRectGetMinX(dst) - (CGRectGetMinX(src) * sx); CGFloat dy = CGRectGetMinY(dst) - (CGRectGetMinY(src) * sy); drawRect = CGRectMake (dx, dy, w*sx, h*sy); } CGContextSaveGState (gc); CGContextClipToRect (gc, dst); CGContextDrawImage (gc, drawRect, image); CGContextRestoreGState (gc); CGImageRelease(image); } void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSource) { // Maybe we have to make the Surface two contexts: // a bitmap context which we do all the drawing on, and then a "real" context // which we copy the output to when we call "Synchronize". Ugh! Gross and slow! // For now, assume that copy can only be called on PixMap surfaces SurfaceImpl& source = static_cast(surfaceSource); // Get the CGImageRef CGImageRef image = source.GetImage(); // If we could not get an image reference, fill the rectangle black if ( image == NULL ) { FillRectangle( rc, ColourDesired( 0 ) ); return; } // Now draw the image on the surface // Some fancy clipping work is required here: draw only inside of rc CGContextSaveGState( gc ); CGContextClipToRect( gc, PRectangleToCGRect( rc ) ); //Platform::DebugPrintf(stderr, "Copy: CGContextDrawImage: (%d, %d) - (%d X %d)\n", rc.left - from.x, rc.top - from.y, source.bitmapWidth, source.bitmapHeight ); CGContextDrawImage( gc, CGRectMake( rc.left - from.x, rc.top - from.y, source.bitmapWidth, source.bitmapHeight ), image ); // Undo the clipping fun CGContextRestoreGState( gc ); // Done with the image CGImageRelease( image ); image = NULL; } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { FillRectangle(rc, back); DrawTextTransparent(rc, font_, ybase, s, len, fore); } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { CGContextSaveGState(gc); CGContextClipToRect(gc, PRectangleToCGRect(rc)); DrawTextNoClip(rc, font_, ybase, s, len, fore, back); CGContextRestoreGState(gc); } //-------------------------------------------------------------------------------------------------- CFStringEncoding EncodingFromCharacterSet(bool unicode, int characterSet) { if (unicode) return kCFStringEncodingUTF8; // Unsupported -> Latin1 as reasonably safe enum { notSupported = kCFStringEncodingISOLatin1}; switch (characterSet) { case SC_CHARSET_ANSI: return kCFStringEncodingISOLatin1; case SC_CHARSET_DEFAULT: return kCFStringEncodingISOLatin1; case SC_CHARSET_BALTIC: return kCFStringEncodingWindowsBalticRim; case SC_CHARSET_CHINESEBIG5: return kCFStringEncodingBig5; case SC_CHARSET_EASTEUROPE: return kCFStringEncodingWindowsLatin2; case SC_CHARSET_GB2312: return kCFStringEncodingGB_18030_2000; case SC_CHARSET_GREEK: return kCFStringEncodingWindowsGreek; case SC_CHARSET_HANGUL: return kCFStringEncodingEUC_KR; case SC_CHARSET_MAC: return kCFStringEncodingMacRoman; case SC_CHARSET_OEM: return kCFStringEncodingISOLatin1; case SC_CHARSET_RUSSIAN: return kCFStringEncodingKOI8_R; case SC_CHARSET_CYRILLIC: return kCFStringEncodingWindowsCyrillic; case SC_CHARSET_SHIFTJIS: return kCFStringEncodingShiftJIS; case SC_CHARSET_SYMBOL: return kCFStringEncodingMacSymbol; case SC_CHARSET_TURKISH: return kCFStringEncodingWindowsLatin5; case SC_CHARSET_JOHAB: return kCFStringEncodingWindowsKoreanJohab; case SC_CHARSET_HEBREW: return kCFStringEncodingWindowsHebrew; case SC_CHARSET_ARABIC: return kCFStringEncodingWindowsArabic; case SC_CHARSET_VIETNAMESE: return kCFStringEncodingWindowsVietnamese; case SC_CHARSET_THAI: return kCFStringEncodingISOLatinThai; case SC_CHARSET_8859_15: return kCFStringEncodingISOLatin1; default: return notSupported; } } void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore) { CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_)); ColourDesired colour(fore.AsLong()); CGColorRef color = CGColorCreateGenericRGB(colour.GetRed()/255.0,colour.GetGreen()/255.0,colour.GetBlue()/255.0,1.0); QuartzTextStyle* style = reinterpret_cast(font_.GetID()); style->setCTStyleColor(color); CGColorRelease(color); textLayout->setText (reinterpret_cast(s), len, encoding, *reinterpret_cast(font_.GetID())); textLayout->draw(rc.left, ybase); } static size_t utf8LengthFromLead(unsigned char uch) { if (uch >= (0x80 + 0x40 + 0x20 + 0x10)) { return 4; } else if (uch >= (0x80 + 0x40 + 0x20)) { return 3; } else if (uch >= (0x80)) { return 2; } else { return 1; } } //-------------------------------------------------------------------------------------------------- void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) { CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_)); textLayout->setText (reinterpret_cast(s), len, encoding, *reinterpret_cast(font_.GetID())); CTLineRef mLine = textLayout->getCTLine(); assert(mLine != NULL); if (unicodeMode) { // Map the widths given for UTF-16 characters back onto the UTF-8 input string CFIndex fit = textLayout->getStringLength(); int ui=0; const unsigned char *us = reinterpret_cast(s); int i=0; while (ui(xPosition); } ui += codeUnits; } XYPOSITION lastPos = 0.0f; if (i > 0) lastPos = positions[i-1]; while (i(xPosition); } ui++; } } else { // Single byte encoding for (int i=0;i(xPosition); } } } XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) { if (font_.GetID()) { CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_)); textLayout->setText (reinterpret_cast(s), len, encoding, *reinterpret_cast(font_.GetID())); return static_cast(textLayout->MeasureStringWidth()); } return 1; } XYPOSITION SurfaceImpl::WidthChar(Font &font_, char ch) { char str[2] = { ch, '\0' }; if (font_.GetID()) { CFStringEncoding encoding = EncodingFromCharacterSet(unicodeMode, FontCharacterSet(font_)); textLayout->setText (reinterpret_cast(str), 1, encoding, *reinterpret_cast(font_.GetID())); return textLayout->MeasureStringWidth(); } else return 1; } // This string contains a good range of characters to test for size. const char sizeString[] = "`~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890" "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; XYPOSITION SurfaceImpl::Ascent(Font &font_) { if (!font_.GetID()) return 1; float ascent = reinterpret_cast( font_.GetID() )->getAscent(); return ascent + 0.5f; } XYPOSITION SurfaceImpl::Descent(Font &font_) { if (!font_.GetID()) return 1; float descent = reinterpret_cast( font_.GetID() )->getDescent(); return descent + 0.5f; } XYPOSITION SurfaceImpl::InternalLeading(Font &) { return 0; } XYPOSITION SurfaceImpl::ExternalLeading(Font &font_) { if (!font_.GetID()) return 1; float leading = reinterpret_cast( font_.GetID() )->getLeading(); return leading + 0.5f; } XYPOSITION SurfaceImpl::Height(Font &font_) { return Ascent(font_) + Descent(font_); } XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) { if (!font_.GetID()) return 1; const int sizeStringLength = ELEMENTS( sizeString ); XYPOSITION width = WidthText( font_, sizeString, sizeStringLength ); return (int) ((width / (float) sizeStringLength) + 0.5); } void SurfaceImpl::SetClip(PRectangle rc) { CGContextClipToRect( gc, PRectangleToCGRect( rc ) ); } void SurfaceImpl::FlushCachedState() { CGContextSynchronize( gc ); } void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { unicodeMode = unicodeMode_; } void SurfaceImpl::SetDBCSMode(int codePage_) { if (codePage_ && (codePage_ != SC_CP_UTF8)) codePage = codePage_; } Surface *Surface::Allocate(int) { return new SurfaceImpl(); } //----------------- Window ------------------------------------------------------------------------- // Cocoa uses different types for windows and views, so a Window may // be either an NSWindow or NSView and the code will check the type // before performing an action. Window::~Window() { } // Window::Destroy needs to see definition of ListBoxImpl so is located after ListBoxImpl //-------------------------------------------------------------------------------------------------- bool Window::HasFocus() { NSView* container = reinterpret_cast(wid); return [[container window] firstResponder] == container; } //-------------------------------------------------------------------------------------------------- static CGFloat ScreenMax(NSWindow* win) { return NSMaxY([[NSScreen mainScreen] frame]); } //-------------------------------------------------------------------------------------------------- PRectangle Window::GetPosition() { if (wid) { NSRect rect; id idWin = reinterpret_cast(wid); NSWindow* win; if ([idWin isKindOfClass: [NSView class]]) { // NSView NSView* view = reinterpret_cast(idWin); win = [view window]; rect = [view convertRect: [view bounds] toView: nil]; rect = [win convertRectToScreen:rect]; } else { // NSWindow win = reinterpret_cast(idWin); rect = [win frame]; } CGFloat screenHeight = ScreenMax(win); // Invert screen positions to match Scintilla return PRectangle( static_cast(NSMinX(rect)), static_cast(screenHeight - NSMaxY(rect)), static_cast(NSMaxX(rect)), static_cast(screenHeight - NSMinY(rect))); } else { return PRectangle(0, 0, 1, 1); } } //-------------------------------------------------------------------------------------------------- void Window::SetPosition(PRectangle rc) { if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isKindOfClass: [NSView class]]) { // NSView // Moves this view inside the parent view NSRect nsrc = NSMakeRect(rc.left, rc.bottom, rc.Width(), rc.Height()); NSView* view = reinterpret_cast(idWin); nsrc = [[view window] convertRectFromScreen:nsrc]; [view setFrame: nsrc]; } else { // NSWindow PLATFORM_ASSERT([idWin isKindOfClass: [NSWindow class]]); NSWindow* win = reinterpret_cast(idWin); CGFloat screenHeight = ScreenMax(win); NSRect nsrc = NSMakeRect(rc.left, screenHeight - rc.bottom, rc.Width(), rc.Height()); [win setFrame: nsrc display:YES]; } } } //-------------------------------------------------------------------------------------------------- void Window::SetPositionRelative(PRectangle rc, Window window) { PRectangle rcOther = window.GetPosition(); rc.left += rcOther.left; rc.right += rcOther.left; rc.top += rcOther.top; rc.bottom += rcOther.top; SetPosition(rc); } //-------------------------------------------------------------------------------------------------- PRectangle Window::GetClientPosition() { // This means, in MacOS X terms, get the "frame bounds". Call GetPosition, just like on Win32. return GetPosition(); } //-------------------------------------------------------------------------------------------------- void Window::Show(bool show) { if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isKindOfClass: [NSWindow class]]) { NSWindow* win = reinterpret_cast(idWin); if (show) { [win orderFront:nil]; } else { [win orderOut:nil]; } } } } //-------------------------------------------------------------------------------------------------- /** * Invalidates the entire window or view so it is completely redrawn. */ void Window::InvalidateAll() { if (wid) { id idWin = reinterpret_cast(wid); NSView* container; if ([idWin isKindOfClass: [NSView class]]) { container = reinterpret_cast(idWin); } else { // NSWindow NSWindow* win = reinterpret_cast(idWin); container = reinterpret_cast([win contentView]); container.needsDisplay = YES; } container.needsDisplay = YES; } } //-------------------------------------------------------------------------------------------------- /** * Invalidates part of the window or view so only this part redrawn. */ void Window::InvalidateRectangle(PRectangle rc) { if (wid) { id idWin = reinterpret_cast(wid); NSView* container; if ([idWin isKindOfClass: [NSView class]]) { container = reinterpret_cast(idWin); } else { // NSWindow NSWindow* win = reinterpret_cast(idWin); container = reinterpret_cast([win contentView]); } [container setNeedsDisplayInRect: PRectangleToNSRect(rc)]; } } //-------------------------------------------------------------------------------------------------- void Window::SetFont(Font&) { // Implemented on list subclass on Cocoa. } //-------------------------------------------------------------------------------------------------- /** * Converts the Scintilla cursor enum into an NSCursor and stores it in the associated NSView, * which then will take care to set up a new mouse tracking rectangle. */ void Window::SetCursor(Cursor curs) { if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isMemberOfClass: [SCIContentView class]]) { SCIContentView* container = reinterpret_cast(idWin); [container setCursor: curs]; } } } //-------------------------------------------------------------------------------------------------- void Window::SetTitle(const char* s) { if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isKindOfClass: [NSWindow class]]) { NSWindow* win = reinterpret_cast(idWin); NSString* sTitle = [NSString stringWithUTF8String:s]; [win setTitle:sTitle]; } } } //-------------------------------------------------------------------------------------------------- PRectangle Window::GetMonitorRect(Point) { if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isKindOfClass: [NSView class]]) { NSView* view = reinterpret_cast(idWin); idWin = [view window]; } if ([idWin isKindOfClass: [NSWindow class]]) { PRectangle rcPosition = GetPosition(); NSWindow* win = reinterpret_cast(idWin); NSScreen* screen = [win screen]; NSRect rect = [screen visibleFrame]; CGFloat screenHeight = rect.origin.y + rect.size.height; // Invert screen positions to match Scintilla PRectangle rcWork( static_cast(NSMinX(rect)), static_cast(screenHeight - NSMaxY(rect)), static_cast(NSMaxX(rect)), static_cast(screenHeight - NSMinY(rect))); PRectangle rcMonitor(rcWork.left - rcPosition.left, rcWork.top - rcPosition.top, rcWork.right - rcPosition.left, rcWork.bottom - rcPosition.top); return rcMonitor; } } return PRectangle(); } //----------------- ImageFromXPM ------------------------------------------------------------------- // Convert an XPM image into an NSImage for use with Cocoa static NSImage* ImageFromXPM(XPM* pxpm) { NSImage* img = nil; if (pxpm) { const int width = pxpm->GetWidth(); const int height = pxpm->GetHeight(); PRectangle rcxpm(0, 0, width, height); Surface* surfaceXPM = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceXPM) { surfaceXPM->InitPixMap(width, height, NULL, NULL); SurfaceImpl* surfaceIXPM = static_cast(surfaceXPM); CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height)); pxpm->Draw(surfaceXPM, rcxpm); img = [[[NSImage alloc] initWithSize:NSZeroSize] autorelease]; CGImageRef imageRef = surfaceIXPM->GetImage(); NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; [img addRepresentation: bitmapRep]; [bitmapRep release]; CGImageRelease(imageRef); delete surfaceXPM; } } return img; } //----------------- ListBox and related classes ---------------------------------------------------- //----------------- IListBox ----------------------------------------------------------------------- namespace { // unnamed namespace hides IListBox interface class IListBox { public: virtual int Rows() = 0; virtual NSImage* ImageForRow(NSInteger row) = 0; virtual NSString* TextForRow(NSInteger row) = 0; virtual void DoubleClick() = 0; }; } // unnamed namespace //----------------- AutoCompletionDataSource ------------------------------------------------------- @interface AutoCompletionDataSource : NSObject #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 #endif { IListBox* box; } @property IListBox* box; @end @implementation AutoCompletionDataSource @synthesize box; - (void) doubleClick: (id) sender { #pragma unused(sender) if (box) { box->DoubleClick(); } } - (id)tableView: (NSTableView*)aTableView objectValueForTableColumn: (NSTableColumn*)aTableColumn row: (NSInteger)rowIndex { #pragma unused(aTableView) if (!box) return nil; if ([(NSString*)[aTableColumn identifier] isEqualToString: @"icon"]) { return box->ImageForRow(rowIndex); } else { return box->TextForRow(rowIndex); } } - (void)tableView: (NSTableView*)aTableView setObjectValue: anObject forTableColumn: (NSTableColumn*)aTableColumn row: (NSInteger)rowIndex { #pragma unused(aTableView) #pragma unused(anObject) #pragma unused(aTableColumn) #pragma unused(rowIndex) } - (NSInteger)numberOfRowsInTableView: (NSTableView*)aTableView { #pragma unused(aTableView) if (!box) return 0; return box->Rows(); } @end //----------------- ListBoxImpl -------------------------------------------------------------------- namespace { // unnamed namespace hides ListBoxImpl and associated classes struct RowData { int type; std::string text; RowData(int type_, const char* text_) : type(type_), text(text_) { } }; class LinesData { std::vector lines; public: LinesData() { } ~LinesData() { } int Length() const { return static_cast(lines.size()); } void Clear() { lines.clear(); } void Add(int /* index */, int type, char* str) { lines.push_back(RowData(type, str)); } int GetType(size_t index) const { if (index < lines.size()) { return lines[index].type; } else { return 0; } } const char* GetString(size_t index) const { if (index < lines.size()) { return lines[index].text.c_str(); } else { return 0; } } }; // Map from icon type to an NSImage* typedef std::map ImageMap; class ListBoxImpl : public ListBox, IListBox { private: ImageMap images; int lineHeight; bool unicodeMode; int desiredVisibleRows; XYPOSITION maxItemWidth; unsigned int aveCharWidth; XYPOSITION maxIconWidth; Font font; int maxWidth; NSTableView* table; NSScrollView* scroller; NSTableColumn* colIcon; NSTableColumn* colText; AutoCompletionDataSource* ds; LinesData ld; CallBackAction doubleClickAction; void* doubleClickActionData; public: ListBoxImpl() : lineHeight(10), unicodeMode(false), desiredVisibleRows(5), maxItemWidth(0), aveCharWidth(8), maxIconWidth(0), maxWidth(2000), table(nil), scroller(nil), colIcon(nil), colText(nil), ds(nil), doubleClickAction(nullptr), doubleClickActionData(nullptr) { } ~ListBoxImpl() {} // ListBox methods void SetFont(Font& font); void Create(Window& parent, int ctrlID, Scintilla::Point pt, int lineHeight_, bool unicodeMode_, int technology_); void SetAverageCharWidth(int width); void SetVisibleRows(int rows); int GetVisibleRows() const; PRectangle GetDesiredRect(); int CaretFromEdge(); void Clear(); void Append(char* s, int type = -1); int Length(); void Select(int n); int GetSelection(); int Find(const char* prefix); void GetValue(int n, char* value, int len); void RegisterImage(int type, const char* xpm_data); void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage); void ClearRegisteredImages(); void SetDoubleClickAction(CallBackAction action, void* data) { doubleClickAction = action; doubleClickActionData = data; } void SetList(const char* list, char separator, char typesep); // To clean up when closed void ReleaseViews(); // For access from AutoCompletionDataSource implement IListBox int Rows(); NSImage* ImageForRow(NSInteger row); NSString* TextForRow(NSInteger row); void DoubleClick(); }; void ListBoxImpl::Create(Window& /*parent*/, int /*ctrlID*/, Scintilla::Point pt, int lineHeight_, bool unicodeMode_, int) { lineHeight = lineHeight_; unicodeMode = unicodeMode_; maxWidth = 2000; NSRect lbRect = NSMakeRect(pt.x,pt.y, 120, lineHeight * desiredVisibleRows); NSWindow* winLB = [[NSWindow alloc] initWithContentRect: lbRect styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: NO]; [winLB setLevel:NSFloatingWindowLevel]; [winLB setHasShadow:YES]; scroller = [NSScrollView alloc]; NSRect scRect = NSMakeRect(0, 0, lbRect.size.width, lbRect.size.height); [scroller initWithFrame: scRect]; [scroller setHasVerticalScroller:YES]; table = [[NSTableView alloc] initWithFrame: scRect]; [table setHeaderView:nil]; [scroller setDocumentView: table]; colIcon = [[NSTableColumn alloc] initWithIdentifier:@"icon"]; [colIcon setWidth: 20]; [colIcon setEditable:NO]; [colIcon setHidden:YES]; NSImageCell* imCell = [[[NSImageCell alloc] init] autorelease]; [colIcon setDataCell:imCell]; [table addTableColumn:colIcon]; colText = [[NSTableColumn alloc] initWithIdentifier:@"name"]; [colText setResizingMask:NSTableColumnAutoresizingMask]; [colText setEditable:NO]; [table addTableColumn:colText]; ds = [[AutoCompletionDataSource alloc] init]; [ds setBox:this]; [table setDataSource: ds]; // Weak reference [scroller setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [[winLB contentView] addSubview: scroller]; [table setTarget:ds]; [table setDoubleAction:@selector(doubleClick:)]; table.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList; wid = winLB; } void ListBoxImpl::SetFont(Font& font_) { // NSCell setFont takes an NSFont* rather than a CTFontRef but they // are the same thing toll-free bridged. QuartzTextStyle* style = reinterpret_cast(font_.GetID()); font.Release(); font.SetID(new QuartzTextStyle(*style)); NSFont *pfont = (NSFont *)style->getFontRef(); [[colText dataCell] setFont: pfont]; CGFloat itemHeight = ceil([pfont boundingRectForFont].size.height); [table setRowHeight:itemHeight]; } void ListBoxImpl::SetAverageCharWidth(int width) { aveCharWidth = width; } void ListBoxImpl::SetVisibleRows(int rows) { desiredVisibleRows = rows; } int ListBoxImpl::GetVisibleRows() const { return desiredVisibleRows; } PRectangle ListBoxImpl::GetDesiredRect() { PRectangle rcDesired; rcDesired = GetPosition(); // There appears to be an extra pixel above and below the row contents CGFloat itemHeight = [table rowHeight] + 2; int rows = Length(); if ((rows == 0) || (rows > desiredVisibleRows)) rows = desiredVisibleRows; rcDesired.bottom = rcDesired.top + static_cast(itemHeight * rows); rcDesired.right = rcDesired.left + maxItemWidth + aveCharWidth; if (Length() > rows) { [scroller setHasVerticalScroller:YES]; rcDesired.right += [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]; } else { [scroller setHasVerticalScroller:NO]; } rcDesired.right += maxIconWidth; rcDesired.right += 6; return rcDesired; } int ListBoxImpl::CaretFromEdge() { if ([colIcon isHidden]) return 3; else return 6 + static_cast([colIcon width]); } void ListBoxImpl::ReleaseViews() { [table release]; table = nil; [scroller release]; scroller = nil; [colIcon release]; colIcon = nil; [colText release ]; colText = nil; [ds release]; ds = nil; } void ListBoxImpl::Clear() { maxItemWidth = 0; maxIconWidth = 0; ld.Clear(); } void ListBoxImpl::Append(char* s, int type) { int count = Length(); ld.Add(count, type, s); Scintilla::SurfaceImpl surface; XYPOSITION width = surface.WidthText(font, s, static_cast(strlen(s))); if (width > maxItemWidth) { maxItemWidth = width; [colText setWidth: maxItemWidth]; } ImageMap::iterator it = images.find(type); if (it != images.end()) { NSImage* img = it->second; if (img) { XYPOSITION widthIcon = static_cast(img.size.width); if (widthIcon > maxIconWidth) { [colIcon setHidden: NO]; maxIconWidth = widthIcon; [colIcon setWidth: maxIconWidth]; } } } } void ListBoxImpl::SetList(const char* list, char separator, char typesep) { Clear(); size_t count = strlen(list) + 1; std::vector words(list, list+count); char* startword = words.data(); char* numword = NULL; int i = 0; for (; words[i]; i++) { if (words[i] == separator) { words[i] = '\0'; if (numword) *numword = '\0'; Append(startword, numword?atoi(numword + 1):-1); startword = words.data() + i + 1; numword = NULL; } else if (words[i] == typesep) { numword = words.data() + i; } } if (startword) { if (numword) *numword = '\0'; Append(startword, numword?atoi(numword + 1):-1); } [table reloadData]; } int ListBoxImpl::Length() { return ld.Length(); } void ListBoxImpl::Select(int n) { [table selectRowIndexes:[NSIndexSet indexSetWithIndex:n] byExtendingSelection:NO]; [table scrollRowToVisible:n]; } int ListBoxImpl::GetSelection() { return static_cast([table selectedRow]); } int ListBoxImpl::Find(const char* prefix) { int count = Length(); for (int i = 0; i < count; i++) { const char* s = ld.GetString(i); if (s && (s[0] != '\0') && (0 == strncmp(prefix, s, strlen(prefix)))) { return i; } } return - 1; } void ListBoxImpl::GetValue(int n, char* value, int len) { const char* textString = ld.GetString(n); if (textString == NULL) { value[0] = '\0'; return; } strlcpy(value, textString, len); } void ListBoxImpl::RegisterImage(int type, const char* xpm_data) { XPM xpm(xpm_data); NSImage* img = ImageFromXPM(&xpm); [img retain]; ImageMap::iterator it=images.find(type); if (it == images.end()) { images[type] = img; } else { [it->second release]; it->second = img; } } void ListBoxImpl::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) { CGImageRef imageRef = ImageCreateFromRGBA(width, height, pixelsImage, false); NSSize sz = {static_cast(width), static_cast(height)}; NSImage *img = [[[NSImage alloc] initWithSize: sz] autorelease]; NSBitmapImageRep *bitmapRep = [[NSBitmapImageRep alloc] initWithCGImage: imageRef]; [img addRepresentation: bitmapRep]; [bitmapRep release]; CGImageRelease(imageRef); [img retain]; ImageMap::iterator it=images.find(type); if (it == images.end()) { images[type] = img; } else { [it->second release]; it->second = img; } } void ListBoxImpl::ClearRegisteredImages() { for (ImageMap::iterator it=images.begin(); it != images.end(); ++it) { [it->second release]; it->second = nil; } images.clear(); } int ListBoxImpl::Rows() { return ld.Length(); } NSImage* ListBoxImpl::ImageForRow(NSInteger row) { ImageMap::iterator it = images.find(ld.GetType(row)); if (it != images.end()) { NSImage* img = it->second; return img; } else { return nil; } } NSString* ListBoxImpl::TextForRow(NSInteger row) { const char* textString = ld.GetString(row); NSString* sTitle; if (unicodeMode) sTitle = [NSString stringWithUTF8String:textString]; else sTitle = [NSString stringWithCString:textString encoding:NSWindowsCP1252StringEncoding]; return sTitle; } void ListBoxImpl::DoubleClick() { if (doubleClickAction) { doubleClickAction(doubleClickActionData); } } } // unnamed namespace //----------------- ListBox ------------------------------------------------------------------------ ListBox::ListBox() { } ListBox::~ListBox() { } ListBox* ListBox::Allocate() { ListBoxImpl* lb = new ListBoxImpl(); return lb; } //-------------------------------------------------------------------------------------------------- void Window::Destroy() { ListBoxImpl *listbox = dynamic_cast(this); if (listbox) { listbox->ReleaseViews(); } if (wid) { id idWin = reinterpret_cast(wid); if ([idWin isKindOfClass: [NSWindow class]]) { NSWindow* win = reinterpret_cast(idWin); [win release]; } } wid = 0; } //----------------- ScintillaContextMenu ----------------------------------------------------------- @implementation ScintillaContextMenu : NSMenu // This NSMenu subclass serves also as target for menu commands and forwards them as // notification messages to the front end. - (void) handleCommand: (NSMenuItem*) sender { owner->HandleCommand([sender tag]); } //-------------------------------------------------------------------------------------------------- - (void) setOwner: (Scintilla::ScintillaCocoa*) newOwner { owner = newOwner; } @end //----------------- Menu --------------------------------------------------------------------------- Menu::Menu() : mid(0) { } //-------------------------------------------------------------------------------------------------- void Menu::CreatePopUp() { Destroy(); mid = [[ScintillaContextMenu alloc] initWithTitle: @""]; } //-------------------------------------------------------------------------------------------------- void Menu::Destroy() { ScintillaContextMenu* menu = reinterpret_cast(mid); [menu release]; mid = NULL; } //-------------------------------------------------------------------------------------------------- void Menu::Show(Point, Window &) { // Cocoa menus are handled a bit differently. We only create the menu. The framework // takes care to show it properly. } //----------------- ElapsedTime -------------------------------------------------------------------- // ElapsedTime is used for precise performance measurements during development // and not for anything a user sees. ElapsedTime::ElapsedTime() { struct timeval curTime; gettimeofday( &curTime, NULL ); bigBit = curTime.tv_sec; littleBit = curTime.tv_usec; } double ElapsedTime::Duration(bool reset) { struct timeval curTime; gettimeofday( &curTime, NULL ); long endBigBit = curTime.tv_sec; long endLittleBit = curTime.tv_usec; double result = 1000000.0 * (endBigBit - bigBit); result += endLittleBit - littleBit; result /= 1000000.0; if (reset) { bigBit = endBigBit; littleBit = endLittleBit; } return result; } //----------------- Platform ----------------------------------------------------------------------- ColourDesired Platform::Chrome() { return ColourDesired(0xE0, 0xE0, 0xE0); } //-------------------------------------------------------------------------------------------------- ColourDesired Platform::ChromeHighlight() { return ColourDesired(0xFF, 0xFF, 0xFF); } //-------------------------------------------------------------------------------------------------- /** * Returns the currently set system font for the user. */ const char *Platform::DefaultFont() { NSString* name = [[NSUserDefaults standardUserDefaults] stringForKey: @"NSFixedPitchFont"]; return [name UTF8String]; } //-------------------------------------------------------------------------------------------------- /** * Returns the currently set system font size for the user. */ int Platform::DefaultFontSize() { return static_cast([[NSUserDefaults standardUserDefaults] integerForKey: @"NSFixedPitchFontSize"]); } //-------------------------------------------------------------------------------------------------- /** * Returns the time span in which two consecutive mouse clicks must occur to be considered as * double click. * * @return time span in milliseconds */ unsigned int Platform::DoubleClickTime() { float threshold = [[NSUserDefaults standardUserDefaults] floatForKey: @"com.apple.mouse.doubleClickThreshold"]; if (threshold == 0) threshold = 0.5; return static_cast(threshold * 1000.0); } //-------------------------------------------------------------------------------------------------- bool Platform::MouseButtonBounce() { return false; } //-------------------------------------------------------------------------------------------------- /** * Helper method for the backend to reach through to the scintilla window. */ long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { return scintilla_send_message(w, msg, wParam, lParam); } //-------------------------------------------------------------------------------------------------- /** * Helper method for the backend to reach through to the scintilla window. */ long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { return scintilla_send_message(w, msg, wParam, (long) lParam); } //-------------------------------------------------------------------------------------------------- bool Platform::IsDBCSLeadByte(int codePage, char ch) { // Byte ranges found in Wikipedia articles with relevant search strings in each case unsigned char uch = static_cast(ch); switch (codePage) { case 932: // Shift_jis return ((uch >= 0x81) && (uch <= 0x9F)) || ((uch >= 0xE0) && (uch <= 0xFC)); // Lead bytes F0 to FC may be a Microsoft addition. case 936: // GBK return (uch >= 0x81) && (uch <= 0xFE); case 949: // Korean Wansung KS C-5601-1987 return (uch >= 0x81) && (uch <= 0xFE); case 950: // Big5 return (uch >= 0x81) && (uch <= 0xFE); case 1361: // Korean Johab KS C-5601-1992 return ((uch >= 0x84) && (uch <= 0xD3)) || ((uch >= 0xD8) && (uch <= 0xDE)) || ((uch >= 0xE0) && (uch <= 0xF9)); } return false; } //-------------------------------------------------------------------------------------------------- int Platform::DBCSCharLength(int /* codePage */, const char* /* s */) { // DBCS no longer uses this. return 1; } //-------------------------------------------------------------------------------------------------- int Platform::DBCSCharMaxLength() { return 2; } //-------------------------------------------------------------------------------------------------- int Platform::Minimum(int a, int b) { return (a < b) ? a : b; } //-------------------------------------------------------------------------------------------------- int Platform::Maximum(int a, int b) { return (a > b) ? a : b; } //-------------------------------------------------------------------------------------------------- //#define TRACE #ifdef TRACE void Platform::DebugDisplay(const char *s) { fprintf( stderr, "%s", s ); } //-------------------------------------------------------------------------------------------------- void Platform::DebugPrintf(const char *format, ...) { const int BUF_SIZE = 2000; char buffer[BUF_SIZE]; va_list pArguments; va_start(pArguments, format); vsnprintf(buffer, BUF_SIZE, format, pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); } #else void Platform::DebugDisplay(const char *) {} void Platform::DebugPrintf(const char *, ...) {} #endif //-------------------------------------------------------------------------------------------------- static bool assertionPopUps = true; bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { bool ret = assertionPopUps; assertionPopUps = assertionPopUps_; return ret; } //-------------------------------------------------------------------------------------------------- void Platform::Assert(const char *c, const char *file, int line) { char buffer[2000]; snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d\r\n", c, file, line); Platform::DebugDisplay(buffer); #ifdef DEBUG // Jump into debugger in assert on Mac (CL269835) ::Debugger(); #endif } //-------------------------------------------------------------------------------------------------- int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; if (val < minVal) val = minVal; return val; } //----------------- DynamicLibrary ----------------------------------------------------------------- /** * Implements the platform specific part of library loading. * * @param modulePath The path to the module to load. * @return A library instance or NULL if the module could not be found or another problem occurred. */ DynamicLibrary* DynamicLibrary::Load(const char* /* modulePath */) { // Not implemented. return NULL; } //-------------------------------------------------------------------------------------------------- scintilla/cocoa/ScintillaView.mm0000644000175000017500000017407312557522743015724 0ustar neilneil /** * Implementation of the native Cocoa View that serves as container for the scintilla parts. * * Created by Mike Lischke. * * Copyright 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright 2009, 2011 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import "Platform.h" #import "ScintillaView.h" #import "ScintillaCocoa.h" using namespace Scintilla; // Two additional cursors we need, which aren't provided by Cocoa. static NSCursor* reverseArrowCursor; static NSCursor* waitCursor; NSString *const SCIUpdateUINotification = @"SCIUpdateUI"; /** * Provide an NSCursor object that matches the Window::Cursor enumeration. */ static NSCursor *cursorFromEnum(Window::Cursor cursor) { switch (cursor) { case Window::cursorText: return [NSCursor IBeamCursor]; case Window::cursorArrow: return [NSCursor arrowCursor]; case Window::cursorWait: return waitCursor; case Window::cursorHoriz: return [NSCursor resizeLeftRightCursor]; case Window::cursorVert: return [NSCursor resizeUpDownCursor]; case Window::cursorReverseArrow: return reverseArrowCursor; case Window::cursorUp: default: return [NSCursor arrowCursor]; } } @implementation SCIMarginView @synthesize marginWidth, owner; - (id)initWithScrollView:(NSScrollView *)aScrollView { self = [super initWithScrollView:aScrollView orientation:NSVerticalRuler]; if (self != nil) { owner = nil; marginWidth = 20; currentCursors = [[NSMutableArray arrayWithCapacity:0] retain]; for (size_t i=0; i<=SC_MAX_MARGIN; i++) { [currentCursors addObject: [reverseArrowCursor retain]]; } [self setClientView:[aScrollView documentView]]; } return self; } - (void) dealloc { [currentCursors release]; [super dealloc]; } - (void) setFrame: (NSRect) frame { [super setFrame: frame]; [[self window] invalidateCursorRectsForView: self]; } - (CGFloat)requiredThickness { return marginWidth; } - (void)drawHashMarksAndLabelsInRect:(NSRect)aRect { if (owner) { NSRect contentRect = [[[self scrollView] contentView] bounds]; NSRect marginRect = [self bounds]; // Ensure paint to bottom of view to avoid glitches if (marginRect.size.height > contentRect.size.height) { // Legacy scroll bar mode leaves a poorly painted corner aRect = marginRect; } owner.backend->PaintMargin(aRect); } } - (void) mouseDown: (NSEvent *) theEvent { NSClipView *textView = [[self scrollView] contentView]; [[textView window] makeFirstResponder:textView]; owner.backend->MouseDown(theEvent); } - (void) mouseDragged: (NSEvent *) theEvent { owner.backend->MouseMove(theEvent); } - (void) mouseMoved: (NSEvent *) theEvent { owner.backend->MouseMove(theEvent); } - (void) mouseUp: (NSEvent *) theEvent { owner.backend->MouseUp(theEvent); } /** * This method is called to give us the opportunity to define our mouse sensitive rectangle. */ - (void) resetCursorRects { [super resetCursorRects]; int x = 0; NSRect marginRect = [self bounds]; size_t co = [currentCursors count]; for (size_t i=0; iWndProc(SCI_GETMARGINCURSORN, i, 0); long width =owner.backend->WndProc(SCI_GETMARGINWIDTHN, i, 0); NSCursor *cc = cursorFromEnum(static_cast(cursType)); [currentCursors replaceObjectAtIndex:i withObject: cc]; marginRect.origin.x = x; marginRect.size.width = width; [self addCursorRect: marginRect cursor: cc]; [cc setOnMouseEntered: YES]; x += width; } } @end @implementation SCIContentView @synthesize owner = mOwner; //-------------------------------------------------------------------------------------------------- - (NSView*) initWithFrame: (NSRect) frame { self = [super initWithFrame: frame]; if (self != nil) { // Some initialization for our view. mCurrentCursor = [[NSCursor arrowCursor] retain]; trackingArea = nil; mMarkedTextRange = NSMakeRange(NSNotFound, 0); [self registerForDraggedTypes: [NSArray arrayWithObjects: NSStringPboardType, ScintillaRecPboardType, NSFilenamesPboardType, nil]]; } return self; } //-------------------------------------------------------------------------------------------------- /** * When the view is resized or scrolled we need to update our tracking area. */ - (void) updateTrackingAreas { if (trackingArea) [self removeTrackingArea:trackingArea]; int opts = (NSTrackingActiveAlways | NSTrackingInVisibleRect | NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved); trackingArea = [[NSTrackingArea alloc] initWithRect:[self bounds] options:opts owner:self userInfo:nil]; [self addTrackingArea: trackingArea]; [super updateTrackingAreas]; } //-------------------------------------------------------------------------------------------------- /** * When the view is resized we need to let the backend know. */ - (void) setFrame: (NSRect) frame { [super setFrame: frame]; mOwner.backend->Resize(); } //-------------------------------------------------------------------------------------------------- /** * Called by the backend if a new cursor must be set for the view. */ - (void) setCursor: (int) cursor { Window::Cursor eCursor = (Window::Cursor)cursor; [mCurrentCursor autorelease]; mCurrentCursor = cursorFromEnum(eCursor); [mCurrentCursor retain]; // Trigger recreation of the cursor rectangle(s). [[self window] invalidateCursorRectsForView: self]; [mOwner updateMarginCursors]; } //-------------------------------------------------------------------------------------------------- /** * This method is called to give us the opportunity to define our mouse sensitive rectangle. */ - (void) resetCursorRects { [super resetCursorRects]; // We only have one cursor rect: our bounds. [self addCursorRect: [self bounds] cursor: mCurrentCursor]; [mCurrentCursor setOnMouseEntered: YES]; } //-------------------------------------------------------------------------------------------------- /** * Called before repainting. */ - (void) viewWillDraw { const NSRect *rects; NSInteger nRects = 0; [self getRectsBeingDrawn:&rects count:&nRects]; if (nRects > 0) { NSRect rectUnion = rects[0]; for (int i=0;iWillDraw(rectUnion); } [super viewWillDraw]; } //-------------------------------------------------------------------------------------------------- /** * Called before responsive scrolling overdraw. */ - (void) prepareContentInRect: (NSRect) rect { mOwner.backend->WillDraw(rect); #if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 [super prepareContentInRect: rect]; #endif } //-------------------------------------------------------------------------------------------------- /** * Gets called by the runtime when the view needs repainting. */ - (void) drawRect: (NSRect) rect { CGContextRef context = (CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]; if (!mOwner.backend->Draw(rect, context)) { dispatch_async(dispatch_get_main_queue(), ^{ [self setNeedsDisplay:YES]; }); } } //-------------------------------------------------------------------------------------------------- /** * Windows uses a client coordinate system where the upper left corner is the origin in a window * (and so does Scintilla). We have to adjust for that. However by returning YES here, we are * already done with that. * Note that because of returning YES here most coordinates we use now (e.g. for painting, * invalidating rectangles etc.) are given with +Y pointing down! */ - (BOOL) isFlipped { return YES; } //-------------------------------------------------------------------------------------------------- - (BOOL) isOpaque { return YES; } //-------------------------------------------------------------------------------------------------- /** * Implement the "click through" behavior by telling the caller we accept the first mouse event too. */ - (BOOL) acceptsFirstMouse: (NSEvent *) theEvent { #pragma unused(theEvent) return YES; } //-------------------------------------------------------------------------------------------------- /** * Make this view accepting events as first responder. */ - (BOOL) acceptsFirstResponder { return YES; } //-------------------------------------------------------------------------------------------------- /** * Called by the framework if it wants to show a context menu for the editor. */ - (NSMenu*) menuForEvent: (NSEvent*) theEvent { if (![mOwner respondsToSelector: @selector(menuForEvent:)]) return mOwner.backend->CreateContextMenu(theEvent); else return [mOwner menuForEvent: theEvent]; } //-------------------------------------------------------------------------------------------------- // Adoption of NSTextInputClient protocol. - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { const NSRange posRange = mOwner.backend->PositionsFromCharacters(aRange); // The backend validated aRange and may have removed characters beyond the end of the document. const NSRange charRange = mOwner.backend->CharactersFromPositions(posRange); if (!NSEqualRanges(aRange, charRange)) { *actualRange = charRange; } [mOwner message: SCI_SETTARGETRANGE wParam: posRange.location lParam: NSMaxRange(posRange)]; std::string text([mOwner message: SCI_TARGETASUTF8] + 1, 0); [mOwner message: SCI_TARGETASUTF8 wParam: 0 lParam: reinterpret_cast(&text[0])]; NSString *result = [NSString stringWithUTF8String: text.c_str()]; NSMutableAttributedString *asResult = [[[NSMutableAttributedString alloc] initWithString:result] autorelease]; const NSRange rangeAS = NSMakeRange(0, [asResult length]); const long style = [mOwner message: SCI_GETSTYLEAT wParam:posRange.location]; std::string fontName([mOwner message: SCI_STYLEGETFONT wParam:style lParam:0] + 1, 0); [mOwner message: SCI_STYLEGETFONT wParam:style lParam:(sptr_t)&fontName[0]]; const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam:style] / 100.0f; NSString *sFontName = [NSString stringWithUTF8String: fontName.c_str()]; NSFont *font = [NSFont fontWithName:sFontName size:fontSize]; [asResult addAttribute:NSFontAttributeName value:font range:rangeAS]; return asResult; } //-------------------------------------------------------------------------------------------------- - (NSUInteger) characterIndexForPoint: (NSPoint) point { const NSRect rectPoint = {point, NSZeroSize}; const NSRect rectInWindow = [self.window convertRectFromScreen:rectPoint]; const NSRect rectLocal = [[[self superview] superview] convertRect:rectInWindow fromView:nil]; const long position = [mOwner message: SCI_CHARPOSITIONFROMPOINT wParam: rectLocal.origin.x lParam: rectLocal.origin.y]; if (position == INVALID_POSITION) { return NSNotFound; } else { const NSRange index = mOwner.backend->CharactersFromPositions(NSMakeRange(position, 0)); return index.location; } } //-------------------------------------------------------------------------------------------------- - (void) doCommandBySelector: (SEL) selector { if ([self respondsToSelector: @selector(selector)]) [self performSelector: selector withObject: nil]; } //-------------------------------------------------------------------------------------------------- - (NSRect) firstRectForCharacterRange: (NSRange) aRange actualRange: (NSRangePointer) actualRange { const NSRange posRange = mOwner.backend->PositionsFromCharacters(aRange); NSRect rect; rect.origin.x = [mOwner message: SCI_POINTXFROMPOSITION wParam: 0 lParam: posRange.location]; rect.origin.y = [mOwner message: SCI_POINTYFROMPOSITION wParam: 0 lParam: posRange.location]; const NSUInteger rangeEnd = NSMaxRange(posRange); rect.size.width = [mOwner message: SCI_POINTXFROMPOSITION wParam: 0 lParam: rangeEnd] - rect.origin.x; rect.size.height = [mOwner message: SCI_POINTYFROMPOSITION wParam: 0 lParam: rangeEnd] - rect.origin.y; rect.size.height += [mOwner message: SCI_TEXTHEIGHT wParam: 0 lParam: 0]; const NSRect rectInWindow = [[[self superview] superview] convertRect:rect toView:nil]; const NSRect rectScreen = [self.window convertRectToScreen:rectInWindow]; return rectScreen; } //-------------------------------------------------------------------------------------------------- - (BOOL) hasMarkedText { return mMarkedTextRange.length > 0; } //-------------------------------------------------------------------------------------------------- /** * General text input. Used to insert new text at the current input position, replacing the current * selection if there is any. * First removes the replacementRange. */ - (void) insertText: (id) aString replacementRange: (NSRange) replacementRange { if ((mMarkedTextRange.location != NSNotFound) && (replacementRange.location != NSNotFound)) { NSLog(@"Trying to insertText when there is both a marked range and a replacement range"); } // Remove any previously marked text first. mOwner.backend->CompositionUndo(); if (mMarkedTextRange.location != NSNotFound) { const NSRange posRangeMark = mOwner.backend->PositionsFromCharacters(mMarkedTextRange); [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeMark.location]; } mMarkedTextRange = NSMakeRange(NSNotFound, 0); if (replacementRange.location == (NSNotFound-1)) // This occurs when the accent popup is visible and menu selected. // Its replacing a non-existent position so do nothing. return; if (replacementRange.location != NSNotFound) { const NSRange posRangeReplacement = mOwner.backend->PositionsFromCharacters(replacementRange); [mOwner message: SCI_DELETERANGE wParam: posRangeReplacement.location lParam: posRangeReplacement.length]; [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeReplacement.location]; } NSString* newText = @""; if ([aString isKindOfClass:[NSString class]]) newText = (NSString*) aString; else if ([aString isKindOfClass:[NSAttributedString class]]) newText = (NSString*) [aString string]; mOwner.backend->InsertText(newText); } //-------------------------------------------------------------------------------------------------- - (NSRange) markedRange { return mMarkedTextRange; } //-------------------------------------------------------------------------------------------------- - (NSRange) selectedRange { const long positionBegin = [mOwner message: SCI_GETSELECTIONSTART]; const long positionEnd = [mOwner message: SCI_GETSELECTIONEND]; NSRange posRangeSel = NSMakeRange(positionBegin, positionEnd-positionBegin); return mOwner.backend->CharactersFromPositions(posRangeSel); } //-------------------------------------------------------------------------------------------------- /** * Called by the input manager to set text which might be combined with further input to form * the final text (e.g. composition of ^ and a to â). * * @param aString The text to insert, either what has been marked already or what is selected already * or simply added at the current insertion point. Depending on what is available. * @param range The range of the new text to select (given relative to the insertion point of the new text). * @param replacementRange The range to remove before insertion. */ - (void) setMarkedText: (id) aString selectedRange: (NSRange)range replacementRange: (NSRange)replacementRange { NSString* newText = @""; if ([aString isKindOfClass:[NSString class]]) newText = (NSString*) aString; else if ([aString isKindOfClass:[NSAttributedString class]]) newText = (NSString*) [aString string]; // Replace marked text if there is one. if (mMarkedTextRange.length > 0) { mOwner.backend->CompositionUndo(); if (replacementRange.location != NSNotFound) { // This situation makes no sense and has not occurred in practice. NSLog(@"Can not handle a replacement range when there is also a marked range"); } else { replacementRange = mMarkedTextRange; const NSRange posRangeMark = mOwner.backend->PositionsFromCharacters(mMarkedTextRange); [mOwner message: SCI_SETEMPTYSELECTION wParam: posRangeMark.location]; } } else { // Must perform deletion before entering composition mode or else // both document and undo history will not contain the deleted text // leading to an inaccurate and unusable undo history. // Convert selection virtual space into real space mOwner.backend->ConvertSelectionVirtualSpace(); if (replacementRange.location != NSNotFound) { const NSRange posRangeReplacement = mOwner.backend->PositionsFromCharacters(replacementRange); [mOwner message: SCI_DELETERANGE wParam: posRangeReplacement.location lParam: posRangeReplacement.length]; } else // No marked or replacement range, so replace selection { if (!mOwner.backend->ScintillaCocoa::ClearAllSelections()) { // Some of the selection is protected so can not perform composition here return; } // Ensure only a single selection. mOwner.backend->SelectOnlyMainSelection(); replacementRange = [self selectedRange]; } } // To support IME input to multiple selections, the following code would // need to insert newText at each selection, mark each piece of new text and then // select range relative to each insertion. if ([newText length]) { // Switching into composition. mOwner.backend->CompositionStart(); NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0)); // Note: Scintilla internally works almost always with bytes instead chars, so we need to take // this into account when determining selection ranges and such. int lengthInserted = mOwner.backend->InsertText(newText); posRangeCurrent.length = lengthInserted; mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent); // Mark the just inserted text. Keep the marked range for later reset. [mOwner setGeneralProperty: SCI_SETINDICATORCURRENT value: INDIC_IME]; [mOwner setGeneralProperty: SCI_INDICATORFILLRANGE parameter: posRangeCurrent.location value: posRangeCurrent.length]; } else { mMarkedTextRange = NSMakeRange(NSNotFound, 0); // Re-enable undo action collection if composition ended (indicated by an empty mark string). mOwner.backend->CompositionCommit(); } // Select the part which is indicated in the given range. It does not scroll the caret into view. if (range.length > 0) { // range is in characters so convert to bytes for selection. range.location += replacementRange.location; NSRange posRangeSelect = mOwner.backend->PositionsFromCharacters(range); [mOwner setGeneralProperty: SCI_SETSELECTION parameter: NSMaxRange(posRangeSelect) value: posRangeSelect.location]; } } //-------------------------------------------------------------------------------------------------- - (void) unmarkText { if (mMarkedTextRange.length > 0) { mOwner.backend->CompositionCommit(); mMarkedTextRange = NSMakeRange(NSNotFound, 0); } } //-------------------------------------------------------------------------------------------------- - (NSArray*) validAttributesForMarkedText { return nil; } // End of the NSTextInputClient protocol adoption. //-------------------------------------------------------------------------------------------------- /** * Generic input method. It is used to pass on keyboard input to Scintilla. The control itself only * handles shortcuts. The input is then forwarded to the Cocoa text input system, which in turn does * its own input handling (character composition via NSTextInputClient protocol): */ - (void) keyDown: (NSEvent *) theEvent { if (mMarkedTextRange.length == 0) mOwner.backend->KeyboardInput(theEvent); NSArray* events = [NSArray arrayWithObject: theEvent]; [self interpretKeyEvents: events]; } //-------------------------------------------------------------------------------------------------- - (void) mouseDown: (NSEvent *) theEvent { mOwner.backend->MouseDown(theEvent); } //-------------------------------------------------------------------------------------------------- - (void) mouseDragged: (NSEvent *) theEvent { mOwner.backend->MouseMove(theEvent); } //-------------------------------------------------------------------------------------------------- - (void) mouseUp: (NSEvent *) theEvent { mOwner.backend->MouseUp(theEvent); } //-------------------------------------------------------------------------------------------------- - (void) mouseMoved: (NSEvent *) theEvent { mOwner.backend->MouseMove(theEvent); } //-------------------------------------------------------------------------------------------------- - (void) mouseEntered: (NSEvent *) theEvent { mOwner.backend->MouseEntered(theEvent); } //-------------------------------------------------------------------------------------------------- - (void) mouseExited: (NSEvent *) theEvent { mOwner.backend->MouseExited(theEvent); } //-------------------------------------------------------------------------------------------------- /** * Mouse wheel with command key magnifies text. * Enabling this code causes visual garbage to appear when scrolling * horizontally on OS X 10.9 with a retina display. * Pinch gestures and key commands can be used for magnification. */ #ifdef SCROLL_WHEEL_MAGNIFICATION - (void) scrollWheel: (NSEvent *) theEvent { if (([theEvent modifierFlags] & NSCommandKeyMask) != 0) { mOwner.backend->MouseWheel(theEvent); } else { [super scrollWheel:theEvent]; } } #endif //-------------------------------------------------------------------------------------------------- /** * Ensure scrolling is aligned to whole lines instead of starting part-way through a line */ - (NSRect)adjustScroll:(NSRect)proposedVisibleRect { NSRect rc = proposedVisibleRect; // Snap to lines NSRect contentRect = [self bounds]; if ((rc.origin.y > 0) && (NSMaxY(rc) < contentRect.size.height)) { // Only snap for positions inside the document - allow outside // for overshoot. long lineHeight = mOwner.backend->WndProc(SCI_TEXTHEIGHT, 0, 0); rc.origin.y = roundf(static_cast(rc.origin.y) / lineHeight) * lineHeight; } return rc; } //-------------------------------------------------------------------------------------------------- /** * The editor is getting the foreground control (the one getting the input focus). */ - (BOOL) becomeFirstResponder { mOwner.backend->WndProc(SCI_SETFOCUS, 1, 0); return YES; } //-------------------------------------------------------------------------------------------------- /** * The editor is losing the input focus. */ - (BOOL) resignFirstResponder { mOwner.backend->WndProc(SCI_SETFOCUS, 0, 0); return YES; } //-------------------------------------------------------------------------------------------------- /** * Implement NSDraggingSource. */ - (NSDragOperation)draggingSession: (NSDraggingSession *) session sourceOperationMaskForDraggingContext: (NSDraggingContext) context { switch(context) { case NSDraggingContextOutsideApplication: return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete; case NSDraggingContextWithinApplication: default: return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete; } } - (void)draggingSession:(NSDraggingSession *)session movedToPoint:(NSPoint)screenPoint { } - (void)draggingSession:(NSDraggingSession *)session endedAtPoint:(NSPoint)screenPoint operation:(NSDragOperation)operation { if (operation == NSDragOperationDelete) { mOwner.backend->WndProc(SCI_CLEAR, 0, 0); } } /** * Implement NSDraggingDestination. */ //-------------------------------------------------------------------------------------------------- /** * Called when an external drag operation enters the view. */ - (NSDragOperation) draggingEntered: (id ) sender { return mOwner.backend->DraggingEntered(sender); } //-------------------------------------------------------------------------------------------------- /** * Called frequently during an external drag operation if we are the target. */ - (NSDragOperation) draggingUpdated: (id ) sender { return mOwner.backend->DraggingUpdated(sender); } //-------------------------------------------------------------------------------------------------- /** * Drag image left the view. Clean up if necessary. */ - (void) draggingExited: (id ) sender { mOwner.backend->DraggingExited(sender); } //-------------------------------------------------------------------------------------------------- - (BOOL) prepareForDragOperation: (id ) sender { #pragma unused(sender) return YES; } //-------------------------------------------------------------------------------------------------- - (BOOL) performDragOperation: (id ) sender { return mOwner.backend->PerformDragOperation(sender); } //-------------------------------------------------------------------------------------------------- /** * Drag operation is done. Notify editor. */ - (void) concludeDragOperation: (id ) sender { // Clean up is the same as if we are no longer the drag target. mOwner.backend->DraggingExited(sender); } //-------------------------------------------------------------------------------------------------- // NSResponder actions. - (void) selectAll: (id) sender { #pragma unused(sender) mOwner.backend->SelectAll(); } - (void) deleteBackward: (id) sender { #pragma unused(sender) mOwner.backend->DeleteBackward(); } - (void) cut: (id) sender { #pragma unused(sender) mOwner.backend->Cut(); } - (void) copy: (id) sender { #pragma unused(sender) mOwner.backend->Copy(); } - (void) paste: (id) sender { #pragma unused(sender) if (mMarkedTextRange.location != NSNotFound) { [[NSTextInputContext currentInputContext] discardMarkedText]; mOwner.backend->CompositionCommit(); mMarkedTextRange = NSMakeRange(NSNotFound, 0); } mOwner.backend->Paste(); } - (void) undo: (id) sender { #pragma unused(sender) if (mMarkedTextRange.location != NSNotFound) { [[NSTextInputContext currentInputContext] discardMarkedText]; mOwner.backend->CompositionCommit(); mMarkedTextRange = NSMakeRange(NSNotFound, 0); } mOwner.backend->Undo(); } - (void) redo: (id) sender { #pragma unused(sender) mOwner.backend->Redo(); } - (BOOL) canUndo { return mOwner.backend->CanUndo() && (mMarkedTextRange.location == NSNotFound); } - (BOOL) canRedo { return mOwner.backend->CanRedo(); } - (BOOL) validateUserInterfaceItem: (id ) anItem { SEL action = [anItem action]; if (action==@selector(undo:)) { return [self canUndo]; } else if (action==@selector(redo:)) { return [self canRedo]; } else if (action==@selector(cut:) || action==@selector(copy:) || action==@selector(clear:)) { return mOwner.backend->HasSelection(); } else if (action==@selector(paste:)) { return mOwner.backend->CanPaste(); } return YES; } - (void) clear: (id) sender { [self deleteBackward:sender]; } - (BOOL) isEditable { return mOwner.backend->WndProc(SCI_GETREADONLY, 0, 0) == 0; } //-------------------------------------------------------------------------------------------------- - (void) dealloc { [mCurrentCursor release]; [super dealloc]; } @end //-------------------------------------------------------------------------------------------------- @implementation ScintillaView @synthesize backend = mBackend; @synthesize delegate = mDelegate; @synthesize scrollView; /** * ScintillaView is a composite control made from an NSView and an embedded NSView that is * used as canvas for the output (by the backend, using its CGContext), plus other elements * (scrollers, info bar). */ //-------------------------------------------------------------------------------------------------- /** * Initialize custom cursor. */ + (void) initialize { if (self == [ScintillaView class]) { NSBundle* bundle = [NSBundle bundleForClass: [ScintillaView class]]; NSString* path = [bundle pathForResource: @"mac_cursor_busy" ofType: @"tiff" inDirectory: nil]; NSImage* image = [[[NSImage alloc] initWithContentsOfFile: path] autorelease]; waitCursor = [[NSCursor alloc] initWithImage: image hotSpot: NSMakePoint(2, 2)]; path = [bundle pathForResource: @"mac_cursor_flipped" ofType: @"tiff" inDirectory: nil]; image = [[[NSImage alloc] initWithContentsOfFile: path] autorelease]; reverseArrowCursor = [[NSCursor alloc] initWithImage: image hotSpot: NSMakePoint(12, 2)]; } } //-------------------------------------------------------------------------------------------------- /** * Specify the SCIContentView class. Can be overridden in a subclass to provide an SCIContentView subclass. */ + (Class) contentViewClass { return [SCIContentView class]; } //-------------------------------------------------------------------------------------------------- /** * Receives zoom messages, for example when a "pinch zoom" is performed on the trackpad. */ - (void) magnifyWithEvent: (NSEvent *) event { #if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_5 zoomDelta += event.magnification * 10.0; if (fabs(zoomDelta)>=1.0) { long zoomFactor = static_cast([self getGeneralProperty: SCI_GETZOOM] + zoomDelta); [self setGeneralProperty: SCI_SETZOOM parameter: zoomFactor value:0]; zoomDelta = 0.0; } #endif } - (void) beginGestureWithEvent: (NSEvent *) event { // Scintilla is only interested in this event as the starft of a zoom #pragma unused(event) zoomDelta = 0.0; } //-------------------------------------------------------------------------------------------------- /** * Sends a new notification of the given type to the default notification center. */ - (void) sendNotification: (NSString*) notificationName { NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; [center postNotificationName: notificationName object: self]; } //-------------------------------------------------------------------------------------------------- /** * Called by a connected component (usually the info bar) if something changed there. * * @param type The type of the notification. * @param message Carries the new status message if the type is a status message change. * @param location Carries the new location (e.g. caret) if the type is a caret change or similar type. * @param value Carries the new zoom value if the type is a zoom change. */ - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location value: (float) value { // These parameters are just to conform to the protocol #pragma unused(message) #pragma unused(location) switch (type) { case IBNZoomChanged: { // Compute point increase/decrease based on default font size. long fontSize = [self getGeneralProperty: SCI_STYLEGETSIZE parameter: STYLE_DEFAULT]; int zoom = (int) (fontSize * (value - 1)); [self setGeneralProperty: SCI_SETZOOM value: zoom]; break; } default: break; }; } //-------------------------------------------------------------------------------------------------- - (void) setCallback: (id ) callback { // Not used. Only here to satisfy protocol. #pragma unused(callback) } //-------------------------------------------------------------------------------------------------- /** * Prevents drawing of the inner view to avoid flickering when doing many visual updates * (like clearing all marks and setting new ones etc.). */ - (void) suspendDrawing: (BOOL) suspend { if (suspend) [[self window] disableFlushWindow]; else [[self window] enableFlushWindow]; } //-------------------------------------------------------------------------------------------------- /** * Method receives notifications from Scintilla (e.g. for handling clicks on the * folder margin or changes in the editor). * A delegate can be set to receive all notifications. If set no handling takes place here, except * for action pertaining to internal stuff (like the info bar). */ - (void) notification: (Scintilla::SCNotification*)scn { // Parent notification. Details are passed as SCNotification structure. if (mDelegate != nil) { [mDelegate notification: scn]; if (scn->nmhdr.code != SCN_ZOOM && scn->nmhdr.code != SCN_UPDATEUI) return; } switch (scn->nmhdr.code) { case SCN_MARGINCLICK: { if (scn->margin == 2) { // Click on the folder margin. Toggle the current line if possible. long line = [self getGeneralProperty: SCI_LINEFROMPOSITION parameter: scn->position]; [self setGeneralProperty: SCI_TOGGLEFOLD value: line]; } break; }; case SCN_MODIFIED: { // Decide depending on the modification type what to do. // There can be more than one modification carried by one notification. if (scn->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) [self sendNotification: NSTextDidChangeNotification]; break; } case SCN_ZOOM: { // A zoom change happened. Notify info bar if there is one. float zoom = [self getGeneralProperty: SCI_GETZOOM parameter: 0]; long fontSize = [self getGeneralProperty: SCI_STYLEGETSIZE parameter: STYLE_DEFAULT]; float factor = (zoom / fontSize) + 1; [mInfoBar notify: IBNZoomChanged message: nil location: NSZeroPoint value: factor]; break; } case SCN_UPDATEUI: { // Triggered whenever changes in the UI state need to be reflected. // These can be: caret changes, selection changes etc. NSPoint caretPosition = mBackend->GetCaretPosition(); [mInfoBar notify: IBNCaretChanged message: nil location: caretPosition value: 0]; [self sendNotification: SCIUpdateUINotification]; if (scn->updated & (SC_UPDATE_SELECTION | SC_UPDATE_CONTENT)) { [self sendNotification: NSTextViewDidChangeSelectionNotification]; } break; } case SCN_FOCUSOUT: [self sendNotification: NSTextDidEndEditingNotification]; break; case SCN_FOCUSIN: // Nothing to do for now. break; } } //-------------------------------------------------------------------------------------------------- /** * Initialization of the view. Used to setup a few other things we need. */ - (id) initWithFrame: (NSRect) frame { self = [super initWithFrame:frame]; if (self) { mContent = [[[[[self class] contentViewClass] alloc] initWithFrame:NSZeroRect] autorelease]; mContent.owner = self; // Initialize the scrollers but don't show them yet. // Pick an arbitrary size, just to make NSScroller selecting the proper scroller direction // (horizontal or vertical). NSRect scrollerRect = NSMakeRect(0, 0, 100, 10); scrollView = [[[NSScrollView alloc] initWithFrame: scrollerRect] autorelease]; [scrollView setDocumentView: mContent]; [scrollView setHasVerticalScroller:YES]; [scrollView setHasHorizontalScroller:YES]; [scrollView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; //[scrollView setScrollerStyle:NSScrollerStyleLegacy]; //[scrollView setScrollerKnobStyle:NSScrollerKnobStyleDark]; //[scrollView setHorizontalScrollElasticity:NSScrollElasticityNone]; [self addSubview: scrollView]; marginView = [[SCIMarginView alloc] initWithScrollView:scrollView]; marginView.owner = self; [marginView setRuleThickness:[marginView requiredThickness]]; [scrollView setVerticalRulerView:marginView]; [scrollView setHasHorizontalRuler:NO]; [scrollView setHasVerticalRuler:YES]; [scrollView setRulersVisible:YES]; mBackend = new ScintillaCocoa(mContent, marginView); // Establish a connection from the back end to this container so we can handle situations // which require our attention. mBackend->SetDelegate(self); // Setup a special indicator used in the editor to provide visual feedback for // input composition, depending on language, keyboard etc. [self setColorProperty: SCI_INDICSETFORE parameter: INDIC_IME fromHTML: @"#FF0000"]; [self setGeneralProperty: SCI_INDICSETUNDER parameter: INDIC_IME value: 1]; [self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDIC_IME value: INDIC_PLAIN]; [self setGeneralProperty: SCI_INDICSETALPHA parameter: INDIC_IME value: 100]; NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:nil]; [center addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:nil]; [center addObserver:self selector:@selector(windowWillMove:) name:NSWindowWillMoveNotification object:[self window]]; [[scrollView contentView] setPostsBoundsChangedNotifications:YES]; [center addObserver:self selector:@selector(scrollerAction:) name:NSViewBoundsDidChangeNotification object:[scrollView contentView]]; } return self; } //-------------------------------------------------------------------------------------------------- - (void) dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; delete mBackend; [marginView release]; [super dealloc]; } //-------------------------------------------------------------------------------------------------- - (void) applicationDidResignActive: (NSNotification *)note { #pragma unused(note) mBackend->ActiveStateChanged(false); } //-------------------------------------------------------------------------------------------------- - (void) applicationDidBecomeActive: (NSNotification *)note { #pragma unused(note) mBackend->ActiveStateChanged(true); } //-------------------------------------------------------------------------------------------------- - (void) windowWillMove: (NSNotification *)note { #pragma unused(note) mBackend->WindowWillMove(); } //-------------------------------------------------------------------------------------------------- - (void) viewDidMoveToWindow { [super viewDidMoveToWindow]; [self positionSubViews]; // Enable also mouse move events for our window (and so this view). [[self window] setAcceptsMouseMovedEvents: YES]; } //-------------------------------------------------------------------------------------------------- /** * Used to position and size the parts of the editor (content, scrollers, info bar). */ - (void) positionSubViews { CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy]; NSSize size = [self frame].size; NSRect barFrame = {{0, size.height - scrollerWidth}, {size.width, scrollerWidth}}; BOOL infoBarVisible = mInfoBar != nil && ![mInfoBar isHidden]; // Horizontal offset of the content. Almost always 0 unless the vertical scroller // is on the left side. CGFloat contentX = 0; NSRect scrollRect = {{contentX, 0}, {size.width, size.height}}; // Info bar frame. if (infoBarVisible) { scrollRect.size.height -= scrollerWidth; // Initial value already is as if the bar is at top. if (!mInfoBarAtTop) { scrollRect.origin.y += scrollerWidth; barFrame.origin.y = 0; } } if (!NSEqualRects([scrollView frame], scrollRect)) { [scrollView setFrame: scrollRect]; } if (infoBarVisible) [mInfoBar setFrame: barFrame]; } //-------------------------------------------------------------------------------------------------- /** * Set the width of the margin. */ - (void) setMarginWidth: (int) width { if (marginView.ruleThickness != width) { marginView.marginWidth = width; [marginView setRuleThickness:[marginView requiredThickness]]; } } //-------------------------------------------------------------------------------------------------- /** * Triggered by one of the scrollers when it gets manipulated by the user. Notify the backend * about the change. */ - (void) scrollerAction: (id) sender { mBackend->UpdateForScroll(); } //-------------------------------------------------------------------------------------------------- /** * Used to reposition our content depending on the size of the view. */ - (void) setFrame: (NSRect) newFrame { NSRect previousFrame = [self frame]; [super setFrame: newFrame]; [self positionSubViews]; if (!NSEqualRects(previousFrame, newFrame)) { mBackend->Resize(); } } //-------------------------------------------------------------------------------------------------- /** * Getter for the currently selected text in raw form (no formatting information included). * If there is no text available an empty string is returned. */ - (NSString*) selectedString { NSString *result = @""; const long length = mBackend->WndProc(SCI_GETSELTEXT, 0, 0); if (length > 0) { std::string buffer(length + 1, '\0'); try { mBackend->WndProc(SCI_GETSELTEXT, length + 1, (sptr_t) &buffer[0]); result = [NSString stringWithUTF8String: buffer.c_str()]; } catch (...) { } } return result; } //-------------------------------------------------------------------------------------------------- /** * Delete a range from the document. */ - (void) deleteRange: (NSRange) aRange { if (aRange.length > 0) { NSRange posRange = mBackend->PositionsFromCharacters(aRange); [self message: SCI_DELETERANGE wParam: posRange.location lParam: posRange.length]; } } //-------------------------------------------------------------------------------------------------- /** * Getter for the current text in raw form (no formatting information included). * If there is no text available an empty string is returned. */ - (NSString*) string { NSString *result = @""; const long length = mBackend->WndProc(SCI_GETLENGTH, 0, 0); if (length > 0) { std::string buffer(length + 1, '\0'); try { mBackend->WndProc(SCI_GETTEXT, length + 1, (sptr_t) &buffer[0]); result = [NSString stringWithUTF8String: buffer.c_str()]; } catch (...) { } } return result; } //-------------------------------------------------------------------------------------------------- /** * Setter for the current text (no formatting included). */ - (void) setString: (NSString*) aString { const char* text = [aString UTF8String]; mBackend->WndProc(SCI_SETTEXT, 0, (long) text); } //-------------------------------------------------------------------------------------------------- - (void) insertString: (NSString*) aString atOffset: (int)offset { const char* text = [aString UTF8String]; mBackend->WndProc(SCI_ADDTEXT, offset, (long) text); } //-------------------------------------------------------------------------------------------------- - (void) setEditable: (BOOL) editable { mBackend->WndProc(SCI_SETREADONLY, editable ? 0 : 1, 0); } //-------------------------------------------------------------------------------------------------- - (BOOL) isEditable { return mBackend->WndProc(SCI_GETREADONLY, 0, 0) == 0; } //-------------------------------------------------------------------------------------------------- - (SCIContentView*) content { return mContent; } //-------------------------------------------------------------------------------------------------- - (void) updateMarginCursors { [[self window] invalidateCursorRectsForView: marginView]; } //-------------------------------------------------------------------------------------------------- /** * Direct call into the backend to allow uninterpreted access to it. The values to be passed in and * the result heavily depend on the message that is used for the call. Refer to the Scintilla * documentation to learn what can be used here. */ + (sptr_t) directCall: (ScintillaView*) sender message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam { return ScintillaCocoa::DirectFunction( reinterpret_cast(sender->mBackend), message, wParam, lParam); } - (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam lParam: (sptr_t) lParam { return mBackend->WndProc(message, wParam, lParam); } - (sptr_t) message: (unsigned int) message wParam: (uptr_t) wParam { return mBackend->WndProc(message, wParam, 0); } - (sptr_t) message: (unsigned int) message { return mBackend->WndProc(message, 0, 0); } //-------------------------------------------------------------------------------------------------- /** * This is a helper method to set properties in the backend, with native parameters. * * @param property Main property like SCI_STYLESETFORE for which a value is to be set. * @param parameter Additional info for this property like a parameter or index. * @param value The actual value. It depends on the property what this parameter means. */ - (void) setGeneralProperty: (int) property parameter: (long) parameter value: (long) value { mBackend->WndProc(property, parameter, value); } //-------------------------------------------------------------------------------------------------- /** * A simplified version for setting properties which only require one parameter. * * @param property Main property like SCI_STYLESETFORE for which a value is to be set. * @param value The actual value. It depends on the property what this parameter means. */ - (void) setGeneralProperty: (int) property value: (long) value { mBackend->WndProc(property, value, 0); } //-------------------------------------------------------------------------------------------------- /** * This is a helper method to get a property in the backend, with native parameters. * * @param property Main property like SCI_STYLESETFORE for which a value is to get. * @param parameter Additional info for this property like a parameter or index. * @param extra Yet another parameter if needed. * @result A generic value which must be interpreted depending on the property queried. */ - (long) getGeneralProperty: (int) property parameter: (long) parameter extra: (long) extra { return mBackend->WndProc(property, parameter, extra); } //-------------------------------------------------------------------------------------------------- /** * Convenience function to avoid unneeded extra parameter. */ - (long) getGeneralProperty: (int) property parameter: (long) parameter { return mBackend->WndProc(property, parameter, 0); } //-------------------------------------------------------------------------------------------------- /** * Convenience function to avoid unneeded parameters. */ - (long) getGeneralProperty: (int) property { return mBackend->WndProc(property, 0, 0); } //-------------------------------------------------------------------------------------------------- /** * Use this variant if you have to pass in a reference to something (e.g. a text range). */ - (long) getGeneralProperty: (int) property ref: (const void*) ref { return mBackend->WndProc(property, 0, (sptr_t) ref); } //-------------------------------------------------------------------------------------------------- /** * Specialized property setter for colors. */ - (void) setColorProperty: (int) property parameter: (long) parameter value: (NSColor*) value { if ([value colorSpaceName] != NSDeviceRGBColorSpace) value = [value colorUsingColorSpaceName: NSDeviceRGBColorSpace]; long red = static_cast([value redComponent] * 255); long green = static_cast([value greenComponent] * 255); long blue = static_cast([value blueComponent] * 255); long color = (blue << 16) + (green << 8) + red; mBackend->WndProc(property, parameter, color); } //-------------------------------------------------------------------------------------------------- /** * Another color property setting, which allows to specify the color as string like in HTML * documents (i.e. with leading # and either 3 hex digits or 6). */ - (void) setColorProperty: (int) property parameter: (long) parameter fromHTML: (NSString*) fromHTML { if ([fromHTML length] > 3 && [fromHTML characterAtIndex: 0] == '#') { bool longVersion = [fromHTML length] > 6; int index = 1; char value[3] = {0, 0, 0}; value[0] = static_cast([fromHTML characterAtIndex: index++]); if (longVersion) value[1] = static_cast([fromHTML characterAtIndex: index++]); else value[1] = value[0]; unsigned rawRed; [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawRed]; value[0] = static_cast([fromHTML characterAtIndex: index++]); if (longVersion) value[1] = static_cast([fromHTML characterAtIndex: index++]); else value[1] = value[0]; unsigned rawGreen; [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawGreen]; value[0] = static_cast([fromHTML characterAtIndex: index++]); if (longVersion) value[1] = static_cast([fromHTML characterAtIndex: index++]); else value[1] = value[0]; unsigned rawBlue; [[NSScanner scannerWithString: [NSString stringWithUTF8String: value]] scanHexInt: &rawBlue]; long color = (rawBlue << 16) + (rawGreen << 8) + rawRed; mBackend->WndProc(property, parameter, color); } } //-------------------------------------------------------------------------------------------------- /** * Specialized property getter for colors. */ - (NSColor*) getColorProperty: (int) property parameter: (long) parameter { long color = mBackend->WndProc(property, parameter, 0); CGFloat red = (color & 0xFF) / 255.0; CGFloat green = ((color >> 8) & 0xFF) / 255.0; CGFloat blue = ((color >> 16) & 0xFF) / 255.0; NSColor* result = [NSColor colorWithDeviceRed: red green: green blue: blue alpha: 1]; return result; } //-------------------------------------------------------------------------------------------------- /** * Specialized property setter for references (pointers, addresses). */ - (void) setReferenceProperty: (int) property parameter: (long) parameter value: (const void*) value { mBackend->WndProc(property, parameter, (sptr_t) value); } //-------------------------------------------------------------------------------------------------- /** * Specialized property getter for references (pointers, addresses). */ - (const void*) getReferenceProperty: (int) property parameter: (long) parameter { return (const void*) mBackend->WndProc(property, parameter, 0); } //-------------------------------------------------------------------------------------------------- /** * Specialized property setter for string values. */ - (void) setStringProperty: (int) property parameter: (long) parameter value: (NSString*) value { const char* rawValue = [value UTF8String]; mBackend->WndProc(property, parameter, (sptr_t) rawValue); } //-------------------------------------------------------------------------------------------------- /** * Specialized property getter for string values. */ - (NSString*) getStringProperty: (int) property parameter: (long) parameter { const char* rawValue = (const char*) mBackend->WndProc(property, parameter, 0); return [NSString stringWithUTF8String: rawValue]; } //-------------------------------------------------------------------------------------------------- /** * Specialized property setter for lexer properties, which are commonly passed as strings. */ - (void) setLexerProperty: (NSString*) name value: (NSString*) value { const char* rawName = [name UTF8String]; const char* rawValue = [value UTF8String]; mBackend->WndProc(SCI_SETPROPERTY, (sptr_t) rawName, (sptr_t) rawValue); } //-------------------------------------------------------------------------------------------------- /** * Specialized property getter for references (pointers, addresses). */ - (NSString*) getLexerProperty: (NSString*) name { const char* rawName = [name UTF8String]; const char* result = (const char*) mBackend->WndProc(SCI_SETPROPERTY, (sptr_t) rawName, 0); return [NSString stringWithUTF8String: result]; } //-------------------------------------------------------------------------------------------------- /** * Sets the notification callback */ - (void) registerNotifyCallback: (intptr_t) windowid value: (Scintilla::SciNotifyFunc) callback { mBackend->RegisterNotifyCallback(windowid, callback); } //-------------------------------------------------------------------------------------------------- /** * Sets the new control which is displayed as info bar at the top or bottom of the editor. * Set newBar to nil if you want to hide the bar again. * The info bar's height is set to the height of the scrollbar. */ - (void) setInfoBar: (NSView *) newBar top: (BOOL) top { if (mInfoBar != newBar) { [mInfoBar removeFromSuperview]; mInfoBar = newBar; mInfoBarAtTop = top; if (mInfoBar != nil) { [self addSubview: mInfoBar]; [mInfoBar setCallback: self]; } [self positionSubViews]; } } //-------------------------------------------------------------------------------------------------- /** * Sets the edit's info bar status message. This call only has an effect if there is an info bar. */ - (void) setStatusText: (NSString*) text { if (mInfoBar != nil) [mInfoBar notify: IBNStatusChanged message: text location: NSZeroPoint value: 0]; } //-------------------------------------------------------------------------------------------------- - (NSRange) selectedRange { return [mContent selectedRange]; } //-------------------------------------------------------------------------------------------------- - (void)insertText: (id) aString { if ([aString isKindOfClass:[NSString class]]) mBackend->InsertText(aString); else if ([aString isKindOfClass:[NSAttributedString class]]) mBackend->InsertText([aString string]); } //-------------------------------------------------------------------------------------------------- /** * For backwards compatibility. */ - (BOOL) findAndHighlightText: (NSString*) searchText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord scrollTo: (BOOL) scrollTo wrap: (BOOL) wrap { return [self findAndHighlightText: searchText matchCase: matchCase wholeWord: wholeWord scrollTo: scrollTo wrap: wrap backwards: NO]; } //-------------------------------------------------------------------------------------------------- /** * Searches and marks the first occurrence of the given text and optionally scrolls it into view. * * @result YES if something was found, NO otherwise. */ - (BOOL) findAndHighlightText: (NSString*) searchText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord scrollTo: (BOOL) scrollTo wrap: (BOOL) wrap backwards: (BOOL) backwards { int searchFlags= 0; if (matchCase) searchFlags |= SCFIND_MATCHCASE; if (wholeWord) searchFlags |= SCFIND_WHOLEWORD; long selectionStart = [self getGeneralProperty: SCI_GETSELECTIONSTART parameter: 0]; long selectionEnd = [self getGeneralProperty: SCI_GETSELECTIONEND parameter: 0]; // Sets the start point for the coming search to the beginning of the current selection. // For forward searches we have therefore to set the selection start to the current selection end // for proper incremental search. This does not harm as we either get a new selection if something // is found or the previous selection is restored. if (!backwards) [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: selectionEnd]; [self setGeneralProperty: SCI_SEARCHANCHOR value: 0]; sptr_t result; const char* textToSearch = [searchText UTF8String]; // The following call will also set the selection if something was found. if (backwards) { result = [ScintillaView directCall: self message: SCI_SEARCHPREV wParam: searchFlags lParam: (sptr_t) textToSearch]; if (result < 0 && wrap) { // Try again from the end of the document if nothing could be found so far and // wrapped search is set. [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: [self getGeneralProperty: SCI_GETTEXTLENGTH parameter: 0]]; [self setGeneralProperty: SCI_SEARCHANCHOR value: 0]; result = [ScintillaView directCall: self message: SCI_SEARCHNEXT wParam: searchFlags lParam: (sptr_t) textToSearch]; } } else { result = [ScintillaView directCall: self message: SCI_SEARCHNEXT wParam: searchFlags lParam: (sptr_t) textToSearch]; if (result < 0 && wrap) { // Try again from the start of the document if nothing could be found so far and // wrapped search is set. [self getGeneralProperty: SCI_SETSELECTIONSTART parameter: 0]; [self setGeneralProperty: SCI_SEARCHANCHOR value: 0]; result = [ScintillaView directCall: self message: SCI_SEARCHNEXT wParam: searchFlags lParam: (sptr_t) textToSearch]; } } if (result >= 0) { if (scrollTo) [self setGeneralProperty: SCI_SCROLLCARET value: 0]; } else { // Restore the former selection if we did not find anything. [self setGeneralProperty: SCI_SETSELECTIONSTART value: selectionStart]; [self setGeneralProperty: SCI_SETSELECTIONEND value: selectionEnd]; } return (result >= 0) ? YES : NO; } //-------------------------------------------------------------------------------------------------- /** * Searches the given text and replaces * * @result Number of entries replaced, 0 if none. */ - (int) findAndReplaceText: (NSString*) searchText byText: (NSString*) newText matchCase: (BOOL) matchCase wholeWord: (BOOL) wholeWord doAll: (BOOL) doAll { // The current position is where we start searching for single occurrences. Otherwise we start at // the beginning of the document. long startPosition; if (doAll) startPosition = 0; // Start at the beginning of the text if we replace all occurrences. else // For a single replacement we start at the current caret position. startPosition = [self getGeneralProperty: SCI_GETCURRENTPOS]; long endPosition = [self getGeneralProperty: SCI_GETTEXTLENGTH]; int searchFlags= 0; if (matchCase) searchFlags |= SCFIND_MATCHCASE; if (wholeWord) searchFlags |= SCFIND_WHOLEWORD; [self setGeneralProperty: SCI_SETSEARCHFLAGS value: searchFlags]; [self setGeneralProperty: SCI_SETTARGETSTART value: startPosition]; [self setGeneralProperty: SCI_SETTARGETEND value: endPosition]; const char* textToSearch = [searchText UTF8String]; long sourceLength = strlen(textToSearch); // Length in bytes. const char* replacement = [newText UTF8String]; long targetLength = strlen(replacement); // Length in bytes. sptr_t result; int replaceCount = 0; if (doAll) { while (true) { result = [ScintillaView directCall: self message: SCI_SEARCHINTARGET wParam: sourceLength lParam: (sptr_t) textToSearch]; if (result < 0) break; replaceCount++; [ScintillaView directCall: self message: SCI_REPLACETARGET wParam: targetLength lParam: (sptr_t) replacement]; // The replacement changes the target range to the replaced text. Continue after that till the end. // The text length might be changed by the replacement so make sure the target end is the actual // text end. [self setGeneralProperty: SCI_SETTARGETSTART value: [self getGeneralProperty: SCI_GETTARGETEND]]; [self setGeneralProperty: SCI_SETTARGETEND value: [self getGeneralProperty: SCI_GETTEXTLENGTH]]; } } else { result = [ScintillaView directCall: self message: SCI_SEARCHINTARGET wParam: sourceLength lParam: (sptr_t) textToSearch]; replaceCount = (result < 0) ? 0 : 1; if (replaceCount > 0) { [ScintillaView directCall: self message: SCI_REPLACETARGET wParam: targetLength lParam: (sptr_t) replacement]; // For a single replace we set the new selection to the replaced text. [self setGeneralProperty: SCI_SETSELECTIONSTART value: [self getGeneralProperty: SCI_GETTARGETSTART]]; [self setGeneralProperty: SCI_SETSELECTIONEND value: [self getGeneralProperty: SCI_GETTARGETEND]]; } } return replaceCount; } //-------------------------------------------------------------------------------------------------- - (void) setFontName: (NSString*) font size: (int) size bold: (BOOL) bold italic: (BOOL) italic { for (int i = 0; i < 128; i++) { [self setGeneralProperty: SCI_STYLESETFONT parameter: i value: (sptr_t)[font UTF8String]]; [self setGeneralProperty: SCI_STYLESETSIZE parameter: i value: size]; [self setGeneralProperty: SCI_STYLESETBOLD parameter: i value: bold]; [self setGeneralProperty: SCI_STYLESETITALIC parameter: i value: italic]; } } //-------------------------------------------------------------------------------------------------- @end scintilla/cocoa/InfoBar.mm0000644000175000017500000003330412477041066014451 0ustar neilneil /** * Scintilla source code edit control * InfoBar.mm - Implements special info bar with zoom info, caret position etc. to be used with * ScintillaView. * * Mike Lischke * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import "InfoBar.h" //-------------------------------------------------------------------------------------------------- @implementation VerticallyCenteredTextFieldCell // Inspired by code from Daniel Jalkut, Red Sweater Software. - (NSRect) drawingRectForBounds: (NSRect) theRect { // Get the parent's idea of where we should draw NSRect newRect = [super drawingRectForBounds: theRect]; // When the text field is being edited or selected, we have to turn off the magic because it // screws up the configuration of the field editor. We sneak around this by intercepting // selectWithFrame and editWithFrame and sneaking a reduced, centered rect in at the last minute. if (mIsEditingOrSelecting == NO) { // Get our ideal size for current text NSSize textSize = [self cellSizeForBounds: theRect]; // Center that in the proposed rect CGFloat heightDelta = newRect.size.height - textSize.height; if (heightDelta > 0) { newRect.size.height -= heightDelta; newRect.origin.y += ceil(heightDelta / 2); } } return newRect; } //-------------------------------------------------------------------------------------------------- - (void) selectWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj delegate:(id) anObject start: (NSInteger) selStart length: (NSInteger) selLength { aRect = [self drawingRectForBounds: aRect]; mIsEditingOrSelecting = YES; [super selectWithFrame: aRect inView: controlView editor: textObj delegate: anObject start: selStart length: selLength]; mIsEditingOrSelecting = NO; } //-------------------------------------------------------------------------------------------------- - (void) editWithFrame: (NSRect) aRect inView: (NSView*) controlView editor: (NSText*) textObj delegate: (id) anObject event: (NSEvent*) theEvent { aRect = [self drawingRectForBounds: aRect]; mIsEditingOrSelecting = YES; [super editWithFrame: aRect inView: controlView editor: textObj delegate: anObject event: theEvent]; mIsEditingOrSelecting = NO; } @end //-------------------------------------------------------------------------------------------------- @implementation InfoBar - (id) initWithFrame: (NSRect) frame { self = [super initWithFrame: frame]; if (self) { NSBundle* bundle = [NSBundle bundleForClass: [InfoBar class]]; NSString* path = [bundle pathForResource: @"info_bar_bg" ofType: @"tiff" inDirectory: nil]; mBackground = [[NSImage alloc] initWithContentsOfFile: path]; if (![mBackground isValid]) NSLog(@"Background image for info bar is invalid."); mScaleFactor = 1.0; mCurrentCaretX = 0; mCurrentCaretY = 0; [self createItems]; } return self; } //-------------------------------------------------------------------------------------------------- /** * Called by a connected component (usually the info bar) if something changed there. * * @param type The type of the notification. * @param message Carries the new status message if the type is a status message change. * @param location Carries the new location (e.g. caret) if the type is a caret change or similar type. * @param value Carries the new zoom value if the type is a zoom change. */ - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location value: (float) value { switch (type) { case IBNZoomChanged: [self setScaleFactor: value adjustPopup: YES]; break; case IBNCaretChanged: [self setCaretPosition: location]; break; case IBNStatusChanged: [mStatusTextLabel setStringValue: message]; break; } } //-------------------------------------------------------------------------------------------------- /** * Used to set a protocol object we can use to send change notifications to. */ - (void) setCallback: (id ) callback { mCallback = callback; } //-------------------------------------------------------------------------------------------------- static NSString *DefaultScaleMenuLabels[] = { @"20%", @"30%", @"50%", @"75%", @"100%", @"130%", @"160%", @"200%", @"250%", @"300%" }; static float DefaultScaleMenuFactors[] = { 0.2f, 0.3f, 0.5f, 0.75f, 1.0f, 1.3f, 1.6f, 2.0f, 2.5f, 3.0f }; static unsigned DefaultScaleMenuSelectedItemIndex = 4; static float BarFontSize = 10.0; - (void) createItems { // 1) The zoom popup. unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuLabels) / sizeof(NSString *); // Create the popup button. mZoomPopup = [[NSPopUpButton allocWithZone:[self zone]] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0) pullsDown: NO]; // No border or background please. [[mZoomPopup cell] setBordered: NO]; [[mZoomPopup cell] setArrowPosition: NSPopUpArrowAtBottom]; // Fill it. for (unsigned count = 0; count < numberOfDefaultItems; count++) { [mZoomPopup addItemWithTitle: NSLocalizedStringFromTable(DefaultScaleMenuLabels[count], @"ZoomValues", nil)]; id currentItem = [mZoomPopup itemAtIndex: count]; if (DefaultScaleMenuFactors[count] != 0.0) [currentItem setRepresentedObject: [NSNumber numberWithFloat: DefaultScaleMenuFactors[count]]]; } [mZoomPopup selectItemAtIndex: DefaultScaleMenuSelectedItemIndex]; // Hook it up. [mZoomPopup setTarget: self]; [mZoomPopup setAction: @selector(zoomItemAction:)]; // Set a suitable font. [mZoomPopup setFont: [NSFont menuBarFontOfSize: BarFontSize]]; // Make sure the popup is big enough to fit the cells. [mZoomPopup sizeToFit]; // Don't let it become first responder [mZoomPopup setRefusesFirstResponder: YES]; // put it in the scrollview. [self addSubview: mZoomPopup]; [mZoomPopup release]; // 2) The caret position label. Class oldCellClass = [NSTextField cellClass]; [NSTextField setCellClass: [VerticallyCenteredTextFieldCell class]]; mCaretPositionLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 50.0, 1.0)]; [mCaretPositionLabel setBezeled: NO]; [mCaretPositionLabel setBordered: NO]; [mCaretPositionLabel setEditable: NO]; [mCaretPositionLabel setSelectable: NO]; [mCaretPositionLabel setDrawsBackground: NO]; [mCaretPositionLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]]; NSTextFieldCell* cell = [mCaretPositionLabel cell]; [cell setPlaceholderString: @"0:0"]; [cell setAlignment: NSCenterTextAlignment]; [self addSubview: mCaretPositionLabel]; [mCaretPositionLabel release]; // 3) The status text. mStatusTextLabel = [[NSTextField alloc] initWithFrame: NSMakeRect(0.0, 0.0, 1.0, 1.0)]; [mStatusTextLabel setBezeled: NO]; [mStatusTextLabel setBordered: NO]; [mStatusTextLabel setEditable: NO]; [mStatusTextLabel setSelectable: NO]; [mStatusTextLabel setDrawsBackground: NO]; [mStatusTextLabel setFont: [NSFont menuBarFontOfSize: BarFontSize]]; cell = [mStatusTextLabel cell]; [cell setPlaceholderString: @""]; [self addSubview: mStatusTextLabel]; [mStatusTextLabel release]; // Restore original cell class so that everything else doesn't get broken [NSTextField setCellClass: oldCellClass]; } //-------------------------------------------------------------------------------------------------- - (void) dealloc { [mBackground release]; [super dealloc]; } //-------------------------------------------------------------------------------------------------- /** * Fill the background. */ - (void) drawRect: (NSRect) rect { // Since the background is seamless, we don't need to take care for the proper offset. // Simply tile the background over the invalid rectangle. NSPoint target = {rect.origin.x, 0}; while (target.x < rect.origin.x + rect.size.width) { [mBackground drawAtPoint: target fromRect: NSZeroRect operation: NSCompositeCopy fraction: 1]; target.x += mBackground.size.width; } // Draw separator lines between items. NSRect verticalLineRect; CGFloat component = 190.0 / 255.0; NSColor* lineColor = [NSColor colorWithDeviceRed: component green: component blue: component alpha: 1]; if (mDisplayMask & IBShowZoom) { verticalLineRect = [mZoomPopup frame]; verticalLineRect.origin.x += verticalLineRect.size.width + 1.0; verticalLineRect.size.width = 1.0; if (NSIntersectsRect(rect, verticalLineRect)) { [lineColor set]; NSRectFill(verticalLineRect); } } if (mDisplayMask & IBShowCaretPosition) { verticalLineRect = [mCaretPositionLabel frame]; verticalLineRect.origin.x += verticalLineRect.size.width + 1.0; verticalLineRect.size.width = 1.0; if (NSIntersectsRect(rect, verticalLineRect)) { [lineColor set]; NSRectFill(verticalLineRect); } } } //-------------------------------------------------------------------------------------------------- - (BOOL) isOpaque { return YES; } //-------------------------------------------------------------------------------------------------- /** * Used to reposition our content depending on the size of the view. */ - (void) setFrame: (NSRect) newFrame { [super setFrame: newFrame]; [self positionSubViews]; } //-------------------------------------------------------------------------------------------------- - (void) positionSubViews { NSRect currentBounds = {{0, 0}, {0, [self frame].size.height}}; if (mDisplayMask & IBShowZoom) { [mZoomPopup setHidden: NO]; currentBounds.size.width = [mZoomPopup frame].size.width; [mZoomPopup setFrame: currentBounds]; currentBounds.origin.x += currentBounds.size.width + 1; // Add 1 for the separator. } else [mZoomPopup setHidden: YES]; if (mDisplayMask & IBShowCaretPosition) { [mCaretPositionLabel setHidden: NO]; currentBounds.size.width = [mCaretPositionLabel frame].size.width; [mCaretPositionLabel setFrame: currentBounds]; currentBounds.origin.x += currentBounds.size.width + 1; } else [mCaretPositionLabel setHidden: YES]; if (mDisplayMask & IBShowStatusText) { // The status text always takes the rest of the available space. [mStatusTextLabel setHidden: NO]; currentBounds.size.width = [self frame].size.width - currentBounds.origin.x; [mStatusTextLabel setFrame: currentBounds]; } else [mStatusTextLabel setHidden: YES]; } //-------------------------------------------------------------------------------------------------- /** * Used to switch the visible parts of the info bar. * * @param display Bitwise ORed IBDisplay values which determine what to show on the bar. */ - (void) setDisplay: (IBDisplay) display { if (mDisplayMask != display) { mDisplayMask = display; [self positionSubViews]; [self needsDisplay]; } } //-------------------------------------------------------------------------------------------------- /** * Handler for selection changes in the zoom menu. */ - (void) zoomItemAction: (id) sender { NSNumber* selectedFactorObject = [[sender selectedCell] representedObject]; if (selectedFactorObject == nil) { NSLog(@"Scale popup action: setting arbitrary zoom factors is not yet supported."); return; } else { [self setScaleFactor: [selectedFactorObject floatValue] adjustPopup: NO]; } } //-------------------------------------------------------------------------------------------------- - (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag { if (mScaleFactor != newScaleFactor) { mScaleFactor = newScaleFactor; if (flag) { unsigned count = 0; unsigned numberOfDefaultItems = sizeof(DefaultScaleMenuFactors) / sizeof(float); // We only work with some preset zoom values. If the given value does not correspond // to one then show no selection. while (count < numberOfDefaultItems && (fabs(newScaleFactor - DefaultScaleMenuFactors[count]) > 0.07)) count++; if (count == numberOfDefaultItems) [mZoomPopup selectItemAtIndex: -1]; else { [mZoomPopup selectItemAtIndex: count]; // Set scale factor to found preset value if it comes close. mScaleFactor = DefaultScaleMenuFactors[count]; } } else { // Internally set. Notify owner. [mCallback notify: IBNZoomChanged message: nil location: NSZeroPoint value: newScaleFactor]; } } } //-------------------------------------------------------------------------------------------------- /** * Called from the notification method to update the caret position display. */ - (void) setCaretPosition: (NSPoint) position { // Make the position one-based. int newX = (int) position.x + 1; int newY = (int) position.y + 1; if (mCurrentCaretX != newX || mCurrentCaretY != newY) { mCurrentCaretX = newX; mCurrentCaretY = newY; [mCaretPositionLabel setStringValue: [NSString stringWithFormat: @"%d:%d", newX, newY]]; } } //-------------------------------------------------------------------------------------------------- /** * Makes the bar resize to the smallest width that can accommodate the currently enabled items. */ - (void) sizeToFit { NSRect frame = [self frame]; frame.size.width = 0; if (mDisplayMask & IBShowZoom) frame.size.width += [mZoomPopup frame].size.width; if (mDisplayMask & IBShowCaretPosition) frame.size.width += [mCaretPositionLabel frame].size.width; if (mDisplayMask & IBShowStatusText) frame.size.width += [mStatusTextLabel frame].size.width; [self setFrame: frame]; } @end scintilla/cocoa/QuartzTextLayout.h0000644000175000017500000000442312477041066016300 0ustar neilneil/* * QuartzTextLayout.h * * Original Code by Evan Jones on Wed Oct 02 2002. * Contributors: * Shane Caraveo, ActiveState * Bernd Paradies, Adobe * */ #ifndef _QUARTZ_TEXT_LAYOUT_H #define _QUARTZ_TEXT_LAYOUT_H #include #include "QuartzTextStyle.h" class QuartzTextLayout { public: /** Create a text layout for drawing on the specified context. */ explicit QuartzTextLayout( CGContextRef context ) { mString = NULL; mLine = NULL; stringLength = 0; setContext(context); } ~QuartzTextLayout() { if ( mString != NULL ) { CFRelease(mString); mString = NULL; } if ( mLine != NULL ) { CFRelease(mLine); mLine = NULL; } } inline void setText( const UInt8* buffer, size_t byteLength, CFStringEncoding encoding, const QuartzTextStyle& r ) { CFStringRef str = CFStringCreateWithBytes( NULL, buffer, byteLength, encoding, false ); if (!str) return; stringLength = CFStringGetLength(str); CFMutableDictionaryRef stringAttribs = r.getCTStyle(); if (mString != NULL) CFRelease(mString); mString = ::CFAttributedStringCreate(NULL, str, stringAttribs); if (mLine != NULL) CFRelease(mLine); mLine = ::CTLineCreateWithAttributedString(mString); CFRelease( str ); } /** Draw the text layout into the current CGContext at the specified position. * @param x The x axis position to draw the baseline in the current CGContext. * @param y The y axis position to draw the baseline in the current CGContext. */ void draw( float x, float y ) { if (mLine == NULL) return; ::CGContextSetTextMatrix(gc, CGAffineTransformMakeScale(1.0, -1.0)); // Set the text drawing position. ::CGContextSetTextPosition(gc, x, y); // And finally, draw! ::CTLineDraw(mLine, gc); } float MeasureStringWidth() { if (mLine == NULL) return 0.0f; return static_cast(::CTLineGetTypographicBounds(mLine, NULL, NULL, NULL)); } CTLineRef getCTLine() { return mLine; } CFIndex getStringLength() { return stringLength; } inline void setContext (CGContextRef context) { gc = context; } private: CGContextRef gc; CFAttributedStringRef mString; CTLineRef mLine; CFIndex stringLength; }; #endif scintilla/cocoa/ScintillaFramework/0000755000175000017500000000000012075650364016374 5ustar neilneilscintilla/cocoa/ScintillaFramework/Info.plist0000644000175000017500000000141512075650364020345 0ustar neilneil CFBundleDevelopmentRegion English CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIconFile CFBundleIdentifier com.sun.${PRODUCT_NAME:identifier} CFBundleInfoDictionaryVersion 6.0 CFBundleName ${PRODUCT_NAME} CFBundlePackageType FMWK CFBundleSignature ???? CFBundleVersion 1.0 NSPrincipalClass scintilla/cocoa/ScintillaFramework/English.lproj/0000755000175000017500000000000012075650364021112 5ustar neilneilscintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings0000644000175000017500000000013412075650364024432 0ustar neilneil/* Localized versions of Info.plist keys */ scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/0000755000175000017500000000000012557522743024174 5ustar neilneilscintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj0000644000175000017500000032640012557522743027255 0ustar neilneil// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 1100F1EB178E393200105727 /* CaseConvert.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E6178E393200105727 /* CaseConvert.cxx */; }; 1100F1EC178E393200105727 /* CaseConvert.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E7178E393200105727 /* CaseConvert.h */; }; 1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1100F1E8178E393200105727 /* CaseFolder.cxx */; }; 1100F1EE178E393200105727 /* CaseFolder.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1E9178E393200105727 /* CaseFolder.h */; }; 1100F1EF178E393200105727 /* UnicodeFromUTF8.h in Headers */ = {isa = PBXBuildFile; fileRef = 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */; }; 1102C31C169FB49300DC16AB /* LexLaTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */; }; 11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11126B8114CD3A6200803C49 /* LexAVS.cxx */; }; 1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1114D6CA1602A951001DC345 /* LexPO.cxx */; }; 114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */; }; 114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EBF11FA7526004FB6AB /* LexAda.cxx */; }; 114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */; }; 114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC111FA7526004FB6AB /* LexAsm.cxx */; }; 114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */; }; 114B6F1211FA7526004FB6AB /* LexASY.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC311FA7526004FB6AB /* LexASY.cxx */; }; 114B6F1311FA7526004FB6AB /* LexAU3.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC411FA7526004FB6AB /* LexAU3.cxx */; }; 114B6F1411FA7526004FB6AB /* LexAVE.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC511FA7526004FB6AB /* LexAVE.cxx */; }; 114B6F1511FA7526004FB6AB /* LexBaan.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC611FA7526004FB6AB /* LexBaan.cxx */; }; 114B6F1611FA7526004FB6AB /* LexBash.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC711FA7526004FB6AB /* LexBash.cxx */; }; 114B6F1711FA7526004FB6AB /* LexBasic.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC811FA7526004FB6AB /* LexBasic.cxx */; }; 114B6F1811FA7526004FB6AB /* LexBullant.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EC911FA7526004FB6AB /* LexBullant.cxx */; }; 114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */; }; 114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */; }; 114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */; }; 114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */; }; 114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECE11FA7526004FB6AB /* LexConf.cxx */; }; 114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */; }; 114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */; }; 114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED111FA7526004FB6AB /* LexCsound.cxx */; }; 114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED211FA7526004FB6AB /* LexCSS.cxx */; }; 114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED311FA7526004FB6AB /* LexD.cxx */; }; 114B6F2311FA7526004FB6AB /* LexEiffel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */; }; 114B6F2411FA7526004FB6AB /* LexErlang.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED511FA7526004FB6AB /* LexErlang.cxx */; }; 114B6F2511FA7526004FB6AB /* LexEScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED611FA7526004FB6AB /* LexEScript.cxx */; }; 114B6F2611FA7526004FB6AB /* LexFlagship.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */; }; 114B6F2711FA7526004FB6AB /* LexForth.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED811FA7526004FB6AB /* LexForth.cxx */; }; 114B6F2811FA7526004FB6AB /* LexFortran.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6ED911FA7526004FB6AB /* LexFortran.cxx */; }; 114B6F2911FA7526004FB6AB /* LexGAP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */; }; 114B6F2A11FA7526004FB6AB /* LexGui4Cli.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */; }; 114B6F2B11FA7526004FB6AB /* LexHaskell.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */; }; 114B6F2C11FA7526004FB6AB /* LexHTML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */; }; 114B6F2D11FA7526004FB6AB /* LexInno.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDE11FA7526004FB6AB /* LexInno.cxx */; }; 114B6F2E11FA7526004FB6AB /* LexKix.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EDF11FA7526004FB6AB /* LexKix.cxx */; }; 114B6F2F11FA7526004FB6AB /* LexLisp.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE011FA7526004FB6AB /* LexLisp.cxx */; }; 114B6F3011FA7526004FB6AB /* LexLout.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE111FA7526004FB6AB /* LexLout.cxx */; }; 114B6F3111FA7526004FB6AB /* LexLua.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE211FA7526004FB6AB /* LexLua.cxx */; }; 114B6F3211FA7526004FB6AB /* LexMagik.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE311FA7526004FB6AB /* LexMagik.cxx */; }; 114B6F3311FA7526004FB6AB /* LexMarkdown.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */; }; 114B6F3411FA7526004FB6AB /* LexMatlab.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */; }; 114B6F3511FA7526004FB6AB /* LexMetapost.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */; }; 114B6F3611FA7526004FB6AB /* LexMMIXAL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */; }; 114B6F3711FA7526004FB6AB /* LexMPT.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE811FA7526004FB6AB /* LexMPT.cxx */; }; 114B6F3811FA7526004FB6AB /* LexMSSQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */; }; 114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */; }; 114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */; }; 114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */; }; 114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EED11FA7526004FB6AB /* LexOpal.cxx */; }; 114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */; }; 114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF011FA7526004FB6AB /* LexPB.cxx */; }; 114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF111FA7526004FB6AB /* LexPerl.cxx */; }; 114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF211FA7526004FB6AB /* LexPLM.cxx */; }; 114B6F4211FA7526004FB6AB /* LexPOV.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF311FA7526004FB6AB /* LexPOV.cxx */; }; 114B6F4311FA7526004FB6AB /* LexPowerPro.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */; }; 114B6F4411FA7526004FB6AB /* LexPowerShell.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */; }; 114B6F4511FA7526004FB6AB /* LexProgress.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF611FA7526004FB6AB /* LexProgress.cxx */; }; 114B6F4611FA7526004FB6AB /* LexPS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF711FA7526004FB6AB /* LexPS.cxx */; }; 114B6F4711FA7526004FB6AB /* LexPython.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF811FA7526004FB6AB /* LexPython.cxx */; }; 114B6F4811FA7526004FB6AB /* LexR.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EF911FA7526004FB6AB /* LexR.cxx */; }; 114B6F4911FA7526004FB6AB /* LexRebol.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */; }; 114B6F4A11FA7526004FB6AB /* LexRuby.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */; }; 114B6F4B11FA7526004FB6AB /* LexScriptol.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */; }; 114B6F4C11FA7526004FB6AB /* LexSmalltalk.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */; }; 114B6F4D11FA7526004FB6AB /* LexSML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFE11FA7526004FB6AB /* LexSML.cxx */; }; 114B6F4E11FA7526004FB6AB /* LexSorcus.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */; }; 114B6F4F11FA7526004FB6AB /* LexSpecman.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */; }; 114B6F5011FA7526004FB6AB /* LexSpice.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0111FA7526004FB6AB /* LexSpice.cxx */; }; 114B6F5111FA7526004FB6AB /* LexSQL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0211FA7526004FB6AB /* LexSQL.cxx */; }; 114B6F5211FA7526004FB6AB /* LexTACL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0311FA7526004FB6AB /* LexTACL.cxx */; }; 114B6F5311FA7526004FB6AB /* LexTADS3.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */; }; 114B6F5411FA7526004FB6AB /* LexTAL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0511FA7526004FB6AB /* LexTAL.cxx */; }; 114B6F5511FA7526004FB6AB /* LexTCL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0611FA7526004FB6AB /* LexTCL.cxx */; }; 114B6F5611FA7526004FB6AB /* LexTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0711FA7526004FB6AB /* LexTeX.cxx */; }; 114B6F5711FA7526004FB6AB /* LexTxt2tags.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */; }; 114B6F5811FA7526004FB6AB /* LexVB.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0911FA7526004FB6AB /* LexVB.cxx */; }; 114B6F5911FA7526004FB6AB /* LexVerilog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */; }; 114B6F5A11FA7526004FB6AB /* LexVHDL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */; }; 114B6F5B11FA7526004FB6AB /* LexYAML.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */; }; 114B6F7711FA7598004FB6AB /* AutoComplete.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */; }; 114B6F7811FA7598004FB6AB /* CallTip.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6111FA7597004FB6AB /* CallTip.cxx */; }; 114B6F7911FA7598004FB6AB /* Catalogue.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6211FA7597004FB6AB /* Catalogue.cxx */; }; 114B6F7A11FA7598004FB6AB /* CellBuffer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */; }; 114B6F7B11FA7598004FB6AB /* CharClassify.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6411FA7597004FB6AB /* CharClassify.cxx */; }; 114B6F7C11FA7598004FB6AB /* ContractionState.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6511FA7597004FB6AB /* ContractionState.cxx */; }; 114B6F7D11FA7598004FB6AB /* Decoration.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6611FA7597004FB6AB /* Decoration.cxx */; }; 114B6F7E11FA7598004FB6AB /* Document.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6711FA7597004FB6AB /* Document.cxx */; }; 114B6F7F11FA7598004FB6AB /* Editor.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6811FA7597004FB6AB /* Editor.cxx */; }; 114B6F8011FA7598004FB6AB /* ExternalLexer.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */; }; 114B6F8111FA7598004FB6AB /* Indicator.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6A11FA7598004FB6AB /* Indicator.cxx */; }; 114B6F8211FA7598004FB6AB /* KeyMap.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */; }; 114B6F8311FA7598004FB6AB /* LineMarker.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */; }; 114B6F8411FA7598004FB6AB /* PerLine.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6D11FA7598004FB6AB /* PerLine.cxx */; }; 114B6F8511FA7598004FB6AB /* PositionCache.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */; }; 114B6F8611FA7598004FB6AB /* RESearch.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F6F11FA7598004FB6AB /* RESearch.cxx */; }; 114B6F8711FA7598004FB6AB /* RunStyles.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7011FA7598004FB6AB /* RunStyles.cxx */; }; 114B6F8811FA7598004FB6AB /* ScintillaBase.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */; }; 114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7211FA7598004FB6AB /* Selection.cxx */; }; 114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7311FA7598004FB6AB /* Style.cxx */; }; 114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7411FA7598004FB6AB /* UniConversion.cxx */; }; 114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */; }; 114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F7611FA7598004FB6AB /* XPM.cxx */; }; 114B6F9711FA75BE004FB6AB /* Accessor.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */; }; 114B6F9811FA75BE004FB6AB /* CharacterSet.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */; }; 114B6F9911FA75BE004FB6AB /* LexerBase.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */; }; 114B6F9A11FA75BE004FB6AB /* LexerModule.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */; }; 114B6F9B11FA75BE004FB6AB /* LexerNoExceptions.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */; }; 114B6F9C11FA75BE004FB6AB /* LexerSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */; }; 114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */; }; 114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */; }; 114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 114B6F9611FA75BE004FB6AB /* WordList.cxx */; }; 114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA011FA75DB004FB6AB /* ILexer.h */; }; 114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA211FA7623004FB6AB /* AutoComplete.h */; }; 114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA311FA7623004FB6AB /* CallTip.h */; }; 114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA411FA7623004FB6AB /* Catalogue.h */; }; 114B6FC011FA7623004FB6AB /* CellBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA511FA7623004FB6AB /* CellBuffer.h */; }; 114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA611FA7623004FB6AB /* CharClassify.h */; }; 114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA711FA7623004FB6AB /* ContractionState.h */; }; 114B6FC311FA7623004FB6AB /* Decoration.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA811FA7623004FB6AB /* Decoration.h */; }; 114B6FC411FA7623004FB6AB /* Document.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FA911FA7623004FB6AB /* Document.h */; }; 114B6FC511FA7623004FB6AB /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAA11FA7623004FB6AB /* Editor.h */; }; 114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */; }; 114B6FC711FA7623004FB6AB /* FontQuality.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAC11FA7623004FB6AB /* FontQuality.h */; }; 114B6FC811FA7623004FB6AB /* Indicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAD11FA7623004FB6AB /* Indicator.h */; }; 114B6FC911FA7623004FB6AB /* KeyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAE11FA7623004FB6AB /* KeyMap.h */; }; 114B6FCA11FA7623004FB6AB /* LineMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FAF11FA7623004FB6AB /* LineMarker.h */; }; 114B6FCB11FA7623004FB6AB /* Partitioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB011FA7623004FB6AB /* Partitioning.h */; }; 114B6FCC11FA7623004FB6AB /* PerLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB111FA7623004FB6AB /* PerLine.h */; }; 114B6FCD11FA7623004FB6AB /* PositionCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB211FA7623004FB6AB /* PositionCache.h */; }; 114B6FCE11FA7623004FB6AB /* RESearch.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB311FA7623004FB6AB /* RESearch.h */; }; 114B6FCF11FA7623004FB6AB /* RunStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB411FA7623004FB6AB /* RunStyles.h */; }; 114B6FD011FA7623004FB6AB /* ScintillaBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB511FA7623004FB6AB /* ScintillaBase.h */; }; 114B6FD111FA7623004FB6AB /* Selection.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB611FA7623004FB6AB /* Selection.h */; }; 114B6FD211FA7623004FB6AB /* SplitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB711FA7623004FB6AB /* SplitVector.h */; }; 114B6FD311FA7623004FB6AB /* Style.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FB811FA7623004FB6AB /* Style.h */; }; 114B6FD511FA7623004FB6AB /* UniConversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBA11FA7623004FB6AB /* UniConversion.h */; }; 114B6FD611FA7623004FB6AB /* ViewStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBB11FA7623004FB6AB /* ViewStyle.h */; }; 114B6FD711FA7623004FB6AB /* XPM.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FBC11FA7623004FB6AB /* XPM.h */; }; 114B6FE311FA7645004FB6AB /* Accessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FD811FA7645004FB6AB /* Accessor.h */; }; 114B6FE411FA7645004FB6AB /* CharacterSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FD911FA7645004FB6AB /* CharacterSet.h */; }; 114B6FE511FA7645004FB6AB /* LexAccessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDA11FA7645004FB6AB /* LexAccessor.h */; }; 114B6FE611FA7645004FB6AB /* LexerBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDB11FA7645004FB6AB /* LexerBase.h */; }; 114B6FE711FA7645004FB6AB /* LexerModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDC11FA7645004FB6AB /* LexerModule.h */; }; 114B6FE811FA7645004FB6AB /* LexerNoExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */; }; 114B6FE911FA7645004FB6AB /* LexerSimple.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDE11FA7645004FB6AB /* LexerSimple.h */; }; 114B6FEA11FA7645004FB6AB /* OptionSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FDF11FA7645004FB6AB /* OptionSet.h */; }; 114B6FEB11FA7645004FB6AB /* PropSetSimple.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE011FA7645004FB6AB /* PropSetSimple.h */; }; 114B6FEC11FA7645004FB6AB /* StyleContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE111FA7645004FB6AB /* StyleContext.h */; }; 114B6FED11FA7645004FB6AB /* WordList.h in Headers */ = {isa = PBXBuildFile; fileRef = 114B6FE211FA7645004FB6AB /* WordList.h */; }; 1152A77315313E58000D4E1A /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1152A77215313E58000D4E1A /* QuartzCore.framework */; }; 11594BE9155B91DF0099E1FA /* LexOScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11594BE7155B91DF0099E1FA /* LexOScript.cxx */; }; 11594BEA155B91DF0099E1FA /* LexVisualProlog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */; }; 1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 1160E0371803651C00BCEBCB /* LexRust.cxx */; }; 117ACE9114A29A1E002876F9 /* LexTCMD.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */; }; 119FF1BF13C9D1820007CE42 /* QuartzTextStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */; }; 11A0A8A1148602DF0018D143 /* LexCoffeeScript.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */; }; 11BB124D12FF9C1300F6BCF7 /* LexModula.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */; }; 11BEB6A214EF189600BDE92A /* LexECL.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11BEB6A114EF189600BDE92A /* LexECL.cxx */; }; 11F35FDB12AEFAF100F0236D /* LexA68k.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */; }; 11FBA39D17817DA00048C071 /* CharacterCategory.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */; }; 11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 11FBA39C17817DA00048C071 /* CharacterCategory.h */; }; 11FDAEB7174E1A9800FA161B /* LexSTTXT.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */; }; 11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */; }; 11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */; }; 2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59D0FC168A100E85C33 /* InfoBar.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A30FC168A100E85C33 /* ScintillaView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2744E5B20FC168C500E85C33 /* InfoBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5AD0FC168C500E85C33 /* InfoBar.mm */; }; 2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */; }; 2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */; }; 2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2744E5B10FC168C500E85C33 /* ScintillaView.mm */; }; 2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59E0FC168A100E85C33 /* PlatCocoa.h */; }; 2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4850FC1678600E85C33 /* Platform.h */; }; 2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4870FC1678600E85C33 /* SciLexer.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E4880FC1678600E85C33 /* Scintilla.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */; }; 2791F3E30FC1A3AE009DBCF9 /* QuartzTextLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */; }; 2791F3E40FC1A3AE009DBCF9 /* QuartzTextStyleAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */; }; 27FEF4540FC1B413005E115A /* info_bar_bg.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4510FC1B413005E115A /* info_bar_bg.png */; }; 27FEF4550FC1B413005E115A /* mac_cursor_busy.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */; }; 27FEF4560FC1B413005E115A /* mac_cursor_flipped.png in Resources */ = {isa = PBXBuildFile; fileRef = 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */; }; 280056FB188DDD2C00F200AE /* SparseState.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F8188DDD2C00F200AE /* SparseState.h */; }; 280056FC188DDD2C00F200AE /* StringCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056F9188DDD2C00F200AE /* StringCopy.h */; }; 280056FD188DDD2C00F200AE /* SubStyles.h in Headers */ = {isa = PBXBuildFile; fileRef = 280056FA188DDD2C00F200AE /* SubStyles.h */; }; 28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28064A04190F12E100E6E47F /* LexDMIS.cxx */; }; 28A067111A36B42600B4966A /* LexHex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A067101A36B42600B4966A /* LexHex.cxx */; }; 28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */; }; 28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */; }; 28A1DD53196BE0CA006EFCDD /* MarginView.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */; }; 28A1DD57196BE0ED006EFCDD /* EditModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD54196BE0ED006EFCDD /* EditModel.h */; }; 28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD55196BE0ED006EFCDD /* EditView.h */; }; 28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */ = {isa = PBXBuildFile; fileRef = 28A1DD56196BE0ED006EFCDD /* MarginView.h */; }; 28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28A7D6041995E47D0062D204 /* LexRegistry.cxx */; }; 28B6470C1B54C0720009DC49 /* LexBatch.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B647061B54C0720009DC49 /* LexBatch.cxx */; }; 28B6470D1B54C0720009DC49 /* LexDiff.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B647071B54C0720009DC49 /* LexDiff.cxx */; }; 28B6470E1B54C0720009DC49 /* LexErrorList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B647081B54C0720009DC49 /* LexErrorList.cxx */; }; 28B6470F1B54C0720009DC49 /* LexMake.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B647091B54C0720009DC49 /* LexMake.cxx */; }; 28B647101B54C0720009DC49 /* LexNull.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B6470A1B54C0720009DC49 /* LexNull.cxx */; }; 28B647111B54C0720009DC49 /* LexProps.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28B6470B1B54C0720009DC49 /* LexProps.cxx */; }; 28D516D81830FFCA0047C93D /* info_bar_bg@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */; }; 28D516D91830FFCA0047C93D /* mac_cursor_busy@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */; }; 28D516DA1830FFCA0047C93D /* mac_cursor_flipped@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */; }; 28FDA42119B6967B00BE27D7 /* LexBibTeX.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */; }; 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; }; 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 1100F1E6178E393200105727 /* CaseConvert.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseConvert.cxx; path = ../../src/CaseConvert.cxx; sourceTree = ""; }; 1100F1E7178E393200105727 /* CaseConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseConvert.h; path = ../../src/CaseConvert.h; sourceTree = ""; }; 1100F1E8178E393200105727 /* CaseFolder.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CaseFolder.cxx; path = ../../src/CaseFolder.cxx; sourceTree = ""; }; 1100F1E9178E393200105727 /* CaseFolder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CaseFolder.h; path = ../../src/CaseFolder.h; sourceTree = ""; }; 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnicodeFromUTF8.h; path = ../../src/UnicodeFromUTF8.h; sourceTree = ""; }; 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLaTeX.cxx; path = ../../lexers/LexLaTeX.cxx; sourceTree = ""; }; 11126B8114CD3A6200803C49 /* LexAVS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVS.cxx; path = ../../lexers/LexAVS.cxx; sourceTree = ""; }; 1114D6CA1602A951001DC345 /* LexPO.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPO.cxx; path = ../../lexers/LexPO.cxx; sourceTree = ""; }; 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAbaqus.cxx; path = ../../lexers/LexAbaqus.cxx; sourceTree = SOURCE_ROOT; }; 114B6EBF11FA7526004FB6AB /* LexAda.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAda.cxx; path = ../../lexers/LexAda.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAPDL.cxx; path = ../../lexers/LexAPDL.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC111FA7526004FB6AB /* LexAsm.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsm.cxx; path = ../../lexers/LexAsm.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAsn1.cxx; path = ../../lexers/LexAsn1.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC311FA7526004FB6AB /* LexASY.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexASY.cxx; path = ../../lexers/LexASY.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC411FA7526004FB6AB /* LexAU3.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAU3.cxx; path = ../../lexers/LexAU3.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC511FA7526004FB6AB /* LexAVE.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexAVE.cxx; path = ../../lexers/LexAVE.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC611FA7526004FB6AB /* LexBaan.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBaan.cxx; path = ../../lexers/LexBaan.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC711FA7526004FB6AB /* LexBash.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBash.cxx; path = ../../lexers/LexBash.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC811FA7526004FB6AB /* LexBasic.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBasic.cxx; path = ../../lexers/LexBasic.cxx; sourceTree = SOURCE_ROOT; }; 114B6EC911FA7526004FB6AB /* LexBullant.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBullant.cxx; path = ../../lexers/LexBullant.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCaml.cxx; path = ../../lexers/LexCaml.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCLW.cxx; path = ../../lexers/LexCLW.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCmake.cxx; path = ../../lexers/LexCmake.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCOBOL.cxx; path = ../../lexers/LexCOBOL.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECE11FA7526004FB6AB /* LexConf.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexConf.cxx; path = ../../lexers/LexConf.cxx; sourceTree = SOURCE_ROOT; }; 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCPP.cxx; path = ../../lexers/LexCPP.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCrontab.cxx; path = ../../lexers/LexCrontab.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED111FA7526004FB6AB /* LexCsound.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCsound.cxx; path = ../../lexers/LexCsound.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED211FA7526004FB6AB /* LexCSS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCSS.cxx; path = ../../lexers/LexCSS.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED311FA7526004FB6AB /* LexD.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexD.cxx; path = ../../lexers/LexD.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexEiffel.cxx; path = ../../lexers/LexEiffel.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED511FA7526004FB6AB /* LexErlang.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexErlang.cxx; path = ../../lexers/LexErlang.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED611FA7526004FB6AB /* LexEScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexEScript.cxx; path = ../../lexers/LexEScript.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFlagship.cxx; path = ../../lexers/LexFlagship.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED811FA7526004FB6AB /* LexForth.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexForth.cxx; path = ../../lexers/LexForth.cxx; sourceTree = SOURCE_ROOT; }; 114B6ED911FA7526004FB6AB /* LexFortran.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexFortran.cxx; path = ../../lexers/LexFortran.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexGAP.cxx; path = ../../lexers/LexGAP.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexGui4Cli.cxx; path = ../../lexers/LexGui4Cli.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHaskell.cxx; path = ../../lexers/LexHaskell.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHTML.cxx; path = ../../lexers/LexHTML.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDE11FA7526004FB6AB /* LexInno.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexInno.cxx; path = ../../lexers/LexInno.cxx; sourceTree = SOURCE_ROOT; }; 114B6EDF11FA7526004FB6AB /* LexKix.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKix.cxx; path = ../../lexers/LexKix.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE011FA7526004FB6AB /* LexLisp.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLisp.cxx; path = ../../lexers/LexLisp.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE111FA7526004FB6AB /* LexLout.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLout.cxx; path = ../../lexers/LexLout.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE211FA7526004FB6AB /* LexLua.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexLua.cxx; path = ../../lexers/LexLua.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE311FA7526004FB6AB /* LexMagik.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMagik.cxx; path = ../../lexers/LexMagik.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMarkdown.cxx; path = ../../lexers/LexMarkdown.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMatlab.cxx; path = ../../lexers/LexMatlab.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMetapost.cxx; path = ../../lexers/LexMetapost.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMMIXAL.cxx; path = ../../lexers/LexMMIXAL.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE811FA7526004FB6AB /* LexMPT.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMPT.cxx; path = ../../lexers/LexMPT.cxx; sourceTree = SOURCE_ROOT; }; 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMSSQL.cxx; path = ../../lexers/LexMSSQL.cxx; sourceTree = SOURCE_ROOT; }; 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMySQL.cxx; path = ../../lexers/LexMySQL.cxx; sourceTree = SOURCE_ROOT; }; 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNimrod.cxx; path = ../../lexers/LexNimrod.cxx; sourceTree = SOURCE_ROOT; }; 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNsis.cxx; path = ../../lexers/LexNsis.cxx; sourceTree = SOURCE_ROOT; }; 114B6EED11FA7526004FB6AB /* LexOpal.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOpal.cxx; path = ../../lexers/LexOpal.cxx; sourceTree = SOURCE_ROOT; }; 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPascal.cxx; path = ../../lexers/LexPascal.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF011FA7526004FB6AB /* LexPB.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPB.cxx; path = ../../lexers/LexPB.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF111FA7526004FB6AB /* LexPerl.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPerl.cxx; path = ../../lexers/LexPerl.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF211FA7526004FB6AB /* LexPLM.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPLM.cxx; path = ../../lexers/LexPLM.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF311FA7526004FB6AB /* LexPOV.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPOV.cxx; path = ../../lexers/LexPOV.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPowerPro.cxx; path = ../../lexers/LexPowerPro.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPowerShell.cxx; path = ../../lexers/LexPowerShell.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF611FA7526004FB6AB /* LexProgress.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexProgress.cxx; path = ../../lexers/LexProgress.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF711FA7526004FB6AB /* LexPS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPS.cxx; path = ../../lexers/LexPS.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF811FA7526004FB6AB /* LexPython.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexPython.cxx; path = ../../lexers/LexPython.cxx; sourceTree = SOURCE_ROOT; }; 114B6EF911FA7526004FB6AB /* LexR.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexR.cxx; path = ../../lexers/LexR.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRebol.cxx; path = ../../lexers/LexRebol.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRuby.cxx; path = ../../lexers/LexRuby.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexScriptol.cxx; path = ../../lexers/LexScriptol.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSmalltalk.cxx; path = ../../lexers/LexSmalltalk.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFE11FA7526004FB6AB /* LexSML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSML.cxx; path = ../../lexers/LexSML.cxx; sourceTree = SOURCE_ROOT; }; 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSorcus.cxx; path = ../../lexers/LexSorcus.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSpecman.cxx; path = ../../lexers/LexSpecman.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0111FA7526004FB6AB /* LexSpice.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSpice.cxx; path = ../../lexers/LexSpice.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0211FA7526004FB6AB /* LexSQL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSQL.cxx; path = ../../lexers/LexSQL.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0311FA7526004FB6AB /* LexTACL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTACL.cxx; path = ../../lexers/LexTACL.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTADS3.cxx; path = ../../lexers/LexTADS3.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0511FA7526004FB6AB /* LexTAL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTAL.cxx; path = ../../lexers/LexTAL.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0611FA7526004FB6AB /* LexTCL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTCL.cxx; path = ../../lexers/LexTCL.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0711FA7526004FB6AB /* LexTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTeX.cxx; path = ../../lexers/LexTeX.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTxt2tags.cxx; path = ../../lexers/LexTxt2tags.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0911FA7526004FB6AB /* LexVB.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVB.cxx; path = ../../lexers/LexVB.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVerilog.cxx; path = ../../lexers/LexVerilog.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVHDL.cxx; path = ../../lexers/LexVHDL.cxx; sourceTree = SOURCE_ROOT; }; 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexYAML.cxx; path = ../../lexers/LexYAML.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AutoComplete.cxx; path = ../../src/AutoComplete.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6111FA7597004FB6AB /* CallTip.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CallTip.cxx; path = ../../src/CallTip.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6211FA7597004FB6AB /* Catalogue.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Catalogue.cxx; path = ../../src/Catalogue.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CellBuffer.cxx; path = ../../src/CellBuffer.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6411FA7597004FB6AB /* CharClassify.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharClassify.cxx; path = ../../src/CharClassify.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6511FA7597004FB6AB /* ContractionState.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ContractionState.cxx; path = ../../src/ContractionState.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6611FA7597004FB6AB /* Decoration.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Decoration.cxx; path = ../../src/Decoration.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6711FA7597004FB6AB /* Document.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Document.cxx; path = ../../src/Document.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6811FA7597004FB6AB /* Editor.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Editor.cxx; path = ../../src/Editor.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExternalLexer.cxx; path = ../../src/ExternalLexer.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6A11FA7598004FB6AB /* Indicator.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Indicator.cxx; path = ../../src/Indicator.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = KeyMap.cxx; path = ../../src/KeyMap.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineMarker.cxx; path = ../../src/LineMarker.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6D11FA7598004FB6AB /* PerLine.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PerLine.cxx; path = ../../src/PerLine.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PositionCache.cxx; path = ../../src/PositionCache.cxx; sourceTree = SOURCE_ROOT; }; 114B6F6F11FA7598004FB6AB /* RESearch.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RESearch.cxx; path = ../../src/RESearch.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7011FA7598004FB6AB /* RunStyles.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RunStyles.cxx; path = ../../src/RunStyles.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScintillaBase.cxx; path = ../../src/ScintillaBase.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7211FA7598004FB6AB /* Selection.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Selection.cxx; path = ../../src/Selection.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7311FA7598004FB6AB /* Style.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Style.cxx; path = ../../src/Style.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7411FA7598004FB6AB /* UniConversion.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UniConversion.cxx; path = ../../src/UniConversion.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ViewStyle.cxx; path = ../../src/ViewStyle.cxx; sourceTree = SOURCE_ROOT; }; 114B6F7611FA7598004FB6AB /* XPM.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XPM.cxx; path = ../../src/XPM.cxx; sourceTree = SOURCE_ROOT; }; 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Accessor.cxx; path = ../../lexlib/Accessor.cxx; sourceTree = SOURCE_ROOT; }; 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterSet.cxx; path = ../../lexlib/CharacterSet.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerBase.cxx; path = ../../lexlib/LexerBase.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerModule.cxx; path = ../../lexlib/LexerModule.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerNoExceptions.cxx; path = ../../lexlib/LexerNoExceptions.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexerSimple.cxx; path = ../../lexlib/LexerSimple.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PropSetSimple.cxx; path = ../../lexlib/PropSetSimple.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleContext.cxx; path = ../../lexlib/StyleContext.cxx; sourceTree = SOURCE_ROOT; }; 114B6F9611FA75BE004FB6AB /* WordList.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WordList.cxx; path = ../../lexlib/WordList.cxx; sourceTree = SOURCE_ROOT; }; 114B6FA011FA75DB004FB6AB /* ILexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ILexer.h; path = ../../include/ILexer.h; sourceTree = SOURCE_ROOT; }; 114B6FA211FA7623004FB6AB /* AutoComplete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AutoComplete.h; path = ../../src/AutoComplete.h; sourceTree = SOURCE_ROOT; }; 114B6FA311FA7623004FB6AB /* CallTip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallTip.h; path = ../../src/CallTip.h; sourceTree = SOURCE_ROOT; }; 114B6FA411FA7623004FB6AB /* Catalogue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Catalogue.h; path = ../../src/Catalogue.h; sourceTree = SOURCE_ROOT; }; 114B6FA511FA7623004FB6AB /* CellBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CellBuffer.h; path = ../../src/CellBuffer.h; sourceTree = SOURCE_ROOT; }; 114B6FA611FA7623004FB6AB /* CharClassify.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharClassify.h; path = ../../src/CharClassify.h; sourceTree = SOURCE_ROOT; }; 114B6FA711FA7623004FB6AB /* ContractionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContractionState.h; path = ../../src/ContractionState.h; sourceTree = SOURCE_ROOT; }; 114B6FA811FA7623004FB6AB /* Decoration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Decoration.h; path = ../../src/Decoration.h; sourceTree = SOURCE_ROOT; }; 114B6FA911FA7623004FB6AB /* Document.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Document.h; path = ../../src/Document.h; sourceTree = SOURCE_ROOT; }; 114B6FAA11FA7623004FB6AB /* Editor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Editor.h; path = ../../src/Editor.h; sourceTree = SOURCE_ROOT; }; 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExternalLexer.h; path = ../../src/ExternalLexer.h; sourceTree = SOURCE_ROOT; }; 114B6FAC11FA7623004FB6AB /* FontQuality.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontQuality.h; path = ../../src/FontQuality.h; sourceTree = SOURCE_ROOT; }; 114B6FAD11FA7623004FB6AB /* Indicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Indicator.h; path = ../../src/Indicator.h; sourceTree = SOURCE_ROOT; }; 114B6FAE11FA7623004FB6AB /* KeyMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KeyMap.h; path = ../../src/KeyMap.h; sourceTree = SOURCE_ROOT; }; 114B6FAF11FA7623004FB6AB /* LineMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineMarker.h; path = ../../src/LineMarker.h; sourceTree = SOURCE_ROOT; }; 114B6FB011FA7623004FB6AB /* Partitioning.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Partitioning.h; path = ../../src/Partitioning.h; sourceTree = SOURCE_ROOT; }; 114B6FB111FA7623004FB6AB /* PerLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PerLine.h; path = ../../src/PerLine.h; sourceTree = SOURCE_ROOT; }; 114B6FB211FA7623004FB6AB /* PositionCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PositionCache.h; path = ../../src/PositionCache.h; sourceTree = SOURCE_ROOT; }; 114B6FB311FA7623004FB6AB /* RESearch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RESearch.h; path = ../../src/RESearch.h; sourceTree = SOURCE_ROOT; }; 114B6FB411FA7623004FB6AB /* RunStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RunStyles.h; path = ../../src/RunStyles.h; sourceTree = SOURCE_ROOT; }; 114B6FB511FA7623004FB6AB /* ScintillaBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaBase.h; path = ../../src/ScintillaBase.h; sourceTree = SOURCE_ROOT; }; 114B6FB611FA7623004FB6AB /* Selection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Selection.h; path = ../../src/Selection.h; sourceTree = SOURCE_ROOT; }; 114B6FB711FA7623004FB6AB /* SplitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SplitVector.h; path = ../../src/SplitVector.h; sourceTree = SOURCE_ROOT; }; 114B6FB811FA7623004FB6AB /* Style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Style.h; path = ../../src/Style.h; sourceTree = SOURCE_ROOT; }; 114B6FBA11FA7623004FB6AB /* UniConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UniConversion.h; path = ../../src/UniConversion.h; sourceTree = SOURCE_ROOT; }; 114B6FBB11FA7623004FB6AB /* ViewStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewStyle.h; path = ../../src/ViewStyle.h; sourceTree = SOURCE_ROOT; }; 114B6FBC11FA7623004FB6AB /* XPM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPM.h; path = ../../src/XPM.h; sourceTree = SOURCE_ROOT; }; 114B6FD811FA7645004FB6AB /* Accessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Accessor.h; path = ../../lexlib/Accessor.h; sourceTree = SOURCE_ROOT; }; 114B6FD911FA7645004FB6AB /* CharacterSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharacterSet.h; path = ../../lexlib/CharacterSet.h; sourceTree = SOURCE_ROOT; }; 114B6FDA11FA7645004FB6AB /* LexAccessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexAccessor.h; path = ../../lexlib/LexAccessor.h; sourceTree = SOURCE_ROOT; }; 114B6FDB11FA7645004FB6AB /* LexerBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerBase.h; path = ../../lexlib/LexerBase.h; sourceTree = SOURCE_ROOT; }; 114B6FDC11FA7645004FB6AB /* LexerModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerModule.h; path = ../../lexlib/LexerModule.h; sourceTree = SOURCE_ROOT; }; 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerNoExceptions.h; path = ../../lexlib/LexerNoExceptions.h; sourceTree = SOURCE_ROOT; }; 114B6FDE11FA7645004FB6AB /* LexerSimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LexerSimple.h; path = ../../lexlib/LexerSimple.h; sourceTree = SOURCE_ROOT; }; 114B6FDF11FA7645004FB6AB /* OptionSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionSet.h; path = ../../lexlib/OptionSet.h; sourceTree = SOURCE_ROOT; }; 114B6FE011FA7645004FB6AB /* PropSetSimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PropSetSimple.h; path = ../../lexlib/PropSetSimple.h; sourceTree = SOURCE_ROOT; }; 114B6FE111FA7645004FB6AB /* StyleContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleContext.h; path = ../../lexlib/StyleContext.h; sourceTree = SOURCE_ROOT; }; 114B6FE211FA7645004FB6AB /* WordList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WordList.h; path = ../../lexlib/WordList.h; sourceTree = SOURCE_ROOT; }; 1152A77215313E58000D4E1A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = ../../../../../../../../System/Library/Frameworks/QuartzCore.framework; sourceTree = ""; }; 11594BE7155B91DF0099E1FA /* LexOScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexOScript.cxx; path = ../../lexers/LexOScript.cxx; sourceTree = ""; }; 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexVisualProlog.cxx; path = ../../lexers/LexVisualProlog.cxx; sourceTree = ""; }; 1160E0371803651C00BCEBCB /* LexRust.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRust.cxx; path = ../../lexers/LexRust.cxx; sourceTree = ""; }; 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexTCMD.cxx; path = ../../lexers/LexTCMD.cxx; sourceTree = ""; }; 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextStyle.h; path = ../QuartzTextStyle.h; sourceTree = ""; }; 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexCoffeeScript.cxx; path = ../../lexers/LexCoffeeScript.cxx; sourceTree = ""; }; 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexModula.cxx; path = ../../lexers/LexModula.cxx; sourceTree = SOURCE_ROOT; }; 11BEB6A114EF189600BDE92A /* LexECL.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexECL.cxx; path = ../../lexers/LexECL.cxx; sourceTree = ""; }; 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexA68k.cxx; path = ../../lexers/LexA68k.cxx; sourceTree = SOURCE_ROOT; }; 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharacterCategory.cxx; path = ../../lexlib/CharacterCategory.cxx; sourceTree = ""; }; 11FBA39C17817DA00048C071 /* CharacterCategory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharacterCategory.h; path = ../../lexlib/CharacterCategory.h; sourceTree = ""; }; 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSTTXT.cxx; path = ../../lexers/LexSTTXT.cxx; sourceTree = ""; }; 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexKVIrc.cxx; path = ../../lexers/LexKVIrc.cxx; sourceTree = ""; }; 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMAP.cxx; path = ../../lexers/LexDMAP.cxx; sourceTree = ""; }; 2744E4850FC1678600E85C33 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = ../../include/Platform.h; sourceTree = SOURCE_ROOT; }; 2744E4870FC1678600E85C33 /* SciLexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SciLexer.h; path = ../../include/SciLexer.h; sourceTree = SOURCE_ROOT; }; 2744E4880FC1678600E85C33 /* Scintilla.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scintilla.h; path = ../../include/Scintilla.h; sourceTree = SOURCE_ROOT; }; 2744E59D0FC168A100E85C33 /* InfoBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoBar.h; path = ../InfoBar.h; sourceTree = SOURCE_ROOT; }; 2744E59E0FC168A100E85C33 /* PlatCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatCocoa.h; path = ../PlatCocoa.h; sourceTree = SOURCE_ROOT; }; 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextLayout.h; path = ../QuartzTextLayout.h; sourceTree = SOURCE_ROOT; }; 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuartzTextStyleAttribute.h; path = ../QuartzTextStyleAttribute.h; sourceTree = SOURCE_ROOT; }; 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaCocoa.h; path = ../ScintillaCocoa.h; sourceTree = ""; }; 2744E5A30FC168A100E85C33 /* ScintillaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScintillaView.h; path = ../ScintillaView.h; sourceTree = ""; }; 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoBarCommunicator.h; path = ../InfoBarCommunicator.h; sourceTree = SOURCE_ROOT; }; 2744E5AD0FC168C500E85C33 /* InfoBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InfoBar.mm; path = ../InfoBar.mm; sourceTree = SOURCE_ROOT; }; 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatCocoa.mm; path = ../PlatCocoa.mm; sourceTree = SOURCE_ROOT; }; 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScintillaCocoa.mm; path = ../ScintillaCocoa.mm; sourceTree = ""; }; 2744E5B10FC168C500E85C33 /* ScintillaView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScintillaView.mm; path = ../ScintillaView.mm; sourceTree = ""; }; 27FEF4510FC1B413005E115A /* info_bar_bg.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = info_bar_bg.png; sourceTree = ""; }; 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mac_cursor_busy.png; sourceTree = ""; }; 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = mac_cursor_flipped.png; sourceTree = ""; }; 280056F8188DDD2C00F200AE /* SparseState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparseState.h; path = ../../lexlib/SparseState.h; sourceTree = ""; }; 280056F9188DDD2C00F200AE /* StringCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringCopy.h; path = ../../lexlib/StringCopy.h; sourceTree = ""; }; 280056FA188DDD2C00F200AE /* SubStyles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SubStyles.h; path = ../../lexlib/SubStyles.h; sourceTree = ""; }; 28064A04190F12E100E6E47F /* LexDMIS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDMIS.cxx; path = ../../lexers/LexDMIS.cxx; sourceTree = ""; }; 28A067101A36B42600B4966A /* LexHex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexHex.cxx; path = ../../lexers/LexHex.cxx; sourceTree = ""; }; 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditModel.cxx; path = ../../src/EditModel.cxx; sourceTree = ""; }; 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EditView.cxx; path = ../../src/EditView.cxx; sourceTree = ""; }; 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MarginView.cxx; path = ../../src/MarginView.cxx; sourceTree = ""; }; 28A1DD54196BE0ED006EFCDD /* EditModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditModel.h; path = ../../src/EditModel.h; sourceTree = ""; }; 28A1DD55196BE0ED006EFCDD /* EditView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EditView.h; path = ../../src/EditView.h; sourceTree = ""; }; 28A1DD56196BE0ED006EFCDD /* MarginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MarginView.h; path = ../../src/MarginView.h; sourceTree = ""; }; 28A7D6041995E47D0062D204 /* LexRegistry.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexRegistry.cxx; path = ../../lexers/LexRegistry.cxx; sourceTree = ""; }; 28B647061B54C0720009DC49 /* LexBatch.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBatch.cxx; path = ../../lexers/LexBatch.cxx; sourceTree = ""; }; 28B647071B54C0720009DC49 /* LexDiff.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDiff.cxx; path = ../../lexers/LexDiff.cxx; sourceTree = ""; }; 28B647081B54C0720009DC49 /* LexErrorList.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexErrorList.cxx; path = ../../lexers/LexErrorList.cxx; sourceTree = ""; }; 28B647091B54C0720009DC49 /* LexMake.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexMake.cxx; path = ../../lexers/LexMake.cxx; sourceTree = ""; }; 28B6470A1B54C0720009DC49 /* LexNull.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexNull.cxx; path = ../../lexers/LexNull.cxx; sourceTree = ""; }; 28B6470B1B54C0720009DC49 /* LexProps.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexProps.cxx; path = ../../lexers/LexProps.cxx; sourceTree = ""; }; 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "info_bar_bg@2x.png"; sourceTree = ""; }; 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_busy@2x.png"; sourceTree = ""; }; 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "mac_cursor_flipped@2x.png"; sourceTree = ""; }; 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexBibTeX.cxx; path = ../../lexers/LexBibTeX.cxx; sourceTree = ""; }; 32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scintilla_Prefix.pch; sourceTree = ""; }; 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8DC2EF5B0486A6940098B216 /* Scintilla.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Scintilla.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8DC2EF560486A6940098B216 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */, 1152A77315313E58000D4E1A /* QuartzCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 034768DFFF38A50411DB9C8B /* Products */ = { isa = PBXGroup; children = ( 8DC2EF5B0486A6940098B216 /* Scintilla.framework */, ); name = Products; sourceTree = ""; }; 0867D691FE84028FC02AAC07 /* Scintilla */ = { isa = PBXGroup; children = ( 2744E47D0FC1674E00E85C33 /* Lexers */, 2744E47C0FC1674100E85C33 /* Backend */, 08FB77AEFE84172EC02AAC07 /* Classes */, 32C88DFF0371C24200C91783 /* Other Sources */, 089C1665FE841158C02AAC07 /* Resources */, 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */, 034768DFFF38A50411DB9C8B /* Products */, ); name = Scintilla; sourceTree = ""; }; 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = { isa = PBXGroup; children = ( 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */, 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */, ); name = "External Frameworks and Libraries"; sourceTree = ""; }; 089C1665FE841158C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( 27FEF4500FC1B413005E115A /* res */, 8DC2EF5A0486A6940098B216 /* Info.plist */, 089C1666FE841158C02AAC07 /* InfoPlist.strings */, ); name = Resources; sourceTree = ""; }; 08FB77AEFE84172EC02AAC07 /* Classes */ = { isa = PBXGroup; children = ( 2744E4980FC167ED00E85C33 /* Source Files */, 2744E4970FC167E400E85C33 /* Header Files */, ); name = Classes; sourceTree = ""; }; 1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; sourceTree = ""; }; 1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 1152A77215313E58000D4E1A /* QuartzCore.framework */, 0867D6A5FE840307C02AAC07 /* AppKit.framework */, D2F7E79907B2D74100F64583 /* CoreData.framework */, 0867D69BFE84028FC02AAC07 /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = ""; }; 2744E47C0FC1674100E85C33 /* Backend */ = { isa = PBXGroup; children = ( 2744E47F0FC1676400E85C33 /* Source Files */, 2744E47E0FC1675800E85C33 /* Header Files */, ); name = Backend; sourceTree = ""; }; 2744E47D0FC1674E00E85C33 /* Lexers */ = { isa = PBXGroup; children = ( 11F35FDA12AEFAF100F0236D /* LexA68k.cxx */, 114B6EBE11FA7526004FB6AB /* LexAbaqus.cxx */, 114B6EBF11FA7526004FB6AB /* LexAda.cxx */, 114B6EC011FA7526004FB6AB /* LexAPDL.cxx */, 114B6EC111FA7526004FB6AB /* LexAsm.cxx */, 114B6EC211FA7526004FB6AB /* LexAsn1.cxx */, 114B6EC311FA7526004FB6AB /* LexASY.cxx */, 114B6EC411FA7526004FB6AB /* LexAU3.cxx */, 114B6EC511FA7526004FB6AB /* LexAVE.cxx */, 11126B8114CD3A6200803C49 /* LexAVS.cxx */, 114B6EC611FA7526004FB6AB /* LexBaan.cxx */, 114B6EC711FA7526004FB6AB /* LexBash.cxx */, 114B6EC811FA7526004FB6AB /* LexBasic.cxx */, 28B647061B54C0720009DC49 /* LexBatch.cxx */, 28FDA42019B6967B00BE27D7 /* LexBibTeX.cxx */, 114B6EC911FA7526004FB6AB /* LexBullant.cxx */, 114B6ECA11FA7526004FB6AB /* LexCaml.cxx */, 114B6ECB11FA7526004FB6AB /* LexCLW.cxx */, 114B6ECC11FA7526004FB6AB /* LexCmake.cxx */, 114B6ECD11FA7526004FB6AB /* LexCOBOL.cxx */, 11A0A8A0148602DF0018D143 /* LexCoffeeScript.cxx */, 114B6ECE11FA7526004FB6AB /* LexConf.cxx */, 114B6ECF11FA7526004FB6AB /* LexCPP.cxx */, 114B6ED011FA7526004FB6AB /* LexCrontab.cxx */, 114B6ED111FA7526004FB6AB /* LexCsound.cxx */, 114B6ED211FA7526004FB6AB /* LexCSS.cxx */, 114B6ED311FA7526004FB6AB /* LexD.cxx */, 28B647071B54C0720009DC49 /* LexDiff.cxx */, 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */, 28064A04190F12E100E6E47F /* LexDMIS.cxx */, 11BEB6A114EF189600BDE92A /* LexECL.cxx */, 114B6ED411FA7526004FB6AB /* LexEiffel.cxx */, 114B6ED511FA7526004FB6AB /* LexErlang.cxx */, 28B647081B54C0720009DC49 /* LexErrorList.cxx */, 114B6ED611FA7526004FB6AB /* LexEScript.cxx */, 114B6ED711FA7526004FB6AB /* LexFlagship.cxx */, 114B6ED811FA7526004FB6AB /* LexForth.cxx */, 114B6ED911FA7526004FB6AB /* LexFortran.cxx */, 114B6EDA11FA7526004FB6AB /* LexGAP.cxx */, 114B6EDB11FA7526004FB6AB /* LexGui4Cli.cxx */, 114B6EDC11FA7526004FB6AB /* LexHaskell.cxx */, 28A067101A36B42600B4966A /* LexHex.cxx */, 114B6EDD11FA7526004FB6AB /* LexHTML.cxx */, 114B6EDE11FA7526004FB6AB /* LexInno.cxx */, 114B6EDF11FA7526004FB6AB /* LexKix.cxx */, 11FDD0DF17C480D4001541B9 /* LexKVIrc.cxx */, 1102C31B169FB49300DC16AB /* LexLaTeX.cxx */, 114B6EE011FA7526004FB6AB /* LexLisp.cxx */, 114B6EE111FA7526004FB6AB /* LexLout.cxx */, 114B6EE211FA7526004FB6AB /* LexLua.cxx */, 114B6EE311FA7526004FB6AB /* LexMagik.cxx */, 28B647091B54C0720009DC49 /* LexMake.cxx */, 114B6EE411FA7526004FB6AB /* LexMarkdown.cxx */, 114B6EE511FA7526004FB6AB /* LexMatlab.cxx */, 114B6EE611FA7526004FB6AB /* LexMetapost.cxx */, 114B6EE711FA7526004FB6AB /* LexMMIXAL.cxx */, 11BB124C12FF9C1300F6BCF7 /* LexModula.cxx */, 114B6EE811FA7526004FB6AB /* LexMPT.cxx */, 114B6EE911FA7526004FB6AB /* LexMSSQL.cxx */, 114B6EEA11FA7526004FB6AB /* LexMySQL.cxx */, 114B6EEB11FA7526004FB6AB /* LexNimrod.cxx */, 114B6EEC11FA7526004FB6AB /* LexNsis.cxx */, 28B6470A1B54C0720009DC49 /* LexNull.cxx */, 114B6EED11FA7526004FB6AB /* LexOpal.cxx */, 11594BE7155B91DF0099E1FA /* LexOScript.cxx */, 114B6EEF11FA7526004FB6AB /* LexPascal.cxx */, 114B6EF011FA7526004FB6AB /* LexPB.cxx */, 114B6EF111FA7526004FB6AB /* LexPerl.cxx */, 114B6EF211FA7526004FB6AB /* LexPLM.cxx */, 1114D6CA1602A951001DC345 /* LexPO.cxx */, 114B6EF311FA7526004FB6AB /* LexPOV.cxx */, 114B6EF411FA7526004FB6AB /* LexPowerPro.cxx */, 114B6EF511FA7526004FB6AB /* LexPowerShell.cxx */, 114B6EF611FA7526004FB6AB /* LexProgress.cxx */, 28B6470B1B54C0720009DC49 /* LexProps.cxx */, 114B6EF711FA7526004FB6AB /* LexPS.cxx */, 114B6EF811FA7526004FB6AB /* LexPython.cxx */, 114B6EF911FA7526004FB6AB /* LexR.cxx */, 114B6EFA11FA7526004FB6AB /* LexRebol.cxx */, 28A7D6041995E47D0062D204 /* LexRegistry.cxx */, 114B6EFB11FA7526004FB6AB /* LexRuby.cxx */, 1160E0371803651C00BCEBCB /* LexRust.cxx */, 114B6EFC11FA7526004FB6AB /* LexScriptol.cxx */, 114B6EFD11FA7526004FB6AB /* LexSmalltalk.cxx */, 114B6EFE11FA7526004FB6AB /* LexSML.cxx */, 114B6EFF11FA7526004FB6AB /* LexSorcus.cxx */, 114B6F0011FA7526004FB6AB /* LexSpecman.cxx */, 114B6F0111FA7526004FB6AB /* LexSpice.cxx */, 114B6F0211FA7526004FB6AB /* LexSQL.cxx */, 11FDAEB6174E1A9700FA161B /* LexSTTXT.cxx */, 114B6F0311FA7526004FB6AB /* LexTACL.cxx */, 114B6F0411FA7526004FB6AB /* LexTADS3.cxx */, 114B6F0511FA7526004FB6AB /* LexTAL.cxx */, 114B6F0611FA7526004FB6AB /* LexTCL.cxx */, 117ACE9014A29A1E002876F9 /* LexTCMD.cxx */, 114B6F0711FA7526004FB6AB /* LexTeX.cxx */, 114B6F0811FA7526004FB6AB /* LexTxt2tags.cxx */, 114B6F0911FA7526004FB6AB /* LexVB.cxx */, 114B6F0A11FA7526004FB6AB /* LexVerilog.cxx */, 114B6F0B11FA7526004FB6AB /* LexVHDL.cxx */, 11594BE8155B91DF0099E1FA /* LexVisualProlog.cxx */, 114B6F0C11FA7526004FB6AB /* LexYAML.cxx */, ); name = Lexers; sourceTree = ""; }; 2744E47E0FC1675800E85C33 /* Header Files */ = { isa = PBXGroup; children = ( 114B6FD811FA7645004FB6AB /* Accessor.h */, 114B6FA211FA7623004FB6AB /* AutoComplete.h */, 114B6FA311FA7623004FB6AB /* CallTip.h */, 1100F1E7178E393200105727 /* CaseConvert.h */, 1100F1E9178E393200105727 /* CaseFolder.h */, 114B6FA411FA7623004FB6AB /* Catalogue.h */, 114B6FA511FA7623004FB6AB /* CellBuffer.h */, 11FBA39C17817DA00048C071 /* CharacterCategory.h */, 114B6FD911FA7645004FB6AB /* CharacterSet.h */, 114B6FA611FA7623004FB6AB /* CharClassify.h */, 114B6FA711FA7623004FB6AB /* ContractionState.h */, 114B6FA811FA7623004FB6AB /* Decoration.h */, 114B6FA911FA7623004FB6AB /* Document.h */, 28A1DD54196BE0ED006EFCDD /* EditModel.h */, 114B6FAA11FA7623004FB6AB /* Editor.h */, 28A1DD55196BE0ED006EFCDD /* EditView.h */, 114B6FAB11FA7623004FB6AB /* ExternalLexer.h */, 114B6FAC11FA7623004FB6AB /* FontQuality.h */, 114B6FA011FA75DB004FB6AB /* ILexer.h */, 114B6FAD11FA7623004FB6AB /* Indicator.h */, 114B6FAE11FA7623004FB6AB /* KeyMap.h */, 114B6FDA11FA7645004FB6AB /* LexAccessor.h */, 114B6FDB11FA7645004FB6AB /* LexerBase.h */, 114B6FDC11FA7645004FB6AB /* LexerModule.h */, 114B6FDD11FA7645004FB6AB /* LexerNoExceptions.h */, 114B6FDE11FA7645004FB6AB /* LexerSimple.h */, 114B6FAF11FA7623004FB6AB /* LineMarker.h */, 28A1DD56196BE0ED006EFCDD /* MarginView.h */, 114B6FDF11FA7645004FB6AB /* OptionSet.h */, 114B6FB011FA7623004FB6AB /* Partitioning.h */, 114B6FB111FA7623004FB6AB /* PerLine.h */, 114B6FB211FA7623004FB6AB /* PositionCache.h */, 114B6FE011FA7645004FB6AB /* PropSetSimple.h */, 114B6FB311FA7623004FB6AB /* RESearch.h */, 114B6FB411FA7623004FB6AB /* RunStyles.h */, 114B6FB511FA7623004FB6AB /* ScintillaBase.h */, 114B6FB611FA7623004FB6AB /* Selection.h */, 280056F8188DDD2C00F200AE /* SparseState.h */, 114B6FB711FA7623004FB6AB /* SplitVector.h */, 280056F9188DDD2C00F200AE /* StringCopy.h */, 114B6FB811FA7623004FB6AB /* Style.h */, 114B6FE111FA7645004FB6AB /* StyleContext.h */, 280056FA188DDD2C00F200AE /* SubStyles.h */, 1100F1EA178E393200105727 /* UnicodeFromUTF8.h */, 114B6FBA11FA7623004FB6AB /* UniConversion.h */, 114B6FBB11FA7623004FB6AB /* ViewStyle.h */, 114B6FE211FA7645004FB6AB /* WordList.h */, 114B6FBC11FA7623004FB6AB /* XPM.h */, ); name = "Header Files"; sourceTree = ""; }; 2744E47F0FC1676400E85C33 /* Source Files */ = { isa = PBXGroup; children = ( 114B6F8E11FA75BE004FB6AB /* Accessor.cxx */, 114B6F6011FA7597004FB6AB /* AutoComplete.cxx */, 114B6F6111FA7597004FB6AB /* CallTip.cxx */, 1100F1E6178E393200105727 /* CaseConvert.cxx */, 1100F1E8178E393200105727 /* CaseFolder.cxx */, 114B6F6211FA7597004FB6AB /* Catalogue.cxx */, 114B6F6311FA7597004FB6AB /* CellBuffer.cxx */, 11FBA39B17817DA00048C071 /* CharacterCategory.cxx */, 114B6F8F11FA75BE004FB6AB /* CharacterSet.cxx */, 114B6F6411FA7597004FB6AB /* CharClassify.cxx */, 114B6F6511FA7597004FB6AB /* ContractionState.cxx */, 114B6F6611FA7597004FB6AB /* Decoration.cxx */, 114B6F6711FA7597004FB6AB /* Document.cxx */, 28A1DD4E196BE0CA006EFCDD /* EditModel.cxx */, 114B6F6811FA7597004FB6AB /* Editor.cxx */, 28A1DD4F196BE0CA006EFCDD /* EditView.cxx */, 114B6F6911FA7598004FB6AB /* ExternalLexer.cxx */, 114B6F6A11FA7598004FB6AB /* Indicator.cxx */, 114B6F6B11FA7598004FB6AB /* KeyMap.cxx */, 114B6F9011FA75BE004FB6AB /* LexerBase.cxx */, 114B6F9111FA75BE004FB6AB /* LexerModule.cxx */, 114B6F9211FA75BE004FB6AB /* LexerNoExceptions.cxx */, 114B6F9311FA75BE004FB6AB /* LexerSimple.cxx */, 114B6F6C11FA7598004FB6AB /* LineMarker.cxx */, 28A1DD50196BE0CA006EFCDD /* MarginView.cxx */, 114B6F6D11FA7598004FB6AB /* PerLine.cxx */, 114B6F6E11FA7598004FB6AB /* PositionCache.cxx */, 114B6F9411FA75BE004FB6AB /* PropSetSimple.cxx */, 114B6F6F11FA7598004FB6AB /* RESearch.cxx */, 114B6F7011FA7598004FB6AB /* RunStyles.cxx */, 114B6F7111FA7598004FB6AB /* ScintillaBase.cxx */, 114B6F7211FA7598004FB6AB /* Selection.cxx */, 114B6F7311FA7598004FB6AB /* Style.cxx */, 114B6F9511FA75BE004FB6AB /* StyleContext.cxx */, 114B6F7411FA7598004FB6AB /* UniConversion.cxx */, 114B6F7511FA7598004FB6AB /* ViewStyle.cxx */, 114B6F9611FA75BE004FB6AB /* WordList.cxx */, 114B6F7611FA7598004FB6AB /* XPM.cxx */, ); name = "Source Files"; sourceTree = ""; }; 2744E4970FC167E400E85C33 /* Header Files */ = { isa = PBXGroup; children = ( 2744E59D0FC168A100E85C33 /* InfoBar.h */, 2744E5AB0FC168B200E85C33 /* InfoBarCommunicator.h */, 2744E59E0FC168A100E85C33 /* PlatCocoa.h */, 2744E4850FC1678600E85C33 /* Platform.h */, 2744E59F0FC168A100E85C33 /* QuartzTextLayout.h */, 119FF1BE13C9D1820007CE42 /* QuartzTextStyle.h */, 2744E5A00FC168A100E85C33 /* QuartzTextStyleAttribute.h */, 2744E4870FC1678600E85C33 /* SciLexer.h */, 2744E4880FC1678600E85C33 /* Scintilla.h */, 2744E5A20FC168A100E85C33 /* ScintillaCocoa.h */, 2744E5A30FC168A100E85C33 /* ScintillaView.h */, ); name = "Header Files"; sourceTree = ""; }; 2744E4980FC167ED00E85C33 /* Source Files */ = { isa = PBXGroup; children = ( 2744E5AD0FC168C500E85C33 /* InfoBar.mm */, 2744E5AE0FC168C500E85C33 /* PlatCocoa.mm */, 2744E5B00FC168C500E85C33 /* ScintillaCocoa.mm */, 2744E5B10FC168C500E85C33 /* ScintillaView.mm */, ); name = "Source Files"; sourceTree = ""; }; 27FEF4500FC1B413005E115A /* res */ = { isa = PBXGroup; children = ( 28D516D51830FFCA0047C93D /* info_bar_bg@2x.png */, 28D516D61830FFCA0047C93D /* mac_cursor_busy@2x.png */, 28D516D71830FFCA0047C93D /* mac_cursor_flipped@2x.png */, 27FEF4510FC1B413005E115A /* info_bar_bg.png */, 27FEF4520FC1B413005E115A /* mac_cursor_busy.png */, 27FEF4530FC1B413005E115A /* mac_cursor_flipped.png */, ); name = res; path = ../res; sourceTree = SOURCE_ROOT; }; 32C88DFF0371C24200C91783 /* Other Sources */ = { isa = PBXGroup; children = ( 32DBCF5E0370ADEE00C91783 /* Scintilla_Prefix.pch */, ); name = "Other Sources"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 8DC2EF500486A6940098B216 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 2744E5A40FC168A100E85C33 /* InfoBar.h in Headers */, 2744E5AC0FC168B200E85C33 /* InfoBarCommunicator.h in Headers */, 2744E5AA0FC168A100E85C33 /* ScintillaView.h in Headers */, 280056FB188DDD2C00F200AE /* SparseState.h in Headers */, 2791F3C80FC19F71009DBCF9 /* SciLexer.h in Headers */, 2791F3C60FC19F71009DBCF9 /* PlatCocoa.h in Headers */, 2791F3E30FC1A3AE009DBCF9 /* QuartzTextLayout.h in Headers */, 2791F3E40FC1A3AE009DBCF9 /* QuartzTextStyleAttribute.h in Headers */, 2791F3E00FC1A390009DBCF9 /* ScintillaCocoa.h in Headers */, 2791F3C70FC19F71009DBCF9 /* Platform.h in Headers */, 2791F3C90FC19F71009DBCF9 /* Scintilla.h in Headers */, 114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */, 114B6FBD11FA7623004FB6AB /* AutoComplete.h in Headers */, 114B6FBE11FA7623004FB6AB /* CallTip.h in Headers */, 114B6FBF11FA7623004FB6AB /* Catalogue.h in Headers */, 114B6FC011FA7623004FB6AB /* CellBuffer.h in Headers */, 114B6FC111FA7623004FB6AB /* CharClassify.h in Headers */, 114B6FC211FA7623004FB6AB /* ContractionState.h in Headers */, 114B6FC311FA7623004FB6AB /* Decoration.h in Headers */, 114B6FC411FA7623004FB6AB /* Document.h in Headers */, 114B6FC511FA7623004FB6AB /* Editor.h in Headers */, 114B6FC611FA7623004FB6AB /* ExternalLexer.h in Headers */, 114B6FC711FA7623004FB6AB /* FontQuality.h in Headers */, 28A1DD57196BE0ED006EFCDD /* EditModel.h in Headers */, 114B6FC811FA7623004FB6AB /* Indicator.h in Headers */, 114B6FC911FA7623004FB6AB /* KeyMap.h in Headers */, 114B6FCA11FA7623004FB6AB /* LineMarker.h in Headers */, 114B6FCB11FA7623004FB6AB /* Partitioning.h in Headers */, 114B6FCC11FA7623004FB6AB /* PerLine.h in Headers */, 114B6FCD11FA7623004FB6AB /* PositionCache.h in Headers */, 114B6FCE11FA7623004FB6AB /* RESearch.h in Headers */, 28A1DD58196BE0ED006EFCDD /* EditView.h in Headers */, 114B6FCF11FA7623004FB6AB /* RunStyles.h in Headers */, 280056FD188DDD2C00F200AE /* SubStyles.h in Headers */, 114B6FD011FA7623004FB6AB /* ScintillaBase.h in Headers */, 114B6FD111FA7623004FB6AB /* Selection.h in Headers */, 114B6FD211FA7623004FB6AB /* SplitVector.h in Headers */, 114B6FD311FA7623004FB6AB /* Style.h in Headers */, 280056FC188DDD2C00F200AE /* StringCopy.h in Headers */, 114B6FD511FA7623004FB6AB /* UniConversion.h in Headers */, 114B6FD611FA7623004FB6AB /* ViewStyle.h in Headers */, 114B6FD711FA7623004FB6AB /* XPM.h in Headers */, 114B6FE311FA7645004FB6AB /* Accessor.h in Headers */, 114B6FE411FA7645004FB6AB /* CharacterSet.h in Headers */, 114B6FE511FA7645004FB6AB /* LexAccessor.h in Headers */, 114B6FE611FA7645004FB6AB /* LexerBase.h in Headers */, 114B6FE711FA7645004FB6AB /* LexerModule.h in Headers */, 114B6FE811FA7645004FB6AB /* LexerNoExceptions.h in Headers */, 114B6FE911FA7645004FB6AB /* LexerSimple.h in Headers */, 114B6FEA11FA7645004FB6AB /* OptionSet.h in Headers */, 28A1DD59196BE0ED006EFCDD /* MarginView.h in Headers */, 114B6FEB11FA7645004FB6AB /* PropSetSimple.h in Headers */, 114B6FEC11FA7645004FB6AB /* StyleContext.h in Headers */, 114B6FED11FA7645004FB6AB /* WordList.h in Headers */, 119FF1BF13C9D1820007CE42 /* QuartzTextStyle.h in Headers */, 11FBA39E17817DA00048C071 /* CharacterCategory.h in Headers */, 1100F1EC178E393200105727 /* CaseConvert.h in Headers */, 1100F1EE178E393200105727 /* CaseFolder.h in Headers */, 1100F1EF178E393200105727 /* UnicodeFromUTF8.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 8DC2EF4F0486A6940098B216 /* Scintilla */ = { isa = PBXNativeTarget; buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Scintilla" */; buildPhases = ( 8DC2EF500486A6940098B216 /* Headers */, 8DC2EF520486A6940098B216 /* Resources */, 8DC2EF540486A6940098B216 /* Sources */, 8DC2EF560486A6940098B216 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Scintilla; productInstallPath = "$(HOME)/Library/Frameworks"; productName = Scintilla; productReference = 8DC2EF5B0486A6940098B216 /* Scintilla.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 0867D690FE84028FC02AAC07 /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 0610; }; buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 0867D691FE84028FC02AAC07 /* Scintilla */; productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 8DC2EF4F0486A6940098B216 /* Scintilla */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8DC2EF520486A6940098B216 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */, 27FEF4540FC1B413005E115A /* info_bar_bg.png in Resources */, 28D516D81830FFCA0047C93D /* info_bar_bg@2x.png in Resources */, 28D516D91830FFCA0047C93D /* mac_cursor_busy@2x.png in Resources */, 27FEF4550FC1B413005E115A /* mac_cursor_busy.png in Resources */, 27FEF4560FC1B413005E115A /* mac_cursor_flipped.png in Resources */, 28D516DA1830FFCA0047C93D /* mac_cursor_flipped@2x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8DC2EF540486A6940098B216 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 2744E5B20FC168C500E85C33 /* InfoBar.mm in Sources */, 2744E5B30FC168C500E85C33 /* PlatCocoa.mm in Sources */, 2744E5B50FC168C500E85C33 /* ScintillaCocoa.mm in Sources */, 2744E5B60FC168C500E85C33 /* ScintillaView.mm in Sources */, 114B6F0D11FA7526004FB6AB /* LexAbaqus.cxx in Sources */, 114B6F0E11FA7526004FB6AB /* LexAda.cxx in Sources */, 28B6470C1B54C0720009DC49 /* LexBatch.cxx in Sources */, 28B6470F1B54C0720009DC49 /* LexMake.cxx in Sources */, 114B6F0F11FA7526004FB6AB /* LexAPDL.cxx in Sources */, 114B6F1011FA7526004FB6AB /* LexAsm.cxx in Sources */, 114B6F1111FA7526004FB6AB /* LexAsn1.cxx in Sources */, 114B6F1211FA7526004FB6AB /* LexASY.cxx in Sources */, 114B6F1311FA7526004FB6AB /* LexAU3.cxx in Sources */, 114B6F1411FA7526004FB6AB /* LexAVE.cxx in Sources */, 114B6F1511FA7526004FB6AB /* LexBaan.cxx in Sources */, 114B6F1611FA7526004FB6AB /* LexBash.cxx in Sources */, 114B6F1711FA7526004FB6AB /* LexBasic.cxx in Sources */, 114B6F1811FA7526004FB6AB /* LexBullant.cxx in Sources */, 114B6F1911FA7526004FB6AB /* LexCaml.cxx in Sources */, 114B6F1A11FA7526004FB6AB /* LexCLW.cxx in Sources */, 114B6F1B11FA7526004FB6AB /* LexCmake.cxx in Sources */, 114B6F1C11FA7526004FB6AB /* LexCOBOL.cxx in Sources */, 114B6F1D11FA7526004FB6AB /* LexConf.cxx in Sources */, 28B647101B54C0720009DC49 /* LexNull.cxx in Sources */, 114B6F1E11FA7526004FB6AB /* LexCPP.cxx in Sources */, 114B6F1F11FA7526004FB6AB /* LexCrontab.cxx in Sources */, 28B647111B54C0720009DC49 /* LexProps.cxx in Sources */, 114B6F2011FA7526004FB6AB /* LexCsound.cxx in Sources */, 114B6F2111FA7526004FB6AB /* LexCSS.cxx in Sources */, 114B6F2211FA7526004FB6AB /* LexD.cxx in Sources */, 114B6F2311FA7526004FB6AB /* LexEiffel.cxx in Sources */, 114B6F2411FA7526004FB6AB /* LexErlang.cxx in Sources */, 114B6F2511FA7526004FB6AB /* LexEScript.cxx in Sources */, 114B6F2611FA7526004FB6AB /* LexFlagship.cxx in Sources */, 28064A05190F12E100E6E47F /* LexDMIS.cxx in Sources */, 114B6F2711FA7526004FB6AB /* LexForth.cxx in Sources */, 114B6F2811FA7526004FB6AB /* LexFortran.cxx in Sources */, 28FDA42119B6967B00BE27D7 /* LexBibTeX.cxx in Sources */, 114B6F2911FA7526004FB6AB /* LexGAP.cxx in Sources */, 114B6F2A11FA7526004FB6AB /* LexGui4Cli.cxx in Sources */, 114B6F2B11FA7526004FB6AB /* LexHaskell.cxx in Sources */, 114B6F2C11FA7526004FB6AB /* LexHTML.cxx in Sources */, 114B6F2D11FA7526004FB6AB /* LexInno.cxx in Sources */, 114B6F2E11FA7526004FB6AB /* LexKix.cxx in Sources */, 28A067111A36B42600B4966A /* LexHex.cxx in Sources */, 114B6F2F11FA7526004FB6AB /* LexLisp.cxx in Sources */, 114B6F3011FA7526004FB6AB /* LexLout.cxx in Sources */, 114B6F3111FA7526004FB6AB /* LexLua.cxx in Sources */, 114B6F3211FA7526004FB6AB /* LexMagik.cxx in Sources */, 114B6F3311FA7526004FB6AB /* LexMarkdown.cxx in Sources */, 28A1DD52196BE0CA006EFCDD /* EditView.cxx in Sources */, 114B6F3411FA7526004FB6AB /* LexMatlab.cxx in Sources */, 114B6F3511FA7526004FB6AB /* LexMetapost.cxx in Sources */, 114B6F3611FA7526004FB6AB /* LexMMIXAL.cxx in Sources */, 114B6F3711FA7526004FB6AB /* LexMPT.cxx in Sources */, 114B6F3811FA7526004FB6AB /* LexMSSQL.cxx in Sources */, 114B6F3911FA7526004FB6AB /* LexMySQL.cxx in Sources */, 114B6F3A11FA7526004FB6AB /* LexNimrod.cxx in Sources */, 114B6F3B11FA7526004FB6AB /* LexNsis.cxx in Sources */, 114B6F3C11FA7526004FB6AB /* LexOpal.cxx in Sources */, 114B6F3E11FA7526004FB6AB /* LexPascal.cxx in Sources */, 28B6470D1B54C0720009DC49 /* LexDiff.cxx in Sources */, 114B6F3F11FA7526004FB6AB /* LexPB.cxx in Sources */, 114B6F4011FA7526004FB6AB /* LexPerl.cxx in Sources */, 114B6F4111FA7526004FB6AB /* LexPLM.cxx in Sources */, 114B6F4211FA7526004FB6AB /* LexPOV.cxx in Sources */, 114B6F4311FA7526004FB6AB /* LexPowerPro.cxx in Sources */, 114B6F4411FA7526004FB6AB /* LexPowerShell.cxx in Sources */, 114B6F4511FA7526004FB6AB /* LexProgress.cxx in Sources */, 114B6F4611FA7526004FB6AB /* LexPS.cxx in Sources */, 114B6F4711FA7526004FB6AB /* LexPython.cxx in Sources */, 114B6F4811FA7526004FB6AB /* LexR.cxx in Sources */, 114B6F4911FA7526004FB6AB /* LexRebol.cxx in Sources */, 114B6F4A11FA7526004FB6AB /* LexRuby.cxx in Sources */, 114B6F4B11FA7526004FB6AB /* LexScriptol.cxx in Sources */, 114B6F4C11FA7526004FB6AB /* LexSmalltalk.cxx in Sources */, 114B6F4D11FA7526004FB6AB /* LexSML.cxx in Sources */, 114B6F4E11FA7526004FB6AB /* LexSorcus.cxx in Sources */, 114B6F4F11FA7526004FB6AB /* LexSpecman.cxx in Sources */, 114B6F5011FA7526004FB6AB /* LexSpice.cxx in Sources */, 114B6F5111FA7526004FB6AB /* LexSQL.cxx in Sources */, 114B6F5211FA7526004FB6AB /* LexTACL.cxx in Sources */, 114B6F5311FA7526004FB6AB /* LexTADS3.cxx in Sources */, 114B6F5411FA7526004FB6AB /* LexTAL.cxx in Sources */, 114B6F5511FA7526004FB6AB /* LexTCL.cxx in Sources */, 114B6F5611FA7526004FB6AB /* LexTeX.cxx in Sources */, 28A1DD53196BE0CA006EFCDD /* MarginView.cxx in Sources */, 114B6F5711FA7526004FB6AB /* LexTxt2tags.cxx in Sources */, 114B6F5811FA7526004FB6AB /* LexVB.cxx in Sources */, 114B6F5911FA7526004FB6AB /* LexVerilog.cxx in Sources */, 114B6F5A11FA7526004FB6AB /* LexVHDL.cxx in Sources */, 114B6F5B11FA7526004FB6AB /* LexYAML.cxx in Sources */, 114B6F7711FA7598004FB6AB /* AutoComplete.cxx in Sources */, 114B6F7811FA7598004FB6AB /* CallTip.cxx in Sources */, 114B6F7911FA7598004FB6AB /* Catalogue.cxx in Sources */, 114B6F7A11FA7598004FB6AB /* CellBuffer.cxx in Sources */, 114B6F7B11FA7598004FB6AB /* CharClassify.cxx in Sources */, 28A1DD51196BE0CA006EFCDD /* EditModel.cxx in Sources */, 114B6F7C11FA7598004FB6AB /* ContractionState.cxx in Sources */, 114B6F7D11FA7598004FB6AB /* Decoration.cxx in Sources */, 114B6F7E11FA7598004FB6AB /* Document.cxx in Sources */, 114B6F7F11FA7598004FB6AB /* Editor.cxx in Sources */, 114B6F8011FA7598004FB6AB /* ExternalLexer.cxx in Sources */, 114B6F8111FA7598004FB6AB /* Indicator.cxx in Sources */, 114B6F8211FA7598004FB6AB /* KeyMap.cxx in Sources */, 114B6F8311FA7598004FB6AB /* LineMarker.cxx in Sources */, 114B6F8411FA7598004FB6AB /* PerLine.cxx in Sources */, 114B6F8511FA7598004FB6AB /* PositionCache.cxx in Sources */, 114B6F8611FA7598004FB6AB /* RESearch.cxx in Sources */, 114B6F8711FA7598004FB6AB /* RunStyles.cxx in Sources */, 114B6F8811FA7598004FB6AB /* ScintillaBase.cxx in Sources */, 114B6F8911FA7598004FB6AB /* Selection.cxx in Sources */, 114B6F8A11FA7598004FB6AB /* Style.cxx in Sources */, 28A7D6051995E47D0062D204 /* LexRegistry.cxx in Sources */, 28B6470E1B54C0720009DC49 /* LexErrorList.cxx in Sources */, 114B6F8B11FA7598004FB6AB /* UniConversion.cxx in Sources */, 114B6F8C11FA7598004FB6AB /* ViewStyle.cxx in Sources */, 114B6F8D11FA7598004FB6AB /* XPM.cxx in Sources */, 114B6F9711FA75BE004FB6AB /* Accessor.cxx in Sources */, 114B6F9811FA75BE004FB6AB /* CharacterSet.cxx in Sources */, 114B6F9911FA75BE004FB6AB /* LexerBase.cxx in Sources */, 114B6F9A11FA75BE004FB6AB /* LexerModule.cxx in Sources */, 114B6F9B11FA75BE004FB6AB /* LexerNoExceptions.cxx in Sources */, 114B6F9C11FA75BE004FB6AB /* LexerSimple.cxx in Sources */, 114B6F9D11FA75BE004FB6AB /* PropSetSimple.cxx in Sources */, 114B6F9E11FA75BE004FB6AB /* StyleContext.cxx in Sources */, 114B6F9F11FA75BE004FB6AB /* WordList.cxx in Sources */, 11F35FDB12AEFAF100F0236D /* LexA68k.cxx in Sources */, 11BB124D12FF9C1300F6BCF7 /* LexModula.cxx in Sources */, 11A0A8A1148602DF0018D143 /* LexCoffeeScript.cxx in Sources */, 117ACE9114A29A1E002876F9 /* LexTCMD.cxx in Sources */, 11126B8214CD3A6200803C49 /* LexAVS.cxx in Sources */, 11BEB6A214EF189600BDE92A /* LexECL.cxx in Sources */, 11594BE9155B91DF0099E1FA /* LexOScript.cxx in Sources */, 11594BEA155B91DF0099E1FA /* LexVisualProlog.cxx in Sources */, 1114D6CB1602A951001DC345 /* LexPO.cxx in Sources */, 1102C31C169FB49300DC16AB /* LexLaTeX.cxx in Sources */, 11FDAEB7174E1A9800FA161B /* LexSTTXT.cxx in Sources */, 11FBA39D17817DA00048C071 /* CharacterCategory.cxx in Sources */, 1100F1EB178E393200105727 /* CaseConvert.cxx in Sources */, 1100F1ED178E393200105727 /* CaseFolder.cxx in Sources */, 11FDD0E017C480D4001541B9 /* LexKVIrc.cxx in Sources */, 1160E0381803651C00BCEBCB /* LexRust.cxx in Sources */, 11FF3FE21810EB3900E13F13 /* LexDMAP.cxx in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = { isa = PBXVariantGroup; children = ( 089C1667FE841158C02AAC07 /* English */, ); name = InfoPlist.strings; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 1DEB91AE08733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; EXCLUDED_RECURSIVE_SEARCH_PATH_SUBDIRECTORIES = ".bzr *.nib *.lproj *.framework *.gch (*) CVS .svn *.xcodeproj *.xcode *.pbproj *.pbxproj"; FRAMEWORK_VERSION = A; GCC_DYNAMIC_NO_PIC = NO; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Scintilla_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( SCI_NAMESPACE, SCI_LEXER, ); GCC_WARN_UNINITIALIZED_AUTOS = NO; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = Scintilla; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; }; name = Debug; }; 1DEB91AF08733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_CXX_LIBRARY = "libc++"; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; FRAMEWORK_VERSION = A; GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Scintilla_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( SCI_NAMESPACE, SCI_LEXER, ); GCC_WARN_UNINITIALIZED_AUTOS = NO; GCC_WARN_UNKNOWN_PRAGMAS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.7; PRODUCT_NAME = Scintilla; SKIP_INSTALL = YES; WRAPPER_EXTENSION = framework; }; name = Release; }; 1DEB91B208733DA50010E9CD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../include, ../../src, ../../lexlib, ); MACOSX_DEPLOYMENT_TARGET = 10.7; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; name = Debug; }; 1DEB91B308733DA50010E9CD /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ( ../../include, ../../src, ../../lexlib, ); MACOSX_DEPLOYMENT_TARGET = 10.7; SDKROOT = macosx; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Scintilla" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91AE08733DA50010E9CD /* Debug */, 1DEB91AF08733DA50010E9CD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ScintillaFramework" */ = { isa = XCConfigurationList; buildConfigurations = ( 1DEB91B208733DA50010E9CD /* Debug */, 1DEB91B308733DA50010E9CD /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 0867D690FE84028FC02AAC07 /* Project object */; } scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch0000644000175000017500000000022612075650364022327 0ustar neilneil// // Prefix header for all source files of the 'Scintilla' target in the 'Scintilla' project. // #ifdef __OBJC__ #import #endif scintilla/cocoa/QuartzTextStyleAttribute.h0000644000175000017500000000341512075650364020010 0ustar neilneil/** * QuartzTextStyleAttribute.h * * Original Code by Evan Jones on Wed Oct 02 2002. * Contributors: * Shane Caraveo, ActiveState * Bernd Paradies, Adobe * */ #ifndef _QUARTZ_TEXT_STYLE_ATTRIBUTE_H #define _QUARTZ_TEXT_STYLE_ATTRIBUTE_H class QuartzFont { public: /** Create a font style from a name. */ QuartzFont( const char* name, size_t length, float size, int weight, bool italic ) { assert( name != NULL && length > 0 && name[length] == '\0' ); CFStringRef fontName = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingMacRoman); assert(fontName != NULL); bool bold = weight > SC_WEIGHT_NORMAL; if (bold || italic) { CTFontSymbolicTraits desiredTrait = 0; CTFontSymbolicTraits traitMask = 0; // if bold was specified, add the trait if (bold) { desiredTrait |= kCTFontBoldTrait; traitMask |= kCTFontBoldTrait; } // if italic was specified, add the trait if (italic) { desiredTrait |= kCTFontItalicTrait; traitMask |= kCTFontItalicTrait; } // create a font and then a copy of it with the sym traits CTFontRef iFont = ::CTFontCreateWithName(fontName, size, NULL); fontid = ::CTFontCreateCopyWithSymbolicTraits(iFont, size, NULL, desiredTrait, traitMask); if (fontid) { CFRelease(iFont); } else { // Traits failed so use base font fontid = iFont; } } else { // create the font, no traits fontid = ::CTFontCreateWithName(fontName, size, NULL); } if (!fontid) { // Failed to create requested font so use font always present fontid = ::CTFontCreateWithName((CFStringRef)@"Monaco", size, NULL); } CFRelease(fontName); } CTFontRef getFontID() { return fontid; } private: CTFontRef fontid; }; #endif scintilla/cocoa/InfoBar.h0000644000175000017500000000255712270355633014274 0ustar neilneil /** * Scintilla source code edit control * InfoBar.h - Implements special info bar with zoom info, caret position etc. to be used with * ScintillaView. * * Mike Lischke * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ #import #import "InfoBarCommunicator.h" /** * Extended text cell for vertically aligned text. */ @interface VerticallyCenteredTextFieldCell : NSTextFieldCell { BOOL mIsEditingOrSelecting; } @end @interface InfoBar : NSView { @private NSImage* mBackground; IBDisplay mDisplayMask; float mScaleFactor; NSPopUpButton* mZoomPopup; int mCurrentCaretX; int mCurrentCaretY; NSTextField* mCaretPositionLabel; NSTextField* mStatusTextLabel; id mCallback; } - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location value: (float) value; - (void) setCallback: (id ) callback; - (void) createItems; - (void) positionSubViews; - (void) setDisplay: (IBDisplay) display; - (void) zoomItemAction: (id) sender; - (void) setScaleFactor: (float) newScaleFactor adjustPopup: (BOOL) flag; - (void) setCaretPosition: (NSPoint) position; - (void) sizeToFit; @end scintilla/cocoa/InfoBarCommunicator.h0000644000175000017500000000236712364434234016653 0ustar neilneil/* * InfoBarCommunicator.h - Definitions of a communication protocol and other data types used for * the info bar implementation. * * Mike Lischke * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt). */ typedef NS_OPTIONS(NSUInteger, IBDisplay) { IBShowZoom = 0x01, IBShowCaretPosition = 0x02, IBShowStatusText = 0x04, IBShowAll = 0xFF }; /** * The info bar communicator protocol is used for communication between ScintillaView and its * information bar component. Using this protocol decouples any potential info target from the main * ScintillaView implementation. The protocol is used two-way. */ typedef NS_ENUM(NSInteger, NotificationType) { IBNZoomChanged, // The user selected another zoom value. IBNCaretChanged, // The caret in the editor changed. IBNStatusChanged, // The application set a new status message. }; @protocol InfoBarCommunicator - (void) notify: (NotificationType) type message: (NSString*) message location: (NSPoint) location value: (float) value; - (void) setCallback: (id ) callback; @end scintilla/cppcheck.suppress0000644000175000017500000000376112557522743015111 0ustar neilneil// File to suppress cppcheck warnings for files that will not be fixed. // Does not suppress warnings where an additional occurrence of the warning may be of interest. // Coding style is to use assignments in constructor when there are many // members to initialize or the initialization is complex or has comments. useInitializationList // Some non-explicit constructors are used for conversions or are private to lexers noExplicitConstructor noExplicitCopyMoveConstructor // cppcheck does not understand private methods can be called from static methods unusedPrivateFunction:scintilla/win32/PlatWin.cxx // Suppress most lexer warnings since the lexers are maintained by others useInitializationList:scintilla/lexers/LexAsm.cxx useInitializationList:scintilla/lexers/LexBasic.cxx noCopyConstructor:scintilla/lexers/LexBash.cxx variableScope:scintilla/lexers/LexBash.cxx variableScope:scintilla/lexers/LexBatch.cxx variableScope:scintilla/lexers/LexCmake.cxx variableScope:scintilla/lexers/LexCSS.cxx useInitializationList:scintilla/lexers/LexD.cxx variableScope:scintilla/lexers/LexErlang.cxx variableScope:scintilla/lexers/LexGui4Cli.cxx variableScope:scintilla/lexers/LexInno.cxx variableScope:scintilla/lexers/LexLaTeX.cxx variableScope:scintilla/lexers/LexMetapost.cxx variableScope:scintilla/lexers/LexModula.cxx variableScope:scintilla/lexers/LexNimrod.cxx variableScope:scintilla/lexers/LexNsis.cxx variableScope:scintilla/lexers/LexOpal.cxx variableScope:scintilla/lexers/LexPB.cxx noCopyConstructor:scintilla/lexers/LexPerl.cxx variableScope:scintilla/lexers/LexRuby.cxx uninitMemberVar:scintilla/lexers/LexRuby.cxx variableScope:scintilla/lexers/LexSpecman.cxx unreadVariable:scintilla/lexers/LexSpice.cxx clarifyCalculation:scintilla/lexers/LexTADS3.cxx invalidscanf:scintilla/lexers/LexTCMD.cxx variableScope:scintilla/lexers/LexTeX.cxx variableScope:scintilla/lexers/LexVHDL.cxx // Suppress everything in catch.hpp as won't be changing *:scintilla/test/unit/catch.hpp scintilla/delbin.bat0000755000175000017500000000024312110353113013415 0ustar neilneildel /S /Q *.a *.aps *.bsc *.dll *.dsw *.exe *.idb *.ilc *.ild *.ilf *.ilk *.ils *.lib *.map *.ncb *.obj *.o *.opt *.pdb *.plg *.res *.sbr *.tds *.exp *.tlog >NUL: scintilla/delcvs.bat0000755000175000017500000000002512075650364013460 0ustar neilneildel /S /Q .cvsignore scintilla/doc/0000755000175000017500000000000012557522743012261 5ustar neilneilscintilla/doc/ScintillaDownload.html0000644000175000017500000000472512557522743016571 0ustar neilneil Download Scintilla
Scintilla icon Download Scintilla
Windows   GTK+/Linux  

Download.

The license for using Scintilla or SciTE is similar to that of Python containing very few restrictions.

Release 3.6.0

Source Code

The source code package contains all of the source code for Scintilla but no binary executable code and is available in
  • zip format (1500K) commonly used on Windows
  • tgz format (1400K) commonly used on Linux and compatible operating systems
Instructions for building on both Windows and Linux are included in the readme file.

Windows Executable Code

There is no download available containing only the Scintilla DLL. However, it is included in the SciTE executable full download as SciLexer.DLL.

SciTE is a good demonstration of Scintilla.

Previous versions can be downloaded from the history page.

scintilla/doc/Privacy.html0000644000175000017500000000435612533717246014572 0ustar neilneil Privacy Policy
Scintilla icon Scintilla and SciTE

Privacy Policy for scintilla.org

Information Collected

Logs are collected to allow analysis of which pages are viewed. The advertisements collect viewing information through Google Analytics which is used by Google and advertisers. No personally identifiable information is collected by scintilla.org.

External Links

Other web sites are linked to from this site. These web sites have their own privacy policies which may differ significantly to those of scintilla.org.

Cookies

A cookie is a text file placed on the hard drive of a computer by some web pages which is used to remember when a particular user returns to that site. The advertisements shown on the main pages may use cookies.

Contact

This web site is the responsibility of Neil Hodgson. Most queries about the site contents should go to one of the mailing lists mentioned on the main pages. Queries about the privacy policy may be sent to neilh @ scintilla.org.

Changes to this Policy

This policy may change. If it does then this page will be updated and the date at the bottom will change.

This policy was last updated 2 June 2015.

scintilla/doc/styledmargin.png0000644000175000017500000004136212075650364015473 0ustar neilneilPNG  IHDR(d1YsRGBgAMA a cHRMz&u0`:pQ<BpIDATx^ Źw5ue]L̈́` E9DcD Q[РLD|%1h|dI0&D1FM0'A2գ{ݏoлG׮_Ԍo'Y>|)O` ` $e%)t_zǗ@1` ` $O93nr jqPXM@-X\`ruw F_5@Z@f2i"y GM@C[@cW9䰣A'ϸ`hh h@G6U Yk!#ǟ7tLK!QY<N" 3>QCK/|ܰ @_:9Qà=֥;'߽9[nۯkDصp g꽷T{W p) 7/;3<~`cƌƸ [ krfYM.4bRAZVD2[q~;}ת#ߘvw柧 !?~q_9s7,rU7tTo 4 F 1$-` 3c'_sI{5jT$LM9zcU#M|kз'^~Ґw& !mf橐Vn5aQWnݻ7=Аʛ` m̷Lx& w|Y3_t}Š0G}s79g趭jWAZ@(uz믿eudO= m`f̤F_S KۀT2xr&J΄`}whywԀm/>ټ>  X/,1M[jwB 7 WK8^샕WiU)Γw@1k{H;/,6<9sVjh X;f2x.pEM eme]M%gliavL~?9xKƉVդŕkoyusjl߫{CF!ϦKmغe*\6:xx0YB*HZR$# T3O4b| - Z&{Lx׷oxܾ_`ȉo ; Mۆ``c!']:X O=;  1cp )mֻ_bB ӡ'xiIۥM2x5 E\m)r5xd{y#[oj3 0<7S&o39P?Q뿽v`Ac!,~6nko:H&njo Ա!Du<7mֻFxڏW͚{H=pt o1ٍsԥd7Vm`&q洞Շ%{:٦nX3紃-yr` ?Jv8 a5}ޗ®nTV:e]Nsdi,7ܲ2ybW  eMe?L@n^9/>cد}=*__?Dɑ``س!c77w}gbh146„m!x"!ݸs TƟK=W?7S` d5 jլ[T{;yCn.#<'9K@˲R=Z. :Ywzlɱ"y+Gm 3 I6d'ҍ;?AЏo Whw ,ܿ2'K&S!qv[ۺd(q)Tcc [iX%i dW!烺M!v#^ʍZV3֡EXr!wPb~ }xHiYKj3ʙ#O=z^_<D7߹=[!M4O?>Ԍ]9`#O!BC>r*>mD%& ~EOObأאkBiBj,5?\mnc|ΜjAݮNax{P4!A- 4أ_ Zg#yLuUi}`_Y&0y 1b̧ /i?u )]lEѼ"^9{1\;v/OwQfA@Zh xLsD+|!ǘd(ʩm\yTwxpBi5=b!%\xښx5 $9g]"&5V\̎–3pgz}ZJkH`Ζ(:aMs`'AZ֒LIDbɡ=zjHZ>]S]Ħ`UCZ,MN7 D;- )A/2V]7ɓ~)&ݎi;j>ٸ| ɍFs|?z&1&oJw\Gf~B/wHG~IedN>wtǺ$g-&2>SFjrZѢJ< ^fkYz̀KrW/d+o@*HZ&9g ykzyqHe l)&)ޜN{Om0,I# #|v; lvv93~`)|v'A`1_d!Z̿Ҋ@>Y\u r~9`<@8 l8"jTuD2kkW_P16}1|a{f {7Mp!f  `y9 d4jĀ-fF0o_:JA*Hˎ%Lm;Ҟ.){nru?ہj-S]ҊV\fް!_:L jǜqg\ N>ߞkRAZv,d#~wߛq?| {HiEhWyg}1` dz}F#O 8w>c[ٱ$ ݏ ޽  n.x}za/[[-p.rk=ghCh hP}g [[A-_tz떏0` ` 41O1iv7 <[ -P7xzo1!l\1jĨ7I(fI+kwR;q<["{$e޺z!QKgEV$~l7[o#roRW\bV1F+ ?P$Z~^:3@SC[(%ON)Xx^Eg^Ukl/Y]EuV-&Њvs5N4gx8 t)H_W؂E H6dKg!{1݃u2bF2'5B28_Dү6~"AmUt$_V=M9Ka+SFRG? }wk/ض= [ZX%4.`.0 ˙և[iON/EWTI!ĈuP+qn}iI9\8j|BQ_^1oÒ^:,{qxGO*o|<`hyxVT<~!=g9㭘ȗg+Ɠ^Kذ G!ՐcmT9ĕorY:c'ӄ8 < zM  Kmʦmv+"Ծ괘Mequr \<4@ qeHQG>}⊻dװ#_Np)_-pqEmUR:x{;tzUSyɓʰ#gWqV|>E7h8^*XoG~VQS5"OVөF:)QU:9*FB#-KOlmlZ̀'ӿ6mhB xMhk,a 4&4zθXa 4&4zsϵXzZ9Ԑ;{/Em%U8~n M K3eAIR(%,MoeK?S(ʠ8+E~SSJAI<xglg|^ҳs7> 3HZ x̱*/9.LB>Ez@X~A3 x~Vm,ODuD췪=OA(eu3WK*Iv Zh"` ` Xӱ^fnhB W@ZMnҭ[w*|ش!xl~;rKÁ%'\yH|{ ?{J-% pp= C-pߓk[`@ݠ|V6/qƛw֞Xo@IsO.?Qb>vЪomhKw: Xʞ=5"x9U 0sodC۽0 ZL]Oj_F'bVV^`T!ڦो"x^j ?q3^G,Z9iՕ+Cg,Oi\O9{6τK7Ƽhg;ٞ}O.]"LVոσeۢPP*W&#ۢѫW⅂GH3*(N-9:[׽`BG+U` JԕbHxxg1<j;:gvJo]IS:$"xYWy5fܘ:j5 <1ccNy"緋/1#y`i,=gxxf ]j[9R][B$07|{%Ea@&;sdRAr=n>4>,hy*?Fnw kxF$% 歬2Zz;ʍ4䫣޹q6¨GRa{^8iףiwܿ2i'lm3 +GiqNα TIvkOV%1kno#ڇ%*7u+':x|TYS`*|=fwSj e2&_5R/b <o9YÒtnfwkL!Wz"+OK)@DZ.K-}iBb^I%_`>Td@r&lOFW1u%YJq'oo \UCJۍhW0>JGKkDZ63Hr&=XܛX.Iv bZM=5diw[ϩԞ^>2PW7 //92`R Wf}ƒg63%9<1&m^K" K 9ȓ}LVG7E-`Vm=.Rl/OnV'gןsXg_&YsOiF|O3 mhZ)a[>?1j6rUP81t^jem/J{?.;M^a03jOqXu-w?9,<wuvyo]tҩJRɨ9,<~nc `hh 0ߨ7I.jPC[3/[ g^|iͯo ll[w0` ` 48yo--l u`oCg{ ~﮻Q0]H R:x}?1G-5.~  nk"u,ȑxK+3F8"9F^"t-ݲ~QNQ<ӦKs`a] K&rk=&bJxu6ۛ6x:HI#IBW-cX7w/t.8Q ]TKMܯItAOG4EIXؐHS© KB7gvF{u'wU7wj*giv 4vxZEj:*J廸0jJ3Av4Z/|ZO 55ތ_O~~0⊅Dh^geEc\\E^4seiiZs<W/P)]j|c_ZJMxU׉fifk㥫xyD:GS8/ּf}8Qrΰ3^M6ǃ,{5NuF9x W{G>0{7?p9/x ܜgowڴ$lY۲m7y}O{"&LQrNJGP# *^=75 <:i7//$\.90ល8(ޱs-!xO:C=e,S񹼓v7+ϭSf׭6voQ´+#l>q~|Bs Үc(xU:xq͙u9I:Ua)HDΪx972 ^asx<~L Gxr@v+#lQOQŕСHOEH3FvKڳ tcEF̌5&|:xu]+#,*^x^u`VdK` yWVGXTNϸ 2'AGܣz,8y)lFg(\2| fRLN  ;Ϊphޮ>qJz1YWſoHzE#ؐ\CJQ C ؏'*^h/+yzVX1 x)gI*x%2ARDTY*xxD&^J╈*CmxsEųJXzvZ#WFGXTެ_Nh8x~NޚnX<2ūBث,*@l/zaSO:F9oSx xr&x!yxë|O^ `QAU,ʠ龙sTw9;@شNW<5xa  ϐ{rsr^v^Ff uޡgP9¢ǻ~#{tB:}<sRQR۴杵-jvvW$`/ݰk}& ^傗s9¢% I*Ig"^i0BE6TWrxtEK󪦻I=b_EP&aϽ.*86RͤytV9^z%&-d :6~U3ޞbPBs\RE1Y0AK NT,t!U,/;> 5AR:eg^Jeg&Mo-Q>O1ƕQht Cų9B~kZIScWlNn,iԤD O;I, /g]N0[XzA6xLZFrOCe& &!dP$qsE /%QfFw[Uwt{2jUGdF?y(F(Rp_89/bm!*^x~]\ܛDŽ+?Ԕfnt*S,cy\kÕ8S?Eqg%sbXsr ԉNؓ=T`BnwQblKܽIzlG;U(lO96$IVtfұleI&xAGꀊ^#l/QNL;3޳?yd8(-H+ isdCa:Fg~tX% 2~䏈0پQN1-҃xֱESxj;sS.G/-wZ(q'/ַ(xaoumuN&O^'QǒPeNhlK4aE!ǭ<^DūkU@RJ`S,<+zv ݽ.0^iWtΰ&R.c 32t,ƻWǪ&]sWLjU/S,G:&sdx!asSwQs4x[լ.TPQ蹣% YW"%WPVx%PCų%2ARDTYjE1^kɷ&b߮lsC r=^YhaլUM>fYLGXT0mYZFgںf .J6mcVBGXT~,< " sYs?CG. xl/(.z7p\ߜxqY⹙Iӄ\ CY a% ;'BZ*Y Vy'-oV6k/M*\W䥭x|-SlGXT.mz3QXlg䔕S G؈'-5ȋ9hj 4EO /jjw“j+#lD/\> !.Z|Rք /7’H^xvx9+-R^a|]UW#xepx8,(W5 ] %qx@ (Ba#͛MD=OgްÎ?؂ˌR;+S]{g[ UvWp"/b,9xx')5 uwLz;H"߱n\\vʃ}ʙSpG݁+YEh:GcG)$EomبHQ֥xQ@ ^X xpgC`HSOYd 3{|3;*yt %w^0.̅EBNLTY \LWGX aA[[3[5#9mNLTsjw"^ZslVMYW5} USMOkUT&}Z*&EqZK ބ5n/%Pd) C+O*u,!xx Cų0lxsEKxw{C$q$MPE.kw-\k >g[|(^:/,6RvG=xZ$-&ņ#`"Y&PϚ Ϻ̆l!(5EJ,M?yFIRatty 'jDO{ Xܨ6VP;_7R'(I'O<%mxN#qMX@#o/a:enY{~(ur3EyZ _opkr܂,W{]Xf5!$&QV#$$ M^!xpi`XW|sG}缺-MkE]pSw)W|$[W n ;GG^,\AS}dn ;J<4.TJhQqsfglם1[wr[usW2SDݗܷTkҹ7 r?E1(xژP\W,$B:++*b} x|يwUFбAC }UkE};\T4 :qSïRvq CPČ|B(Fb>D)3y0t x)c+p+}tJ}<ŠIPR84/%Pb'AR8&gs5;~y(5 Ibx3R^h xxaxO^awX'"n޶}26YNyzLC@7g6xWG-#l>Ŕ!=&[ľkk);Zh%^axE{[P>]海+#l>ϚϺ̆BQ IWVG*^o^2O~ϔIu\o6DcP$+UJ!)1*2)x^`fAixqͳѳv"o-/x6+֔O(ދAmiW$G*^o<{g/A gmaA6Dr-Zx;0`  -f @/ڱcL{'{k sϥGF0x|[$5G,,[Z FN Scintilla and SciTE Related Sites
Scintilla icon Scintilla and SciTE

Related Sites

Ports and Bindings of Scintilla

Scinterm is an implementation of Scintilla for the ncurses platform.

Scintilla.mcc is a port to MorphOS.

Wx::Scintilla is a Perl Binding for Scintilla on wxWidgets.

GtkScintilla is a GTK+ widget which enables easily adding a powerful source code editor to your applications. Harnessing the abilities of the Scintilla editing component, GtkScintilla adds a familiar GTK+/GObject API, making the widget comfortable to use in these programs, using all the typical GObject conventions.

Editawy is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.

Jintilla is a JNI wrapper that allows Scintilla to be used in Java with both SWT and AWT.

Delphi Scintilla Interface Components is a FREE collection of components that makes it easy to use the Scintilla source code editing control from within Delphi and C++ Builder.

wxStEdit is a library and sample program that provides extra features over wxStyledTextControl.

CScintillaCtrl, CScintillaView & CScintillaDoc are freeware MFC classes to encapsulate Scintilla.

ScintillaNet is an encapsulation of Scintilla for use within the .NET framework.

QScintilla is a port of Scintilla to the Qt platform. It has a similar license to Qt: GPL for use in free software and commercial for use in close-source applications.

GWindows is a Win32 RAD GUI Framework for Ada 95 that includes a binding of Scintilla.

ScintillaVB is an ActiveX control written in VB that encapsulates Scintilla.

FXScintilla is a port of Scintilla to the FOX platform. FXRuby includes Ruby bindings for FXScintilla.

Delphi wrapper for Scintilla which is also usable from Borland C++ Builder.

The wxStyledTextCtrl editor component in the wxWidgets cross platform toolkit is based on Scintilla.
A Python binding for wxStyledTextCtrl is part of wxPython.

gtkscintilla is an alternative GTK class implementation for scintilla. This implementation acts more like a Gtk+ object, with many methods rather than just scintilla_send_message() and is available as a shared library. This implementation works with GTK 1.x.

gtkscintilla2 is an alternative GTK class implementation for scintilla similar to the above, but for GTK 2.x.

pygtkscintilla is a Python binding for gtk1.x scintilla that uses gtkscintilla instead of the default GTK class.

ScintillaCtrl is an unmaintained ActiveX control wrapper for Scintilla.

Projects using Scintilla

SciTECO is an advanced TECO dialect and interactive screen editor based on Scintilla.

Quantum GIS is a user friendly Open Source Geographic Information System (GIS).

QGrinUI searches for a regex within all relevant files in a directory and shows matches using SciTE through the director interface.

Textadept is a ridiculously extensible cross-platform text editor for programmers written (mostly) in Lua using LPeg to handle the lexers.

Scribble is a text editor included in MorphOS.

MySQL Workbench is a cross-platform, visual database design, sql coding and administration tool.

LIVEditor is for web front end coders editing html/css/js code.

Padre is a wxWidgets-based Perl IDE.

CoderStudio is an IDE for Assembly programming similar to Visual Studio 6.0.

Enterprise Architect is a UML 2.1 analysis and design tool.

The CodeAssistor Editor is a small and simple MacOSX source code editor.

PBEditor is a text editor for PowerBuilder.

CrypTool is an application for applying and analyzing cryptographic algorithms.

FXiTe is an advanced cross-platform text editor built with the Fox GUI toolkit and the FXScintilla text widget.

Jabaco is a simple programming language with a Visual Basic like syntax.

LispIDE is a basic Lisp editor for Windows 2000, XP and Vista.

FlexEdit is Free Text/Hex Editor for Windows.

File Workbench: a file manager / text editor environment with Squirrel scripting.

Kephra is a free, easy and comfortable cross-platform editor written in Perl.

TOP is an interface to HP's NonStop servers which run a proprietary OS.

UniversalIndentGUI is a cross platform GUI for several code formatters, beautifiers and indenters like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.

TrackBack watches and backs up every change made in your source code.

Elementary Reports is designed to reduce the time to compose detailed and professional primary school reports.

Visual Classworks Visual class modeling and coding in C++ via 'live' UML style class diagrams.

Javelin Visual Class modeling and coding in Java via 'live' UML style class diagrams.

The ExtendScript Toolkit is a development and debugging tool for JavaScript scripts included with Adobe CS3 Suites.

TortoiseSVN is a Windows GUI client for the Subversion source control software.

Geany is a small and fast GTK2 based IDE, which has only a few dependencies from other packages.

ECMerge is a commercial graphical and batch diff / merge tool for Windows, Linux and Solaris (aiming to target all major platforms).

PyPE is an editor written in Python with the wxPython GUI toolkit.

Sciboo is an editor based on ScintillaNET.

The Scite Config Tool is a graphical user interface for changing SciTE properties files.

Scintilla Lister is a plugin for Total Commander allowing viewing all documents with syntax highlighting inside Total Commander.

ChSciTE is a free IDE for C/C++ interpreter Ch. It runs cross platform. Ch is for cross-platform scripting, shell programming, 2D/3D plotting, numerical computing, and embedded scripting.

Code::Blocks is an open source, cross platform free C++ IDE.

Notepad++ is a free source code editor under Windows.

Gubed is a cross platform program to debug PHP scripts.

LSW DotNet-Lab is a development environment for the .NET platform.

GLIntercept is an OpenGL function call interceptor that uses SciTE as a run-time shader editor.

wyoEditor is "A nice editor with a well designed and consistent look and feel".

Notepad2 is "Yet another Notepad replacement".

PyCrash Viewer can examine crash dumps of Python programs.

MPT series Wire Analyzers use Scintilla and SciTE.

MyGeneration is a .NET based code generator.

CSSED is a tiny GTK2 CSS editor.

IdePS is a free Integrated Development Environment for PostScript

CUTE is a user-friendly source code editor easily extended using Python.

Venis IX, the Visual Environment for NSIS (Nullsoft Scriptable Install System).

Eric3 is a Python IDE written using PyQt and QScintilla.

SciTE|Flash is a free Scintilla-based ActionScript editor for Windows.

CPPIDE is part of some commercial high-school oriented programming course software.

Instant Source is a commercial tool for looking at the HTML on web sites.

RAD.On++ is a free C++ Rapid Application Developer for Win32.

wxBasic is an open source Basic interpreter that uses the wxWidgets toolkit. A small IDE is under construction.

FreeRIDE will be a cross-platform IDE for the Ruby programming language.

Visual MinGW is an IDE for the MinGW compiler system.This runs on Windows with gcc.

The Wing IDE is a complete integrated development environment for the Python programming language. Available on Intel based Linux and Windows and on MacOS X through XDarwin.

LuaIDE is an IDE for Lua on Windows.

Sphere is 2D RPG engine with a development environment.

Practical Ruby is an IDE for Ruby on Windows.

GNUe is a suite of tools and applications for solving the needs of the enterprise.

SilverCity is a lexing package that can provide lexical analysis for over 20 programming and markup languages.

HAP Python Remote Debugger is a Python debugger that can run on one Windows machine debugging a Python program running on either the same or another machine.

pyeditor and wxEditor are scriptable editors implemented in Python. pyeditor is based on GTK+ and the pyscintilla wrapper. wxEditor is based on wxWidgets, wxPython and wxStyledTextControl.

PyCrust is an interactive Python shell based on wxPython.

Black Adder is a Qt based development environment for Python and Ruby.

Komodo is a cross-platform multi-language development environment built as an application of Mozilla.

Filerx is a project manager for SciTE on Windows. Open source and includes an implementation of SciTE's Director interface so will be of interest to others wanting to control SciTE.

Anjuta is an open source C/C++ IDE for Linux/GNOME.

A version of SciTE for Win32 enhanced with a tab control to allow easy movement between buffers. Go to the "Goodies" area on this site.

Suneido is an integrated application platform currently available for Win32 that includes an object-oriented language, client-server database, and user interface and reporting frameworks.

Agast is an authoring system for adventure games which includes a customised version of SciTE.

Boa Constructor is a RAD GUI Building IDE for the wxWidgets cross platform platform. Written using wxPython with the wxStyledTextCtrl used as its editor.

PythonWin, a Win32 IDE for Python, uses Scintilla for both its editing and interactive windows.

Editing Components

CodeMirror is a versatile text editor implemented in JavaScript for the browser.

UniCodeEditor is a Unicode aware syntax editor control for Delphi and C++ Builder.

GtkSourceView is a text widget that extends the standard GTK+ 2.x text widget and improves it by implementing syntax highlighting and other features typical of a source editor.

AEditor is a free source code editing component implemented in Ruby.

SyntaxEditor is a commercial native .Net source code editing component.

jEdit is a good Open Source syntax colouring editor written in and for Java.

GTK+, the GIMP Toolkit, contains a rich text editing widget.
Gedit is an editor for GTK+/GNOME.

CodeGuru has source code for several Win32 MFC based editors.

SynEdit is a Win32 edit control written in Delphi.

SourceView is a commercial editing component for Win32.

CodeMax is another commercial component for Win32.

Documents

The Craft of Text Editing describes how EMACS works, Craig A. Finseth

Data Structures in a Bit-Mapped Text Editor, Wilfred J. Hanson, Byte January 1987

Text Editors: Algorithms and Architectures, Ray Valdés, Dr. Dobbs Journal April 1993

Macintosh User Interface Guidelines and TextEdit chapters of Inside Macintosh

Development Tools

Scintilla and SciTE were developed using the Mingw version of GCC.

AStyle is a source code formatter for C++ and Java code. SciTE has an Indent command defined for .cxx files that uses AStyle.

WinMerge is an interactive diff / merge for Windows. I prefer code submissions in the form of source files rather than diffs and then run WinMerge over the files to work out how to merge.

Python is my favourite programming language. Scintilla was started after I tried to improve the editor built into PythonWin, but was frustrated by the limitations of the Windows Richedit control which PythonWin used.

regex is a public domain implementation of regular expression pattern matching used in Scintilla.

Inspirational coding soundscapes by David Bridie.

scintilla/doc/ScintillaToDo.html0000644000175000017500000000741612125452110015644 0ustar neilneil Scintilla and SciTE To Do
Scintilla icon Scintilla and SciTE

Bugs and To Do List

Feedback

Issues can be reported on the Bug Tracker and features requested on the Feature Request Tracker.

Scintilla Bugs

Automatic scrolling when text dragged near edge of window.

Scintilla To Do

Folding for languages that don't have it yet and good folding for languages that inherited poor folding from another languages folding code.

Simple pattern based styling.

Different height lines based upon tallest text on the line rather than on the tallest style possible.

Composition of lexing for mixed languages (such as ASP+ over COBOL) by combining lexers.

Stream folding which could be used to fold up the contents of HTML elements.

Printing of highlight lines and folding margin.

Flow diagrams inside editor similar to GRASP.

More lexers for other languages.

SciTE To Do

Good regular expression support through a plugin.

Allow file name based selection on all properties rather than just a chosen few.

Opening from and saving to FTP servers.

Setting to fold away comments upon opening.

User defined fold ranges.

Silent mode that does not display any message boxes.

Features I am unlikely to do

These are features I don't like or don't think are important enough to work on. Implementations are welcome from others though.

Mouse wheel panning (press the mouse wheel and then move the mouse) on Windows.

Adding options to the save dialog to save in a particular encoding or with a chosen line ending.

Directions

The main point of this development is Scintilla, and this is where most effort will go. SciTE will get new features, but only when they make my life easier - I am not intending to make it grow up to be a huge full-function IDE like Visual Cafe. The lines I've currently decided not to step over in SciTE are any sort of project facility and any configuration dialogs. SciTE for Windows now has a Director interface for communicating with a separate project manager application.

If you are interested in contributing code, do not feel any need to make it cross platform. Just code it for your platform and I'll either reimplement for the other platform or ensure that there is no effect on the other platform.

scintilla/doc/SciCoding.html0000644000175000017500000003264212075650364015014 0ustar neilneil Scintilla and SciTE Code Style Preferences
Scintilla icon Scintilla and SciTE

Code Style

Introduction

The source code of Scintilla and SciTE follow my preferences. Some of these decisions are arbitrary and based on my sense of aesthetics but its good to have all the code look the same even if its not exactly how everyone would prefer.

Code that does not follow these conventions will be accepted, but will be modified as time goes by to fit the conventions. Scintilla code follows the conventions more closely than SciTE except for lexers which are relatively independent modules. Lexers that are maintained by others are left as they are submitted except that warnings will be fixed so the whole project can compile cleanly.

The AStyle formatting program with '-taOHUKk3 -M8' arguments formats code in much the right way although there are a few bugs in AStyle.

Language features

Design goals for Scintilla and SciTE include portability to currently available C++ compilers on diverse platforms with high performance and low resource usage. Scintilla has stricter portability requirements to SciTE as it may be ported to low capability platforms.

To achieve portability, only a subset of C++ features are used. Exceptions and templates may be used but, since Scintilla can be used from C as well as C++, exceptions may not be thrown out of Scintilla and all exceptions should be caught before returning from Scintilla. Run-time type information adds to memory use so is turned off. A 'Scintilla' name spaces is optionally used based on the SCI_NAMESPACE definition. This helps with name clashes on OS X.

The goto statement is not used because of bad memories from my first job maintaining FORTRAN programs. The union feature is not used as it can lead to non-type-safe value access.

Casting

Do not use old C style casts like (char *)s. Instead use the most strict form of C++ cast possible like const_cast<char *>(s). Use static_cast and const_cast where possible rather than reinterpret_cast. Because the code is compiled with run-time type information turned off, dynamic_cast will not work.

The benefit to using the new style casts is that they explicitly detail what evil is occurring and act as signals that something potentially unsafe is being done.

Code that treats const seriously is easier to reason about both for humans and compilers, so use const parameters and avoid const_cast.

Warnings

To help ensure code is well written and portable, it is compiled with almost all warnings turned on. This sometimes results in warnings about code that is completely good (false positives) but changing the code to avoid the warnings is generally fast and has little impact on readability.

Initialise all variables and minimise the scope of variables. If a variable is defined just before its use then it can't be misused by code before that point. Use loop declarations that are compatible with both the C++ standard and currently available compilers.

Allocation

Memory exhaustion can occur in many Scintilla methods. This should be checked for and handled but once it has happened, it is very difficult to do anything as Scintilla's data structures may be in an inconsistent state. Fixed length buffers are often used as these are simple and avoid the need to worry about memory exhaustion but then require that buffer lengths are respected.

The C++ new and delete operators are preferred over C's malloc and free as new and delete are type safe.

Bracketing

Start brackets, '{', should be located on the line of the control structure they start and end brackets, '}', should be at the indented start of a line. When there is an else clause, this occurs on the same line as the '}'. This format uses less lines than alternatives, allowing more code to be seen on screen. Fully bracketed control structures are preferred because this makes it more likely that modifications will be correct and it allows Scintilla's folder to work. No braces on returned expressions as return is a keyword, not a function call.

bool fn(int a) {
        
if (a) {
                
s();
                
t();
        
} else {
                
u();
        
}
        
return !a;
}

Spacing

Spaces on both sides of '=' and comparison operators and no attempt to line up '='. No space before or after '(', when used in calls, but a space after every ','. No spaces between tokens in short expressions but may be present in longer expressions. Space before '{'. No space before ';'. No space after '*' when used to mean pointer and no space after '[' or ']'. One space between keywords and '('.

void StoreConditionally(int c, const char *s) {
        
if (c && (baseSegment == trustSegment["html"])) {
                
baseSegment = s+1;
                
Store(s, baseSegment, "html");
        
}
}

Names

Identifiers use mixed case and no underscores. Class, function and method names start with an uppercase letter and use further upper case letters to distinguish words. Variables start with a lower case letter and use upper case letters to distinguish words. Loop counters and similar variables can have simple names like 'i'. Function calls should be differentiated from method calls with an initial '::' global scope modifier.

class StorageZone {
public:
        
void Store(const char *s) {
                
Media *mediaStore = ::GetBaseMedia(zoneDefault);
                
for (int i=mediaStore->cursor; mediaStore[i], i++) {
                        
mediaStore->Persist(s[i]);
                
}
        
}
};

Submitting a lexer

Add a public feature request to the Feature Request Tracker.

Send all the modified and new files as full text (not patches) in an archive (.zip or .tgz).

Define all of the lexical states in a modified Scintilla.iface.

Ensure there are no warnings under the compiler you use. Warnings from other compilers will be noted on the feature request.

sc.ch is an int: do not pass this around as a char.

scintilla/doc/index.html0000644000175000017500000002142112557522743014256 0ustar neilneil Scintilla and SciTE
Scintilla A free source code editing component for Win32, GTK+, and OS X Release version 3.6.0
Site last modified August 3 2015
 
 
  • Version 3.6.0 implements more multiple selection operations. Type definitions Sci_Position, Sci_PositionU, and Sci_PositionCR allow client code to prepare for a future change allowing larger than 2 GB documents.
  • Version 3.5.7 fixes a crash on Cocoa with drag and drop and adds commands to add the next or each occurrence of the main selection to the set of selections.
  • Version 3.5.6 fixes a bug with undo on Cocoa that could lose data.
  • Version 3.5.5 improves IME on Qt and fixes minor bugs.
  • Version 3.5.4 improves indicators to be able to change appearance on mouse-over and to use a wide variety of colours together.

Scintilla is a free source code editing component. It comes with complete source code and a license that permits use in any free project or commercial product.

As well as features found in standard text editing components, Scintilla includes features especially useful when editing and debugging source code. These include support for syntax styling, error indicators, code completion and call tips. The selection margin can contain markers like those used in debuggers to indicate breakpoints and the current line. Styling choices are more open than with many editors, allowing the use of proportional fonts, bold and italics, multiple foreground and background colours and multiple fonts.

SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. It is best used for jobs with simple configurations - I use it for building test and demonstration programs as well as SciTE and Scintilla, themselves.

Development of Scintilla started as an effort to improve the text editor in PythonWin. After being frustrated by problems in the Richedit control used by PythonWin, it looked like the best way forward was to write a new edit control. The biggest problem with Richedit and other similar controls is that they treat styling changes as important persistent changes to the document so they are saved into the undo stack and set the document's dirty flag. For source code, styling should not be persisted as it can be mechanically recreated.

Scintilla and SciTE are currently available for Intel Win32, OS X, and Linux compatible operating systems with GTK+. They have been run on Windows XP, Windows 7, OS X 10.6+, and on Ubuntu 10.10 with GTK+ 2.20. Here is a screenshot of SciTE.

You can download Scintilla.

The source code can be downloaded via Mercurial at the Source Forge Scintilla project page.

Related sites.

Bugs and To Do list.

History and contribution credits.

Icons that can be used with Scintilla.

Questions and comments about Scintilla should be directed to the scintilla-interest mailing list, which is for discussion of Scintilla and related projects, their bugs and future features. This is a low traffic list, averaging less than 20 messages per week. To avoid spam, only list members can write to the list. New versions of Scintilla are announced on scintilla-interest and may also be received by SourceForge members by clicking on the Monitor column icon for "scintilla" on the downloads page. Messages sent to my personal email address that could have been sent to the list may receive no response.

There is a Scintilla project page hosted on scintilla/doc/ScintillaDoc.html0000644000175000017500000151555112557522743015534 0ustar neilneil Scintilla Documentation
Scintilla icon Scintilla

Scintilla Documentation

Last edited 31 July 2015 NH

There is an overview of the internal design of Scintilla.
Some notes on using Scintilla.
How to use the Scintilla Edit Control on Windows.
A simple sample using Scintilla from C++ on Windows.
A simple sample using Scintilla from Visual Basic.
Bait is a tiny sample using Scintilla on GTK+.
A detailed description of how to write a lexer, including a discussion of folding.
How to implement a lexer in the container.
How to implement folding.
Beginner's Guide to lexing and folding.
The coding style used in Scintilla and SciTE is worth following if you want to contribute code to Scintilla but is not compulsory.

Introduction

The Windows version of Scintilla is a Windows Control. As such, its primary programming interface is through Windows messages. Early versions of Scintilla emulated much of the API defined by the standard Windows Edit and RichEdit controls but those APIs are now deprecated in favour of Scintilla's own, more consistent API. In addition to messages performing the actions of a normal Edit control, Scintilla allows control of syntax styling, folding, markers, autocompletion and call tips.

The GTK+ version also uses messages in a similar way to the Windows version. This is different to normal GTK+ practice but made it easier to implement rapidly.

Scintilla also builds with Cocoa on OS X and with Qt, and follows the conventions of those platforms.

Scintilla does not properly support right-to-left languages like Arabic and Hebrew. While text in these languages may appear correct, it is not possible to interact with this text as is normal with other editing components.

This documentation describes the individual messages and notifications used by Scintilla. It does not describe how to link them together to form a useful editor. For now, the best way to work out how to develop using Scintilla is to see how SciTE uses it. SciTE exercises most of Scintilla's facilities.

In the descriptions that follow, the messages are described as function calls with zero, one or two arguments. These two arguments are the standard wParam and lParam familiar to Windows programmers. These parameters are integers that are large enough to hold pointers, and the return value is also an integer large enough to contain a pointer. Although the commands only use the arguments described, because all messages have two arguments whether Scintilla uses them or not, it is strongly recommended that any unused arguments are set to 0. This allows future enhancement of messages without the risk of breaking existing code. Common argument types are:

bool Arguments expect the values 0 for false and 1 for true.
int Arguments are 32-bit signed integers.
const char * Arguments point at text that is being passed to Scintilla but not modified. The text may be zero terminated or another argument may specify the character count, the description will make this clear.
char * Arguments point at text buffers that Scintilla will fill with text. In some cases, another argument will tell Scintilla the buffer size. In others, you must make sure that the buffer is big enough to hold the requested text. If a NULL pointer (0) is passed then, for SCI_* calls, the length that should be allocated, not including any terminating NUL, is returned. Some calls (marked "NUL-terminated") add a NUL character to the result but other calls do not: to generically handle both types, allocate one more byte than indicated and set it to NUL.
colour Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255. If you have three such intensities, they are combined as: red | (green << 8) | (blue << 16). If you set all intensities to 255, the colour is white. If you set all intensities to 0, the colour is black. When you set a colour, you are making a request. What you will get depends on the capabilities of the system and the current screen mode.
alpha Translucency is set using an alpha value. Alpha ranges from 0 (SC_ALPHA_TRANSPARENT) which is completely transparent to 255 (SC_ALPHA_OPAQUE) which is opaque. The value 256 (SC_ALPHA_NOALPHA) is opaque and uses code that is not alpha-aware and may be faster. Not all platforms support translucency and only some Scintilla features implement translucency. The default alpha value for most features is SC_ALPHA_NOALPHA.
<unused> This is an unused argument. Setting it to 0 will ensure compatibility with future enhancements.

Contents

o Text retrieval and modification o Searching and replacing o Overtype
o Cut, copy and paste o Error handling o Undo and Redo
o Selection and information o Multiple Selection and Virtual Space o Scrolling and automatic scrolling
o White space o Cursor o Mouse capture
o Line endings o Styling o Style definition
o Caret, selection, and hotspot styles o Character representations o Margins
o Annotations o Other settings o Brace highlighting
o Tabs and Indentation Guides o Markers o Indicators
o Autocompletion o User lists o Call tips
o Keyboard commands o Key bindings o Popup edit menu
o Macro recording o Printing o Direct access
o Multiple views o Background loading and saving o Folding
o Line wrapping o Zooming o Long lines
o Lexer o Lexer objects o Notifications
o Images o GTK+ o Provisional messages
o Deprecated messages o Edit messages never supported by Scintilla o Building Scintilla

Messages with names of the form SCI_SETxxxxx often have a companion SCI_GETxxxxx. To save tedious repetition, if the SCI_GETxxxxx message returns the value set by the SCI_SETxxxxx message, the SET routine is described and the GET routine is left to your imagination.

Text retrieval and modification

Each byte in a Scintilla document is associated with a byte of styling information. The combination of a character byte and a style byte is called a cell. Style bytes are interpreted an index into an array of styles.

In this document, 'character' normally refers to a byte even when multi-byte characters are used. Lengths measure the numbers of bytes, not the amount of characters in those bytes.

Positions within the Scintilla document refer to a character or the gap before that character. The first character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last character is numbered nLen-1. The caret exists between character positions and can be located from before the first character (0) to after the last character (nLen).

There are places where the caret can not go where two character bytes make up one character. This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M standard of a carriage return followed by a line feed. The INVALID_POSITION constant (-1) represents an invalid position within the document.

All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style. This restriction is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.

SCI_GETTEXT(int length, char *text)
SCI_SETTEXT(<unused>, const char *text)
SCI_SETSAVEPOINT
SCI_GETLINE(int line, char *text)
SCI_REPLACESEL(<unused>, const char *text)
SCI_SETREADONLY(bool readOnly)
SCI_GETREADONLY
SCI_GETTEXTRANGE(<unused>, Sci_TextRange *tr)
SCI_ALLOCATE(int bytes, <unused>)
SCI_ADDTEXT(int length, const char *s)
SCI_ADDSTYLEDTEXT(int length, cell *s)
SCI_APPENDTEXT(int length, const char *s)
SCI_INSERTTEXT(int pos, const char *text)
SCI_CHANGEINSERTION(int length, const char *text)
SCI_CLEARALL
SCI_DELETERANGE(int pos, int deleteLength)
SCI_CLEARDOCUMENTSTYLE
SCI_GETCHARAT(int position)
SCI_GETSTYLEAT(int position)
SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr)
SCI_RELEASEALLEXTENDEDSTYLES
SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)
SCI_TARGETASUTF8(<unused>, char *s)
SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)
SCI_SETLENGTHFORENCODE(int bytes)

SCI_GETTEXT(int length, char *text NUL-terminated)
This returns length-1 characters of text from the start of the document plus one terminating 0 character. To collect all the text in a document, use SCI_GETLENGTH to get the number of characters in the document (nLen), allocate a character buffer of length nLen+1 bytes, then call SCI_GETTEXT(nLen+1, char *text). If the text argument is 0 then the length that should be allocated to store the entire document is returned. If you then save the text, you should use SCI_SETSAVEPOINT to mark the text as unmodified.

See also: SCI_GETSELTEXT, SCI_GETCURLINE, SCI_GETLINE, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

SCI_SETTEXT(<unused>, const char *text)
This replaces all the text in the document with the zero terminated text string you pass in.

SCI_SETSAVEPOINT
This message tells Scintilla that the current state of the document is unmodified. This is usually done when the file is saved or loaded, hence the name "save point". As Scintilla performs undo and redo operations, it notifies the container that it has entered or left the save point with SCN_SAVEPOINTREACHED and SCN_SAVEPOINTLEFT notification messages, allowing the container to know if the file should be considered dirty or not.

See also: SCI_EMPTYUNDOBUFFER, SCI_GETMODIFY

SCI_GETLINE(int line, char *text)
This fills the buffer defined by text with the contents of the nominated line (lines start at 0). The buffer is not terminated by a 0 character. It is up to you to make sure that the buffer is long enough for the text, use SCI_LINELENGTH(int line). The returned value is the number of characters copied to the buffer. The returned text includes any end of line characters. If you ask for a line number outside the range of lines in the document, 0 characters are copied. If the text argument is 0 then the length that should be allocated to store the entire line is returned.

See also: SCI_GETCURLINE, SCI_GETSELTEXT, SCI_GETTEXTRANGE, SCI_GETSTYLEDTEXT, SCI_GETTEXT

SCI_REPLACESEL(<unused>, const char *text)
The currently selected text between the anchor and the current position is replaced by the 0 terminated text string. If the anchor and current position are the same, the text is inserted at the caret position. The caret is positioned after the inserted text and the caret is scrolled into view.

SCI_SETREADONLY(bool readOnly)
SCI_GETREADONLY
These messages set and get the read-only flag for the document. If you mark a document as read only, attempts to modify the text cause the SCN_MODIFYATTEMPTRO notification.

SCI_GETTEXTRANGE(<unused>, Sci_TextRange *tr)
This collects the text between the positions cpMin and cpMax and copies it to lpstrText (see struct Sci_TextRange in Scintilla.h). If cpMax is -1, text is returned to the end of the document. The text is 0 terminated, so you must supply a buffer that is at least 1 character longer than the number of characters you wish to read. The return value is the length of the returned text not including the terminating 0.

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETCURLINE, SCI_GETSTYLEDTEXT, SCI_GETTEXT

SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr)
This collects styled text into a buffer using two bytes for each cell, with the character at the lower address of each pair and the style byte at the upper address. Characters between the positions cpMin and cpMax are copied to lpstrText (see struct Sci_TextRange in Scintilla.h). Two 0 bytes are added to the end of the text, so the buffer that lpstrText points at must be at least 2*(cpMax-cpMin)+2 bytes long. No check is made for sensible values of cpMin or cpMax. Positions outside the document return character codes and style bytes of 0.

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETCURLINE, SCI_GETTEXTRANGE, SCI_GETTEXT

SCI_ALLOCATE(int bytes, <unused>)
Allocate a document buffer large enough to store a given number of bytes. The document will not be made smaller than its current contents.

SCI_ADDTEXT(int length, const char *s)
This inserts the first length characters from the string s at the current position. This will include any 0's in the string that you might have expected to stop the insert operation. The current position is set at the end of the inserted text, but it is not scrolled into view.

SCI_ADDSTYLEDTEXT(int length, cell *s)
This behaves just like SCI_ADDTEXT, but inserts styled text.

SCI_APPENDTEXT(int length, const char *s)
This adds the first length characters from the string s to the end of the document. This will include any 0's in the string that you might have expected to stop the operation. The current selection is not changed and the new text is not scrolled into view.

SCI_INSERTTEXT(int pos, const char *text)
This inserts the zero terminated text string at position pos or at the current position if pos is -1. If the current position is after the insertion point then it is moved along with its surrounding text but no scrolling is performed.

SCI_CHANGEINSERTION(int length, const char *text)
This may only be called from a SC_MOD_INSERTCHECK notification handler and will change the text being inserted to that provided.

SCI_CLEARALL
Unless the document is read-only, this deletes all the text.

SCI_DELETERANGE(int pos, int deleteLength)
Deletes a range of text in the document.

SCI_CLEARDOCUMENTSTYLE
When wanting to completely restyle the document, for example after choosing a lexer, the SCI_CLEARDOCUMENTSTYLE can be used to clear all styling information and reset the folding state.

SCI_GETCHARAT(int pos)
This returns the character at pos in the document or 0 if pos is negative or past the end of the document.

SCI_GETSTYLEAT(int pos)
This returns the style at pos in the document, or 0 if pos is negative or past the end of the document.

SCI_RELEASEALLEXTENDEDSTYLES
SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)
Extended styles are used for features like textual margins and annotations as well as internally by Scintilla. They are outside the range 0..255 used for the styles bytes associated with document bytes. These functions manage the use of extended styles to ensures that components cooperate in defining styles. SCI_RELEASEALLEXTENDEDSTYLES releases any extended styles allocated by the container. SCI_ALLOCATEEXTENDEDSTYLES allocates a range of style numbers after the byte style values and returns the number of the first allocated style. Ranges for margin and annotation styles should be allocated before calling SCI_MARGINSETSTYLEOFFSET or SCI_ANNOTATIONSETSTYLEOFFSET.

Sci_TextRange and Sci_CharacterRange
These structures are defined to be exactly the same shape as the Win32 TEXTRANGE and CHARRANGE, so that older code that treats Scintilla as a RichEdit will work.

In a future release the type Sci_PositionCR will be redefined to be 64-bits when Scintilla is built for 64-bits on all platforms.

typedef long Sci_PositionCR;

struct Sci_CharacterRange {
    Sci_PositionCR cpMin;
    Sci_PositionCR cpMax;
};

struct Sci_TextRange {
    struct Sci_CharacterRange chrg;
    char *lpstrText;
};

Specific to GTK+, Cocoa and Windows only: Access to encoded text

SCI_TARGETASUTF8(<unused>, char *s)
This method retrieves the value of the target encoded as UTF-8 which is the default encoding of GTK+ so is useful for retrieving text for use in other parts of the user interface, such as find and replace dialogs. The length of the encoded text in bytes is returned. Cocoa uses UTF-16 which is easily converted from UTF-8 so this method can be used to perform the more complex work of transcoding from the various encodings supported.

SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded)
SCI_SETLENGTHFORENCODE(int bytes)
SCI_ENCODEDFROMUTF8 converts a UTF-8 string into the document's encoding which is useful for taking the results of a find dialog, for example, and receiving a string of bytes that can be searched for in the document. Since the text can contain nul bytes, the SCI_SETLENGTHFORENCODE method can be used to set the length that will be converted. If set to -1, the length is determined by finding a nul byte. The length of the converted string is returned.

Searching

There are methods to search for text and for regular expressions. Most applications should use SCI_SEARCHINTARGET as the basis for their search implementations. Other calls augment this or were implemented before SCI_SEARCHINTARGET.

The base regular expression support is limited and should only be used for simple cases and initial development. When using a C++11 compliant compiler and runtime, it may be possible to use the runtime's implementation of <regex> by compiling Scintilla with CXX11_REGEX defined. A different regular expression library can be integrated into Scintilla or can be called from the container using direct access to the buffer contents through SCI_GETCHARACTERPOINTER.

Search and replace using the target

Searching can be performed within the target range with SCI_SEARCHINTARGET, which uses a counted string to allow searching for null characters. It returns the position of the start of the matching text range or -1 for failure, in which case the target is not moved. The flags used by SCI_SEARCHINTARGET such as SCFIND_MATCHCASE, SCFIND_WHOLEWORD, SCFIND_WORDSTART, and SCFIND_REGEXP can be set with SCI_SETSEARCHFLAGS.

SCI_SETTARGETSTART(int pos)
SCI_GETTARGETSTART
SCI_SETTARGETEND(int pos)
SCI_GETTARGETEND
SCI_SETTARGETRANGE(int start, int end)
SCI_TARGETFROMSELECTION
SCI_TARGETWHOLEDOCUMENT
SCI_SETSEARCHFLAGS(int searchFlags)
SCI_GETSEARCHFLAGS
SCI_SEARCHINTARGET(int length, const char *text)
SCI_GETTARGETTEXT(<unused>, char *text)
SCI_REPLACETARGET(int length, const char *text)
SCI_REPLACETARGETRE(int length, const char *text)
SCI_GETTAG(int tagNumber, char *tagValue)

SCI_SETTARGETSTART(int pos)
SCI_GETTARGETSTART
SCI_SETTARGETEND(int pos)
SCI_GETTARGETEND
SCI_SETTARGETRANGE(int start, int end)
These functions set and return the start and end of the target. When searching you can set start greater than end to find the last matching text in the target rather than the first matching text. The target is also set by a successful SCI_SEARCHINTARGET.

SCI_TARGETFROMSELECTION
Set the target start and end to the start and end positions of the selection.

SCI_TARGETWHOLEDOCUMENT
Set the target start to the start of the document and target end to the end of the document.

SCI_SETSEARCHFLAGS(int searchFlags)
SCI_GETSEARCHFLAGS
These get and set the searchFlags used by SCI_SEARCHINTARGET. There are several option flags including a simple regular expression search.

SCI_SEARCHINTARGET(int length, const char *text)
This searches for the first occurrence of a text string in the target defined by SCI_SETTARGETSTART and SCI_SETTARGETEND. The text string is not zero terminated; the size is set by length. The search is modified by the search flags set by SCI_SETSEARCHFLAGS. If the search succeeds, the target is set to the found text and the return value is the position of the start of the matching text. If the search fails, the result is -1.

SCI_GETTARGETTEXT(<unused>, char *text)
Retrieve the value in the target.

SCI_REPLACETARGET(int length, const char *text)
If length is -1, text is a zero terminated string, otherwise length sets the number of character to replace the target with. After replacement, the target range refers to the replacement text. The return value is the length of the replacement string.
Note that the recommended way to delete text in the document is to set the target to the text to be removed, and to perform a replace target with an empty string.

SCI_REPLACETARGETRE(int length, const char *text)
This replaces the target using regular expressions. If length is -1, text is a zero terminated string, otherwise length is the number of characters to use. The replacement string is formed from the text string with any sequences of \1 through \9 replaced by tagged matches from the most recent regular expression search. \0 is replaced with all the matched text from the most recent search. After replacement, the target range refers to the replacement text. The return value is the length of the replacement string.

SCI_GETTAG(int tagNumber, char *tagValue NUL-terminated)
Discover what text was matched by tagged expressions in a regular expression search. This is useful if the application wants to interpret the replacement string itself.

See also: SCI_FINDTEXT

searchFlags
Several of the search routines use flag options, which include a simple regular expression search. Combine the flag options by adding them:

SCFIND_MATCHCASE A match only occurs with text that matches the case of the search string.
SCFIND_WHOLEWORD A match only occurs if the characters before and after are not word characters.
SCFIND_WORDSTART A match only occurs if the character before is not a word character.
SCFIND_REGEXP The search string should be interpreted as a regular expression.
SCFIND_POSIX Treat regular expression in a more POSIX compatible manner by interpreting bare ( and ) for tagged sections rather than \( and \).
SCFIND_CXX11REGEX When compiled with CXX11_REGEX this flag may be set to use <regex> instead of Scintilla's basic regular expressions. If the regular expression is invalid then -1 is returned and status is set to SC_STATUS_WARN_REGEX. The ECMAScript flag is set on the regex object and UTF-8 documents will exhibit Unicode-compliant behaviour. For MSVC, where wchar_t is 16-bits, the reular expression ".." will match a single astral-plane character. There may be other differences between compilers.

In a regular expression, special characters interpreted are:

. Matches any character
\( This marks the start of a region for tagging a match.
\) This marks the end of a tagged region.
\n Where n is 1 through 9 refers to the first through ninth tagged region when replacing. For example, if the search string was Fred\([1-9]\)XXX and the replace string was Sam\1YYY, when applied to Fred2XXX this would generate Sam2YYY. \0 refers to all of the matching text.
\< This matches the start of a word using Scintilla's definitions of words.
\> This matches the end of a word using Scintilla's definition of words.
\x This allows you to use a character x that would otherwise have a special meaning. For example, \[ would be interpreted as [ and not as the start of a character set.
[...] This indicates a set of characters, for example, [abc] means any of the characters a, b or c. You can also use ranges, for example [a-z] for any lower case character.
[^...] The complement of the characters in the set. For example, [^A-Za-z] means any character except an alphabetic character.
^ This matches the start of a line (unless used inside a set, see above).
$ This matches the end of a line.
* This matches 0 or more times. For example, Sa*m matches Sm, Sam, Saam, Saaam and so on.
+ This matches 1 or more times. For example, Sa+m matches Sam, Saam, Saaam and so on.

Regular expressions will only match ranges within a single line, never matching over multiple lines.

SCI_FINDTEXT(int flags, Sci_TextToFind *ttf)
SCI_SEARCHANCHOR
SCI_SEARCHNEXT(int searchFlags, const char *text)
SCI_SEARCHPREV(int searchFlags, const char *text)

SCI_FINDTEXT(int searchFlags, Sci_TextToFind *ttf)
This message searches for text in the document. It does not use or move the current selection. The searchFlags argument controls the search type, which includes regular expression searches.

You can search backwards to find the previous occurrence of a search string by setting the end of the search range before the start.

The Sci_TextToFind structure is defined in Scintilla.h; set chrg.cpMin and chrg.cpMax with the range of positions in the document to search. You can search backwards by setting chrg.cpMax less than chrg.cpMin. Set the lpstrText member of Sci_TextToFind to point at a zero terminated text string holding the search pattern. If your language makes the use of Sci_TextToFind difficult, you should consider using SCI_SEARCHINTARGET instead.

The return value is -1 if the search fails or the position of the start of the found text if it succeeds. The chrgText.cpMin and chrgText.cpMax members of Sci_TextToFind are filled in with the start and end positions of the found text.

See also: SCI_SEARCHINTARGET

Sci_TextToFind
This structure is defined to have exactly the same shape as the Win32 structure FINDTEXTEX for old code that treated Scintilla as a RichEdit control.

struct Sci_TextToFind {
    struct Sci_CharacterRange chrg;     // range to search
    const char *lpstrText;                // the search pattern (zero terminated)
    struct Sci_CharacterRange chrgText; // returned as position of matching text
};

SCI_SEARCHANCHOR
SCI_SEARCHNEXT(int searchFlags, const char *text)
SCI_SEARCHPREV(int searchFlags, const char *text)
These messages provide relocatable search support. This allows multiple incremental interactive searches to be macro recorded while still setting the selection to found text so the find/select operation is self-contained. These three messages send SCN_MACRORECORD notifications if macro recording is enabled.

SCI_SEARCHANCHOR sets the search start point used by SCI_SEARCHNEXT and SCI_SEARCHPREV to the start of the current selection, that is, the end of the selection that is nearer to the start of the document. You should always call this before calling either of SCI_SEARCHNEXT or SCI_SEARCHPREV.

SCI_SEARCHNEXT and SCI_SEARCHPREV search for the next and previous occurrence of the zero terminated search string pointed at by text. The search is modified by the searchFlags.

The return value is -1 if nothing is found, otherwise the return value is the start position of the matching text. The selection is updated to show the matched text, but is not scrolled into view.

See also: SCI_SEARCHINTARGET, SCI_FINDTEXT

Overtype

SCI_SETOVERTYPE(bool overType)
SCI_GETOVERTYPE
When overtype is enabled, each typed character replaces the character to the right of the text caret. When overtype is disabled, characters are inserted at the caret. SCI_GETOVERTYPE returns TRUE (1) if overtyping is active, otherwise FALSE (0) will be returned. Use SCI_SETOVERTYPE to set the overtype mode.

Cut, copy and paste

SCI_CUT
SCI_COPY
SCI_PASTE
SCI_CLEAR
SCI_CANPASTE
SCI_COPYRANGE(int start, int end)
SCI_COPYTEXT(int length, const char *text)
SCI_COPYALLOWLINE
SCI_SETPASTECONVERTENDINGS(bool convert)
SCI_GETPASTECONVERTENDINGS

SCI_CUT
SCI_COPY
SCI_PASTE
SCI_CLEAR
SCI_CANPASTE
SCI_COPYALLOWLINE
These commands perform the standard tasks of cutting and copying data to the clipboard, pasting from the clipboard into the document, and clearing the document. SCI_CANPASTE returns non-zero if the document isn't read-only and if the selection doesn't contain protected text. If you need a "can copy" or "can cut", use SCI_GETSELECTIONEMPTY(), which will be zero if there are any non-empty selection ranges implying that a copy or cut to the clipboard should work.

GTK+ does not really support SCI_CANPASTE and always returns TRUE unless the document is read-only.

On X, the clipboard is asynchronous and may require several messages between the destination and source applications. Data from SCI_PASTE will not arrive in the document immediately.

SCI_COPYALLOWLINE works the same as SCI_COPY except that if the selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker is added to the clipboard which is then used in SCI_PASTE to paste the whole line before the current line.

SCI_COPYRANGE(int start, int end)
SCI_COPYTEXT(int length, const char *text)

SCI_COPYRANGE copies a range of text from the document to the system clipboard and SCI_COPYTEXT copies a supplied piece of text to the system clipboard.

SCI_SETPASTECONVERTENDINGS(bool convert)
SCI_GETPASTECONVERTENDINGS
If this property is set then when text is pasted any line ends are converted to match the document's end of line mode as set with SCI_SETEOLMODE. Defaults to true.

Error handling

SCI_SETSTATUS(int status)
SCI_GETSTATUS
If an error occurs, Scintilla may set an internal error number that can be retrieved with SCI_GETSTATUS. To clear the error status call SCI_SETSTATUS(0). Status values from 1 to 999 are errors and status SC_STATUS_WARN_START (1000) and above are warnings. The currently defined statuses are:

SC_STATUS_OK 0 No failures
SC_STATUS_FAILURE 1 Generic failure
SC_STATUS_BADALLOC 2 Memory is exhausted
SC_STATUS_WARN_REGEX 1001 Regular expression is invalid

Undo and Redo

Scintilla has multiple level undo and redo. It will continue to collect undoable actions until memory runs out. Scintilla saves actions that change the document. Scintilla does not save caret and selection movements, view scrolling and the like. Sequences of typing or deleting are compressed into single transactions to make it easier to undo and redo at a sensible level of detail. Sequences of actions can be combined into transactions that are undone as a unit. These sequences occur between SCI_BEGINUNDOACTION and SCI_ENDUNDOACTION messages. These transactions can be nested and only the top-level sequences are undone as units.

SCI_UNDO
SCI_CANUNDO
SCI_EMPTYUNDOBUFFER
SCI_REDO
SCI_CANREDO
SCI_SETUNDOCOLLECTION(bool collectUndo)
SCI_GETUNDOCOLLECTION
SCI_BEGINUNDOACTION
SCI_ENDUNDOACTION
SCI_ADDUNDOACTION(int token, int flags)

SCI_UNDO
SCI_CANUNDO
SCI_UNDO undoes one action, or if the undo buffer has reached a SCI_ENDUNDOACTION point, all the actions back to the corresponding SCI_BEGINUNDOACTION.

SCI_CANUNDO returns 0 if there is nothing to undo, and 1 if there is. You would typically use the result of this message to enable/disable the Edit menu Undo command.

SCI_REDO
SCI_CANREDO
SCI_REDO undoes the effect of the last SCI_UNDO operation.

SCI_CANREDO returns 0 if there is no action to redo and 1 if there are undo actions to redo. You could typically use the result of this message to enable/disable the Edit menu Redo command.

SCI_EMPTYUNDOBUFFER
This command tells Scintilla to forget any saved undo or redo history. It also sets the save point to the start of the undo buffer, so the document will appear to be unmodified. This does not cause the SCN_SAVEPOINTREACHED notification to be sent to the container.

See also: SCI_SETSAVEPOINT

SCI_SETUNDOCOLLECTION(bool collectUndo)
SCI_GETUNDOCOLLECTION
You can control whether Scintilla collects undo information with SCI_SETUNDOCOLLECTION. Pass in true (1) to collect information and false (0) to stop collecting. If you stop collection, you should also use SCI_EMPTYUNDOBUFFER to avoid the undo buffer being unsynchronized with the data in the buffer.

You might wish to turn off saving undo information if you use the Scintilla to store text generated by a program (a Log view) or in a display window where text is often deleted and regenerated.

SCI_BEGINUNDOACTION
SCI_ENDUNDOACTION
Send these two messages to Scintilla to mark the beginning and end of a set of operations that you want to undo all as one operation but that you have to generate as several operations. Alternatively, you can use these to mark a set of operations that you do not want to have combined with the preceding or following operations if they are undone.

SCI_ADDUNDOACTION(int token, int flags)
The container can add its own actions into the undo stack by calling SCI_ADDUNDOACTION and an SCN_MODIFIED notification will be sent to the container with the SC_MOD_CONTAINER flag when it is time to undo (SC_PERFORMED_UNDO) or redo (SC_PERFORMED_REDO) the action. The token argument supplied is returned in the token field of the notification.

For example, if the container wanted to allow undo and redo of a 'toggle bookmark' command then it could call SCI_ADDUNDOACTION(line, 0) each time the command is performed. Then when it receives a notification to undo or redo it toggles a bookmark on the line given by the token field. If there are different types of commands or parameters that need to be stored into the undo stack then the container should maintain a stack of its own for the document and use the current position in that stack as the argument to SCI_ADDUNDOACTION(line). SCI_ADDUNDOACTION commands are not combined together into a single undo transaction unless grouped with SCI_BEGINUNDOACTION and SCI_ENDUNDOACTION.

The flags argument can be UNDO_MAY_COALESCE (1) if the container action may be coalesced along with any insertion and deletion actions into a single compound action, otherwise 0. Coalescing treats coalescible container actions as transparent so will still only group together insertions that look like typing or deletions that look like multiple uses of the Backspace or Delete keys.

Selection and information

Scintilla maintains a selection that stretches between two points, the anchor and the current position. If the anchor and the current position are the same, there is no selected text. Positions in the document range from 0 (before the first character), to the document size (after the last character). If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. However, keyboard commands will not move the caret into such positions.

SCI_GETTEXTLENGTH
SCI_GETLENGTH
SCI_GETLINECOUNT
SCI_SETFIRSTVISIBLELINE(int lineDisplay)
SCI_GETFIRSTVISIBLELINE
SCI_LINESONSCREEN
SCI_GETMODIFY
SCI_SETSEL(int anchorPos, int currentPos)
SCI_GOTOPOS(int position)
SCI_GOTOLINE(int line)
SCI_SETCURRENTPOS(int position)
SCI_GETCURRENTPOS
SCI_SETANCHOR(int position)
SCI_GETANCHOR
SCI_SETSELECTIONSTART(int position)
SCI_GETSELECTIONSTART
SCI_SETSELECTIONEND(int position)
SCI_GETSELECTIONEND
SCI_SETEMPTYSELECTION(int pos)
SCI_SELECTALL
SCI_LINEFROMPOSITION(int position)
SCI_POSITIONFROMLINE(int line)
SCI_GETLINEENDPOSITION(int line)
SCI_LINELENGTH(int line)
SCI_GETCOLUMN(int position)
SCI_FINDCOLUMN(int line, int column)
SCI_POSITIONFROMPOINT(int x, int y)
SCI_POSITIONFROMPOINTCLOSE(int x, int y)
SCI_CHARPOSITIONFROMPOINT(int x, int y)
SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y)
SCI_POINTXFROMPOSITION(<unused>, int position)
SCI_POINTYFROMPOSITION(<unused>, int position)
SCI_HIDESELECTION(bool hide)
SCI_GETSELTEXT(<unused>, char *text)
SCI_GETCURLINE(int textLen, char *text)
SCI_SELECTIONISRECTANGLE
SCI_SETSELECTIONMODE(int mode)
SCI_GETSELECTIONMODE
SCI_GETLINESELSTARTPOSITION(int line)
SCI_GETLINESELENDPOSITION(int line)
SCI_MOVECARETINSIDEVIEW
SCI_WORDENDPOSITION(int position, bool onlyWordCharacters)
SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters)
SCI_ISRANGEWORD(int start, int end)
SCI_POSITIONBEFORE(int position)
SCI_POSITIONAFTER(int position)
SCI_POSITIONRELATIVE(int position, int relative)
SCI_COUNTCHARACTERS(int startPos, int endPos)
SCI_TEXTWIDTH(int styleNumber, const char *text)
SCI_TEXTHEIGHT(int line)
SCI_CHOOSECARETX
SCI_MOVESELECTEDLINESUP
SCI_MOVESELECTEDLINESDOWN
SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool mouseSelectionRectangularSwitch)
SCI_GETMOUSESELECTIONRECTANGULARSWITCH

SCI_GETTEXTLENGTH
SCI_GETLENGTH
Both these messages return the length of the document in bytes.

SCI_GETLINECOUNT
This returns the number of lines in the document. An empty document contains 1 line. A document holding only an end of line sequence has 2 lines.

SCI_SETFIRSTVISIBLELINE(int lineDisplay)
SCI_GETFIRSTVISIBLELINE
These messages retrieve and set the line number of the first visible line in the Scintilla view. The first line in the document is numbered 0. The value is a visible line rather than a document line.

SCI_LINESONSCREEN
This returns the number of complete lines visible on the screen. With a constant line height, this is the vertical space available divided by the line separation. Unless you arrange to size your window to an integral number of lines, there may be a partial line visible at the bottom of the view.

SCI_GETMODIFY
This returns non-zero if the document is modified and 0 if it is unmodified. The modified status of a document is determined by the undo position relative to the save point. The save point is set by SCI_SETSAVEPOINT, usually when you have saved data to a file.

If you need to be notified when the document becomes modified, Scintilla notifies the container that it has entered or left the save point with the SCN_SAVEPOINTREACHED and SCN_SAVEPOINTLEFT notification messages.

SCI_SETSEL(int anchorPos, int currentPos)
This message sets both the anchor and the current position. If currentPos is negative, it means the end of the document. If anchorPos is negative, it means remove any selection (i.e. set the anchor to the same position as currentPos). The caret is scrolled into view after this operation.

SCI_GOTOPOS(int pos)
This removes any selection, sets the caret at pos and scrolls the view to make the caret visible, if necessary. It is equivalent to SCI_SETSEL(pos, pos). The anchor position is set the same as the current position.

SCI_GOTOLINE(int line)
This removes any selection and sets the caret at the start of line number line and scrolls the view (if needed) to make it visible. The anchor position is set the same as the current position. If line is outside the lines in the document (first line is 0), the line set is the first or last.

SCI_SETCURRENTPOS(int pos)
This sets the current position and creates a selection between the anchor and the current position. The caret is not scrolled into view.

See also: SCI_SCROLLCARET

SCI_GETCURRENTPOS
This returns the current position.

SCI_SETANCHOR(int pos)
This sets the anchor position and creates a selection between the anchor position and the current position. The caret is not scrolled into view.

See also: SCI_SCROLLCARET

SCI_GETANCHOR
This returns the current anchor position.

SCI_SETSELECTIONSTART(int pos)
SCI_SETSELECTIONEND(int pos)
These set the selection based on the assumption that the anchor position is less than the current position. They do not make the caret visible. The table shows the positions of the anchor and the current position after using these messages.

anchor current
SCI_SETSELECTIONSTART pos Max(pos, current)
SCI_SETSELECTIONEND Min(anchor, pos) pos

See also: SCI_SCROLLCARET

SCI_GETSELECTIONSTART
SCI_GETSELECTIONEND
These return the start and end of the selection without regard to which end is the current position and which is the anchor. SCI_GETSELECTIONSTART returns the smaller of the current position or the anchor position. SCI_GETSELECTIONEND returns the larger of the two values.

SCI_SETEMPTYSELECTION(int pos)
This removes any selection and sets the caret at pos. The caret is not scrolled into view.

SCI_SELECTALL
This selects all the text in the document. The current position is not scrolled into view.

SCI_LINEFROMPOSITION(int pos)
This message returns the line that contains the position pos in the document. The return value is 0 if pos <= 0. The return value is the last line if pos is beyond the end of the document.

SCI_POSITIONFROMLINE(int line)
This returns the document position that corresponds with the start of the line. If line is negative, the position of the line holding the start of the selection is returned. If line is greater than the lines in the document, the return value is -1. If line is equal to the number of lines in the document (i.e. 1 line past the last line), the return value is the end of the document.

SCI_GETLINEENDPOSITION(int line)
This returns the position at the end of the line, before any line end characters. If line is the last line in the document (which does not have any end of line characters) or greater, the result is the size of the document. If line is negative the result is undefined.

SCI_LINELENGTH(int line)
This returns the length of the line, including any line end characters. If line is negative or beyond the last line in the document, the result is 0. If you want the length of the line not including any end of line characters, use SCI_GETLINEENDPOSITION(line) - SCI_POSITIONFROMLINE(line).

SCI_GETSELTEXT(<unused>, char *text NUL-terminated)
This copies the currently selected text and a terminating 0 byte to the text buffer. The buffer size should be determined by calling with a NULL pointer for the text argument SCI_GETSELTEXT(0,0). This allows for rectangular and discontiguous selections as well as simple selections. See Multiple Selection for information on how multiple and rectangular selections and virtual space are copied.

See also: SCI_GETCURLINE, SCI_GETLINE, SCI_GETTEXT, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

SCI_GETCURLINE(int textLen, char *text NUL-terminated)
This retrieves the text of the line containing the caret and returns the position within the line of the caret. Pass in char* text pointing at a buffer large enough to hold the text you wish to retrieve and a terminating 0 character. Set textLen to the length of the buffer which must be at least 1 to hold the terminating 0 character. If the text argument is 0 then the length that should be allocated to store the entire current line is returned.

See also: SCI_GETSELTEXT, SCI_GETLINE, SCI_GETTEXT, SCI_GETSTYLEDTEXT, SCI_GETTEXTRANGE

SCI_SELECTIONISRECTANGLE
This returns 1 if the current selection is in rectangle mode, 0 if not.

SCI_SETSELECTIONMODE(int mode)
SCI_GETSELECTIONMODE
The two functions set and get the selection mode, which can be stream (SC_SEL_STREAM=0) or rectangular (SC_SEL_RECTANGLE=1) or by lines (SC_SEL_LINES=2) or thin rectangular (SC_SEL_THIN=3). When set in these modes, regular caret moves will extend or reduce the selection, until the mode is cancelled by a call with same value or with SCI_CANCEL. The get function returns the current mode even if the selection was made by mouse or with regular extended moves. SC_SEL_THIN is the mode after a rectangular selection has been typed into and ensures that no characters are selected.

SCI_GETLINESELSTARTPOSITION(int line)
SCI_GETLINESELENDPOSITION(int line)
Retrieve the position of the start and end of the selection at the given line with INVALID_POSITION returned if no selection on this line.

SCI_MOVECARETINSIDEVIEW
If the caret is off the top or bottom of the view, it is moved to the nearest line that is visible to its current position. Any selection is lost.

SCI_WORDENDPOSITION(int position, bool onlyWordCharacters)
SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters)
These messages return the start and end of words using the same definition of words as used internally within Scintilla. You can set your own list of characters that count as words with SCI_SETWORDCHARS. The position sets the start or the search, which is forwards when searching for the end and backwards when searching for the start.

SCI_ISRANGEWORD(int start, int end)
Is the range start..end a word or set of words? This message checks that start is at a word start transition and that end is at a word end transition. It does not check whether there are any spaces inside the range.

SCI_ISRANGEWORD(int start, int end)

Set onlyWordCharacters to true (1) to stop searching at the first non-word character in the search direction. If onlyWordCharacters is false (0), the first character in the search direction sets the type of the search as word or non-word and the search stops at the first non-matching character. Searches are also terminated by the start or end of the document.

If "w" represents word characters and "." represents non-word characters and "|" represents the position and true or false is the state of onlyWordCharacters:

Initial state end, true end, false start, true start, false
..ww..|..ww.. ..ww..|..ww.. ..ww....|ww.. ..ww..|..ww.. ..ww|....ww..
....ww|ww.... ....wwww|.... ....wwww|.... ....|wwww.... ....|wwww....
..ww|....ww.. ..ww|....ww.. ..ww....|ww.. ..|ww....ww.. ..|ww....ww..
..ww....|ww.. ..ww....ww|.. ..ww....ww|.. ..ww....|ww.. ..ww|....ww..

SCI_POSITIONBEFORE(int position)
SCI_POSITIONAFTER(int position)
These messages return the position before and after another position in the document taking into account the current code page. The minimum position returned is 0 and the maximum is the last position in the document. If called with a position within a multi byte character will return the position of the start/end of that character.

SCI_POSITIONRELATIVE(int position, int relative)
Count a number of whole characters before or after the argument position and return that position. The minimum position returned is 0 and the maximum is the last position in the document.

SCI_COUNTCHARACTERS(int startPos, int endPos)
Returns the number of whole characters between two positions..

SCI_TEXTWIDTH(int styleNumber, const char *text)
This returns the pixel width of a string drawn in the given styleNumber which can be used, for example, to decide how wide to make the line number margin in order to display a given number of numerals.

SCI_TEXTHEIGHT(int line)
This returns the height in pixels of a particular line. Currently all lines are the same height.

SCI_GETCOLUMN(int pos)
This message returns the column number of a position pos within the document taking the width of tabs into account. This returns the column number of the last tab on the line before pos, plus the number of characters between the last tab and pos. If there are no tab characters on the line, the return value is the number of characters up to the position on the line. In both cases, double byte characters count as a single character. This is probably only useful with monospaced fonts.

SCI_FINDCOLUMN(int line, int column)
This message returns the position of a column on a line taking the width of tabs into account. It treats a multi-byte character as a single column. Column numbers, like lines start at 0.

SCI_POSITIONFROMPOINT(int x, int y)
SCI_POSITIONFROMPOINTCLOSE(int x, int y)
SCI_POSITIONFROMPOINT finds the closest character position to a point and SCI_POSITIONFROMPOINTCLOSE is similar but returns -1 if the point is outside the window or not close to any characters.

SCI_CHARPOSITIONFROMPOINT(int x, int y)
SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y)
SCI_CHARPOSITIONFROMPOINT finds the closest character to a point and SCI_CHARPOSITIONFROMPOINTCLOSE is similar but returns -1 if the point is outside the window or not close to any characters. This is similar to the previous methods but finds characters rather than inter-character positions.

SCI_POINTXFROMPOSITION(<unused>, int pos)
SCI_POINTYFROMPOSITION(<unused>, int pos)
These messages return the x and y display pixel location of text at position pos in the document.

SCI_HIDESELECTION(bool hide)
The normal state is to make the selection visible by drawing it as set by SCI_SETSELFORE and SCI_SETSELBACK. However, if you hide the selection, it is drawn as normal text.

SCI_CHOOSECARETX
Scintilla remembers the x value of the last position horizontally moved to explicitly by the user and this value is then used when moving vertically such as by using the up and down keys. This message sets the current x position of the caret as the remembered value.

SCI_MOVESELECTEDLINESUP
Move the selected lines up one line, shifting the line above after the selection. The selection will be automatically extended to the beginning of the selection's first line and the end of the selection's last line. If nothing was selected, the line the cursor is currently at will be selected.

SCI_MOVESELECTEDLINESDOWN
Move the selected lines down one line, shifting the line below before the selection. The selection will be automatically extended to the beginning of the selection's first line and the end of the selection's last line. If nothing was selected, the line the cursor is currently at will be selected.

SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool mouseSelectionRectangularSwitch)
SCI_GETMOUSESELECTIONRECTANGULARSWITCH
Enable or disable the ability to switch to rectangular selection mode while making a selection with the mouse. When this option is turned on, mouse selections in stream mode can be switched to rectangular mode by pressing the corresponding modifier key. They then stick to rectangular mode even when the modifier key is released again. When this option is turned off, mouse selections will always stick to the mode the selection was started in. It is off by default.

Multiple Selection and Virtual Space

SCI_SETMULTIPLESELECTION(bool multipleSelection)
SCI_GETMULTIPLESELECTION
SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)
SCI_GETADDITIONALSELECTIONTYPING
SCI_SETMULTIPASTE(int multiPaste)
SCI_GETMULTIPASTE
SCI_SETVIRTUALSPACEOPTIONS(int virtualSpaceOptions)
SCI_GETVIRTUALSPACEOPTIONS
SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)
SCI_GETRECTANGULARSELECTIONMODIFIER

SCI_GETSELECTIONS
SCI_GETSELECTIONEMPTY
SCI_CLEARSELECTIONS
SCI_SETSELECTION(int caret, int anchor)
SCI_ADDSELECTION(int caret, int anchor)
SCI_DROPSELECTIONN(int selection)
SCI_SETMAINSELECTION(int selection)
SCI_GETMAINSELECTION

SCI_SETSELECTIONNCARET(int selection, int pos)
SCI_GETSELECTIONNCARET(int selection)
SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)
SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)
SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)
SCI_GETSELECTIONNANCHOR(int selection)
SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)
SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)
SCI_SETSELECTIONNSTART(int selection, int pos)
SCI_GETSELECTIONNSTART(int selection)
SCI_SETSELECTIONNEND(int selection, int pos)
SCI_GETSELECTIONNEND(int selection)

SCI_SETRECTANGULARSELECTIONCARET(int pos)
SCI_GETRECTANGULARSELECTIONCARET
SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)
SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE
SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)
SCI_GETRECTANGULARSELECTIONANCHOR
SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)
SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE

SCI_SETADDITIONALSELALPHA(int alpha)
SCI_GETADDITIONALSELALPHA
SCI_SETADDITIONALSELFORE(int colour)
SCI_SETADDITIONALSELBACK(int colour)
SCI_SETADDITIONALCARETFORE(int colour)
SCI_GETADDITIONALCARETFORE
SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)
SCI_GETADDITIONALCARETSBLINK
SCI_SETADDITIONALCARETSVISIBLE(bool additionalCaretsVisible)
SCI_GETADDITIONALCARETSVISIBLE

SCI_SWAPMAINANCHORCARET
SCI_ROTATESELECTION
SCI_MULTIPLESELECTADDNEXT
SCI_MULTIPLESELECTADDEACH

There may be multiple selections active at one time. More selections are made by holding down the Ctrl key while dragging with the mouse. The most recent selection is the main selection and determines which part of the document is shown automatically. Any selection apart from the main selection is called an additional selection. The calls in the previous section operate on the main selection. There is always at least one selection. The selection can be simplified down to just the main selection by SCI_CANCEL which is normally mapped to the Esc key.

Rectangular selections are handled as multiple selections although the original rectangular range is remembered so that subsequent operations may be handled differently for rectangular selections. For example, pasting a rectangular selection places each piece in a vertical column.

Virtual space is space beyond the end of each line. The caret may be moved into virtual space but no real space will be added to the document until there is some text typed or some other text insertion command is used.

When discontiguous selections are copied to the clipboard, each selection is added to the clipboard text in order with no delimiting characters. For rectangular selections the document's line end is added after each line's text. Rectangular selections are always copied from top line to bottom, not in the in order of selection.Virtual space is not copied.

SCI_SETMULTIPLESELECTION(bool multipleSelection)
SCI_GETMULTIPLESELECTION
Enable or disable multiple selection. When multiple selection is disabled, it is not possible to select multiple ranges by holding down the Ctrl key while dragging with the mouse.

SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)
SCI_GETADDITIONALSELECTIONTYPING
Whether typing, new line, cursor left/right/up/down, backspace, delete, home, and end work with multiple selections simultaneously. Also allows selection and word and line deletion commands.

SCI_SETMULTIPASTE(int multiPaste)
SCI_GETMULTIPASTE
When pasting into multiple selections, the pasted text can go into just the main selection with SC_MULTIPASTE_ONCE=0 or into each selection with SC_MULTIPASTE_EACH=1. SC_MULTIPASTE_ONCE is the default.

SCI_SETVIRTUALSPACEOPTIONS(int virtualSpace)
SCI_GETVIRTUALSPACEOPTIONS
Virtual space can be enabled or disabled for rectangular selections or in other circumstances or in both. There are two bit flags SCVS_RECTANGULARSELECTION=1 and SCVS_USERACCESSIBLE=2 which can be set independently. SCVS_NONE=0, the default, disables all use of virtual space.

SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)
SCI_GETRECTANGULARSELECTIONMODIFIER
On GTK+, the key used to indicate that a rectangular selection should be created when combined with a mouse drag can be set. The three possible values are SCMOD_CTRL=2 (default), SCMOD_ALT=4 or SCMOD_SUPER=8. Since SCMOD_ALT is often already used by a window manager, the window manager may need configuring to allow this choice. SCMOD_SUPER is often a system dependent modifier key such as the Left Windows key on a Windows keyboard or the Command key on a Mac.

SCI_GETSELECTIONS
Return the number of selections currently active. There is always at least one selection.

SCI_GETSELECTIONEMPTY
Return 1 if every selected range is empty else 0.

SCI_CLEARSELECTIONS
Set a single empty selection at 0 as the only selection.

SCI_SETSELECTION(int caret, int anchor)
Set a single selection from anchor to caret as the only selection.

SCI_ADDSELECTION(int caret, int anchor)
Add a new selection from anchor to caret as the main selection retaining all other selections as additional selections. Since there is always at least one selection, to set a list of selections, the first selection should be added with SCI_SETSELECTION and later selections added with SCI_ADDSELECTION

SCI_DROPSELECTIONN(int selection)
If there are multiple selections, remove the indicated selection. If this was the main selection then make the previous selection the main and if it was the first then the last selection becomes main. If there is only one selection, or there is no selection selection, then there is no effect.

SCI_SETMAINSELECTION(int selection)
SCI_GETMAINSELECTION
One of the selections is the main selection which is used to determine what range of text is automatically visible. The main selection may be displayed in different colours or with a differently styled caret. Only an already existing selection can be made main.

SCI_SETSELECTIONNCARET(int selection, int pos)
SCI_GETSELECTIONNCARET(int selection)
SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)
SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection)
SCI_SETSELECTIONNANCHOR(int selection, int posAnchor)
SCI_GETSELECTIONNANCHOR(int selection)
SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)
SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection)
Set or query the position and amount of virtual space for the caret and anchor of each already existing selection.

SCI_SETSELECTIONNSTART(int selection, int pos)
SCI_GETSELECTIONNSTART(int selection)
SCI_SETSELECTIONNEND(int selection, int pos)
SCI_GETSELECTIONNEND(int selection)
Set or query the start and end position of each already existing selection. Mostly of use to query each range for its text. The selection parameter is zero-based.

SCI_SETRECTANGULARSELECTIONCARET(int pos)
SCI_GETRECTANGULARSELECTIONCARET
SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)
SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE
SCI_SETRECTANGULARSELECTIONANCHOR(int posAnchor)
SCI_GETRECTANGULARSELECTIONANCHOR
SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)
SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE
Set or query the position and amount of virtual space for the caret and anchor of the rectangular selection. After setting the rectangular selection, this is broken down into multiple selections, one for each line.

SCI_SETADDITIONALSELALPHA(int alpha)
SCI_GETADDITIONALSELALPHA
SCI_SETADDITIONALSELFORE(int colour)
SCI_SETADDITIONALSELBACK(int colour)
Modify the appearance of additional selections so that they can be differentiated from the main selection which has its appearance set with SCI_SETSELALPHA, SCI_GETSELALPHA, SCI_SETSELFORE, and SCI_SETSELBACK. SCI_SETADDITIONALSELFORE and SCI_SETADDITIONALSELBACK calls have no effect until SCI_SETSELFORE and SCI_SETSELBACK are called with useSelection*Colour value set to true. Subsequent calls to SCI_SETSELFORE, and SCI_SETSELBACK will overwrite the values set by SCI_SETADDITIONALSEL* functions.

SCI_SETADDITIONALCARETFORE(int colour)
SCI_GETADDITIONALCARETFORE
SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)
SCI_GETADDITIONALCARETSBLINK
Modify the appearance of additional carets so that they can be differentiated from the main caret which has its appearance set with SCI_SETCARETFORE, SCI_GETCARETFORE, SCI_SETCARETPERIOD, and SCI_GETCARETPERIOD.

SCI_SETADDITIONALCARETSVISIBLE(bool additionalCaretsVisible)
SCI_GETADDITIONALCARETSVISIBLE
Determine whether to show additional carets (defaults to true).

SCI_SWAPMAINANCHORCARET
SCI_ROTATESELECTION
SCI_MULTIPLESELECTADDNEXT
SCI_MULTIPLESELECTADDEACH
These commands may be assigned to keys to make it possible to manipulate multiple selections. SCI_SWAPMAINANCHORCARET moves the caret to the opposite end of the main selection. SCI_ROTATESELECTION makes the next selection be the main selection.
SCI_MULTIPLESELECTADDNEXT adds the next occurrence of the main selection within the target to the set of selections as main. If the current selection is empty then select word around caret. The current searchFlags are used so the application may choose case sensitivity and word search options.
SCI_MULTIPLESELECTADDEACH is similar to SCI_MULTIPLESELECTADDNEXT but adds multiple occurrences instead of just one.

Scrolling and automatic scrolling

SCI_LINESCROLL(int column, int line)
SCI_SCROLLCARET
SCI_SCROLLRANGE(int secondary, int primary)
SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)
SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)
SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)
SCI_SETHSCROLLBAR(bool visible)
SCI_GETHSCROLLBAR
SCI_SETVSCROLLBAR(bool visible)
SCI_GETVSCROLLBAR
SCI_GETXOFFSET
SCI_SETXOFFSET(int xOffset)
SCI_SETSCROLLWIDTH(int pixelWidth)
SCI_GETSCROLLWIDTH
SCI_SETSCROLLWIDTHTRACKING(bool tracking)
SCI_GETSCROLLWIDTHTRACKING
SCI_SETENDATLASTLINE(bool endAtLastLine)
SCI_GETENDATLASTLINE

SCI_LINESCROLL(int column, int line)
This will attempt to scroll the display by the number of columns and lines that you specify. Positive line values increase the line number at the top of the screen (i.e. they move the text upwards as far as the user is concerned), Negative line values do the reverse.

The column measure is the width of a space in the default style. Positive values increase the column at the left edge of the view (i.e. they move the text leftwards as far as the user is concerned). Negative values do the reverse.

See also: SCI_SETXOFFSET

SCI_SCROLLCARET
If the current position (this is the caret if there is no selection) is not visible, the view is scrolled to make it visible according to the current caret policy.

SCI_SCROLLRANGE(int secondary, int primary)
Scroll the argument positions and the range between them into view giving priority to the primary position then the secondary position. The behaviour is similar to SCI_SCROLLCARET with the primary position used instead of the caret. An effort is then made to ensure that the secondary position and range between are also visible. This may be used to make a search match visible.

SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)
SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)
These set the caret policy. The value of caretPolicy is a combination of CARET_SLOP, CARET_STRICT, CARET_JUMPS and CARET_EVEN.

CARET_SLOP If set, we can define a slop value: caretSlop. This value defines an unwanted zone (UZ) where the caret is... unwanted. This zone is defined as a number of pixels near the vertical margins, and as a number of lines near the horizontal margins. By keeping the caret away from the edges, it is seen within its context. This makes it likely that the identifier that the caret is on can be completely seen, and that the current line is seen with some of the lines following it, which are often dependent on that line.
CARET_STRICT If set, the policy set by CARET_SLOP is enforced... strictly. The caret is centred on the display if caretSlop is not set, and cannot go in the UZ if caretSlop is set.
CARET_JUMPS If set, the display is moved more energetically so the caret can move in the same direction longer before the policy is applied again. '3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin.
CARET_EVEN If not set, instead of having symmetrical UZs, the left and bottom UZs are extended up to right and top UZs respectively. This way, we favour the displaying of useful information: the beginning of lines, where most code reside, and the lines after the caret, for example, the body of a function.
slop strict jumps even Caret can go to the margin On reaching limit (going out of visibility
or going into the UZ) display is...
0 0 0 0 Yes moved to put caret on top/on right
0 0 0 1 Yes moved by one position
0 0 1 0 Yes moved to put caret on top/on right
0 0 1 1 Yes centred on the caret
0 1 - 0 Caret is always on top/on right of display -
0 1 - 1 No, caret is always centred -
1 0 0 0 Yes moved to put caret out of the asymmetrical UZ
1 0 0 1 Yes moved to put caret out of the UZ
1 0 1 0 Yes moved to put caret at 3UZ of the top or right margin
1 0 1 1 Yes moved to put caret at 3UZ of the margin
1 1 - 0 Caret is always at UZ of top/right margin -
1 1 0 1 No, kept out of UZ moved by one position
1 1 1 0 No, kept out of UZ moved to put caret at 3UZ of the margin

SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)
This determines how the vertical positioning is determined when SCI_ENSUREVISIBLEENFORCEPOLICY is called. It takes VISIBLE_SLOP and VISIBLE_STRICT flags for the policy parameter. It is similar in operation to SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop).

SCI_SETHSCROLLBAR(bool visible)
SCI_GETHSCROLLBAR
The horizontal scroll bar is only displayed if it is needed for the assumed width. If you never wish to see it, call SCI_SETHSCROLLBAR(0). Use SCI_SETHSCROLLBAR(1) to enable it again. SCI_GETHSCROLLBAR returns the current state. The default state is to display it when needed.

See also: SCI_SETSCROLLWIDTH.

SCI_SETVSCROLLBAR(bool visible)
SCI_GETVSCROLLBAR
By default, the vertical scroll bar is always displayed when required. You can choose to hide or show it with SCI_SETVSCROLLBAR and get the current state with SCI_GETVSCROLLBAR.

SCI_SETXOFFSET(int xOffset)
SCI_GETXOFFSET
The xOffset is the horizontal scroll position in pixels of the start of the text view. A value of 0 is the normal position with the first text column visible at the left of the view.

See also: SCI_LINESCROLL

SCI_SETSCROLLWIDTH(int pixelWidth)
SCI_GETSCROLLWIDTH
For performance, Scintilla does not measure the display width of the document to determine the properties of the horizontal scroll bar. Instead, an assumed width is used. These messages set and get the document width in pixels assumed by Scintilla. The default value is 2000. To ensure the width of the currently visible lines can be scrolled use SCI_SETSCROLLWIDTHTRACKING

SCI_SETSCROLLWIDTHTRACKING(bool tracking)
SCI_GETSCROLLWIDTHTRACKING
If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.

SCI_SETENDATLASTLINE(bool endAtLastLine)
SCI_GETENDATLASTLINE
SCI_SETENDATLASTLINE sets the scroll range so that maximum scroll position has the last line at the bottom of the view (default). Setting this to false allows scrolling one page below the last line.

White space

SCI_SETVIEWWS(int wsMode)
SCI_GETVIEWWS
SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int colour)
SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour)
SCI_SETWHITESPACESIZE(int size)
SCI_GETWHITESPACESIZE
SCI_SETEXTRAASCENT(int extraAscent)
SCI_GETEXTRAASCENT
SCI_SETEXTRADESCENT(int extraDescent)
SCI_GETEXTRADESCENT

SCI_SETVIEWWS(int wsMode)
SCI_GETVIEWWS
White space can be made visible which may be useful for languages in which white space is significant, such as Python. Space characters appear as small centred dots and tab characters as light arrows pointing to the right. There are also ways to control the display of end of line characters. The two messages set and get the white space display mode. The wsMode argument can be one of:

SCWS_INVISIBLE 0 The normal display mode with white space displayed as an empty background colour.
SCWS_VISIBLEALWAYS 1 White space characters are drawn as dots and arrows,
SCWS_VISIBLEAFTERINDENT 2 White space used for indentation is displayed normally but after the first visible character, it is shown as dots and arrows.

The effect of using any other wsMode value is undefined.

SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int colour)
SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour)
By default, the colour of visible white space is determined by the lexer in use. The foreground and/or background colour of all visible white space can be set globally, overriding the lexer's colours with SCI_SETWHITESPACEFORE and SCI_SETWHITESPACEBACK.

SCI_SETWHITESPACESIZE(int size)
SCI_GETWHITESPACESIZE
SCI_SETWHITESPACESIZE sets the size of the dots used for mark space characters. The SCI_GETWHITESPACESIZE message retrieves the current size.

SCI_SETEXTRAASCENT(int extraAscent)
SCI_GETEXTRAASCENT
SCI_SETEXTRADESCENT(int extraDescent)
SCI_GETEXTRADESCENT
Text is drawn with the base of each character on a 'baseline'. The height of a line is found from the maximum that any style extends above the baseline (its 'ascent'), added to the maximum that any style extends below the baseline (its 'descent'). Space may be added to the maximum ascent (SCI_SETEXTRAASCENT) and the maximum descent (SCI_SETEXTRADESCENT) to allow for more space between lines. This may done to make the text easier to read or to accommodate underlines or highlights.

Cursor

SCI_SETCURSOR(int curType)
SCI_GETCURSOR
The cursor is normally chosen in a context sensitive way, so it will be different over the margin than when over the text. When performing a slow action, you may wish to change to a wait cursor. You set the cursor type with SCI_SETCURSOR. The curType argument can be:

SC_CURSORNORMAL -1 The normal cursor is displayed.
SC_CURSORWAIT  4 The wait cursor is displayed when the mouse is over or owned by the Scintilla window.

Cursor values 1 through 7 have defined cursors, but only SC_CURSORWAIT is usefully controllable. Other values of curType cause a pointer to be displayed. The SCI_GETCURSOR message returns the last cursor type you set, or SC_CURSORNORMAL (-1) if you have not set a cursor type.

Mouse capture

SCI_SETMOUSEDOWNCAPTURES(bool captures)
SCI_GETMOUSEDOWNCAPTURES
When the mouse is pressed inside Scintilla, it is captured so future mouse movement events are sent to Scintilla. This behaviour may be turned off with SCI_SETMOUSEDOWNCAPTURES(0).

Line endings

Scintilla can handle the major line end conventions and, depending on settings and the current lexer also support additional Unicode line ends.

Scintilla can interpret any of the Macintosh (\r), Unix (\n) and Windows (\r\n) line ends. When the user presses the Enter key, one of these line end strings is inserted into the buffer. The default is \r\n in Windows and \n in Unix, but this can be changed with the SCI_SETEOLMODE message. You can also convert the entire document to one of these line endings with SCI_CONVERTEOLS. Finally, you can choose to display the line endings with SCI_SETVIEWEOL.

For the UTF-8 encoding, three additional Unicode line ends, Next Line (NEL=U+0085), Line Separator (LS=U+2028), and Paragraph Separator (PS=U+2029) may optionally be interpreted when Unicode line ends is turned on and the current lexer also supports Unicode line ends.

SCI_SETEOLMODE(int eolMode)
SCI_GETEOLMODE
SCI_CONVERTEOLS(int eolMode)
SCI_SETVIEWEOL(bool visible)
SCI_GETVIEWEOL
SCI_GETLINEENDTYPESSUPPORTED
SCI_SETLINEENDTYPESALLOWED(int lineEndBitSet)
SCI_GETLINEENDTYPESALLOWED
SCI_GETLINEENDTYPESACTIVE

SCI_SETEOLMODE(int eolMode)
SCI_GETEOLMODE
SCI_SETEOLMODE sets the characters that are added into the document when the user presses the Enter key. You can set eolMode to one of SC_EOL_CRLF (0), SC_EOL_CR (1), or SC_EOL_LF (2). The SCI_GETEOLMODE message retrieves the current state.

SCI_CONVERTEOLS(int eolMode)
This message changes all the end of line characters in the document to match eolMode. Valid values are: SC_EOL_CRLF (0), SC_EOL_CR (1), or SC_EOL_LF (2).

SCI_SETVIEWEOL(bool visible)
SCI_GETVIEWEOL
Normally, the end of line characters are hidden, but SCI_SETVIEWEOL allows you to display (or hide) them by setting visible true (or false). The visible rendering of the end of line characters is similar to (CR), (LF), or (CR)(LF). SCI_GETVIEWEOL returns the current state.

SCI_GETLINEENDTYPESSUPPORTED
SCI_GETLINEENDTYPESSUPPORTED reports the different types of line ends supported by the current lexer. This is a bit set although there is currently only a single choice with either SC_LINE_END_TYPE_DEFAULT (0) or SC_LINE_END_TYPE_UNICODE (1). These values are also used by the other messages concerned with Unicode line ends.

SCI_SETLINEENDTYPESALLOWED(int lineEndBitSet)
SCI_GETLINEENDTYPESALLOWED
By default, only the ASCII line ends are interpreted. Unicode line ends may be requested with SCI_SETLINEENDTYPESALLOWED(SC_LINE_END_TYPE_UNICODE) but this will be ineffective unless the lexer also allows you Unicode line ends. SCI_GETLINEENDTYPESALLOWED returns the current state.

SCI_GETLINEENDTYPESACTIVE
SCI_GETLINEENDTYPESACTIVE reports the set of line ends currently interpreted by Scintilla. It is SCI_GETLINEENDTYPESSUPPORTED & SCI_GETLINEENDTYPESALLOWED.

Styling

The styling messages allow you to assign styles to text. If your styling needs can be met by one of the standard lexers, or if you can write your own, then a lexer is probably the easiest way to style your document. If you choose to use the container to do the styling you can use the SCI_SETLEXER command to select SCLEX_CONTAINER, in which case the container is sent a SCN_STYLENEEDED notification each time text needs styling for display. As another alternative, you might use idle time to style the document. Even if you use a lexer, you might use the styling commands to mark errors detected by a compiler. The following commands can be used.

SCI_GETENDSTYLED
SCI_STARTSTYLING(int position, int unused)
SCI_SETSTYLING(int length, int style)
SCI_SETSTYLINGEX(int length, const char *styles)
SCI_SETLINESTATE(int line, int value)
SCI_GETLINESTATE(int line)
SCI_GETMAXLINESTATE

SCI_GETENDSTYLED
Scintilla keeps a record of the last character that is likely to be styled correctly. This is moved forwards when characters after it are styled and moved backwards if changes are made to the text of the document before it. Before drawing text, this position is checked to see if any styling is needed and, if so, a SCN_STYLENEEDED notification message is sent to the container. The container can send SCI_GETENDSTYLED to work out where it needs to start styling. Scintilla will always ask to style whole lines.

SCI_STARTSTYLING(int pos, int unused)
This prepares for styling by setting the styling position pos to start at. The unused argument was used in earlier versions but is now ignored. After SCI_STARTSTYLING, send multiple SCI_SETSTYLING messages for each lexical entity to style or send SCI_SETSTYLINGEX to style in blocks.

SCI_SETSTYLING(int length, int style)
This message sets the style of length characters starting at the styling position and then increases the styling position by length, ready for the next call. SCI_STARTSTYLING should be called before the first call to this.

SCI_SETSTYLINGEX(int length, const char *styles)
As an alternative to SCI_SETSTYLING, which applies the same style to each byte, you can use this message which specifies the styles for each of length bytes from the styling position and then increases the styling position by length, ready for the next call. SCI_STARTSTYLING should be called before the first call to this.

SCI_SETLINESTATE(int line, int value)
SCI_GETLINESTATE(int line)
As well as the 8 bits of lexical state stored for each character there is also an integer stored for each line. This can be used for longer lived parse states such as what the current scripting language is in an ASP page. Use SCI_SETLINESTATE to set the integer value and SCI_GETLINESTATE to get the value. Changing the value produces a SC_MOD_CHANGELINESTATE notification.

SCI_GETMAXLINESTATE
This returns the last line that has any line state.

Style definition

While the style setting messages mentioned above change the style numbers associated with text, these messages define how those style numbers are interpreted visually. There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255). There are also some predefined numbered styles starting at 32, The following STYLE_* constants are defined.

STYLE_DEFAULT 32 This style defines the attributes that all styles receive when the SCI_STYLECLEARALL message is used.
STYLE_LINENUMBER 33 This style sets the attributes of the text used to display line numbers in a line number margin. The background colour set for this style also sets the background colour for all margins that do not have any folding mask bits set. That is, any margin for which mask & SC_MASK_FOLDERS is 0. See SCI_SETMARGINMASKN for more about masks.
STYLE_BRACELIGHT 34 This style sets the attributes used when highlighting braces with the SCI_BRACEHIGHLIGHT message and when highlighting the corresponding indentation with SCI_SETHIGHLIGHTGUIDE.
STYLE_BRACEBAD 35 This style sets the display attributes used when marking an unmatched brace with the SCI_BRACEBADLIGHT message.
STYLE_CONTROLCHAR 36 This style sets the font used when drawing control characters. Only the font, size, bold, italics, and character set attributes are used and not the colour attributes. See also: SCI_SETCONTROLCHARSYMBOL.
STYLE_INDENTGUIDE 37 This style sets the foreground and background colours used when drawing the indentation guides.
STYLE_CALLTIP 38 Call tips normally use the font attributes defined by STYLE_DEFAULT. Use of SCI_CALLTIPUSESTYLE causes call tips to use this style instead. Only the font face name, font size, foreground and background colours and character set attributes are used.
STYLE_LASTPREDEFINED 39 To make it easier for client code to discover the range of styles that are predefined, this is set to the style number of the last predefined style. This is currently set to 39 and the last style with an identifier is 38, which reserves space for one future predefined style.
STYLE_MAX 255 This is not a style but is the number of the maximum style that can be set. Styles between STYLE_LASTPREDEFINED and STYLE_MAX may be used.

For each style you can set the font name, size and use of bold, italic and underline, foreground and background colour and the character set. You can also choose to hide text with a given style, display all characters as upper or lower case and fill from the last character on a line to the end of the line (for embedded languages). There is also an experimental attribute to make text read-only.

It is entirely up to you how you use styles. If you want to use syntax colouring you might use style 0 for white space, style 1 for numbers, style 2 for keywords, style 3 for strings, style 4 for preprocessor, style 5 for operators, and so on.

SCI_STYLERESETDEFAULT
SCI_STYLECLEARALL
SCI_STYLESETFONT(int styleNumber, char *fontName)
SCI_STYLEGETFONT(int styleNumber, char *fontName)
SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)
SCI_STYLEGETSIZE(int styleNumber)
SCI_STYLESETSIZEFRACTIONAL(int styleNumber, int sizeInHundredthPoints)
SCI_STYLEGETSIZEFRACTIONAL(int styleNumber)
SCI_STYLESETBOLD(int styleNumber, bool bold)
SCI_STYLEGETBOLD(int styleNumber)
SCI_STYLESETWEIGHT(int styleNumber, int weight)
SCI_STYLEGETWEIGHT(int styleNumber)
SCI_STYLESETITALIC(int styleNumber, bool italic)
SCI_STYLEGETITALIC(int styleNumber)
SCI_STYLESETUNDERLINE(int styleNumber, bool underline)
SCI_STYLEGETUNDERLINE(int styleNumber)
SCI_STYLESETFORE(int styleNumber, int colour)
SCI_STYLEGETFORE(int styleNumber)
SCI_STYLESETBACK(int styleNumber, int colour)
SCI_STYLEGETBACK(int styleNumber)
SCI_STYLESETEOLFILLED(int styleNumber, bool eolFilled)
SCI_STYLEGETEOLFILLED(int styleNumber)
SCI_STYLESETCHARACTERSET(int styleNumber, int charSet)
SCI_STYLEGETCHARACTERSET(int styleNumber)
SCI_STYLESETCASE(int styleNumber, int caseMode)
SCI_STYLEGETCASE(int styleNumber)
SCI_STYLESETVISIBLE(int styleNumber, bool visible)
SCI_STYLEGETVISIBLE(int styleNumber)
SCI_STYLESETCHANGEABLE(int styleNumber, bool changeable)
SCI_STYLEGETCHANGEABLE(int styleNumber)
SCI_STYLESETHOTSPOT(int styleNumber, bool hotspot)
SCI_STYLEGETHOTSPOT(int styleNumber)

SCI_STYLERESETDEFAULT
This message resets STYLE_DEFAULT to its state when Scintilla was initialised.

SCI_STYLECLEARALL
This message sets all styles to have the same attributes as STYLE_DEFAULT. If you are setting up Scintilla for syntax colouring, it is likely that the lexical styles you set will be very similar. One way to set the styles is to:
1. Set STYLE_DEFAULT to the common features of all styles.
2. Use SCI_STYLECLEARALL to copy this to all styles.
3. Set the style attributes that make your lexical styles different.

SCI_STYLESETFONT(int styleNumber, const char *fontName)
SCI_STYLEGETFONT(int styleNumber, char *fontName NUL-terminated)
SCI_STYLESETSIZE(int styleNumber, int sizeInPoints)
SCI_STYLEGETSIZE(int styleNumber)
SCI_STYLESETSIZEFRACTIONAL(int styleNumber, int sizeInHundredthPoints)
SCI_STYLEGETSIZEFRACTIONAL(int styleNumber)
SCI_STYLESETBOLD(int styleNumber, bool bold)
SCI_STYLEGETBOLD(int styleNumber)
SCI_STYLESETWEIGHT(int styleNumber, int weight)
SCI_STYLEGETWEIGHT(int styleNumber)
SCI_STYLESETITALIC(int styleNumber, bool italic)
SCI_STYLEGETITALIC(int styleNumber)
These messages (plus SCI_STYLESETCHARACTERSET) set the font attributes that are used to match the fonts you request to those available.

The fontName is a zero terminated string holding the name of a font. Under Windows, only the first 32 characters of the name are used, the name is decoded as UTF-8, and the name is not case sensitive. For internal caching, Scintilla tracks fonts by name and does care about the casing of font names, so please be consistent. On GTK+, Pango is used to display text and the name is sent directly to Pango without transformation. On Qt, the name is decoded as UTF-8. On Cocoa, the name is decoded as MacRoman.

Sizes can be set to a whole number of points with SCI_STYLESETSIZE or to a fractional point size in hundredths of a point with SCI_STYLESETSIZEFRACTIONAL by multiplying the size by 100 (SC_FONT_SIZE_MULTIPLIER). For example, a text size of 9.4 points is set with SCI_STYLESETSIZEFRACTIONAL(<style>, 940).

The weight or boldness of a font can be set with SCI_STYLESETBOLD or SCI_STYLESETWEIGHT. The weight is a number between 1 and 999 with 1 being very light and 999 very heavy. While any value can be used, fonts often only support between 2 and 4 weights with three weights being common enough to have symbolic names: SC_WEIGHT_NORMAL (400), SC_WEIGHT_SEMIBOLD (600), and SC_WEIGHT_BOLD (700). The SCI_STYLESETBOLD message takes a boolean argument with 0 choosing SC_WEIGHT_NORMAL and 1 SC_WEIGHT_BOLD.

SCI_STYLESETUNDERLINE(int styleNumber, bool underline)
SCI_STYLEGETUNDERLINE(int styleNumber)
You can set a style to be underlined. The underline is drawn in the foreground colour. All characters with a style that includes the underline attribute are underlined, even if they are white space.

SCI_STYLESETFORE(int styleNumber, int colour)
SCI_STYLEGETFORE(int styleNumber)
SCI_STYLESETBACK(int styleNumber, int colour)
SCI_STYLEGETBACK(int styleNumber)
Text is drawn in the foreground colour. The space in each character cell that is not occupied by the character is drawn in the background colour.

SCI_STYLESETEOLFILLED(int styleNumber, bool eolFilled)
SCI_STYLEGETEOLFILLED(int styleNumber)
If the last character in the line has a style with this attribute set, the remainder of the line up to the right edge of the window is filled with the background colour set for the last character. This is useful when a document contains embedded sections in another language such as HTML pages with embedded JavaScript. By setting eolFilled to true and a consistent background colour (different from the background colour set for the HTML styles) to all JavaScript styles then JavaScript sections will be easily distinguished from HTML.

SCI_STYLESETCHARACTERSET(int styleNumber, int charSet)
SCI_STYLEGETCHARACTERSET(int styleNumber)
You can set a style to use a different character set than the default. The places where such characters sets are likely to be useful are comments and literal strings. For example, SCI_STYLESETCHARACTERSET(SCE_C_STRING, SC_CHARSET_RUSSIAN) would ensure that strings in Russian would display correctly in C and C++ (SCE_C_STRING is the style number used by the C and C++ lexer to display literal strings; it has the value 6). This feature works differently on Windows and GTK+.

The character sets supported on Windows are:
SC_CHARSET_ANSI, SC_CHARSET_ARABIC, SC_CHARSET_BALTIC, SC_CHARSET_CHINESEBIG5, SC_CHARSET_DEFAULT, SC_CHARSET_EASTEUROPE, SC_CHARSET_GB2312, SC_CHARSET_GREEK, SC_CHARSET_HANGUL, SC_CHARSET_HEBREW, SC_CHARSET_JOHAB, SC_CHARSET_MAC, SC_CHARSET_OEM, SC_CHARSET_RUSSIAN (code page 1251), SC_CHARSET_SHIFTJIS, SC_CHARSET_SYMBOL, SC_CHARSET_THAI, SC_CHARSET_TURKISH, and SC_CHARSET_VIETNAMESE.

The character sets supported on GTK+ are:
SC_CHARSET_ANSI, SC_CHARSET_CYRILLIC (code page 1251), SC_CHARSET_EASTEUROPE, SC_CHARSET_GB2312, SC_CHARSET_HANGUL, SC_CHARSET_RUSSIAN (KOI8-R), SC_CHARSET_SHIFTJIS, and SC_CHARSET_8859_15.

SCI_STYLESETCASE(int styleNumber, int caseMode)
SCI_STYLEGETCASE(int styleNumber)
The value of caseMode determines how text is displayed. You can set upper case (SC_CASE_UPPER, 1) or lower case (SC_CASE_LOWER, 2) or camel case (SC_CASE_CAMEL, 3) or display normally (SC_CASE_MIXED, 0). This does not change the stored text, only how it is displayed.

SCI_STYLESETVISIBLE(int styleNumber, bool visible)
SCI_STYLEGETVISIBLE(int styleNumber)
Text is normally visible. However, you can completely hide it by giving it a style with the visible set to 0. This could be used to hide embedded formatting instructions or hypertext keywords in HTML or XML.

SCI_STYLESETCHANGEABLE(int styleNumber, bool changeable)
SCI_STYLEGETCHANGEABLE(int styleNumber)
This is an experimental and incompletely implemented style attribute. The default setting is changeable set true but when set false it makes text read-only. Currently it only stops the caret from being within not-changeable text and does not yet stop deleting a range that contains not-changeable text.

SCI_STYLESETHOTSPOT(int styleNumber, bool hotspot)
SCI_STYLEGETHOTSPOT(int styleNumber)
This style is used to mark ranges of text that can detect mouse clicks. The cursor changes to a hand over hotspots, and the foreground, and background colours may change and an underline appear to indicate that these areas are sensitive to clicking. This may be used to allow hyperlinks to other documents.

Caret, selection, and hotspot styles

The selection is shown by changing the foreground and/or background colours. If one of these is not set then that attribute is not changed for the selection. The default is to show the selection by changing the background to light grey and leaving the foreground the same as when it was not selected. When there is no selection, the current insertion point is marked by the text caret. This is a vertical line that is normally blinking on and off to attract the users attention.

SCI_SETSELFORE(bool useSelectionForeColour, int colour)
SCI_SETSELBACK(bool useSelectionBackColour, int colour)
SCI_SETSELALPHA(int alpha)
SCI_GETSELALPHA
SCI_SETSELEOLFILLED(bool filled)
SCI_GETSELEOLFILLED
SCI_SETCARETFORE(int colour)
SCI_GETCARETFORE
SCI_SETCARETLINEVISIBLE(bool show)
SCI_GETCARETLINEVISIBLE
SCI_SETCARETLINEBACK(int colour)
SCI_GETCARETLINEBACK
SCI_SETCARETLINEBACKALPHA(int alpha)
SCI_GETCARETLINEBACKALPHA
SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)
SCI_GETCARETLINEVISIBLEALWAYS
SCI_SETCARETPERIOD(int milliseconds)
SCI_GETCARETPERIOD
SCI_SETCARETSTYLE(int style)
SCI_GETCARETSTYLE
SCI_SETCARETWIDTH(int pixels)
SCI_GETCARETWIDTH
SCI_SETHOTSPOTACTIVEFORE(bool useSetting, int colour)
SCI_GETHOTSPOTACTIVEFORE
SCI_SETHOTSPOTACTIVEBACK(bool useSetting, int colour)
SCI_GETHOTSPOTACTIVEBACK
SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)
SCI_GETHOTSPOTACTIVEUNDERLINE
SCI_SETHOTSPOTSINGLELINE(bool singleLine)
SCI_GETHOTSPOTSINGLELINE
SCI_SETCARETSTICKY(int useCaretStickyBehaviour)
SCI_GETCARETSTICKY
SCI_TOGGLECARETSTICKY

SCI_SETSELFORE(bool useSelectionForeColour, int colour)
SCI_SETSELBACK(bool useSelectionBackColour, int colour)
You can choose to override the default selection colouring with these two messages. The colour you provide is used if you set useSelection*Colour to true. If it is set to false, the default styled colouring is used and the colour argument has no effect.

SCI_SETSELALPHA(int alpha)
SCI_GETSELALPHA
The selection can be drawn translucently in the selection background colour by setting an alpha value.

SCI_SETSELEOLFILLED(bool filled)
SCI_GETSELEOLFILLED
The selection can be drawn up to the right hand border by setting this property.

SCI_SETCARETFORE(int colour)
SCI_GETCARETFORE
The colour of the caret can be set with SCI_SETCARETFORE and retrieved with SCI_GETCARETFORE.

SCI_SETCARETLINEVISIBLE(bool show)
SCI_GETCARETLINEVISIBLE
SCI_SETCARETLINEBACK(int colour)
SCI_GETCARETLINEBACK
SCI_SETCARETLINEBACKALPHA(int alpha)
SCI_GETCARETLINEBACKALPHA
You can choose to make the background colour of the line containing the caret different with these messages. To do this, set the desired background colour with SCI_SETCARETLINEBACK, then use SCI_SETCARETLINEVISIBLE(true) to enable the effect. You can cancel the effect with SCI_SETCARETLINEVISIBLE(false). The two SCI_GETCARET* functions return the state and the colour. This form of background colouring has highest priority when a line has markers that would otherwise change the background colour. The caret line may also be drawn translucently which allows other background colours to show through. This is done by setting the alpha (translucency) value by calling SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA, the caret line is drawn after all other features so will affect the colour of all other features.

SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)
SCI_GETCARETLINEVISIBLEALWAYS
Choose to make the caret line always visible even when the window is not in focus. Default behaviour SCI_SETCARETLINEVISIBLEALWAYS(false) the caret line is only visible when the window is in focus.

SCI_SETCARETPERIOD(int milliseconds)
SCI_GETCARETPERIOD
The rate at which the caret blinks can be set with SCI_SETCARETPERIOD which determines the time in milliseconds that the caret is visible or invisible before changing state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds. SCI_GETCARETPERIOD returns the current setting.

SCI_SETCARETSTYLE(int style)
SCI_GETCARETSTYLE
The style of the caret can be set with SCI_SETCARETSTYLE to be a line caret (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1). You can determine the current caret style setting using SCI_GETCARETSTYLE.

The block character draws most combining and multibyte character sequences successfully, though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when the cursor is positioned at these characters, which may result in only drawing a part of the cursor character sequence. This is most notable on Windows platforms.

SCI_SETCARETWIDTH(int pixels)
SCI_GETCARETWIDTH
The width of the line caret can be set with SCI_SETCARETWIDTH to a value of 0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with SCI_GETCARETWIDTH. A width of 0 makes the caret invisible (added at version 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangeable). This setting only affects the width of the cursor when the cursor style is set to line caret mode, it does not affect the width for a block caret.

SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int colour)
SCI_GETHOTSPOTACTIVEFORE
SCI_SETHOTSPOTACTIVEBACK(bool useHotSpotBackColour, int colour)
SCI_GETHOTSPOTACTIVEBACK
SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)
SCI_GETHOTSPOTACTIVEUNDERLINE
SCI_SETHOTSPOTSINGLELINE(bool singleLine)
SCI_GETHOTSPOTSINGLELINE
While the cursor hovers over text in a style with the hotspot attribute set, the default colouring can be modified and an underline drawn with these settings. Single line mode stops a hotspot from wrapping onto next line.

SCI_SETCARETSTICKY(int useCaretStickyBehaviour)
SCI_GETCARETSTICKY
SCI_TOGGLECARETSTICKY
These messages set, get or toggle the caretSticky setting which controls when the last position of the caret on the line is saved.

When set to SC_CARETSTICKY_OFF (0), the sticky flag is off; all text changes (and all caret position changes) will remember the caret's new horizontal position when moving to different lines. This is the default.

When set to SC_CARETSTICKY_ON (1), the sticky flag is on, and the only thing which will cause the editor to remember the horizontal caret position is moving the caret with mouse or keyboard (left/right arrow keys, home/end keys, etc).

When set to SC_CARETSTICKY_WHITESPACE (2), the caret acts like mode 0 (sticky off) except under one special case; when space or tab characters are inserted. (Including pasting only space/tabs -- undo, redo, etc. do not exhibit this behaviour..).

SCI_TOGGLECARETSTICKY switches from SC_CARETSTICKY_ON and SC_CARETSTICKY_WHITESPACE to SC_CARETSTICKY_OFF and from SC_CARETSTICKY_OFF to SC_CARETSTICKY_ON.

Character representations

Some characters, such as control characters and invalid bytes, do not have a visual glyph or use a glyph that is hard to distinguish.

Control characters (characters with codes less than 32, or between 128 and 159 in some encodings) are displayed by Scintilla using their mnemonics inverted in a rounded rectangle. These mnemonics come from the early days of signalling, though some are still used (LF = Line Feed, BS = Back Space, CR = Carriage Return, for example).

For the low 'C0' values: "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US".

For the high 'C1' values: "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA", "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC".

Invalid bytes are shown in a similar way with an 'x' followed by their value in hexadecimal, like "xFE".

SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)
SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation)
SCI_CLEARREPRESENTATION(const char *encodedCharacter)
SCI_SETCONTROLCHARSYMBOL(int symbol)
SCI_GETCONTROLCHARSYMBOL

SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)
SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation NUL-terminated)
SCI_CLEARREPRESENTATION(const char *encodedCharacter)
Any character, including those normally displayed as mnemonics may be represented by a string inverted in a rounded rectangle.

For example, the Ohm sign Ω U+2126 looks very similar to the Greek Omega character Ω U+03C9 so, for the UTF-8 encoding, to distinguish the Ohm sign as "U+2126 Ω" this call could be made: SCI_SETREPRESENTATION("\xe2\x84\xa6", "U+2126 \xe2\x84\xa6")

The encodedCharacter parameter is a NUL-terminated string of the bytes for one character in the current encoding. This can not be used to set a representation for multiple-character strings.

The NUL (0) character is a special case since the encodedCharacter parameter is NUL terminated, the NUL character is specified as an empty string.

SCI_SETCONTROLCHARSYMBOL(int symbol)
SCI_GETCONTROLCHARSYMBOL
The mnemonics may be replaced by a nominated symbol with an ASCII code in the range 32 to 255. If you set a symbol value less than 32, all control characters are displayed as mnemonics. The symbol you set is rendered in the font of the style set for the character. You can read back the current symbol with the SCI_GETCONTROLCHARSYMBOL message. The default symbol value is 0.

Margins

There may be up to five margins, numbered 0 to SC_MAX_MARGIN (4) to the left of the text display, plus a gap either side of the text. Each margin can be set to display only symbols, line numbers, or text with SCI_SETMARGINTYPEN. Textual margins may also display symbols. The markers that can be displayed in each margin are set with SCI_SETMARGINMASKN. Any markers not associated with a visible margin will be displayed as changes in background colour in the text. A width in pixels can be set for each margin. Margins with a zero width are ignored completely. You can choose if a mouse click in a margin sends a SCN_MARGINCLICK notification to the container or selects a line of text.

The margins are numbered 0 to 4. Using a margin number outside the valid range has no effect. By default, margin 0 is set to display line numbers, but is given a width of 0, so it is hidden. Margin 1 is set to display non-folding symbols and is given a width of 16 pixels, so it is visible. Margin 2 is set to display the folding symbols, but is given a width of 0, so it is hidden. Of course, you can set the margins to be whatever you wish.

Styled text margins used to show revision and blame information:

Styled text margins used to show revision and blame information

SCI_SETMARGINTYPEN(int margin, int type)
SCI_GETMARGINTYPEN(int margin)
SCI_SETMARGINWIDTHN(int margin, int pixelWidth)
SCI_GETMARGINWIDTHN(int margin)
SCI_SETMARGINMASKN(int margin, int mask)
SCI_GETMARGINMASKN(int margin)
SCI_SETMARGINSENSITIVEN(int margin, bool sensitive)
SCI_GETMARGINSENSITIVEN(int margin)
SCI_SETMARGINCURSORN(int margin, int cursor)
SCI_GETMARGINCURSORN(int margin)
SCI_SETMARGINLEFT(<unused>, int pixels)
SCI_GETMARGINLEFT
SCI_SETMARGINRIGHT(<unused>, int pixels)
SCI_GETMARGINRIGHT
SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
SCI_MARGINSETTEXT(int line, char *text)
SCI_MARGINGETTEXT(int line, char *text)
SCI_MARGINSETSTYLE(int line, int style)
SCI_MARGINGETSTYLE(int line)
SCI_MARGINSETSTYLES(int line, char *styles)
SCI_MARGINGETSTYLES(int line, char *styles)
SCI_MARGINTEXTCLEARALL
SCI_MARGINSETSTYLEOFFSET(int style)
SCI_MARGINGETSTYLEOFFSET
SCI_SETMARGINOPTIONS(int marginOptions)
SCI_GETMARGINOPTIONS

SCI_SETMARGINTYPEN(int margin, int iType)
SCI_GETMARGINTYPEN(int margin)
These two routines set and get the type of a margin. The margin argument should be 0, 1, 2, 3 or 4. You can use the predefined constants SC_MARGIN_SYMBOL (0) and SC_MARGIN_NUMBER (1) to set a margin as either a line number or a symbol margin. A margin with application defined text may use SC_MARGIN_TEXT (4) or SC_MARGIN_RTEXT (5) to right justify the text. By convention, margin 0 is used for line numbers and the next two are used for symbols. You can also use the constants SC_MARGIN_BACK (2) and SC_MARGIN_FORE (3) for symbol margins that set their background colour to match the STYLE_DEFAULT background and foreground colours.

SCI_SETMARGINWIDTHN(int margin, int pixelWidth)
SCI_GETMARGINWIDTHN(int margin)
These routines set and get the width of a margin in pixels. A margin with zero width is invisible. By default, Scintilla sets margin 1 for symbols with a width of 16 pixels, so this is a reasonable guess if you are not sure what would be appropriate. Line number margins widths should take into account the number of lines in the document and the line number style. You could use something like SCI_TEXTWIDTH(STYLE_LINENUMBER, "_99999") to get a suitable width.

SCI_SETMARGINMASKN(int margin, int mask)
SCI_GETMARGINMASKN(int margin)
The mask is a 32-bit value. Each bit corresponds to one of 32 logical symbols that can be displayed in a margin that is enabled for symbols. There is a useful constant, SC_MASK_FOLDERS (0xFE000000 or -33554432), that is a mask for the 7 logical symbols used to denote folding. You can assign a wide range of symbols and colours to each of the 32 logical symbols, see Markers for more information. If (mask & SC_MASK_FOLDERS)==0, the margin background colour is controlled by style 33 (STYLE_LINENUMBER).

You add logical markers to a line with SCI_MARKERADD. If a line has an associated marker that does not appear in the mask of any margin with a non-zero width, the marker changes the background colour of the line. For example, suppose you decide to use logical marker 10 to mark lines with a syntax error and you want to show such lines by changing the background colour. The mask for this marker is 1 shifted left 10 times (1<<10) which is 0x400. If you make sure that no symbol margin includes 0x400 in its mask, any line with the marker gets the background colour changed.

To set a non-folding margin 1 use SCI_SETMARGINMASKN(1, ~SC_MASK_FOLDERS) which is the default set by Scintilla. To set a folding margin 2 use SCI_SETMARGINMASKN(2, SC_MASK_FOLDERS). ~SC_MASK_FOLDERS is 0x1FFFFFF in hexadecimal or 33554431 decimal. Of course, you may need to display all 32 symbols in a margin, in which case use SCI_SETMARGINMASKN(margin, -1).

SCI_SETMARGINSENSITIVEN(int margin, bool sensitive)
SCI_GETMARGINSENSITIVEN(int margin)
Each of the five margins can be set sensitive or insensitive to mouse clicks. A click in a sensitive margin sends a SCN_MARGINCLICK notification to the container. Margins that are not sensitive act as selection margins which make it easy to select ranges of lines. By default, all margins are insensitive.

SCI_SETMARGINCURSORN(int margin, int cursor)
SCI_GETMARGINCURSORN(int margin)
A reversed arrow cursor is normally shown over all margins. This may be changed to a normal arrow with SCI_SETMARGINCURSORN(margin, SC_CURSORARROW) or restored to a reversed arrow with SCI_SETMARGINCURSORN(margin, SC_CURSORREVERSEARROW).

SCI_SETMARGINLEFT(<unused>, int pixels)
SCI_GETMARGINLEFT
SCI_SETMARGINRIGHT(<unused>, int pixels)
SCI_GETMARGINRIGHT
These messages set and get the width of the blank margin on both sides of the text in pixels. The default is to one pixel on each side.

SCI_SETFOLDMARGINCOLOUR(bool useSetting, int colour)
SCI_SETFOLDMARGINHICOLOUR(bool useSetting, int colour)
These messages allow changing the colour of the fold margin and fold margin highlight. On Windows the fold margin colour defaults to ::GetSysColor(COLOR_3DFACE) and the fold margin highlight colour to ::GetSysColor(COLOR_3DHIGHLIGHT).

SCI_MARGINSETTEXT(int line, char *text)
SCI_MARGINGETTEXT(int line, char *text)
SCI_MARGINSETSTYLE(int line, int style)
SCI_MARGINGETSTYLE(int line)
SCI_MARGINSETSTYLES(int line, char *styles)
SCI_MARGINGETSTYLES(int line, char *styles)
SCI_MARGINTEXTCLEARALL
Text margins are created with the type SC_MARGIN_TEXT or SC_MARGIN_RTEXT. A different string may be set for each line with SCI_MARGINSETTEXT. The whole of the text margin on a line may be displayed in a particular style with SCI_MARGINSETSTYLE or each character may be individually styled with SCI_MARGINSETSTYLES which uses an array of bytes with each byte setting the style of the corresponding text byte similar to SCI_SETSTYLINGEX. Setting a text margin will cause a SC_MOD_CHANGEMARGIN notification to be sent.

Only some style attributes are active in text margins: font, size/sizeFractional, bold/weight, italics, fore, back, and characterSet.

SCI_MARGINSETSTYLEOFFSET(int style)
SCI_MARGINGETSTYLEOFFSET
Margin styles may be completely separated from standard text styles by setting a style offset. For example, SCI_MARGINSETSTYLEOFFSET(256) would allow the margin styles to be numbered from 256 up to 511 so they do not overlap styles set by lexers. Each style number set with SCI_MARGINSETSTYLE or SCI_MARGINSETSTYLES has the offset added before looking up the style.

Always call SCI_ALLOCATEEXTENDEDSTYLES before SCI_MARGINSETSTYLEOFFSET and use the result as the argument to SCI_MARGINSETSTYLEOFFSET.

SCI_SETMARGINOPTIONS(int marginOptions)
SCI_GETMARGINOPTIONS
Define margin options by enabling appropriate bit flags. At the moment, only one flag is available SC_MARGINOPTION_SUBLINESELECT=1, which controls how wrapped lines are selected when clicking on margin in front of them. If SC_MARGINOPTION_SUBLINESELECT is set only sub line of wrapped line is selected, otherwise whole wrapped line is selected. Margin options are set to SC_MARGINOPTION_NONE=0 by default.

Annotations

Annotations are read-only lines of text underneath each line of editable text. An annotation may consist of multiple lines separated by '\n'. Annotations can be used to display an assembler version of code for debugging or to show diagnostic messages inline or to line up different versions of text in a merge tool.

Annotations count as display lines for the methods SCI_VISIBLEFROMDOCLINE and SCI_DOCLINEFROMVISIBLE

Annotations used for inline diagnostics:

Annotations used for inline diagnostics

SCI_ANNOTATIONSETTEXT(int line, char *text)
SCI_ANNOTATIONGETTEXT(int line, char *text)
SCI_ANNOTATIONSETSTYLE(int line, int style)
SCI_ANNOTATIONGETSTYLE(int line)
SCI_ANNOTATIONSETSTYLES(int line, char *styles)
SCI_ANNOTATIONGETSTYLES(int line, char *styles)
SCI_ANNOTATIONGETLINES(int line)
SCI_ANNOTATIONCLEARALL
SCI_ANNOTATIONSETVISIBLE(int visible)
SCI_ANNOTATIONGETVISIBLE
SCI_ANNOTATIONSETSTYLEOFFSET(int style)
SCI_ANNOTATIONGETSTYLEOFFSET

SCI_ANNOTATIONSETTEXT(int line, char *text)
SCI_ANNOTATIONGETTEXT(int line, char *text)
SCI_ANNOTATIONSETSTYLE(int line, int style)
SCI_ANNOTATIONGETSTYLE(int line)
SCI_ANNOTATIONSETSTYLES(int line, char *styles)
SCI_ANNOTATIONGETSTYLES(int line, char *styles)
SCI_ANNOTATIONGETLINES(int line)
SCI_ANNOTATIONCLEARALL
A different string may be set for each line with SCI_ANNOTATIONSETTEXT. To clear annotations call SCI_ANNOTATIONSETTEXT with a NULL pointer. The whole of the text ANNOTATION on a line may be displayed in a particular style with SCI_ANNOTATIONSETSTYLE or each character may be individually styled with SCI_ANNOTATIONSETSTYLES which uses an array of bytes with each byte setting the style of the corresponding text byte similar to SCI_SETSTYLINGEX. The text must be set first as it specifies how long the annotation is so how many bytes of styling to read. Setting an annotation will cause a SC_MOD_CHANGEANNOTATION notification to be sent.

The number of lines annotating a line can be retrieved with SCI_ANNOTATIONGETLINES. All the lines can be cleared of annotations with SCI_ANNOTATIONCLEARALL which is equivalent to clearing each line (setting to 0) and then deleting other memory used for this feature.

Only some style attributes are active in annotations: font, size/sizeFractional, bold/weight, italics, fore, back, and characterSet.

SCI_ANNOTATIONSETVISIBLE(int visible)
SCI_ANNOTATIONGETVISIBLE
Annotations can be made visible in a view and there is a choice of display style when visible. The two messages set and get the annotation display mode. The visible argument can be one of:

ANNOTATION_HIDDEN 0 Annotations are not displayed.
ANNOTATION_STANDARD 1 Annotations are drawn left justified with no adornment.
ANNOTATION_BOXED 2 Annotations are indented to match the text and are surrounded by a box.
ANNOTATION_INDENTED 3 Annotations are indented to match the text.

SCI_ANNOTATIONSETSTYLEOFFSET(int style)
SCI_ANNOTATIONGETSTYLEOFFSET
Annotation styles may be completely separated from standard text styles by setting a style offset. For example, SCI_ANNOTATIONSETSTYLEOFFSET(512) would allow the annotation styles to be numbered from 512 up to 767 so they do not overlap styles set by lexers (or margins if margins offset is 256). Each style number set with SCI_ANNOTATIONSETSTYLE or SCI_ANNOTATIONSETSTYLES has the offset added before looking up the style.

Always call SCI_ALLOCATEEXTENDEDSTYLES before SCI_ANNOTATIONSETSTYLEOFFSET and use the result as the argument to SCI_ANNOTATIONSETSTYLEOFFSET.

Other settings

SCI_SETBUFFEREDDRAW(bool isBuffered)
SCI_GETBUFFEREDDRAW
SCI_SETPHASESDRAW(int phases)
SCI_GETPHASESDRAW
SCI_SETTWOPHASEDRAW(bool twoPhase)
SCI_GETTWOPHASEDRAW
SCI_SETTECHNOLOGY(int technology)
SCI_GETTECHNOLOGY
SCI_SETFONTQUALITY(int fontQuality)
SCI_GETFONTQUALITY
SCI_SETCODEPAGE(int codePage)
SCI_GETCODEPAGE
SCI_SETIMEINTERACTION(int imeInteraction)
SCI_GETIMEINTERACTION
SCI_SETWORDCHARS(<unused>, const char *characters)
SCI_GETWORDCHARS(<unused>, char *characters)
SCI_SETWHITESPACECHARS(<unused>, const char *characters)
SCI_GETWHITESPACECHARS(<unused>, char *characters)
SCI_SETPUNCTUATIONCHARS(<unused>, const char *characters)
SCI_GETPUNCTUATIONCHARS(<unused>, char *characters)
SCI_SETCHARSDEFAULT
SCI_GRABFOCUS
SCI_SETFOCUS(bool focus)
SCI_GETFOCUS

To forward a message (WM_XXXX, WPARAM, LPARAM) to Scintilla, you can use SendMessage(hScintilla, WM_XXXX, WPARAM, LPARAM) where hScintilla is the handle to the Scintilla window you created as your editor.

While we are on the subject of forwarding messages in Windows, the top level window should forward any WM_SETTINGCHANGE messages to Scintilla (this is currently used to collect changes to mouse settings, but could be used for other user interface items in the future).

SCI_SETBUFFEREDDRAW(bool isBuffered)
SCI_GETBUFFEREDDRAW
These messages turn buffered drawing on or off and report the buffered drawing state. Buffered drawing draws each line into a bitmap rather than directly to the screen and then copies the bitmap to the screen. This avoids flickering although it does take longer. The default is for drawing to be buffered.

SCI_SETPHASESDRAW(int phases)
SCI_GETPHASESDRAW
There are several orders in which the text area may be drawn offering a trade-off between speed and allowing all pixels of text to be seen even when they overlap other elements.

In single phase drawing (SC_PHASES_ONE) each run of characters in one style is drawn along with its background. If a character overhangs the end of a run, such as in "V_" where the "V" is in a different style from the "_", then this can cause the right hand side of the "V" to be overdrawn by the background of the "_" which cuts it off.

Two phase drawing (SC_PHASES_TWO) fixes this by drawing all the backgrounds of a line first and then drawing the text in transparent mode. Lines are drawn separately and no line will overlap another so any pixels that overlap into another line such as extreme ascenders and descenders on characters will be cut off. Two phase drawing may flicker more than single phase unless buffered drawing is on or the platform is naturally buffered. The default is for drawing to be two phase.

Multiple phase drawing (SC_PHASES_MULTIPLE) draws the whole area multiple times, once for each feature, building up the the appearance in layers or phases. The coloured backgrounds for all lines are drawn before any text and then all the text is drawn in transparent mode over this combined background without clipping text to the line boundaries. This allows extreme ascenders and descenders to overflow into the adjacent lines. This mode is incompatible with buffered drawing and will act as SC_PHASES_TWO if buffered drawing is turned on. Multiple phase drawing is slower than two phase drawing. Setting the layout cache to SC_CACHE_PAGE or higher can ensure that multiple phase drawing is not significantly slower.

SCI_SETTWOPHASEDRAW(bool twoPhase)
SCI_GETTWOPHASEDRAW
This property has been replaced with the preceding PHASESDRAW property which is more general, allowing multiple phase drawing as well as one and two phase drawing.

SCI_SETTECHNOLOGY(int technology)
SCI_GETTECHNOLOGY
The technology property allows choosing between different drawing APIs and options. On most platforms, the only choice is SC_TECHNOLOGY_DEFAULT (0). On Windows Vista or later, SC_TECHNOLOGY_DIRECTWRITE (1), SC_TECHNOLOGY_DIRECTWRITERETAIN (2), or SC_TECHNOLOGY_DIRECTWRITEDC (3) can be chosen to use the Direct2D and DirectWrite APIs for higher quality antialiased drawing. SC_TECHNOLOGY_DIRECTWRITERETAIN differs from SC_TECHNOLOGY_DIRECTWRITE by requesting that the frame is retained after being presented which may prevent drawing failures on some cards and drivers. SC_TECHNOLOGY_DIRECTWRITEDC differs from SC_TECHNOLOGY_DIRECTWRITE by using DirectWrite to draw into a GDI DC. Since Direct2D buffers drawing, Scintilla's buffering can be turned off with SCI_SETBUFFEREDDRAW(0). Since SC_TECHNOLOGY_DIRECTWRITERETAIN and SC_TECHNOLOGY_DIRECTWRITEDC are provisional, they may be changed or removed in a future release if a better solution is found.

SCI_SETFONTQUALITY(int fontQuality)
SCI_GETFONTQUALITY
Manage font quality (antialiasing method). Currently, the following values are available on Windows: SC_EFF_QUALITY_DEFAULT (backward compatible), SC_EFF_QUALITY_NON_ANTIALIASED, SC_EFF_QUALITY_ANTIALIASED, SC_EFF_QUALITY_LCD_OPTIMIZED.

In case it is necessary to squeeze more options into this property, only a limited number of bits defined by SC_EFF_QUALITY_MASK (0xf) will be used for quality.

SCI_SETCODEPAGE(int codePage)
SCI_GETCODEPAGE
Scintilla has some support for Japanese, Chinese and Korean DBCS. Use this message with codePage set to the code page number to set Scintilla to use code page information to ensure double byte characters are treated as one character rather than two. This also stops the caret from moving between the two bytes in a double byte character. Do not use this message to choose between different single byte character sets: it doesn't do that. Call with codePage set to zero to disable DBCS support. The default is SCI_SETCODEPAGE(0).

Code page SC_CP_UTF8 (65001) sets Scintilla into Unicode mode with the document treated as a sequence of characters expressed in UTF-8. The text is converted to the platform's normal Unicode encoding before being drawn by the OS and thus can display Hebrew, Arabic, Cyrillic, and Han characters. Languages which can use two characters stacked vertically in one horizontal space, such as Thai, will mostly work but there are some issues where the characters are drawn separately leading to visual glitches. Bi-directional text is not supported.

Code page can be set to 932 (Japanese Shift-JIS), 936 (Simplified Chinese GBK), 949 (Korean Unified Hangul Code), 950 (Traditional Chinese Big5), or 1361 (Korean Johab) although these may require installation of language specific support.

SCI_SETIMEINTERACTION(int imeInteraction)
SCI_GETIMEINTERACTION
When entering text in Chinese, Japanese, or Korean an Input Method Editor (IME) may be displayed. The IME may be an extra window appearing above Scintilla or may be displayed by Scintilla itself as text. On some platforms there is a choice between the two techniques. A windowed IME SC_IME_WINDOWED (0) may be more similar in appearance and behaviour to the IME in other applications. An inline IME SC_IME_INLINE (1) may work better with some Scintilla features such as rectangular and multiple selection.

The windowed behaviour can be chosen with SCI_SETIMEINTERACTION(SC_IME_WINDOWED) and the inline behaviour with SCI_SETIMEINTERACTION(SC_IME_INLINE). Scintilla may ignore this call in some cases. For example, the inline behaviour might only be supported for some languages.

SCI_SETWORDCHARS(<unused>, const char *characters)
Scintilla has several functions that operate on words, which are defined to be contiguous sequences of characters from a particular set of characters. This message defines which characters are members of that set. The character sets are set to default values before processing this function. For example, if you don't allow '_' in your set of characters use:
SCI_SETWORDCHARS(0, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789");

SCI_GETWORDCHARS(<unused>, char *characters)
This fills the characters parameter with all the characters included in words. The characters parameter must be large enough to hold all of the characters. If the characters parameter is 0 then the length that should be allocated to store the entire set is returned.

SCI_SETWHITESPACECHARS(<unused>, const char *characters)
SCI_GETWHITESPACECHARS(<unused>, char *characters)
Similar to SCI_SETWORDCHARS, this message allows the user to define which chars Scintilla considers as whitespace. Setting the whitespace chars allows the user to fine-tune Scintilla's behaviour doing such things as moving the cursor to the start or end of a word; for example, by defining punctuation chars as whitespace, they will be skipped over when the user presses ctrl+left or ctrl+right. This function should be called after SCI_SETWORDCHARS as it will reset the whitespace characters to the default set. SCI_GETWHITESPACECHARS behaves similarly to SCI_GETWORDCHARS.

SCI_SETPUNCTUATIONCHARS(<unused>, const char *characters)
SCI_GETPUNCTUATIONCHARS(<unused>, char *characters)
Similar to SCI_SETWORDCHARS and SCI_SETWHITESPACECHARS, this message allows the user to define which chars Scintilla considers as punctuation. SCI_GETPUNCTUATIONCHARS behaves similarly to SCI_GETWORDCHARS.

SCI_SETCHARSDEFAULT
Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other characters with codes less than 0x20, with word characters set to alphanumeric and '_'.

SCI_GRABFOCUS
SCI_SETFOCUS(bool focus)
SCI_GETFOCUS
Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where focus handling is more complicated than on Windows.

The internal focus flag can be set with SCI_SETFOCUS. This is used by clients that have complex focus requirements such as having their own window that gets the real focus but with the need to indicate that Scintilla has the logical focus.

Brace highlighting

SCI_BRACEHIGHLIGHT(int pos1, int pos2)
SCI_BRACEBADLIGHT(int pos1)
SCI_BRACEHIGHLIGHTINDICATOR(bool useBraceHighlightIndicator, int indicatorNumber)
SCI_BRACEBADLIGHTINDICATOR(bool useBraceBadLightIndicator, int indicatorNumber)
SCI_BRACEMATCH(int position, int maxReStyle)

SCI_BRACEHIGHLIGHT(int pos1, int pos2)
Up to two characters can be highlighted in a 'brace highlighting style', which is defined as style number STYLE_BRACELIGHT (34). If you have enabled indent guides, you may also wish to highlight the indent that corresponds with the brace. You can locate the column with SCI_GETCOLUMN and highlight the indent with SCI_SETHIGHLIGHTGUIDE.

SCI_BRACEBADLIGHT(int pos1)
If there is no matching brace then the brace badlighting style, style STYLE_BRACEBAD (35), can be used to show the brace that is unmatched. Using a position of INVALID_POSITION (-1) removes the highlight.

SCI_BRACEHIGHLIGHTINDICATOR(bool useBraceHighlightIndicator, int indicatorNumber)
Use specified indicator to highlight matching braces instead of changing their style.

SCI_BRACEBADLIGHTINDICATOR(bool useBraceBadLightIndicator, int indicatorNumber)
Use specified indicator to highlight non matching brace instead of changing its style.

SCI_BRACEMATCH(int pos, int maxReStyle)
The SCI_BRACEMATCH message finds a corresponding matching brace given pos, the position of one brace. The brace characters handled are '(', ')', '[', ']', '{', '}', '<', and '>'. The search is forwards from an opening brace and backwards from a closing brace. If the character at position is not a brace character, or a matching brace cannot be found, the return value is -1. Otherwise, the return value is the position of the matching brace.

A match only occurs if the style of the matching brace is the same as the starting brace or the matching brace is beyond the end of styling. Nested braces are handled correctly. The maxReStyle parameter must currently be 0 - it may be used in the future to limit the length of brace searches.

Tabs and Indentation Guides

Indentation (the white space at the start of a line) is often used by programmers to clarify program structure and in some languages, for example Python, it may be part of the language syntax. Tabs are normally used in editors to insert a tab character or to pad text with spaces up to the next tab.

When Scintilla is laying out a section of text, text after a tab character will usually be displayed at the next multiple of TABWIDTH columns from the left. However, it is also possible to explicitly set tabstops in pixels for each line.

Scintilla can be set to treat tab and backspace in the white space at the start of a line in a special way: inserting a tab indents the line to the next indent position rather than just inserting a tab at the current character position and backspace unindents the line rather than deleting a character. Scintilla can also display indentation guides (vertical lines) to help you to generate code.

SCI_SETTABWIDTH(int widthInChars)
SCI_GETTABWIDTH
SCI_CLEARTABSTOPS(int line)
SCI_ADDTABSTOP(int line, int x)
SCI_GETNEXTTABSTOP(int line, int x)
SCI_SETUSETABS(bool useTabs)
SCI_GETUSETABS
SCI_SETINDENT(int widthInChars)
SCI_GETINDENT
SCI_SETTABINDENTS(bool tabIndents)
SCI_GETTABINDENTS
SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)
SCI_GETBACKSPACEUNINDENTS
SCI_SETLINEINDENTATION(int line, int indentation)
SCI_GETLINEINDENTATION(int line)
SCI_GETLINEINDENTPOSITION(int line)
SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES
SCI_SETHIGHLIGHTGUIDE(int column)
SCI_GETHIGHLIGHTGUIDE

SCI_SETTABWIDTH(int widthInChars)
SCI_GETTABWIDTH
SCI_SETTABWIDTH sets the size of a tab as a multiple of the size of a space character in STYLE_DEFAULT. The default tab width is 8 characters. There are no limits on tab sizes, but values less than 1 or large values may have undesirable effects.

SCI_CLEARTABSTOPS(int line)
SCI_ADDTABSTOP(int line, int x)
SCI_GETNEXTTABSTOP(int line, int x)
SCI_CLEARTABSTOPS clears explicit tabstops on a line. SCI_ADDTABSTOP adds an explicit tabstop at the specified distance from the left (in pixels), and SCI_GETNEXTTABSTOP gets the next explicit tabstop position set after the given x position, or zero if there aren't any. Changing tab stops produces a SC_MOD_CHANGETABSTOPS notification.

SCI_SETUSETABS(bool useTabs)
SCI_GETUSETABS
SCI_SETUSETABS determines whether indentation should be created out of a mixture of tabs and spaces or be based purely on spaces. Set useTabs to false (0) to create all tabs and indents out of spaces. The default is true. You can use SCI_GETCOLUMN to get the column of a position taking the width of a tab into account.

SCI_SETINDENT(int widthInChars)
SCI_GETINDENT
SCI_SETINDENT sets the size of indentation in terms of the width of a space in STYLE_DEFAULT. If you set a width of 0, the indent size is the same as the tab size. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.

SCI_SETTABINDENTS(bool tabIndents)
SCI_GETTABINDENTS
SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)
SCI_GETBACKSPACEUNINDENTS

Inside indentation white space, the tab and backspace keys can be made to indent and unindent rather than insert a tab character or delete a character with the SCI_SETTABINDENTS and SCI_SETBACKSPACEUNINDENTS functions.

SCI_SETLINEINDENTATION(int line, int indentation)
SCI_GETLINEINDENTATION(int line)
The amount of indentation on a line can be discovered and set with SCI_GETLINEINDENTATION and SCI_SETLINEINDENTATION. The indentation is measured in character columns, which correspond to the width of space characters.

SCI_GETLINEINDENTPOSITION(int line)
This returns the position at the end of indentation of a line.

SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES
Indentation guides are dotted vertical lines that appear within indentation white space every indent size columns. They make it easy to see which constructs line up especially when they extend over multiple pages. Style STYLE_INDENTGUIDE (37) is used to specify the foreground and background colour of the indentation guides.

There are 4 indentation guide views. SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on empty lines.

SC_IV_NONE No indentation guides are shown.
SC_IV_REAL Indentation guides are shown inside real indentation white space.
SC_IV_LOOKFORWARD Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line. If the previous non-empty line was a fold header then indentation guides are shown for one more level of indent than that line. This setting is good for Python.
SC_IV_LOOKBOTH Indentation guides are shown beyond the actual indentation up to the level of the next non-empty line or previous non-empty line whichever is the greater. This setting is good for most languages.

SCI_SETHIGHLIGHTGUIDE(int column)
SCI_GETHIGHLIGHTGUIDE
When brace highlighting occurs, the indentation guide corresponding to the braces may be highlighted with the brace highlighting style, STYLE_BRACELIGHT (34). Set column to 0 to cancel this highlight.

Markers

There are 32 markers, numbered 0 to MARKER_MAX (31), and you can assign any combination of them to each line in the document. Markers appear in the selection margin to the left of the text. If the selection margin is set to zero width, the background colour of the whole line is changed instead. Marker numbers 25 to 31 are used by Scintilla in folding margins, and have symbolic names of the form SC_MARKNUM_*, for example SC_MARKNUM_FOLDEROPEN.

Marker numbers 0 to 24 have no pre-defined function; you can use them to mark syntax errors or the current point of execution, break points, or whatever you need marking. If you do not need folding, you can use all 32 for any purpose you wish.

Each marker number has a symbol associated with it. You can also set the foreground and background colour for each marker number, so you can use the same symbol more than once with different colouring for different uses. Scintilla has a set of symbols you can assign (SC_MARK_*) or you can use characters. By default, all 32 markers are set to SC_MARK_CIRCLE with a black foreground and a white background.

The markers are drawn in the order of their numbers, so higher numbered markers appear on top of lower numbered ones. Markers try to move with their text by tracking where the start of their line moves. When a line is deleted, its markers are combined, by an OR operation, with the markers of the next line.

SCI_MARKERDEFINE(int markerNumber, int markerSymbols)
SCI_MARKERDEFINEPIXMAP(int markerNumber, const char *xpm)
SCI_RGBAIMAGESETWIDTH(int width)
SCI_RGBAIMAGESETHEIGHT(int height)
SCI_RGBAIMAGESETSCALE(int scalePercent)
SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)
SCI_MARKERSYMBOLDEFINED(int markerNumber)
SCI_MARKERSETFORE(int markerNumber, int colour)
SCI_MARKERSETBACK(int markerNumber, int colour)
SCI_MARKERSETBACKSELECTED(int markerNumber, int colour)
SCI_MARKERENABLEHIGHLIGHT(bool enabled)
SCI_MARKERSETALPHA(int markerNumber, int alpha)
SCI_MARKERADD(int line, int markerNumber)
SCI_MARKERADDSET(int line, int markerMask)
SCI_MARKERDELETE(int line, int markerNumber)
SCI_MARKERDELETEALL(int markerNumber)
SCI_MARKERGET(int line)
SCI_MARKERNEXT(int lineStart, int markerMask)
SCI_MARKERPREVIOUS(int lineStart, int markerMask)
SCI_MARKERLINEFROMHANDLE(int handle)
SCI_MARKERDELETEHANDLE(int handle)

SCI_MARKERDEFINE(int markerNumber, int markerSymbols)
This message associates a marker number in the range 0 to 31 with one of the marker symbols or an ASCII character. The general-purpose marker symbols currently available are:
SC_MARK_CIRCLE, SC_MARK_ROUNDRECT, SC_MARK_ARROW, SC_MARK_SMALLRECT, SC_MARK_SHORTARROW, SC_MARK_EMPTY, SC_MARK_ARROWDOWN, SC_MARK_MINUS, SC_MARK_PLUS, SC_MARK_ARROWS, SC_MARK_DOTDOTDOT, SC_MARK_BACKGROUND, SC_MARK_LEFTRECT, SC_MARK_FULLRECT, SC_MARK_BOOKMARK, and SC_MARK_UNDERLINE.

The SC_MARK_BACKGROUND marker changes the background colour of the line only. The SC_MARK_FULLRECT symbol mirrors this, changing only the margin background colour. SC_MARK_UNDERLINE draws an underline across the text. The SC_MARK_EMPTY symbol is invisible, allowing client code to track the movement of lines. You would also use it if you changed the folding style and wanted one or more of the SC_FOLDERNUM_* markers to have no associated symbol.

Applications may use the marker symbol SC_MARK_AVAILABLE to indicate that plugins may allocate that marker number.

There are also marker symbols designed for use in the folding margin in a flattened tree style.
SC_MARK_BOXMINUS, SC_MARK_BOXMINUSCONNECTED, SC_MARK_BOXPLUS, SC_MARK_BOXPLUSCONNECTED, SC_MARK_CIRCLEMINUS, SC_MARK_CIRCLEMINUSCONNECTED, SC_MARK_CIRCLEPLUS, SC_MARK_CIRCLEPLUSCONNECTED, SC_MARK_LCORNER, SC_MARK_LCORNERCURVE, SC_MARK_TCORNER, SC_MARK_TCORNERCURVE, and SC_MARK_VLINE.

Characters can be used as markers by adding the ASCII value of the character to SC_MARK_CHARACTER (10000). For example, to use 'A' (ASCII code 65) as marker number 1 use:
SCI_MARKERDEFINE(1, SC_MARK_CHARACTER+65).

The marker numbers SC_MARKNUM_FOLDER and SC_MARKNUM_FOLDEROPEN are used for showing that a fold is present and open or closed. Any symbols may be assigned for this purpose although the (SC_MARK_PLUS, SC_MARK_MINUS) pair or the (SC_MARK_ARROW, SC_MARK_ARROWDOWN) pair are good choices. As well as these two, more assignments are needed for the flattened tree style: SC_MARKNUM_FOLDEREND, SC_MARKNUM_FOLDERMIDTAIL, SC_MARKNUM_FOLDEROPENMID, SC_MARKNUM_FOLDERSUB, and SC_MARKNUM_FOLDERTAIL. The bits used for folding are specified by SC_MASK_FOLDERS, which is commonly used as an argument to SCI_SETMARGINMASKN when defining a margin to be used for folding.

This table shows which SC_MARK_* symbols should be assigned to which SC_MARKNUM_* marker numbers to obtain four folding styles: Arrow (mimics Macintosh), plus/minus shows folded lines as '+' and opened folds as '-', Circle tree, Box tree.

SC_MARKNUM_* Arrow Plus/minus Circle tree Box tree
FOLDEROPEN ARROWDOWN MINUS CIRCLEMINUS BOXMINUS
FOLDER ARROW PLUS CIRCLEPLUS BOXPLUS
FOLDERSUB EMPTY EMPTY VLINE VLINE
FOLDERTAIL EMPTY EMPTY LCORNERCURVE LCORNER
FOLDEREND EMPTY EMPTY CIRCLEPLUSCONNECTED BOXPLUSCONNECTED
FOLDEROPENMID EMPTY EMPTY CIRCLEMINUSCONNECTED BOXMINUSCONNECTED
FOLDERMIDTAIL EMPTY EMPTY TCORNERCURVE TCORNER

Marker samples

SCI_MARKERDEFINEPIXMAP(int markerNumber, const char *xpm)
Markers can be set to pixmaps with this message. The XPM format is used for the pixmap. Pixmaps use the SC_MARK_PIXMAP marker symbol.

SCI_RGBAIMAGESETWIDTH(int width)
SCI_RGBAIMAGESETHEIGHT(int height)
SCI_RGBAIMAGESETSCALE(int scalePercent)
SCI_MARKERDEFINERGBAIMAGE(int markerNumber, const char *pixels)
Markers can be set to translucent pixmaps with this message. The RGBA format is used for the pixmap. The width and height must previously been set with the SCI_RGBAIMAGESETWIDTH and SCI_RGBAIMAGESETHEIGHT messages.

A scale factor in percent may be set with SCI_RGBAIMAGESETSCALE. This is useful on OS X with a retina display where each display unit is 2 pixels: use a factor of 200 so that each image pixel is displayed using a screen pixel. The default scale, 100, will stretch each image pixel to cover 4 screen pixels on a retina display.

Pixmaps use the SC_MARK_RGBAIMAGE marker symbol.

SCI_MARKERSYMBOLDEFINED(int markerNumber)
Returns the symbol defined for a markerNumber with SCI_MARKERDEFINE or SC_MARK_PIXMAP if defined with SCI_MARKERDEFINEPIXMAP or SC_MARK_RGBAIMAGE if defined with SCI_MARKERDEFINERGBAIMAGE.

SCI_MARKERSETFORE(int markerNumber, int colour)
SCI_MARKERSETBACK(int markerNumber, int colour)
These two messages set the foreground and background colour of a marker number.
SCI_MARKERSETBACKSELECTED(int markerNumber, int colour)
This message sets the highlight background colour of a marker number when its folding block is selected. The default colour is #FF0000.

SCI_MARKERENABLEHIGHLIGHT(bool enabled)
This message allows to enable/disable the highlight folding block when it is selected. (i.e. block that contains the caret)

SCI_MARKERSETALPHA(int markerNumber, int alpha)
When markers are drawn in the content area, either because there is no margin for them or they are of SC_MARK_BACKGROUND or SC_MARK_UNDERLINE types, they may be drawn translucently by setting an alpha value.

SCI_MARKERADD(int line, int markerNumber)
This message adds marker number markerNumber to a line. The message returns -1 if this fails (illegal line number, out of memory) or it returns a marker handle number that identifies the added marker. You can use this returned handle with SCI_MARKERLINEFROMHANDLE to find where a marker is after moving or combining lines and with SCI_MARKERDELETEHANDLE to delete the marker based on its handle. The message does not check the value of markerNumber, nor does it check if the line already contains the marker.

SCI_MARKERADDSET(int line, int markerMask)
This message can add one or more markers to a line with a single call, specified in the same "one-bit-per-marker" 32-bit integer format returned by SCI_MARKERGET (and used by the mask-based marker search functions SCI_MARKERNEXT and SCI_MARKERPREVIOUS). As with SCI_MARKERADD, no check is made to see if any of the markers are already present on the targeted line.

SCI_MARKERDELETE(int line, int markerNumber)
This searches the given line number for the given marker number and deletes it if it is present. If you added the same marker more than once to the line, this will delete one copy each time it is used. If you pass in a marker number of -1, all markers are deleted from the line.

SCI_MARKERDELETEALL(int markerNumber)
This removes markers of the given number from all lines. If markerNumber is -1, it deletes all markers from all lines.

SCI_MARKERGET(int line)
This returns a 32-bit integer that indicates which markers were present on the line. Bit 0 is set if marker 0 is present, bit 1 for marker 1 and so on.

SCI_MARKERNEXT(int lineStart, int markerMask)
SCI_MARKERPREVIOUS(int lineStart, int markerMask)
These messages search efficiently for lines that include a given set of markers. The search starts at line number lineStart and continues forwards to the end of the file (SCI_MARKERNEXT) or backwards to the start of the file (SCI_MARKERPREVIOUS). The markerMask argument should have one bit set for each marker you wish to find. Set bit 0 to find marker 0, bit 1 for marker 1 and so on. The message returns the line number of the first line that contains one of the markers in markerMask or -1 if no marker is found.

SCI_MARKERLINEFROMHANDLE(int markerHandle)
The markerHandle argument is an identifier for a marker returned by SCI_MARKERADD. This function searches the document for the marker with this handle and returns the line number that contains it or -1 if it is not found.

SCI_MARKERDELETEHANDLE(int markerHandle)
The markerHandle argument is an identifier for a marker returned by SCI_MARKERADD. This function searches the document for the marker with this handle and deletes the marker if it is found.

Indicators

Indicators are used to display additional information over the top of styling. They can be used to show, for example, syntax errors, deprecated names and bad indentation by drawing underlines under text or boxes around text.

Indicators may have a different "hover" colour and style when the mouse is over them or the caret is moved into them. This may be used, for example, to indicate that a URL can be clicked.

Indicators may be displayed as simple underlines, squiggly underlines, a line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text. They may also be invisible when used to track pieces of content for the application as INDIC_HIDDEN.

The SCI_INDIC* messages allow you to get and set the visual appearance of the indicators. They all use an indicatorNumber argument in the range 0 to INDIC_MAX(35) to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use by lexers (0..7) a range for use by containers (8=INDIC_CONTAINER .. 31=INDIC_IME-1) and a range for IME indicators (32=INDIC_IME .. 35=INDIC_IME_MAX).

Indicators are stored in a format similar to run length encoding which is efficient in both speed and storage for sparse information.

An indicator may store different values for each range but currently all values are drawn the same. In the future, it may be possible to draw different values in different styles.

Originally, Scintilla used a different technique for indicators but this has been removed and the APIs perform no action. While both techniques were supported, the term "modern indicators" was used for the newer implementation.

SCI_INDICSETSTYLE(int indicatorNumber, int indicatorStyle)
SCI_INDICGETSTYLE(int indicatorNumber)
SCI_INDICSETFORE(int indicatorNumber, int colour)
SCI_INDICGETFORE(int indicatorNumber)
SCI_INDICSETALPHA(int indicatorNumber, int alpha)
SCI_INDICGETALPHA(int indicatorNumber)
SCI_INDICSETOUTLINEALPHA(int indicatorNumber, int alpha)
SCI_INDICGETOUTLINEALPHA(int indicatorNumber)
SCI_INDICSETUNDER(int indicatorNumber, bool under)
SCI_INDICGETUNDER(int indicatorNumber)
SCI_INDICSETHOVERSTYLE(int indicatorNumber, int indicatorStyle)
SCI_INDICGETHOVERSTYLE(int indicatorNumber)
SCI_INDICSETHOVERFORE(int indicatorNumber, int colour)
SCI_INDICGETHOVERFORE(int indicatorNumber)
SCI_INDICSETFLAGS(int indicatorNumber, int flags)
SCI_INDICGETFLAGS(int indicatorNumber)

SCI_SETINDICATORCURRENT(int indicator)
SCI_GETINDICATORCURRENT
SCI_SETINDICATORVALUE(int value)
SCI_GETINDICATORVALUE
SCI_INDICATORFILLRANGE(int position, int fillLength)
SCI_INDICATORCLEARRANGE(int position, int clearLength)
SCI_INDICATORALLONFOR(int position)
SCI_INDICATORVALUEAT(int indicator, int position)
SCI_INDICATORSTART(int indicator, int position)
SCI_INDICATOREND(int indicator, int position)
SCI_FINDINDICATORSHOW(int start, int end)
SCI_FINDINDICATORFLASH(int start, int end)
SCI_FINDINDICATORHIDE

SCI_INDICSETSTYLE(int indicatorNumber, int indicatorStyle)
SCI_INDICGETSTYLE(int indicatorNumber)
These two messages set and get the style for a particular indicator. The indicator styles currently available are:
Indicator samples

Symbol Value Visual effect
INDIC_PLAIN 0 Underlined with a single, straight line.
INDIC_SQUIGGLE 1 A squiggly underline. Requires 3 pixels of descender space.
INDIC_TT 2 A line of small T shapes.
INDIC_DIAGONAL 3 Diagonal hatching.
INDIC_STRIKE 4 Strike out.
INDIC_HIDDEN 5 An indicator with no visual effect.
INDIC_BOX 6 A rectangle around the text.
INDIC_ROUNDBOX 7 A rectangle with rounded corners around the text using translucent drawing with the interior usually more transparent than the border. You can use SCI_INDICSETALPHA and SCI_INDICSETOUTLINEALPHA to control the alpha transparency values. The default alpha values are 30 for fill colour and 50 for outline colour.
INDIC_STRAIGHTBOX 8 A rectangle around the text using translucent drawing with the interior usually more transparent than the border. You can use SCI_INDICSETALPHA and SCI_INDICSETOUTLINEALPHA to control the alpha transparency values. The default alpha values are 30 for fill colour and 50 for outline colour. This indicator does not colour the top pixel of the line so that indicators on contiguous lines are visually distinct and disconnected.
INDIC_FULLBOX 16 A rectangle around the text using translucent drawing similar to INDIC_STRAIGHTBOX but covering the entire character area.
INDIC_DASH 9 A dashed underline.
INDIC_DOTS 10 A dotted underline.
INDIC_SQUIGGLELOW 11 Similar to INDIC_SQUIGGLE but only using 2 vertical pixels so will fit under small fonts.
INDIC_DOTBOX 12 A dotted rectangle around the text using translucent drawing. Translucency alternates between the alpha and outline alpha settings with the top-left pixel using the alpha setting. SCI_INDICSETALPHA and SCI_INDICSETOUTLINEALPHA control the alpha transparency values. The default values are 30 for alpha and 50 for outline alpha. To avoid excessive memory allocation the maximum width of a dotted box is 4000 pixels.
INDIC_SQUIGGLEPIXMAP 13 A version of INDIC_SQUIGGLE that draws using a pixmap instead of as a series of line segments for performance. Measured to be between 3 and 6 times faster than INDIC_SQUIGGLE on GTK+. Appearance will not be as good as INDIC_SQUIGGLE on OS X in HiDPI mode.
INDIC_COMPOSITIONTHICK 14 A 2-pixel thick underline located at the bottom of the line to try to avoid touching the character base. Each side is inset 1 pixel so that different indicators in this style covering a range appear isolated. This is similar to an appearance used for the target in Asian language input composition.
INDIC_COMPOSITIONTHIN 15 A 1-pixel thick underline located just before the bottom of the line. Each side is inset 1 pixel so that different indicators in this style covering a range appear isolated. This is similar to an appearance used for non-target ranges in Asian language input composition.
INDIC_TEXTFORE 17 Change the colour of the text to the indicator's fore colour.

The default indicator styles are equivalent to:
SCI_INDICSETSTYLE(0, INDIC_SQUIGGLE);
SCI_INDICSETSTYLE(1, INDIC_TT);
SCI_INDICSETSTYLE(2, INDIC_PLAIN);

SCI_INDICSETFORE(int indicatorNumber, int colour)
SCI_INDICGETFORE(int indicatorNumber)
These two messages set and get the colour used to draw an indicator. The default indicator colours are equivalent to:
SCI_INDICSETFORE(0, 0x007f00); (dark green)
SCI_INDICSETFORE(1, 0xff0000); (light blue)
SCI_INDICSETFORE(2, 0x0000ff); (light red)

SCI_INDICSETALPHA(int indicatorNumber, int alpha)
SCI_INDICGETALPHA(int indicatorNumber)
These two messages set and get the alpha transparency used for drawing the fill colour of the INDIC_ROUNDBOX and INDIC_STRAIGHTBOX rectangle. The alpha value can range from 0 (completely transparent) to 255 (no transparency).

SCI_INDICSETOUTLINEALPHA(int indicatorNumber, int alpha)
SCI_INDICGETOUTLINEALPHA(int indicatorNumber)
These two messages set and get the alpha transparency used for drawing the outline colour of the INDIC_ROUNDBOX and INDIC_STRAIGHTBOX rectangle. The alpha value can range from 0 (completely transparent) to 255 (no transparency).

SCI_INDICSETUNDER(int indicatorNumber, bool under)
SCI_INDICGETUNDER(int indicatorNumber)
These two messages set and get whether an indicator is drawn under text or over(default). Drawing under text works only for indicators when two phase drawing is enabled.

SCI_INDICSETHOVERSTYLE(int indicatorNumber, int indicatorStyle)
SCI_INDICGETHOVERSTYLE(int indicatorNumber)
SCI_INDICSETHOVERFORE(int indicatorNumber, int colour)
SCI_INDICGETHOVERFORE(int indicatorNumber)
These messages set and get the colour and style used to draw indicators when the mouse is over them or the caret moved into them. The mouse cursor also changes when an indicator is drawn in hover style. The default is for the hover appearance to be the same as the normal appearance and calling SCI_INDICSETFORE or SCI_INDICSETSTYLE will also reset the hover attribute.

SCI_INDICSETFLAGS(int indicatorNumber, int flags)
SCI_INDICGETFLAGS(int indicatorNumber)
These messages set and get the flags associated with an indicator. There is currently one flag defined, SC_INDICFLAG_VALUEFORE: when this flag is set the colour used by the indicator is not from the indicator's fore setting but instead from the value of the indicator at that point in the file. This allows many colours to be displayed for a single indicator. The value is an RGB integer colour that has been ored with SC_INDICVALUEBIT(0x1000000) when calling SCI_SETINDICATORVALUE. To find the colour from the value, and the value with SC_INDICVALUEMASK(0xFFFFFF).

SCI_SETINDICATORCURRENT(int indicator)
SCI_GETINDICATORCURRENT
These two messages set and get the indicator that will be affected by calls to SCI_INDICATORFILLRANGE(int position, int fillLength) and SCI_INDICATORCLEARRANGE(int position, int clearLength).

SCI_SETINDICATORVALUE(int value)
SCI_GETINDICATORVALUE
These two messages set and get the value that will be set by calls to SCI_INDICATORFILLRANGE.

SCI_INDICATORFILLRANGE(int position, int fillLength)
SCI_INDICATORCLEARRANGE(int position, int clearLength)
These two messages fill or clear a range for the current indicator. SCI_INDICATORFILLRANGE fills with the the current value.

SCI_INDICATORALLONFOR(int position)
Retrieve a bitmap value representing which indicators are non-zero at a position. Only the first 32 indicators are represented in the result so no IME indicators are included.

SCI_INDICATORVALUEAT(int indicator, int position)
Retrieve the value of a particular indicator at a position.

SCI_INDICATORSTART(int indicator, int position)
SCI_INDICATOREND(int indicator, int position)
Find the start or end of a range with one value from a position within the range. Can be used to iterate through the document to discover all the indicator positions.

OS X Find Indicator

On OS X search matches are highlighted with an animated gold rounded rectangle. The indicator shows, then briefly grows 25% and shrinks to the original size to draw the user's attention. While this feature is currently only implemented on OS X, it may be implemented on other platforms in the future.

SCI_FINDINDICATORSHOW(int start, int end)
SCI_FINDINDICATORFLASH(int start, int end)
These two messages show and animate the find indicator. The indicator remains visible with SCI_FINDINDICATORSHOW and fades out after showing for half a second with SCI_FINDINDICATORFLASH. SCI_FINDINDICATORSHOW behaves similarly to the OS X TextEdit and Safari applications and is best suited to editing documentation where the search target is often a word. SCI_FINDINDICATORFLASH is similar to Xcode and is suited to editing source code where the match will often be located next to operators which would otherwise be hidden under the indicator's padding.

SCI_FINDINDICATORHIDE
This message hides the find indicator.

Earlier versions of Scintilla allowed partitioning style bytes between style numbers and indicators and provided APIs for setting and querying this.

Autocompletion

Autocompletion displays a list box showing likely identifiers based upon the user's typing. The user chooses the currently selected item by pressing the tab character or another character that is a member of the fillup character set defined with SCI_AUTOCSETFILLUPS. Autocompletion is triggered by your application. For example, in C if you detect that the user has just typed fred. you could look up fred, and if it has a known list of members, you could offer them in an autocompletion list. Alternatively, you could monitor the user's typing and offer a list of likely items once their typing has narrowed down the choice to a reasonable list. As yet another alternative, you could define a key code to activate the list.

When the user makes a selection from the list the container is sent a SCN_AUTOCSELECTION notification message. On return from the notification Scintilla will insert the selected text and the container is sent a SCN_AUTOCCOMPLETED notification message unless the autocompletion list has been cancelled, for example by the container sending SCI_AUTOCCANCEL.

To make use of autocompletion you must monitor each character added to the document. See SciTEBase::CharAdded() in SciTEBase.cxx for an example of autocompletion.

SCI_AUTOCSHOW(int lenEntered, const char *list)
SCI_AUTOCCANCEL
SCI_AUTOCACTIVE
SCI_AUTOCPOSSTART
SCI_AUTOCCOMPLETE
SCI_AUTOCSTOPS(<unused>, const char *chars)
SCI_AUTOCSETSEPARATOR(char separator)
SCI_AUTOCGETSEPARATOR
SCI_AUTOCSELECT(<unused>, const char *select)
SCI_AUTOCGETCURRENT
SCI_AUTOCGETCURRENTTEXT(<unused>, char *text)
SCI_AUTOCSETCANCELATSTART(bool cancel)
SCI_AUTOCGETCANCELATSTART
SCI_AUTOCSETFILLUPS(<unused>, const char *chars)
SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)
SCI_AUTOCGETCHOOSESINGLE
SCI_AUTOCSETIGNORECASE(bool ignoreCase)
SCI_AUTOCGETIGNORECASE
SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR(int behaviour)
SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR
SCI_AUTOCSETMULTI(int multi)
SCI_AUTOCGETMULTI
SCI_AUTOCSETORDER(int order)
SCI_AUTOCGETORDER
SCI_AUTOCSETAUTOHIDE(bool autoHide)
SCI_AUTOCGETAUTOHIDE
SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)
SCI_AUTOCGETDROPRESTOFWORD
SCI_REGISTERIMAGE(int type, const char *xpmData)
SCI_REGISTERRGBAIMAGE(int type, const char *pixels)
SCI_CLEARREGISTEREDIMAGES
SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
SCI_AUTOCGETTYPESEPARATOR
SCI_AUTOCSETMAXHEIGHT(int rowCount)
SCI_AUTOCGETMAXHEIGHT
SCI_AUTOCSETMAXWIDTH(int characterCount)
SCI_AUTOCGETMAXWIDTH

SCI_AUTOCSHOW(int lenEntered, const char *list)
This message causes a list to be displayed. lenEntered is the number of characters of the word already entered and list is the list of words separated by separator characters. The initial separator character is a space but this can be set or got with SCI_AUTOCSETSEPARATOR and SCI_AUTOCGETSEPARATOR.

With default settings, the list of words should be in sorted order. If set to ignore case mode with SCI_AUTOCSETIGNORECASE, then strings are matched after being converted to upper case. One result of this is that the list should be sorted with the punctuation characters '[', '\', ']', '^', '_', and '`' sorted after letters. Alternative handling of list order may be specified with SCI_AUTOCSETORDER

SCI_AUTOCCANCEL
This message cancels any displayed autocompletion list. When in autocompletion mode, the list should disappear when the user types a character that can not be part of the autocompletion, such as '.', '(' or '[' when typing an identifier. A set of characters that will cancel autocompletion can be specified with SCI_AUTOCSTOPS.

SCI_AUTOCACTIVE
This message returns non-zero if there is an active autocompletion list and zero if there is not.

SCI_AUTOCPOSSTART
This returns the value of the current position when SCI_AUTOCSHOW started display of the list.

SCI_AUTOCCOMPLETE
This message triggers autocompletion. This has the same effect as the tab key.

SCI_AUTOCSTOPS(<unused>, const char *chars)
The chars argument is a string containing a list of characters that will automatically cancel the autocompletion list. When you start the editor, this list is empty.

SCI_AUTOCSETSEPARATOR(char separator)
SCI_AUTOCGETSEPARATOR
These two messages set and get the separator character used to separate words in the SCI_AUTOCSHOW list. The default is the space character.

SCI_AUTOCSELECT(<unused>, const char *select)
SCI_AUTOCGETCURRENT
This message selects an item in the autocompletion list. It searches the list of words for the first that matches select. By default, comparisons are case sensitive, but you can change this with SCI_AUTOCSETIGNORECASE. The match is character by character for the length of the select string. That is, if select is "Fred" it will match "Frederick" if this is the first item in the list that begins with "Fred". If an item is found, it is selected. If the item is not found, the autocompletion list closes if auto-hide is true (see SCI_AUTOCSETAUTOHIDE).
The current selection index can be retrieved with SCI_AUTOCGETCURRENT.

SCI_AUTOCGETCURRENTTEXT(<unused>, char *text NUL-terminated)
This message retrieves the current selected text in the autocompletion list. Normally the SCN_AUTOCSELECTION notification is used instead.

The value is copied to the text buffer, returning the length (not including the terminating 0). If not found, an empty string is copied to the buffer and 0 is returned.

If the value argument is 0 then the length that should be allocated to store the value is returned; again, the terminating 0 is not included.

SCI_AUTOCSETCANCELATSTART(bool cancel)
SCI_AUTOCGETCANCELATSTART
The default behaviour is for the list to be cancelled if the caret moves to the location it was at when the list was displayed. By calling this message with a false argument, the list is not cancelled until the caret moves at least one character before the word being completed.

SCI_AUTOCSETFILLUPS(<unused>, const char *chars)
If a fillup character is typed with an autocompletion list active, the currently selected item in the list is added into the document, then the fillup character is added. Common fillup characters are '(', '[' and '.' but others are possible depending on the language. By default, no fillup characters are set.

SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)
SCI_AUTOCGETCHOOSESINGLE
If you use SCI_AUTOCSETCHOOSESINGLE(1) and a list has only one item, it is automatically added and no list is displayed. The default is to display the list even if there is only a single item.

SCI_AUTOCSETIGNORECASE(bool ignoreCase)
SCI_AUTOCGETIGNORECASE
By default, matching of characters to list members is case sensitive. These messages let you set and get case sensitivity.

SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR(int behaviour)
SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR
When autocompletion is set to ignore case (SCI_AUTOCSETIGNORECASE), by default it will nonetheless select the first list member that matches in a case sensitive way to entered characters. This corresponds to a behaviour property of SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE (0). If you want autocompletion to ignore case at all, choose SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE (1).

SCI_AUTOCSETMULTI(int multi)
SCI_AUTOCGETMULTI
When autocompleting with multiple selections present, the autocompleted text can go into just the main selection with SC_MULTIAUTOC_ONCE (0) or into each selection with SC_MULTIAUTOC_EACH (1). The default is SC_MULTIAUTOC_ONCE.

SCI_AUTOCSETORDER(int order)
SCI_AUTOCGETORDER
The default setting SC_ORDER_PRESORTED (0) requires that the list be provided in alphabetical sorted order.

Sorting the list can be done by Scintilla instead of the application with SC_ORDER_PERFORMSORT (1). This will take additional time.

Applications that wish to prioritize some values and show the list in order of priority instead of alphabetical order can use SC_ORDER_CUSTOM (2). This requires extra processing in SCI_AUTOCSHOW to create a sorted index.

Setting the order should be done before calling SCI_AUTOCSHOW.

SCI_AUTOCSETAUTOHIDE(bool autoHide)
SCI_AUTOCGETAUTOHIDE
By default, the list is cancelled if there are no viable matches (the user has typed characters that no longer match a list entry). If you want to keep displaying the original list, set autoHide to false. This also effects SCI_AUTOCSELECT.

SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord)
SCI_AUTOCGETDROPRESTOFWORD
When an item is selected, any word characters following the caret are first erased if dropRestOfWord is set true. The default is false.

SCI_REGISTERIMAGE(int type, const char *xpmData)
SCI_REGISTERRGBAIMAGE(int type, const char *pixels)
SCI_CLEARREGISTEREDIMAGES
SCI_AUTOCSETTYPESEPARATOR(char separatorCharacter)
SCI_AUTOCGETTYPESEPARATOR
Autocompletion list items may display an image as well as text. Each image is first registered with an integer type. Then this integer is included in the text of the list separated by a '?' from the text. For example, "fclose?2 fopen" displays image 2 before the string "fclose" and no image before "fopen". The images are in either the XPM format (SCI_REGISTERIMAGE) or RGBA format (SCI_REGISTERRGBAIMAGE). For SCI_REGISTERRGBAIMAGE the width and height must previously been set with the SCI_RGBAIMAGESETWIDTH and SCI_RGBAIMAGESETHEIGHT messages. The set of registered images can be cleared with SCI_CLEARREGISTEREDIMAGES and the '?' separator changed with SCI_AUTOCSETTYPESEPARATOR.

SCI_AUTOCSETMAXHEIGHT(int rowCount)
SCI_AUTOCGETMAXHEIGHT
Get or set the maximum number of rows that will be visible in an autocompletion list. If there are more rows in the list, then a vertical scrollbar is shown. The default is 5.

SCI_AUTOCSETMAXWIDTH(int characterCount)
SCI_AUTOCGETMAXWIDTH
Get or set the maximum width of an autocompletion list expressed as the number of characters in the longest item that will be totally visible. If zero (the default) then the list's width is calculated to fit the item with the most characters. Any items that cannot be fully displayed within the available width are indicated by the presence of ellipsis.

User lists

User lists use the same internal mechanisms as autocompletion lists, and all the calls listed for autocompletion work on them; you cannot display a user list at the same time as an autocompletion list is active. They differ in the following respects:

o The SCI_AUTOCSETCHOOSESINGLE message has no effect.
o When the user makes a selection you are sent a SCN_USERLISTSELECTION notification message rather than SCN_AUTOCSELECTION.

BEWARE: if you have set fillup characters or stop characters, these will still be active with the user list, and may result in items being selected or the user list cancelled due to the user typing into the editor.

SCI_USERLISTSHOW(int listType, const char *list)
The listType parameter is returned to the container as the wParam field of the SCNotification structure. It must be greater than 0 as this is how Scintilla tells the difference between an autocompletion list and a user list. If you have different types of list, for example a list of buffers and a list of macros, you can use listType to tell which one has returned a selection.

Call tips

Call tips are small windows displaying the arguments to a function and are displayed after the user has typed the name of the function. They normally display characters using the font facename, size and character set defined by STYLE_DEFAULT. You can choose to use STYLE_CALLTIP to define the facename, size, foreground and background colours and character set with SCI_CALLTIPUSESTYLE. This also enables support for Tab characters. There is some interaction between call tips and autocompletion lists in that showing a call tip cancels any active autocompletion list, and vice versa.

Call tips are not implemented on Qt.

Call tips can highlight part of the text within them. You could use this to highlight the current argument to a function by counting the number of commas (or whatever separator your language uses). See SciTEBase::CharAdded() in SciTEBase.cxx for an example of call tip use.

The mouse may be clicked on call tips and this causes a SCN_CALLTIPCLICK notification to be sent to the container. Small up and down arrows may be displayed within a call tip by, respectively, including the characters '\001', or '\002'. This is useful for showing that there are overloaded variants of one function name and that the user can click on the arrows to cycle through the overloads.

Alternatively, call tips can be displayed when you leave the mouse pointer for a while over a word in response to the SCN_DWELLSTART notification and cancelled in response to SCN_DWELLEND. This method could be used in a debugger to give the value of a variable, or during editing to give information about the word under the pointer.

SCI_CALLTIPSHOW(int posStart, const char *definition)
SCI_CALLTIPCANCEL
SCI_CALLTIPACTIVE
SCI_CALLTIPPOSSTART
SCI_CALLTIPSETPOSSTART(int posStart)
SCI_CALLTIPSETHLT(int highlightStart, int highlightEnd)
SCI_CALLTIPSETBACK(int colour)
SCI_CALLTIPSETFORE(int colour)
SCI_CALLTIPSETFOREHLT(int colour)
SCI_CALLTIPUSESTYLE(int tabsize)
SCI_CALLTIPSETPOSITION(bool above)

SCI_CALLTIPSHOW(int posStart, const char *definition)
This message starts the process by displaying the call tip window. If a call tip is already active, this has no effect.
posStart is the position in the document at which to align the call tip. The call tip text is aligned to start 1 line below this character unless you have included up and/or down arrows in the call tip text in which case the tip is aligned to the right-hand edge of the rightmost arrow. The assumption is that you will start the text with something like "\001 1 of 3 \002".
definition is the call tip text. This can contain multiple lines separated by '\n' (Line Feed, ASCII code 10) characters. Do not include '\r' (Carriage Return, ASCII code 13), as this will most likely print as an empty box. '\t' (Tab, ASCII code 9) is supported if you set a tabsize with SCI_CALLTIPUSESTYLE.
The position of the caret is remembered here so that the call tip can be cancelled automatically if subsequent deletion moves the caret before this position.

SCI_CALLTIPCANCEL
This message cancels any displayed call tip. Scintilla will also cancel call tips for you if you use any keyboard commands that are not compatible with editing the argument list of a function. Call tips are cancelled if you delete back past the position where the caret was when the tip was triggered.

SCI_CALLTIPACTIVE
This returns 1 if a call tip is active and 0 if it is not active.

SCI_CALLTIPPOSSTART
SCI_CALLTIPSETPOSSTART(int posStart)
This message returns or sets the value of the current position when SCI_CALLTIPSHOW started to display the tip.

SCI_CALLTIPSETHLT(int hlStart, int hlEnd)
This sets the region of the call tips text to display in a highlighted style. hlStart is the zero-based index into the string of the first character to highlight and hlEnd is the index of the first character after the highlight. hlEnd must be greater than hlStart; hlEnd-hlStart is the number of characters to highlight. Highlights can extend over line ends if this is required.

Unhighlighted text is drawn in a mid grey. Selected text is drawn in a dark blue. The background is white. These can be changed with SCI_CALLTIPSETBACK, SCI_CALLTIPSETFORE, and SCI_CALLTIPSETFOREHLT.

SCI_CALLTIPSETBACK(int colour)
The background colour of call tips can be set with this message; the default colour is white. It is not a good idea to set a dark colour as the background as the default colour for normal calltip text is mid grey and the default colour for highlighted text is dark blue. This also sets the background colour of STYLE_CALLTIP.

SCI_CALLTIPSETFORE(int colour)
The colour of call tip text can be set with this message; the default colour is mid grey. This also sets the foreground colour of STYLE_CALLTIP.

SCI_CALLTIPSETFOREHLT(int colour)
The colour of highlighted call tip text can be set with this message; the default colour is dark blue.

SCI_CALLTIPUSESTYLE(int tabsize)
This message changes the style used for call tips from STYLE_DEFAULT to STYLE_CALLTIP and sets a tab size in screen pixels. If tabsize is less than 1, Tab characters are not treated specially. Once this call has been used, the call tip foreground and background colours are also taken from the style.

SCI_CALLTIPSETPOSITION(bool above)
By default the calltip is displayed below the text, setting above to true (1) will display it above the text.

Keyboard commands

To allow the container application to perform any of the actions available to the user with keyboard, all the keyboard actions are messages. They do not take any parameters. These commands are also used when redefining the key bindings with the SCI_ASSIGNCMDKEY message.

SCI_LINEDOWN SCI_LINEDOWNEXTEND SCI_LINEDOWNRECTEXTEND SCI_LINESCROLLDOWN
SCI_LINEUP SCI_LINEUPEXTEND SCI_LINEUPRECTEXTEND SCI_LINESCROLLUP
SCI_PARADOWN SCI_PARADOWNEXTEND SCI_PARAUP SCI_PARAUPEXTEND
SCI_CHARLEFT SCI_CHARLEFTEXTEND SCI_CHARLEFTRECTEXTEND
SCI_CHARRIGHT SCI_CHARRIGHTEXTEND SCI_CHARRIGHTRECTEXTEND
SCI_WORDLEFT SCI_WORDLEFTEXTEND SCI_WORDRIGHT SCI_WORDRIGHTEXTEND
SCI_WORDLEFTEND SCI_WORDLEFTENDEXTEND SCI_WORDRIGHTEND SCI_WORDRIGHTENDEXTEND
SCI_WORDPARTLEFT SCI_WORDPARTLEFTEXTEND SCI_WORDPARTRIGHT SCI_WORDPARTRIGHTEXTEND
SCI_HOME SCI_HOMEEXTEND SCI_HOMERECTEXTEND
SCI_HOMEDISPLAY SCI_HOMEDISPLAYEXTEND SCI_HOMEWRAP SCI_HOMEWRAPEXTEND
SCI_VCHOME SCI_VCHOMEEXTEND SCI_VCHOMERECTEXTEND
SCI_VCHOMEWRAP SCI_VCHOMEWRAPEXTEND SCI_VCHOMEDISPLAY SCI_VCHOMEDISPLAYEXTEND
SCI_LINEEND SCI_LINEENDEXTEND SCI_LINEENDRECTEXTEND
SCI_LINEENDDISPLAY SCI_LINEENDDISPLAYEXTEND SCI_LINEENDWRAP SCI_LINEENDWRAPEXTEND
SCI_DOCUMENTSTART SCI_DOCUMENTSTARTEXTEND SCI_DOCUMENTEND SCI_DOCUMENTENDEXTEND
SCI_PAGEUP SCI_PAGEUPEXTEND SCI_PAGEUPRECTEXTEND
SCI_PAGEDOWN SCI_PAGEDOWNEXTEND SCI_PAGEDOWNRECTEXTEND
SCI_STUTTEREDPAGEUP SCI_STUTTEREDPAGEUPEXTEND
SCI_STUTTEREDPAGEDOWN SCI_STUTTEREDPAGEDOWNEXTEND
SCI_DELETEBACK SCI_DELETEBACKNOTLINE
SCI_DELWORDLEFT SCI_DELWORDRIGHT SCI_DELWORDRIGHTEND
SCI_DELLINELEFT SCI_DELLINERIGHT SCI_LINEDELETE
SCI_LINECUT SCI_LINECOPY SCI_LINETRANSPOSE SCI_LINEDUPLICATE
SCI_LOWERCASE SCI_UPPERCASE SCI_CANCEL SCI_EDITTOGGLEOVERTYPE
SCI_NEWLINE SCI_FORMFEED SCI_TAB SCI_BACKTAB
SCI_SELECTIONDUPLICATE SCI_VERTICALCENTRECARET
SCI_MOVESELECTEDLINESUP SCI_MOVESELECTEDLINESDOWN
SCI_SCROLLTOSTART SCI_SCROLLTOEND

The SCI_*EXTEND messages extend the selection.

The SCI_*RECTEXTEND messages extend the rectangular selection (and convert regular selection to rectangular one, if any).

The SCI_WORDPART* commands are used to move between word segments marked by capitalisation (aCamelCaseIdentifier) or underscores (an_under_bar_ident).

The SCI_HOME* commands move the caret to the start of the line, while the SCI_VCHOME* commands move the caret to the first non-blank character of the line (ie. just after the indentation) unless it is already there; in this case, it acts as SCI_HOME*.

The SCI_[HOME|LINEEND]DISPLAY* commands are used when in line wrap mode to allow movement to the start or end of display lines as opposed to the normal SCI_[HOME|LINEEND] commands which move to the start or end of document lines.

The SCI_[[VC]HOME|LINEEND]WRAP* commands are like their namesakes SCI_[[VC]HOME|LINEEND]* except they behave differently when word-wrap is enabled: They go first to the start / end of the display line, like SCI_[HOME|LINEEND]DISPLAY*, but if the cursor is already at the point, it goes on to the start or end of the document line, as appropriate for SCI_[[VC]HOME|LINEEND]*.

The SCI_SCROLLTO[START|END] commands scroll the document to the start or end without changing the selection. These commands match OS X platform conventions for the behaviour of the home and end keys. Scintilla can be made to match OS X applications by binding the home and end keys to these commands.

The SCI_CANCEL command cancels autocompletion and calltip display and drops any additional selections.

Key bindings

There is a default binding of keys to commands that is defined in the Scintilla source in the file KeyMap.cxx by the constant KeyMap::MapDefault[]. This table maps key definitions to SCI_* messages with no parameters (mostly the keyboard commands discussed above, but any Scintilla command that has no arguments can be mapped). You can change the mapping to suit your own requirements.

SCI_ASSIGNCMDKEY(int keyDefinition, int sciCommand)
SCI_CLEARCMDKEY(int keyDefinition)
SCI_CLEARALLCMDKEYS
SCI_NULL

keyDefinition
A key definition contains the key code in the low 16-bits and the key modifiers in the high 16-bits. To combine keyCode and keyMod set:

keyDefinition = keyCode + (keyMod << 16)

The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT (Page Down), SCK_PRIOR (Page Up), SCK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.

The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, and SCMOD_META. On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META. If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.

SCI_ASSIGNCMDKEY(int keyDefinition, int sciCommand)
This assigns the given key definition to a Scintilla command identified by sciCommand. sciCommand can be any SCI_* command that has no arguments.

SCI_CLEARCMDKEY(int keyDefinition)
This makes the given key definition do nothing by assigning the action SCI_NULL to it.

SCI_CLEARALLCMDKEYS
This command removes all keyboard command mapping by setting an empty mapping table.

SCI_NULL
The SCI_NULL does nothing and is the value assigned to keys that perform no action. SCI_NULL ensures that keys do not propagate to the parent window as that may cause focus to move. If you want the standard platform behaviour use the constant 0 instead.

Popup edit menu

SCI_USEPOPUP(bool bEnablePopup)
Clicking the wrong button on the mouse pops up a short default editing menu. This may be turned off with SCI_USEPOPUP(0). If you turn it off, context menu commands (in Windows, WM_CONTEXTMENU) will not be handled by Scintilla, so the parent of the Scintilla window will have the opportunity to handle the message.

Macro recording

Start and stop macro recording mode. In macro recording mode, actions are reported to the container through SCN_MACRORECORD notifications. It is then up to the container to record these actions for future replay.

SCI_STARTRECORD
SCI_STOPRECORD
These two messages turn macro recording on and off.

Printing

SCI_FORMATRANGE can be used to draw the text onto a display surface which can include a printer display surface. Printed output shows text styling as on the screen, but it hides all margins except a line number margin. All special marker effects are removed and the selection and caret are hidden.

Different platforms use different display surface ID types to print on. On Windows, these are HDCs., on GTK+ 3.x cairo_t *, and on Cocoa CGContextRef is used.

SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat *pfr)
SCI_SETPRINTMAGNIFICATION(int magnification)
SCI_GETPRINTMAGNIFICATION
SCI_SETPRINTCOLOURMODE(int mode)
SCI_GETPRINTCOLOURMODE
SCI_SETPRINTWRAPMODE
SCI_GETPRINTWRAPMODE

SCI_FORMATRANGE(bool bDraw, Sci_RangeToFormat *pfr)
This call renders a range of text into a device context. If you use this for printing, you will probably want to arrange a page header and footer; Scintilla does not do this for you. See SciTEWin::Print() in SciTEWinDlg.cxx for an example. Each use of this message renders a range of text into a rectangular area and returns the position in the document of the next character to print.

bDraw controls if any output is done. Set this to false if you are paginating (for example, if you use this with MFC you will need to paginate in OnBeginPrinting() before you output each page.

struct Sci_Rectangle { int left; int top; int right; int bottom; };

struct Sci_RangeToFormat {
    Sci_SurfaceID hdc;        // The Surface ID we print to
    Sci_SurfaceID hdcTarget;  // The Surface ID we use for measuring (may be same as hdc)
    Sci_Rectangle rc;         // Rectangle in which to print
    Sci_Rectangle rcPage;     // Physically printable page size
    Sci_CharacterRange chrg;  // Range of characters to print
};

On Windows, hdc and hdcTarget should both be set to the device context handle of the output device (usually a printer). If you print to a metafile these will not be the same as Windows metafiles (unlike extended metafiles) do not implement the full API for returning information. In this case, set hdcTarget to the screen DC.
rcPage is the rectangle {0, 0, maxX, maxY} where maxX+1 and maxY+1 are the number of physically printable pixels in x and y.
rc is the rectangle to render the text in (which will, of course, fit within the rectangle defined by rcPage).
chrg.cpMin and chrg.cpMax define the start position and maximum position of characters to output. All of each line within this character range is drawn.

On Cocoa, the surface IDs for printing (bDraw=1) should be the graphics port of the current context ((CGContextRef) [[NSGraphicsContext currentContext] graphicsPort]) when the view's drawRect method is called. The Surface IDs are not really used for measurement (bDraw=0) but can be set to a bitmap context (created with CGBitmapContextCreate) to avoid runtime warnings.

On GTK+, the surface IDs to use can be found from the printing context with gtk_print_context_get_cairo_context(context).

chrg.cpMin and chrg.cpMax define the start position and maximum position of characters to output. All of each line within this character range is drawn.

When printing, the most tedious part is always working out what the margins should be to allow for the non-printable area of the paper and printing a header and footer. If you look at the printing code in SciTE, you will find that most of it is taken up with this. The loop that causes Scintilla to render text is quite simple if you strip out all the margin, non-printable area, header and footer code.

SCI_SETPRINTMAGNIFICATION(int magnification)
SCI_GETPRINTMAGNIFICATION
SCI_GETPRINTMAGNIFICATION lets you to print at a different size than the screen font. magnification is the number of points to add to the size of each screen font. A value of -3 or -4 gives reasonably small print. You can get this value with SCI_GETPRINTMAGNIFICATION.

SCI_SETPRINTCOLOURMODE(int mode)
SCI_GETPRINTCOLOURMODE
These two messages set and get the method used to render coloured text on a printer that is probably using white paper. It is especially important to consider the treatment of colour if you use a dark or black screen background. Printing white on black uses up toner and ink very many times faster than the other way around. You can set the mode to one of:

Symbol Value Purpose
SC_PRINT_NORMAL 0 Print using the current screen colours. This is the default.
SC_PRINT_INVERTLIGHT 1 If you use a dark screen background this saves ink by inverting the light value of all colours and printing on a white background.
SC_PRINT_BLACKONWHITE 2 Print all text as black on a white background.
SC_PRINT_COLOURONWHITE 3 Everything prints in its own colour on a white background.
SC_PRINT_COLOURONWHITEDEFAULTBG 4 Everything prints in its own colour on a white background except that line numbers use their own background colour.

SCI_SETPRINTWRAPMODE(int wrapMode)
SCI_GETPRINTWRAPMODE
These two functions get and set the printer wrap mode. wrapMode can be set to SC_WRAP_NONE (0), SC_WRAP_WORD (1) or SC_WRAP_CHAR (2). The default is SC_WRAP_WORD, which wraps printed output so that all characters fit into the print rectangle. If you set SC_WRAP_NONE, each line of text generates one line of output and the line is truncated if it is too long to fit into the print area.
SC_WRAP_WORD tries to wrap only between words as indicated by white space or style changes although if a word is longer than a line, it will be wrapped before the line end. SC_WRAP_CHAR is preferred to SC_WRAP_WORD for Asian languages where there is no white space between words.

Direct access

SCI_GETDIRECTFUNCTION
SCI_GETDIRECTPOINTER
SCI_GETCHARACTERPOINTER
SCI_GETRANGEPOINTER(int position, int rangeLength)
SCI_GETGAPPOSITION

On Windows, the message-passing scheme used to communicate between the container and Scintilla is mediated by the operating system SendMessage function and can lead to bad performance when calling intensively. To avoid this overhead, Scintilla provides messages that allow you to call the Scintilla message function directly. The code to do this in C/C++ is of the form:

#include "Scintilla.h"
SciFnDirect pSciMsg = (SciFnDirect)SendMessage(hSciWnd, SCI_GETDIRECTFUNCTION, 0, 0);
sptr_t pSciWndData = (sptr_t)SendMessage(hSciWnd, SCI_GETDIRECTPOINTER, 0, 0);

// now a wrapper to call Scintilla directly
sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
    return pSciMsg(pSciWndData, iMessage, wParam, lParam);
}

SciFnDirect, sptr_t and uptr_t are declared in Scintilla.h. hSciWnd is the window handle returned when you created the Scintilla window.

While faster, this direct calling will cause problems if performed from a different thread to the native thread of the Scintilla window in which case SendMessage(hSciWnd, SCI_*, wParam, lParam) should be used to synchronize with the window's thread.

This feature also works on GTK+ but has no significant impact on speed.

From version 1.47 on Windows, Scintilla exports a function called Scintilla_DirectFunction that can be used the same as the function returned by SCI_GETDIRECTFUNCTION. This saves you the call to SCI_GETDIRECTFUNCTION and the need to call Scintilla indirectly via the function pointer.

SCI_GETDIRECTFUNCTION
This message returns the address of the function to call to handle Scintilla messages without the overhead of passing through the Windows messaging system. You need only call this once, regardless of the number of Scintilla windows you create.

SCI_GETDIRECTPOINTER
This returns a pointer to data that identifies which Scintilla window is in use. You must call this once for each Scintilla window you create. When you call the direct function, you must pass in the direct pointer associated with the target window.

SCI_GETCHARACTERPOINTER
SCI_GETRANGEPOINTER(int position, int rangeLength)
SCI_GETGAPPOSITION
Grant temporary direct read-only access to the memory used by Scintilla to store the document.

SCI_GETCHARACTERPOINTER moves the gap within Scintilla so that the text of the document is stored consecutively and ensure there is a NUL character after the text, then returns a pointer to the first character. Applications may then pass this to a function that accepts a character pointer such as a regular expression search or a parser. The pointer should not be written to as that may desynchronize the internal state of Scintilla.

Since any action in Scintilla may change its internal state this pointer becomes invalid after any call or by allowing user interface activity. The application should reacquire the pointer after making any call to Scintilla or performing any user-interface calls such as modifying a progress indicator.

This call takes similar time to inserting a character at the end of the document and this may include moving the document contents. Specifically, all the characters after the document gap are moved to before the gap. This compacted state should persist over calls and user interface actions that do not change the document contents so reacquiring the pointer afterwards is very quick. If this call is used to implement a global replace operation, then each replacement will move the gap so if SCI_GETCHARACTERPOINTER is called after each replacement then the operation will become O(n^2) rather than O(n). Instead, all matches should be found and remembered, then all the replacements performed.

SCI_GETRANGEPOINTER provides direct access to just the range requested. The gap is not moved unless it is within the requested range so this call can be faster than SCI_GETCHARACTERPOINTER. This can be used by application code that is able to act on blocks of text or ranges of lines.

SCI_GETGAPPOSITION returns the current gap position. This is a hint that applications can use to avoid calling SCI_GETRANGEPOINTER with a range that contains the gap and consequent costs of moving the gap.

Multiple views

A Scintilla window and the document that it displays are separate entities. When you create a new window, you also create a new, empty document. Each document has a reference count that is initially set to 1. The document also has a list of the Scintilla windows that are linked to it so when any window changes the document, all other windows in which it appears are notified to cause them to update. The system is arranged in this way so that you can work with many documents in a single Scintilla window and so you can display a single document in multiple windows (for use with splitter windows).

Although these messages use document *pDoc, to ensure compatibility with future releases of Scintilla you should treat pDoc as an opaque void*. That is, you can use and store the pointer as described in this section but you should not dereference it.

SCI_GETDOCPOINTER
SCI_SETDOCPOINTER(<unused>, document *pDoc)
SCI_CREATEDOCUMENT
SCI_ADDREFDOCUMENT(<unused>, document *pDoc)
SCI_RELEASEDOCUMENT(<unused>, document *pDoc)

SCI_GETDOCPOINTER
This returns a pointer to the document currently in use by the window. It has no other effect.

SCI_SETDOCPOINTER(<unused>, document *pDoc)
This message does the following:
1. It removes the current window from the list held by the current document.
2. It reduces the reference count of the current document by 1.
3. If the reference count reaches 0, the document is deleted.
4. pDoc is set as the new document for the window.
5. If pDoc was 0, a new, empty document is created and attached to the window.
6. If pDoc was not 0, its reference count is increased by 1.

SCI_CREATEDOCUMENT
This message creates a new, empty document and returns a pointer to it. This document is not selected into the editor and starts with a reference count of 1. This means that you have ownership of it and must either reduce its reference count by 1 after using SCI_SETDOCPOINTER so that the Scintilla window owns it or you must make sure that you reduce the reference count by 1 with SCI_RELEASEDOCUMENT before you close the application to avoid memory leaks.

SCI_ADDREFDOCUMENT(<unused>, document *pDoc)
This increases the reference count of a document by 1. If you want to replace the current document in the Scintilla window and take ownership of the current document, for example if you are editing many documents in one window, do the following:
1. Use SCI_GETDOCPOINTER to get a pointer to the document, pDoc.
2. Use SCI_ADDREFDOCUMENT(0, pDoc) to increment the reference count.
3. Use SCI_SETDOCPOINTER(0, pNewDoc) to set a different document or SCI_SETDOCPOINTER(0, 0) to set a new, empty document.

SCI_RELEASEDOCUMENT(<unused>, document *pDoc)
This message reduces the reference count of the document identified by pDoc. pDoc must be the result of SCI_GETDOCPOINTER or SCI_CREATEDOCUMENT and must point at a document that still exists. If you call this on a document with a reference count of 1 that is still attached to a Scintilla window, bad things will happen. To keep the world spinning in its orbit you must balance each call to SCI_CREATEDOCUMENT or SCI_ADDREFDOCUMENT with a call to SCI_RELEASEDOCUMENT.

Background loading and saving

To ensure a responsive user interface, applications may decide to load and save documents using a separate thread from the user interface.

Loading in the background

An application can load all of a file into a buffer it allocates on a background thread and then add the data in that buffer into a Scintilla document on the user interface thread. That technique uses extra memory to store a complete copy of the file and also means that the time that Scintilla takes to perform initial line end discovery blocks the user interface.

To avoid these issues, a loader object may be created and used to load the file. The loader object supports the ILoader interface.

SCI_CREATELOADER(int bytes)
Create an object that supports the ILoader interface which can be used to load data and then be turned into a Scintilla document object for attachment to a view object. The bytes argument determines the initial memory allocation for the document as it is more efficient to allocate once rather than rely on the buffer growing as data is added. If SCI_CREATELOADER fails then 0 is returned.

ILoader

class ILoader {
public:
        virtual int SCI_METHOD Release() = 0;
        // Returns a status code from SC_STATUS_*
        virtual int SCI_METHOD AddData(char *data, int length) = 0;
        virtual void * SCI_METHOD ConvertToDocument() = 0;
};

The application should call the AddData method with each block of data read from the file. AddData will return SC_STATUS_OK unless a failure, such as memory exhaustion occurs. If a failure occurs in AddData or in a file reading call then loading can be abandoned and the loader released with the Release call. When the whole file has been read, the ConvertToDocument method should be called to produce a Scintilla document pointer which can be used in the same way as a document pointer returned from SCI_CREATEDOCUMENT. There is no need to call Release after ConvertToDocument.

Saving in the background

An application that wants to save in the background should lock the document with SCI_SETREADONLY(1) to prevent modifications and retrieve a pointer to the unified document contents with SCI_GETCHARACTERPOINTER. The buffer of a locked document will not move so the pointer is valid until the application calls SCI_SETREADONLY(0).

If the user tries to performs a modification while the document is locked then a SCN_MODIFYATTEMPTRO notification is sent to the application. The application may then decide to ignore the modification or to terminate the background saving thread and reenable modification before returning from the notification.

Folding

The fundamental operation in folding is making lines invisible or visible. Line visibility is a property of the view rather than the document so each view may be displaying a different set of lines. From the point of view of the user, lines are hidden and displayed using fold points. Generally, the fold points of a document are based on the hierarchical structure of the document contents. In Python, the hierarchy is determined by indentation and in C++ by brace characters. This hierarchy can be represented within a Scintilla document object by attaching a numeric "fold level" to each line. The fold level is most easily set by a lexer, but you can also set it with messages.

It is up to your code to set the connection between user actions and folding and unfolding. The best way to see how this is done is to search the SciTE source code for the messages used in this section of the documentation and see how they are used. You will also need to use markers and a folding margin to complete your folding implementation. The "fold" property should be set to "1" with SCI_SETPROPERTY("fold", "1") to enable folding.

SCI_VISIBLEFROMDOCLINE(int docLine)
SCI_DOCLINEFROMVISIBLE(int displayLine)
SCI_SHOWLINES(int lineStart, int lineEnd)
SCI_HIDELINES(int lineStart, int lineEnd)
SCI_GETLINEVISIBLE(int line)
SCI_GETALLLINESVISIBLE
SCI_SETFOLDLEVEL(int line, int level)
SCI_GETFOLDLEVEL(int line)
SCI_SETAUTOMATICFOLD(int automaticFold)
SCI_GETAUTOMATICFOLD
SCI_SETFOLDFLAGS(int flags)
SCI_GETLASTCHILD(int line, int level)
SCI_GETFOLDPARENT(int line)
SCI_SETFOLDEXPANDED(int line, bool expanded)
SCI_GETFOLDEXPANDED(int line)
SCI_CONTRACTEDFOLDNEXT(int lineStart)
SCI_TOGGLEFOLD(int line)
SCI_FOLDLINE(int line, int action)
SCI_FOLDCHILDREN(int line, int action)
SCI_FOLDALL(int action)
SCI_EXPANDCHILDREN(int line, int level)
SCI_ENSUREVISIBLE(int line)
SCI_ENSUREVISIBLEENFORCEPOLICY(int line)

SCI_VISIBLEFROMDOCLINE(int docLine)
When some lines are hidden and/or annotations are displayed, then a particular line in the document may be displayed at a different position to its document position. If no lines are hidden and there are no annotations, this message returns docLine. Otherwise, this returns the display line (counting the very first visible line as 0). The display line of an invisible line is the same as the previous visible line. The display line number of the first line in the document is 0. If lines are hidden and docLine is outside the range of lines in the document, the return value is -1. Lines can occupy more than one display line if they wrap.

SCI_DOCLINEFROMVISIBLE(int displayLine)
When some lines are hidden and/or annotations are displayed, then a particular line in the document may be displayed at a different position to its document position. This message returns the document line number that corresponds to a display line (counting the display line of the first line in the document as 0). If displayLine is less than or equal to 0, the result is 0. If displayLine is greater than or equal to the number of displayed lines, the result is the number of lines in the document.

SCI_SHOWLINES(int lineStart, int lineEnd)
SCI_HIDELINES(int lineStart, int lineEnd)
SCI_GETLINEVISIBLE(int line)
SCI_GETALLLINESVISIBLE
The first two messages mark a range of lines as visible or invisible and then redraw the display. SCI_GETLINEVISIBLE reports on the visible state of a line and returns 1 if it is visible and 0 if it is not visible. SCI_GETALLLINESVISIBLE returns 1 if all lines are visible and 0 if some lines are hidden. These messages have no effect on fold levels or fold flags. The first line can not be hidden.

SCI_SETFOLDLEVEL(int line, int level)
SCI_GETFOLDLEVEL(int line)
These two messages set and get a 32-bit value that contains the fold level of a line and some flags associated with folding. The fold level is a number in the range 0 to SC_FOLDLEVELNUMBERMASK (4095). However, the initial fold level is set to SC_FOLDLEVELBASE (1024) to allow unsigned arithmetic on folding levels. There are two addition flag bits. SC_FOLDLEVELWHITEFLAG indicates that the line is blank and allows it to be treated slightly different then its level may indicate. For example, blank lines should generally not be fold points and will be considered part of the preceding section even though they may have a lesser fold level. SC_FOLDLEVELHEADERFLAG indicates that the line is a header (fold point).

Use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVELNUMBERMASK to get the fold level of a line. Likewise, use SCI_GETFOLDLEVEL(line) & SC_FOLDLEVEL*FLAG to get the state of the flags. To set the fold level you must or in the associated flags. For instance, to set the level to thisLevel and mark a line as being a fold point use: SCI_SETFOLDLEVEL(line, thisLevel | SC_FOLDLEVELHEADERFLAG).

If you use a lexer, you should not need to use SCI_SETFOLDLEVEL as this is far better handled by the lexer. You will need to use SCI_GETFOLDLEVEL to decide how to handle user folding requests. If you do change the fold levels, the folding margin will update to match your changes.

SCI_SETFOLDFLAGS(int flags)
In addition to showing markers in the folding margin, you can indicate folds to the user by drawing lines in the text area. The lines are drawn in the foreground colour set for STYLE_DEFAULT. Bits set in flags determine where folding lines are drawn:

Symbol Value Effect
1 Experimental feature that has been removed.
SC_FOLDFLAG_LINEBEFORE_EXPANDED 2 Draw above if expanded
SC_FOLDFLAG_LINEBEFORE_CONTRACTED 4 Draw above if not expanded
SC_FOLDFLAG_LINEAFTER_EXPANDED 8 Draw below if expanded
SC_FOLDFLAG_LINEAFTER_CONTRACTED 16 Draw below if not expanded
SC_FOLDFLAG_LEVELNUMBERS 64 display hexadecimal fold levels in line margin to aid debugging of folding. The appearance of this feature may change in the future.
SC_FOLDFLAG_LINESTATE 128 display hexadecimal line state in line margin to aid debugging of lexing and folding. May not be used at the same time as SC_FOLDFLAG_LEVELNUMBERS.

This message causes the display to redraw.

SCI_GETLASTCHILD(int startLine, int level)
This message searches for the next line after startLine, that has a folding level that is less than or equal to level and then returns the previous line number. If you set level to -1, level is set to the folding level of line startLine. If from is a fold point, SCI_GETLASTCHILD(from, -1) returns the last line that would be in made visible or hidden by toggling the fold state.

SCI_GETFOLDPARENT(int startLine)
This message returns the line number of the first line before startLine that is marked as a fold point with SC_FOLDLEVELHEADERFLAG and has a fold level less than the startLine. If no line is found, or if the header flags and fold levels are inconsistent, the return value is -1.

SCI_TOGGLEFOLD(int line)
Each fold point may be either expanded, displaying all its child lines, or contracted, hiding all the child lines. This message toggles the folding state of the given line as long as it has the SC_FOLDLEVELHEADERFLAG set. This message takes care of folding or expanding all the lines that depend on the line. The display updates after this message.

SCI_SETFOLDEXPANDED(int line, bool expanded)
SCI_GETFOLDEXPANDED(int line)
These messages set and get the expanded state of a single line. The set message has no effect on the visible state of the line or any lines that depend on it. It does change the markers in the folding margin. If you ask for the expansion state of a line that is outside the document, the result is false (0).

If you just want to toggle the fold state of one line and handle all the lines that are dependent on it, it is much easier to use SCI_TOGGLEFOLD. You would use the SCI_SETFOLDEXPANDED message to process many folds without updating the display until you had finished. See SciTEBase::FoldAll() and SciTEBase::Expand() for examples of the use of these messages.

SCI_FOLDLINE(int line, int action)
SCI_FOLDCHILDREN(int line, int action)
SCI_FOLDALL(int action)
These messages provide a higher-level approach to folding instead of setting expanded flags and showing or hiding individual lines.

An individual fold can be contracted/expanded/toggled with SCI_FOLDLINE. To affect all child folds as well call SCI_FOLDCHILDREN.

To affect the entire document call SCI_FOLDALL. With SC_FOLDACTION_TOGGLE the first fold header in the document is examined to decide whether to expand or contract.

Symbol Value Effect
SC_FOLDACTION_CONTRACT 0 Contract.
SC_FOLDACTION_EXPAND 1 Expand.
SC_FOLDACTION_TOGGLE 2 Toggle between contracted and expanded.

SCI_EXPANDCHILDREN(int line, int level)
This is used to respond to a change to a line causing its fold level or whether it is a header to change, perhaps when adding or removing a '{'.

By the time the container has received the notification that the line has changed, the fold level has already been set, so the container has to use the previous level in this call so that any range hidden underneath this line can be shown.

SCI_SETAUTOMATICFOLD(int automaticFold)
SCI_GETAUTOMATICFOLD
Instead of implementing all the logic for handling folding in the container, Scintilla can provide behaviour that is adequate for many applications. The automaticFold argument is a bit set defining which of the 3 pieces of folding implementation should be enabled. Most applications should be able to use the SC_AUTOMATICFOLD_SHOW and SC_AUTOMATICFOLD_CHANGE flags unless they wish to implement quite different behaviour such as defining their own fold structure. SC_AUTOMATICFOLD_CLICK is more likely to be set off when an application would like to add or change click behaviour such as showing method headers only when Shift+Alt is used in conjunction with a click.

Symbol Value Effect
SC_AUTOMATICFOLD_SHOW 1 Automatically show lines as needed. This avoids sending the SCN_NEEDSHOWN notification.
SC_AUTOMATICFOLD_CLICK 2 Handle clicks in fold margin automatically. This avoids sending the SCN_MARGINCLICK notification for folding margins.
SC_AUTOMATICFOLD_CHANGE 4 Show lines as needed when fold structure is changed. The SCN_MODIFIED notification is still sent unless it is disabled by the container.

SCI_CONTRACTEDFOLDNEXT(int lineStart)
Search efficiently for lines that are contracted fold headers. This is useful when saving the user's folding when switching documents or saving folding with a file. The search starts at line number lineStart and continues forwards to the end of the file. lineStart is returned if it is a contracted fold header otherwise the next contracted fold header is returned. If there are no more contracted fold headers then -1 is returned.

SCI_ENSUREVISIBLE(int line)
SCI_ENSUREVISIBLEENFORCEPOLICY(int line)
A line may be hidden because more than one of its parent lines is contracted. Both these message travels up the fold hierarchy, expanding any contracted folds until they reach the top level. The line will then be visible. If you use SCI_ENSUREVISIBLEENFORCEPOLICY, the vertical caret policy set by SCI_SETVISIBLEPOLICY is then applied.

Line wrapping

SCI_SETWRAPMODE(int wrapMode)
SCI_GETWRAPMODE
SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
SCI_GETWRAPVISUALFLAGS
SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
SCI_GETWRAPVISUALFLAGSLOCATION
SCI_SETWRAPINDENTMODE(int indentMode)
SCI_GETWRAPINDENTMODE
SCI_SETWRAPSTARTINDENT(int indent)
SCI_GETWRAPSTARTINDENT
SCI_SETLAYOUTCACHE(int cacheMode)
SCI_GETLAYOUTCACHE
SCI_SETPOSITIONCACHE(int size)
SCI_GETPOSITIONCACHE
SCI_LINESSPLIT(int pixelWidth)
SCI_LINESJOIN
SCI_WRAPCOUNT(int docLine)

By default, Scintilla does not wrap lines of text. If you enable line wrapping, lines wider than the window width are continued on the following lines. Lines are broken after space or tab characters or between runs of different styles. If this is not possible because a word in one style is wider than the window then the break occurs after the last character that completely fits on the line. The horizontal scroll bar does not appear when wrap mode is on.

For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla draws the visual flag at the beginning of the next subline this subline will be indented by one char. Independent from drawing a visual flag at the begin the subline can have an indention.

Much of the time used by Scintilla is spent on laying out and drawing text. The same text layout calculations may be performed many times even when the data used in these calculations does not change. To avoid these unnecessary calculations in some circumstances, the line layout cache can store the results of the calculations. The cache is invalidated whenever the underlying data, such as the contents or styling of the document changes. Caching the layout of the whole document has the most effect, making dynamic line wrap as much as 20 times faster but this requires 7 times the memory required by the document contents plus around 80 bytes per line.

Wrapping is not performed immediately there is a change but is delayed until the display is redrawn. This delay improves performance by allowing a set of changes to be performed and then wrapped and displayed once. Because of this, some operations may not occur as expected. If a file is read and the scroll position moved to a particular line in the text, such as occurs when a container tries to restore a previous editing session, then the scroll position will have been determined before wrapping so an unexpected range of text will be displayed. To scroll to the position correctly, delay the scroll until the wrapping has been performed by waiting for an initial SCN_PAINTED notification.

SCI_SETWRAPMODE(int wrapMode)
SCI_GETWRAPMODE
Set wrapMode to SC_WRAP_WORD (1) to enable wrapping on word or style boundaries, SC_WRAP_CHAR (2) to enable wrapping between any characters, SC_WRAP_WHITESPACE (3) to enable wrapping on whitespace, and SC_WRAP_NONE (0) to disable line wrapping. SC_WRAP_CHAR is preferred for Asian languages where there is no white space between words.

SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
SCI_GETWRAPVISUALFLAGS
You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in wrapVisualFlags determine which visual flags are drawn.

Symbol Value Effect
SC_WRAPVISUALFLAG_NONE 0 No visual flags
SC_WRAPVISUALFLAG_END 1 Visual flag at end of subline of a wrapped line.
SC_WRAPVISUALFLAG_START 2 Visual flag at begin of subline of a wrapped line.
Subline is indented by at least 1 to make room for the flag.
SC_WRAPVISUALFLAG_MARGIN 4 Visual flag in line number margin.

SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
SCI_GETWRAPVISUALFLAGSLOCATION
You can set whether the visual flags to indicate a line is wrapped are drawn near the border or near the text. Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.

Symbol Value Effect
SC_WRAPVISUALFLAGLOC_DEFAULT 0 Visual flags drawn near border
SC_WRAPVISUALFLAGLOC_END_BY_TEXT 1 Visual flag at end of subline drawn near text
SC_WRAPVISUALFLAGLOC_START_BY_TEXT 2 Visual flag at beginning of subline drawn near text

SCI_SETWRAPINDENTMODE(int indentMode)
SCI_GETWRAPINDENTMODE
Wrapped sublines can be indented to the position of their first subline or one more indent level. The default is SC_WRAPINDENT_FIXED. The modes are:

Symbol Value Effect
SC_WRAPINDENT_FIXED 0 Wrapped sublines aligned to left of window plus amount set by SCI_SETWRAPSTARTINDENT
SC_WRAPINDENT_SAME 1 Wrapped sublines are aligned to first subline indent
SC_WRAPINDENT_INDENT 2 Wrapped sublines are aligned to first subline indent plus one more level of indentation

SCI_SETWRAPSTARTINDENT(int indent)
SCI_GETWRAPSTARTINDENT
SCI_SETWRAPSTARTINDENT sets the size of indentation of sublines for wrapped lines in terms of the average character width in STYLE_DEFAULT. There are no limits on indent sizes, but values less than 0 or large values may have undesirable effects.
The indention of sublines is independent of visual flags, but if SC_WRAPVISUALFLAG_START is set an indent of at least 1 is used.

SCI_SETLAYOUTCACHE(int cacheMode)
SCI_GETLAYOUTCACHE
You can set cacheMode to one of the symbols in the table:

Symbol Value Layout cached for these lines
SC_CACHE_NONE 0 No lines are cached.
SC_CACHE_CARET 1 The line containing the text caret. This is the default.
SC_CACHE_PAGE 2 Visible lines plus the line containing the caret.
SC_CACHE_DOCUMENT 3 All lines in the document.

SCI_SETPOSITIONCACHE(int size)
SCI_GETPOSITIONCACHE
The position cache stores position information for short runs of text so that their layout can be determined more quickly if the run recurs. The size in entries of this cache can be set with SCI_SETPOSITIONCACHE.

SCI_LINESSPLIT(int pixelWidth)
Split a range of lines indicated by the target into lines that are at most pixelWidth wide. Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping. When pixelWidth is 0 then the width of the window is used.

SCI_LINESJOIN
Join a range of lines indicated by the target into one line by removing line end characters. Where this would lead to no space between words, an extra space is inserted.

SCI_WRAPCOUNT(int docLine)
Document lines can occupy more than one display line if they wrap and this returns the number of display lines needed to wrap a document line.

Zooming

Scintilla incorporates a "zoom factor" that lets you make all the text in the document larger or smaller in steps of one point. The displayed point size never goes below 2, whatever zoom factor you set. You can set zoom factors in the range -10 to +20 points.

SCI_ZOOMIN
SCI_ZOOMOUT
SCI_SETZOOM(int zoomInPoints)
SCI_GETZOOM

SCI_ZOOMIN
SCI_ZOOMOUT
SCI_ZOOMIN increases the zoom factor by one point if the current zoom factor is less than 20 points. SCI_ZOOMOUT decreases the zoom factor by one point if the current zoom factor is greater than -10 points.

SCI_SETZOOM(int zoomInPoints)
SCI_GETZOOM
These messages let you set and get the zoom factor directly. There is no limit set on the factors you can set, so limiting yourself to -10 to +20 to match the incremental zoom functions is a good idea.

Long lines

You can choose to mark lines that exceed a given length by drawing a vertical line or by colouring the background of characters that exceed the set length.

SCI_SETEDGEMODE(int mode)
SCI_GETEDGEMODE
SCI_SETEDGECOLUMN(int column)
SCI_GETEDGECOLUMN
SCI_SETEDGECOLOUR(int colour)
SCI_GETEDGECOLOUR

SCI_SETEDGEMODE(int edgeMode)
SCI_GETEDGEMODE
These two messages set and get the mode used to display long lines. You can set one of the values in the table:

Symbol Value Long line display mode
EDGE_NONE 0 Long lines are not marked. This is the default state.
EDGE_LINE 1 A vertical line is drawn at the column number set by SCI_SETEDGECOLUMN. This works well for monospaced fonts. The line is drawn at a position based on the width of a space character in STYLE_DEFAULT, so it may not work very well if your styles use proportional fonts or if your style have varied font sizes or you use a mixture of bold, italic and normal text.
EDGE_BACKGROUND 2 The background colour of characters after the column limit is changed to the colour set by SCI_SETEDGECOLOUR. This is recommended for proportional fonts.

SCI_SETEDGECOLUMN(int column)
SCI_GETEDGECOLUMN
These messages set and get the column number at which to display the long line marker. When drawing lines, the column sets a position in units of the width of a space character in STYLE_DEFAULT. When setting the background colour, the column is a character count (allowing for tabs) into the line.

SCI_SETEDGECOLOUR(int colour)
SCI_GETEDGECOLOUR
These messages set and get the colour of the marker used to show that a line has exceeded the length set by SCI_SETEDGECOLUMN.

Lexer

If you define the symbol SCI_LEXER when building Scintilla, (this is sometimes called the SciLexer version of Scintilla), lexing support for a wide range of programming languages is included and the messages in this section are supported. If you want to set styling and fold points for an unsupported language you can either do this in the container or better still, write your own lexer following the pattern of one of the existing ones.

Scintilla also supports external lexers. These are DLLs (on Windows) or .so modules (on GTK+/Linux) that export three functions: GetLexerCount, GetLexerName, and GetLexerFactory. See externalLexer.cxx for more.

SCI_SETLEXER(int lexer)
SCI_GETLEXER
SCI_SETLEXERLANGUAGE(<unused>, const char *name)
SCI_GETLEXERLANGUAGE(<unused>, char *name)
SCI_LOADLEXERLIBRARY(<unused>, const char *path)
SCI_COLOURISE(int start, int end)
SCI_CHANGELEXERSTATE(int start, int end)
SCI_PROPERTYNAMES(<unused>, char *names)
SCI_PROPERTYTYPE(const char *name)
SCI_DESCRIBEPROPERTY(const char *name, char *description)
SCI_SETPROPERTY(const char *key, const char *value)
SCI_GETPROPERTY(const char *key, char *value)
SCI_GETPROPERTYEXPANDED(const char *key, char *value)
SCI_GETPROPERTYINT(const char *key, int default)
SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)
SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)
SCI_GETSUBSTYLEBASES(<unused>, char *styles)
SCI_DISTANCETOSECONDARYSTYLES
SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)
SCI_FREESUBSTYLES
SCI_GETSUBSTYLESSTART(int styleBase)
SCI_GETSUBSTYLESLENGTH(int styleBase)
SCI_GETSTYLEFROMSUBSTYLE(int subStyle)
SCI_GETPRIMARYSTYLEFROMSTYLE(int style)
SCI_SETIDENTIFIERS(int style, const char *identifiers)

SCI_SETLEXER(int lexer)
SCI_GETLEXER
You can select the lexer to use with an integer code from the SCLEX_* enumeration in Scintilla.h. There are two codes in this sequence that do not use lexers: SCLEX_NULL to select no lexing action and SCLEX_CONTAINER which sends the SCN_STYLENEEDED notification to the container whenever a range of text needs to be styled. You cannot use the SCLEX_AUTOMATIC value; this identifies additional external lexers that Scintilla assigns unused lexer numbers to.

SCI_SETLEXERLANGUAGE(<unused>, const char *name)
SCI_GETLEXERLANGUAGE(<unused>, char *name NUL-terminated)
SCI_SETLEXERLANGUAGE lets you select a lexer by name, and is the only method if you are using an external lexer or if you have written a lexer module for a language of your own and do not wish to assign it an explicit lexer number. To select an existing lexer, set name to match the (case sensitive) name given to the module, for example "ada" or "python", not "Ada" or "Python". To locate the name for the built-in lexers, open the relevant Lex*.cxx file and search for LexerModule. The third argument in the LexerModule constructor is the name to use.

To test if your lexer assignment worked, use SCI_GETLEXER before and after setting the new lexer to see if the lexer number changed.

SCI_GETLEXERLANGUAGE retrieves the name of the lexer.

SCI_LOADLEXERLIBRARY(<unused>, const char *path)
Load a lexer implemented in a shared library. This is a .so file on GTK+/Linux or a .DLL file on Windows.

SCI_COLOURISE(int startPos, int endPos)
This requests the current lexer or the container (if the lexer is set to SCLEX_CONTAINER) to style the document between startPos and endPos. If endPos is -1, the document is styled from startPos to the end. If the "fold" property is set to "1" and your lexer or container supports folding, fold levels are also set. This message causes a redraw.

SCI_CHANGELEXERSTATE(int startPos, int endPos)
Indicate that the internal state of a lexer has changed over a range and therefore there may be a need to redraw.

SCI_PROPERTYNAMES(<unused>, char *names NUL-terminated)
SCI_PROPERTYTYPE(const char *name)
SCI_DESCRIBEPROPERTY(const char *name, char *description NUL-terminated)
Information may be retrieved about the properties that can be set for the current lexer. This information is only available for newer lexers. SCI_PROPERTYNAMES returns a string with all of the valid properties separated by "\n". If the lexer does not support this call then an empty string is returned. Properties may be boolean (SC_TYPE_BOOLEAN), integer (SC_TYPE_INTEGER), or string (SC_TYPE_STRING) and this is found with SCI_PROPERTYTYPE. A description of a property in English is returned by SCI_DESCRIBEPROPERTY.

SCI_SETPROPERTY(const char *key, const char *value)
You can communicate settings to lexers with keyword:value string pairs. There is no limit to the number of keyword pairs you can set, other than available memory. key is a case sensitive keyword, value is a string that is associated with the keyword. If there is already a value string associated with the keyword, it is replaced. If you pass a zero length string, the message does nothing. Both key and value are used without modification; extra spaces at the beginning or end of key are significant.

The value string can refer to other keywords. For example, SCI_SETPROPERTY("foldTimes10", "$(fold)0") stores the string "$(fold)0", but when this is accessed, the $(fold) is replaced by the value of the "fold" keyword (or by nothing if this keyword does not exist).

Currently the "fold" property is defined for most of the lexers to set the fold structure if set to "1". SCLEX_PYTHON understands "tab.timmy.whinge.level" as a setting that determines how to indicate bad indentation. Most keywords have values that are interpreted as integers. Search the lexer sources for GetPropertyInt to see how properties are used.

There is a convention for naming properties used by lexers so that the set of properties can be found by scripts. Property names should start with "lexer.<lexer>." or "fold.<lexer>." when they apply to one lexer or start with "lexer." or "fold." if they apply to multiple lexers.

Applications may discover the set of properties used by searching the source code of lexers for lines that contain GetProperty and a double quoted string and extract the value of the double quoted string as the property name. The scintilla/scripts/LexGen.py script does this and can be used as an example. Documentation for the property may be located above the call as a multi-line comment starting with
// property <property-name>

SCI_GETPROPERTY(const char *key, char *value NUL-terminated)
Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied buffer and return the length (not including the terminating 0). If not found, copy an empty string to the buffer and return 0.

Note that "keyword replacement" as described in SCI_SETPROPERTY will not be performed.

If the value argument is 0 then the length that should be allocated to store the value is returned; again, the terminating 0 is not included.

SCI_GETPROPERTYEXPANDED(const char *key, char *value)
Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied buffer and return the length (not including the terminating 0). If not found, copy an empty string to the buffer and return 0.

Note that "keyword replacement" as described in SCI_SETPROPERTY will be performed.

If the value argument is 0 then the length that should be allocated to store the value (including any indicated keyword replacement) is returned; again, the terminating 0 is not included.

SCI_GETPROPERTYINT(const char *key, int default)
Lookup a keyword:value pair using the specified key; if found, interpret the value as an integer and return it. If not found (or the value is an empty string) then return the supplied default. If the keyword:value pair is found but is not a number, then return 0.

Note that "keyword replacement" as described in SCI_SETPROPERTY will be performed before any numeric interpretation.

SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)
You can set up to 9 lists of keywords for use by the current lexer. keyWordSet can be 0 to 8 (actually 0 to KEYWORDSET_MAX) and selects which keyword list to replace. keyWordList is a list of keywords separated by spaces, tabs, "\n" or "\r" or any combination of these. It is expected that the keywords will be composed of standard ASCII printing characters, but there is nothing to stop you using any non-separator character codes from 1 to 255 (except common sense).

How these keywords are used is entirely up to the lexer. Some languages, such as HTML may contain embedded languages, VBScript and JavaScript are common for HTML. For HTML, key word set 0 is for HTML, 1 is for JavaScript and 2 is for VBScript, 3 is for Python, 4 is for PHP and 5 is for SGML and DTD keywords. Review the lexer code to see examples of keyword list. A fully conforming lexer sets the fourth argument of the LexerModule constructor to be a list of strings that describe the uses of the keyword lists.

Alternatively, you might use set 0 for general keywords, set 1 for keywords that cause indentation and set 2 for keywords that cause unindentation. Yet again, you might have a simple lexer that colours keywords and you could change languages by changing the keywords in set 0. There is nothing to stop you building your own keyword lists into the lexer, but this means that the lexer must be rebuilt if more keywords are added.

SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions NUL-terminated)
A description of all of the keyword sets separated by "\n" is returned by SCI_DESCRIBEKEYWORDSETS.

Substyles

Lexers may support several different sublanguages and each sublanguage may want to style some number of sets of identifiers (or similar lexemes such as documentation keywords) uniquely. Preallocating a large number for each purpose would exhaust the number of allowed styles quickly. This is alleviated by substyles which allow the application to determine how many sets of identifiers to allocate for each purpose. Lexers have to explicitly support this feature by implementing the methods in ILexerWithSubStyles.

SCI_GETSUBSTYLEBASES(<unused>, char *styles NUL-terminated)
Fill styles with a byte for each style that can be split into substyles.

SCI_DISTANCETOSECONDARYSTYLES
Returns the distance between a primary style and its corresponding secondary style.

SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles)
Allocate some number of substyles for a particular base style returning the first substyle number allocated. Substyles are allocated contiguously.

SCI_FREESUBSTYLES
Free all allocated substyles.

SCI_GETSUBSTYLESSTART(int styleBase)
SCI_GETSUBSTYLESLENGTH(int styleBase)
Return the start and length of the substyles allocated for a base style.

SCI_GETSTYLEFROMSUBSTYLE(int subStyle)
For a sub style, return the base style, else return the argument.

SCI_GETPRIMARYSTYLEFROMSTYLE(int style)
For a secondary style, return the primary style, else return the argument.

SCI_SETIDENTIFIERS(int style, const char *identifiers)
Similar to SCI_SETKEYWORDS but for substyles. The prefix feature available with SCI_SETKEYWORDS is not implemented for SCI_SETIDENTIFIERS.

Lexer Objects

Lexers are programmed as objects that implement the ILexer interface and that interact with the document they are lexing through the IDocument interface. Previously lexers were defined by providing lexing and folding functions but creating an object to handle the interaction of a lexer with a document allows the lexer to store state information that can be used during lexing. For example a C++ lexer may store a set of preprocessor definitions or variable declarations and style these depending on their role.

A set of helper classes allows older lexers defined by functions to be used in Scintilla.

ILexer

class ILexer {
public:
    virtual int SCI_METHOD Version() const = 0;
    virtual void SCI_METHOD Release() = 0;
    virtual const char * SCI_METHOD PropertyNames() = 0;
    virtual int SCI_METHOD PropertyType(const char *name) = 0;
    virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0;
    virtual Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) = 0;
    virtual const char * SCI_METHOD DescribeWordListSets() = 0;
    virtual Sci_Position SCI_METHOD WordListSet(int n, const char *wl) = 0;
    virtual void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0;
    virtual void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0;
    virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0;
};

The types Sci_Position and Sci_PositionU are used for positions and line numbers in the document. Before release 3.6.0 the types int and unsigned int were used instead and, for 3.6.0, Sci_Position is defined as int and Sci_PositionU is defined as unsigned int. In a future release, 64-bit builds will define these as 64-bit types to allow documents larger than 2 GB.

The return values from PropertySet and WordListSet are used to indicate whether the change requires performing lexing or folding over any of the document. It is the position at which to restart lexing and folding or -1 if the change does not require any extra work on the document. A simple approach is to return 0 if there is any possibility that a change requires lexing the document again while an optimisation could be to remember where a setting first affects the document and return that position.

Version returns an enumerated value specifying which version of the interface is implemented: lvOriginal for ILexer and lvSubStyles for ILexerWithSubStyles.

Release is called to destroy the lexer object.

PrivateCall allows for direct communication between the application and a lexer. An example would be where an application maintains a single large data structure containing symbolic information about system headers (like Windows.h) and provides this to the lexer where it can be applied to each document. This avoids the costs of constructing the system header information for each document. This is invoked with the SCI_PRIVATELEXERCALL API.

Fold is called with the exact range that needs folding. Previously, lexers were called with a range that started one line before the range that needs to be folded as this allowed fixing up the last line from the previous folding. The new approach allows the lexer to decide whether to backtrack or to handle this more efficiently.

ILexerWithSubStyles

To allow lexers to report which line ends they support, and to support substyles, Ilexer is extended to ILexerWithSubStyles.

class ILexerWithSubStyles : public ILexer {
public:
        virtual int SCI_METHOD LineEndTypesSupported() = 0;
        virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0;
        virtual int SCI_METHOD SubStylesStart(int styleBase) = 0;
        virtual int SCI_METHOD SubStylesLength(int styleBase) = 0;
        virtual int SCI_METHOD StyleFromSubStyle(int subStyle) = 0;
        virtual int SCI_METHOD PrimaryStyleFromStyle(int style) = 0;
        virtual void SCI_METHOD FreeSubStyles() = 0;
        virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0;
        virtual int SCI_METHOD DistanceToSecondaryStyles() = 0;
        virtual const char * SCI_METHOD GetSubStyleBases() = 0;
};

IDocument

class IDocument {
public:
        virtual int SCI_METHOD Version() const = 0;
        virtual void SCI_METHOD SetErrorStatus(int status) = 0;
        virtual Sci_Position SCI_METHOD Length() const = 0;
        virtual void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const = 0;
        virtual char SCI_METHOD StyleAt(Sci_Position position) const = 0;
        virtual Sci_Position SCI_METHOD LineFromPosition(Sci_Position position) const = 0;
        virtual Sci_Position SCI_METHOD LineStart(Sci_Position line) const = 0;
        virtual int SCI_METHOD GetLevel(Sci_Position line) const = 0;
        virtual int SCI_METHOD SetLevel(Sci_Position line, int level) = 0;
        virtual int SCI_METHOD GetLineState(Sci_Position line) const = 0;
        virtual int SCI_METHOD SetLineState(Sci_Position line, int state) = 0;
        virtual void SCI_METHOD StartStyling(Sci_Position position, char mask) = 0;
        virtual bool SCI_METHOD SetStyleFor(Sci_Position length, char style) = 0;
        virtual bool SCI_METHOD SetStyles(Sci_Position length, const char *styles) = 0;
        virtual void SCI_METHOD DecorationSetCurrentIndicator(int indicator) = 0;
        virtual void SCI_METHOD DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) = 0;
        virtual void SCI_METHOD ChangeLexerState(Sci_Position start, Sci_Position end) = 0;
        virtual int SCI_METHOD CodePage() const = 0;
        virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0;
        virtual const char * SCI_METHOD BufferPointer() = 0;
        virtual int SCI_METHOD GetLineIndentation(Sci_Position line) = 0;
};

Scintilla tries to minimize the consequences of modifying text to only relex and redraw the line of the change where possible. Lexer objects contain their own private extra state which can affect later lines. For example, if the C++ lexer is greying out inactive code segments then changing the statement #define BEOS 0 to #define BEOS 1 may require restyling and redisplaying later parts of the document. The lexer can call ChangeLexerState to signal to the document that it should relex and display more.

For StartStyling the mask argument has no effect. It was used in version 3.4.2 and earlier.

SetErrorStatus is used to notify the document of exceptions. Exceptions should not be thrown over build boundaries as the two sides may be built with different compilers or incompatible exception options.

IDocumentWithLineEnd

To allow lexers to determine the end position of a line and thus more easily support Unicode line ends IDocument is extended to IDocumentWithLineEnd.

GetRelativePosition navigates the document by whole characters, returning INVALID_POSITION for movement beyond the start and end of the document.

GetCharacterAndWidth provides a standard conversion from UTF-8 bytes to a UTF-32 character or from DBCS to a 16 bit value. Bytes in invalid UTF-8 are reported individually with values 0xDC80+byteValue, which are not valid Unicode code points. The pWidth argument can be NULL if the caller does not need to know the number of bytes in the character.

class IDocumentWithLineEnd : public IDocument {
public:
        virtual Sci_Position SCI_METHOD LineEnd(Sci_Position line) const = 0;
        virtual Sci_Position SCI_METHOD GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const = 0;
        virtual int SCI_METHOD GetCharacterAndWidth(Sci_Position position, Sci_Position *pWidth) const = 0;
};

The ILexer, ILexerWithSubStyles, IDocument, and IDocumentWithLineEnd interfaces may be expanded in the future with extended versions (ILexer2...). The Version method indicates which interface is implemented and thus which methods may be called.

Notifications

Notifications are sent (fired) from the Scintilla control to its container when an event has occurred that may interest the container.

Notifications are sent using the WM_NOTIFY message on Windows.

On GTK+, the "sci-notify" signal is sent and the signal handler should have the signature handler(GtkWidget *, gint, SCNotification *notification, gpointer userData).

On Cocoa, a delegate implementing the ScintillaNotificationProtocol may be set to receive notifications or the ScintillaView class may be subclassed and the notification: method overridden. Overriding notification: allows the subclass to control whether default handling is performed.

The container is passed a SCNotification structure containing information about the event.

struct Sci_NotifyHeader {   // This matches the Win32 NMHDR structure
    void *hwndFrom;     // environment specific window handle/pointer
    uptr_t idFrom;        // CtrlID of the window issuing the notification
    unsigned int code;  // The SCN_* notification code
};

struct SCNotification {
	struct Sci_NotifyHeader nmhdr;
	Sci_Position position;
	/* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */
	/* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */
	/* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */
	/* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */
	/* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */

	int ch;
	/* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETE, SCN_AUTOCSELECTION, */
	/* SCN_USERLISTSELECTION */
	int modifiers;
	/* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */
	/* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */

	int modificationType;	/* SCN_MODIFIED */
	const char *text;
	/* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */

	Sci_Position length;		/* SCN_MODIFIED */
	Sci_Position linesAdded;	/* SCN_MODIFIED */
	int message;	/* SCN_MACRORECORD */
	uptr_t wParam;	/* SCN_MACRORECORD */
	sptr_t lParam;	/* SCN_MACRORECORD */
	Sci_Position line;		/* SCN_MODIFIED */
	int foldLevelNow;	/* SCN_MODIFIED */
	int foldLevelPrev;	/* SCN_MODIFIED */
	int margin;		/* SCN_MARGINCLICK */
	int listType;	/* SCN_USERLISTSELECTION */
	int x;			/* SCN_DWELLSTART, SCN_DWELLEND */
	int y;		/* SCN_DWELLSTART, SCN_DWELLEND */
	int token;		/* SCN_MODIFIED with SC_MOD_CONTAINER */
	int annotationLinesAdded;	/* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
	int updated;	/* SCN_UPDATEUI */
	int listCompletionMethod; 
	/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION */

};

The notification messages that your container can choose to handle and the messages associated with them are:

SCN_STYLENEEDED
SCN_CHARADDED
SCN_SAVEPOINTREACHED
SCN_SAVEPOINTLEFT
SCN_MODIFYATTEMPTRO
SCN_KEY
SCN_DOUBLECLICK
SCN_UPDATEUI
SCN_MODIFIED
SCN_MACRORECORD
SCN_MARGINCLICK
SCN_NEEDSHOWN
SCN_PAINTED
SCN_USERLISTSELECTION
SCN_URIDROPPED
SCN_DWELLSTART
SCN_DWELLEND
SCN_ZOOM
SCN_HOTSPOTCLICK
SCN_HOTSPOTDOUBLECLICK
SCN_HOTSPOTRELEASECLICK
SCN_INDICATORCLICK
SCN_INDICATORRELEASE
SCN_CALLTIPCLICK
SCN_AUTOCSELECTION
SCN_AUTOCCANCELLED
SCN_AUTOCCHARDELETED
SCN_FOCUSIN
SCN_FOCUSOUT
SCN_AUTOCCOMPLETED

The following SCI_* messages are associated with these notifications:

SCI_SETMODEVENTMASK(int eventMask)
SCI_GETMODEVENTMASK
SCI_SETMOUSEDWELLTIME(int milliseconds)
SCI_GETMOUSEDWELLTIME
SCI_SETIDENTIFIER(int identifier)
SCI_GETIDENTIFIER

The following additional notifications are sent using a secondary "command" method and should be avoided in new code as the primary "notification" method provides all the same events with richer information. The WM_COMMAND message is used on Windows. This emulates the Windows Edit control. Only the lower 16 bits of the control's ID is passed in these notifications.

On GTK+, the "command" signal is sent and the signal handler should have the signature handler(GtkWidget *, gint wParam, gpointer lParam, gpointer userData).

SCEN_CHANGE
SCEN_SETFOCUS
SCEN_KILLFOCUS

SCI_SETIDENTIFIER(int identifier)
SCI_GETIDENTIFIER
These two messages set and get the identifier of the Scintilla instance which is included in notifications as the idFrom field. When an application creates multiple Scintilla widgets, this allows the source of each notification to be found. On Windows, this value is initialised in the CreateWindow call and stored as the GWLP_ID attribute of the window. The value should be small, preferably less than 16 bits, rather than a pointer as some of the functions will only transmit 16 or 32 bits.

SCN_STYLENEEDED
If you used SCI_SETLEXER(SCLEX_CONTAINER) to make the container act as the lexer, you will receive this notification when Scintilla is about to display or print text that requires styling. You are required to style the text from the line that contains the position returned by SCI_GETENDSTYLED up to the position passed in SCNotification.position. Symbolically, you need code of the form:

    startPos = SCI_GETENDSTYLED()
    lineNumber = SCI_LINEFROMPOSITION(startPos);
    startPos = SCI_POSITIONFROMLINE(lineNumber);
    MyStyleRoutine(startPos, SCNotification.position);

SCN_CHARADDED
This is sent when the user types an ordinary text character (as opposed to a command character) that is entered into the text. The container can use this to decide to display a call tip or an auto completion list. The character is in SCNotification.ch. This notification is sent before the character has been styled so processing that depends on styling should instead be performed in the SCN_UPDATEUI notification.

SCN_SAVEPOINTREACHED
SCN_SAVEPOINTLEFT
Sent to the container when the save point is entered or left, allowing the container to display a "document dirty" indicator and change its menus.
See also: SCI_SETSAVEPOINT, SCI_GETMODIFY

SCN_MODIFYATTEMPTRO
When in read-only mode, this notification is sent to the container if the user tries to change the text. This can be used to check the document out of a version control system. You can set the read-only state of a document with SCI_SETREADONLY.

SCN_KEY
Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of some problems with keyboard focus and is not sent by the Windows version. SCNotification.ch holds the key code and SCNotification.modifiers holds the modifiers. This notification is sent if the modifiers include SCMOD_ALT or SCMOD_CTRL and the key code is less than 256.

SCN_DOUBLECLICK
The mouse button was double clicked in editor. The position field is set to the text position of the double click, the line field is set to the line of the double click, and the modifiers field is set to the key modifiers held down in a similar manner to SCN_KEY.

SCN_UPDATEUI
Either the text or styling of the document has changed or the selection range or scroll position has changed. Now would be a good time to update any container UI elements that depend on document or view state. The updated field is set to the bit set of things changed since the previous notification.

Symbol Value Meaning
SC_UPDATE_CONTENT 0x01 Contents, styling or markers have been changed.
SC_UPDATE_SELECTION 0x02 Selection has been changed.
SC_UPDATE_V_SCROLL 0x04 Scrolled vertically.
SC_UPDATE_H_SCROLL 0x08 Scrolled horizontally.

SCN_MODIFIED
This notification is sent when the text or styling of the document changes or is about to change. You can set a mask for the notifications that are sent to the container with SCI_SETMODEVENTMASK. The notification structure contains information about what changed, how the change occurred and whether this changed the number of lines in the document. No modifications may be performed while in a SCN_MODIFIED event. The SCNotification fields used are:

Field Usage
modificationType A set of flags that identify the change(s) made. See the next table.
position Start position of a text or styling change. Set to 0 if not used.
length Length of the change in bytes when the text or styling changes. Set to 0 if not used.
linesAdded Number of added lines. If negative, the number of deleted lines. Set to 0 if not used or no lines added or deleted.
text Valid for text changes, not for style changes. If we are collecting undo information this holds a pointer to the text that is handed to the Undo system, otherwise it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0.
line The line number at which a fold level or marker change occurred. This is 0 if unused and may be -1 if more than one line changed.
foldLevelNow The new fold level applied to the line or 0 if this field is unused.
foldLevelPrev The previous folding level of the line or 0 if this field is unused.

The SCNotification.modificationType field has bits set to tell you what has been done. The SC_MOD_* bits correspond to actions. The SC_PERFORMED_* bits tell you if the action was done by the user, or the result of Undo or Redo of a previous action.

Symbol Value Meaning SCNotification fields
SC_MOD_INSERTTEXT 0x01 Text has been inserted into the document. position, length, text, linesAdded
SC_MOD_DELETETEXT 0x02 Text has been removed from the document. position, length, text, linesAdded
SC_MOD_CHANGESTYLE 0x04 A style change has occurred. position, length
SC_MOD_CHANGEFOLD 0x08 A folding change has occurred. line, foldLevelNow, foldLevelPrev
SC_PERFORMED_USER 0x10 Information: the operation was done by the user. None
SC_PERFORMED_UNDO 0x20 Information: this was the result of an Undo. None
SC_PERFORMED_REDO 0x40 Information: this was the result of a Redo. None
SC_MULTISTEPUNDOREDO 0x80 This is part of a multi-step Undo or Redo transaction. None
SC_LASTSTEPINUNDOREDO 0x100 This is the final step in an Undo or Redo transaction. None
SC_MOD_CHANGEMARKER 0x200 One or more markers has changed in a line. line
SC_MOD_BEFOREINSERT 0x400 Text is about to be inserted into the document. position, if performed by user then text in bytes, length in bytes
SC_MOD_BEFOREDELETE 0x800 Text is about to be deleted from the document. position, length
SC_MOD_CHANGEINDICATOR 0x4000 An indicator has been added or removed from a range of text. position, length
SC_MOD_CHANGELINESTATE 0x8000 A line state has changed because SCI_SETLINESTATE was called. line
SC_MOD_CHANGETABSTOPS 0x200000 The explicit tab stops on a line have changed because SCI_CLEARTABSTOPS or SCI_ADDTABSTOP was called. line
SC_MOD_LEXERSTATE 0x80000 The internal state of a lexer has changed over a range. position, length
SC_MOD_CHANGEMARGIN 0x10000 A text margin has changed. line
SC_MOD_CHANGEANNOTATION 0x20000 An annotation has changed. line
SC_MOD_INSERTCHECK 0x100000 Text is about to be inserted. The handler may change the text being inserted by calling SCI_CHANGEINSERTION. No other modifications may be made in this handler. position, length, text
SC_MULTILINEUNDOREDO 0x1000 This is part of an Undo or Redo with multi-line changes. None
SC_STARTACTION 0x2000 This is set on a SC_PERFORMED_USER action when it is the first or only step in an undo transaction. This can be used to integrate the Scintilla undo stack with an undo stack in the container application by adding a Scintilla action to the container's stack for the currently opened container transaction or to open a new container transaction if there is no open container transaction. None
SC_MOD_CONTAINER 0x40000 This is set on for actions that the container stored into the undo stack with SCI_ADDUNDOACTION. token
SC_MODEVENTMASKALL 0x1FFFFF This is a mask for all valid flags. This is the default mask state set by SCI_SETMODEVENTMASK. None

SCEN_CHANGE
SCEN_CHANGE (768) is fired when the text (not the style) of the document changes. This notification is sent using the WM_COMMAND message on Windows and the "command" signal on GTK+ as this is the behaviour of the standard Edit control (SCEN_CHANGE has the same value as the Windows Edit control EN_CHANGE). No other information is sent. If you need more detailed information use SCN_MODIFIED. You can filter the types of changes you are notified about with SCI_SETMODEVENTMASK.

SCI_SETMODEVENTMASK(int eventMask)
SCI_GETMODEVENTMASK
These messages set and get an event mask that determines which document change events are notified to the container with SCN_MODIFIED and SCEN_CHANGE. For example, a container may decide to see only notifications about changes to text and not styling changes by calling SCI_SETMODEVENTMASK(SC_MOD_INSERTTEXT|SC_MOD_DELETETEXT).

The possible notification types are the same as the modificationType bit flags used by SCN_MODIFIED: SC_MOD_INSERTTEXT, SC_MOD_DELETETEXT, SC_MOD_CHANGESTYLE, SC_MOD_CHANGEFOLD, SC_PERFORMED_USER, SC_PERFORMED_UNDO, SC_PERFORMED_REDO, SC_MULTISTEPUNDOREDO, SC_LASTSTEPINUNDOREDO, SC_MOD_CHANGEMARKER, SC_MOD_BEFOREINSERT, SC_MOD_BEFOREDELETE, SC_MULTILINEUNDOREDO, and SC_MODEVENTMASKALL.

SCEN_SETFOCUS
SCEN_KILLFOCUS
SCEN_SETFOCUS (512) is fired when Scintilla receives focus and SCEN_KILLFOCUS (256) when it loses focus. These notifications are sent using the WM_COMMAND message on Windows and the "command" signal on GTK+ as this is the behaviour of the standard Edit control. Unfortunately, these codes do not match the Windows Edit notification codes EN_SETFOCUS (256) and EN_KILLFOCUS (512). It is now too late to change the Scintilla codes as clients depend on the current values.

SCN_MACRORECORD
The SCI_STARTRECORD and SCI_STOPRECORD messages enable and disable macro recording. When enabled, each time a recordable change occurs, the SCN_MACRORECORD notification is sent to the container. It is up to the container to record the action. To see the complete list of SCI_* messages that are recordable, search the Scintilla source Editor.cxx for Editor::NotifyMacroRecord. The fields of SCNotification set in this notification are:

Field Usage
message The SCI_* message that caused the notification.
wParam The value of wParam in the SCI_* message.
lParam The value of lParam in the SCI_* message.

SCN_MARGINCLICK
This notification tells the container that the mouse was clicked inside a margin that was marked as sensitive (see SCI_SETMARGINSENSITIVEN). This can be used to perform folding or to place breakpoints. The following SCNotification fields are used:

Field Usage
modifiers The appropriate combination of SCI_SHIFT, SCI_CTRL and SCI_ALT to indicate the keys that were held down at the time of the margin click.
position The position of the start of the line in the document that corresponds to the margin click.
margin The margin number that was clicked.

SCN_NEEDSHOWN
Scintilla has determined that a range of lines that is currently invisible should be made visible. An example of where this may be needed is if the end of line of a contracted fold point is deleted. This message is sent to the container in case it wants to make the line visible in some unusual way such as making the whole document visible. Most containers will just ensure each line in the range is visible by calling SCI_ENSUREVISIBLE. The position and length fields of SCNotification indicate the range of the document that should be made visible. The container code will be similar to the following code skeleton:

firstLine = SCI_LINEFROMPOSITION(scn.position)
lastLine = SCI_LINEFROMPOSITION(scn.position+scn.length-1)
for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next

SCN_PAINTED
Painting has just been done. Useful when you want to update some other widgets based on a change in Scintilla, but want to have the paint occur first to appear more responsive. There is no other information in SCNotification.

SCN_USERLISTSELECTION
The user has selected an item in a user list. The SCNotification fields used are:

Field Usage
listType This is set to the listType parameter from the SCI_USERLISTSHOW message that initiated the list.
text The text of the selection.
position The position the list was displayed at.
ch If a fillup character was the method of selection, the used character, otherwise 0.
listCompletionMethod A value indicating the way in which the completion occurred. See the table below.

See the SCN_AUTOCCOMPLETED notification for the possible values for listCompletionMethod.

SCN_URIDROPPED
Only on the GTK+ version. Indicates that the user has dragged a URI such as a file name or Web address onto Scintilla. The container could interpret this as a request to open the file. The text field of SCNotification points at the URI text.

SCN_DWELLSTART
SCN_DWELLEND
SCN_DWELLSTART is generated when the user keeps the mouse in one position for the dwell period (see SCI_SETMOUSEDWELLTIME). SCN_DWELLEND is generated after a SCN_DWELLSTART and the mouse is moved or other activity such as key press indicates the dwell is over. Both notifications set the same fields in SCNotification:

Field Usage
position This is the nearest position in the document to the position where the mouse pointer was lingering.
x, y Where the pointer lingered. The position field is set to SCI_POSITIONFROMPOINTCLOSE(x, y).

SCI_SETMOUSEDWELLTIME(int milliseconds)
SCI_GETMOUSEDWELLTIME
These two messages set and get the time the mouse must sit still, in milliseconds, to generate a SCN_DWELLSTART notification. If set to SC_TIME_FOREVER, the default, no dwell events are generated.

SCN_ZOOM
This notification is generated when the user zooms the display using the keyboard or the SCI_SETZOOM method is called. This notification can be used to recalculate positions, such as the width of the line number margin to maintain sizes in terms of characters rather than pixels. SCNotification has no additional information.

SCN_HOTSPOTCLICK
SCN_HOTSPOTDOUBLECLICK
SCN_HOTSPOTRELEASECLICK
These notifications are generated when the user clicks or double clicks on text that is in a style with the hotspot attribute set. This notification can be used to link to variable definitions or web pages. In the notification handler, you should avoid calling any function that modifies the current selection or caret position. The position field is set the text position of the click or double click and the modifiers field set to the key modifiers held down in a similar manner to SCN_KEY. Only the state of the Ctrl key is reported for SCN_HOTSPOTRELEASECLICK.

SCN_INDICATORCLICK
SCN_INDICATORRELEASE
These notifications are generated when the user clicks or releases the mouse on text that has an indicator. The position field is set the text position of the click or double click and the modifiers field set to the key modifiers held down in a similar manner to SCN_KEY.

SCN_CALLTIPCLICK
This notification is generated when the user clicks on a calltip. This notification can be used to display the next function prototype when a function name is overloaded with different arguments. The position field is set to 1 if the click is in an up arrow, 2 if in a down arrow, and 0 if elsewhere.

SCN_AUTOCSELECTION
The user has selected an item in an autocompletion list. The notification is sent before the selection is inserted. Automatic insertion can be cancelled by sending a SCI_AUTOCCANCEL message before returning from the notification. The SCNotification fields used are:

Field Usage
position The start position of the word being completed.
text The text of the selection.
ch If a fillup character was the method of selection, the used character, otherwise 0.
listCompletionMethod A value indicating the way in which the completion occurred. See the table below.

Symbol Value Meaning
SC_AC_FILLUP 0x01 A fillup character triggered the completion. The character used is in ch.
SC_AC_DOUBLECLICK 0x02 A double-click triggered the completion. ch is 0.
SC_AC_TAB 0x04 The tab key or SCI_TAB triggered the completion. ch is 0.
SC_AC_NEWLINE 0x08 A new line or SCI_NEWLINE triggered the completion. ch is 0.
SC_AC_COMMAND 0x10 The SCI_AUTOCSELECT message triggered the completion. ch is 0.

SCN_AUTOCCANCELLED
The user has cancelled an autocompletion list. There is no other information in SCNotification.

SCN_AUTOCCHARDELETED
The user deleted a character while autocompletion list was active. There is no other information in SCNotification.

SCN_FOCUSIN
SCN_FOCUSOUT
SCN_FOCUSIN (2028) is fired when Scintilla receives focus and SCN_FOCUSOUT (2029) when it loses focus.

SCN_AUTOCCOMPLETED
This notification is generated after an autocompletion has inserted its text. The fields are identical to the SCN_AUTOCSELECTION notification.

Images

Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.

RGBA

The RGBA format allows translucency with an alpha value for each pixel. It is simpler than XPM and more capable.

The data is a sequence of 4 byte pixel values starting with the pixels for the top line, with the leftmost pixel first, then continuing with the pixels for subsequent lines. There is no gap between lines for alignment reasons.

Each pixel consists of, in order, a red byte, a green byte, a blue byte and an alpha byte. The colour bytes are not premultiplied by the alpha value. That is, a fully red pixel that is 25% opaque will be [FF, 00, 00, 3F]

Since the RGBA pixel data does not include any size information the width and height must previously been set with the SCI_RGBAIMAGESETWIDTH and SCI_RGBAIMAGESETHEIGHT messages.

GUI platforms often include functions for reading image file formats like PNG into memory in the RGBA form or a similar form. If there is no suitable platform support, the LodePNG and picoPNG libraries are small libraries for loading and decoding PNG files available under a BSD-style license.

RGBA format is supported on Windows, GTK+ and OS X Cocoa.

XPM

The XPM format is described here. Scintilla is only able to handle XPM pixmaps that use one character per pixel with no named colours. There may be a completely transparent colour named "None".

There are two forms of data structure used for XPM images, the first "lines form" format is well suited to embedding an image inside C source code and the "text form" is suited to reading from a file. In the lines form, an array of strings is used with the first string indicating the dimensions and number of colours used. This is followed by a string for each colour and that section is followed by the image with one string per line. The text form contains the same data as one null terminated block formatted as C source code starting with a "/* XPM */" comment to mark the format.

Either format may be used with Scintilla APIs with the bytes at the location pointed to examined to determine which format: if the bytes start with "/* XPM */" then it is treated as text form, otherwise it is treated as lines form.

XPM format is supported on on all platforms.

GTK+

On GTK+, the following functions create a Scintilla widget, communicate with it and allow resources to be released after all Scintilla widgets have been destroyed.

GtkWidget *scintilla_new()
void scintilla_set_id(ScintillaObject *sci, uptr_t id)
sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)
void scintilla_release_resources()

GtkWidget *scintilla_new()
Create a new Scintilla widget. The returned pointer can be added to a container and displayed in the same way as other widgets.

void scintilla_set_id(ScintillaObject *sci, uptr_t id)
Set the control ID which will be used in the idFrom field of the NotifyHeader structure of all notifications for this instance. This is equivalent to SCI_SETIDENTIFIER.

sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)
The main entry point allows sending any of the messages described in this document.

void scintilla_release_resources()
Call this to free any remaining resources after all the Scintilla widgets have been destroyed.

Provisional messages

Complex new features may be added as 'provisional' to allow further changes to the API. Provisional features may even be removed if experience shows they are a mistake.

Provisional features are displayed in this document with a distinctive background colour.

There are currently no provisional messages. The SC_TECHNOLOGY_DIRECTWRITERETAIN and SC_TECHNOLOGY_DIRECTWRITEDC values for SCI_SETTECHNOLOGY are provisional.

Using C++11 <regex> is provisional.

Some developers may want to only use features that are stable and have graduated from provisional status. To avoid using provisional messages compile with the symbol SCI_DISABLE_PROVISIONAL defined.

Deprecated messages and notifications

The following messages are currently supported to emulate existing Windows controls, but they will be removed in future versions of Scintilla. If you use these messages you should replace them with the Scintilla equivalent.

WM_GETTEXT(int length, char *text)
WM_SETTEXT(<unused>, const char *text)
EM_GETLINE(int line, char *text)
EM_REPLACESEL(<unused>, const char *text)
EM_SETREADONLY
EM_GETTEXTRANGE(<unused>, TEXTRANGE *tr)
WM_CUT
WM_COPY
WM_PASTE
WM_CLEAR
WM_UNDO
EM_CANUNDO
EM_EMPTYUNDOBUFFER
WM_GETTEXTLENGTH
EM_GETFIRSTVISIBLELINE
EM_GETLINECOUNT
EM_GETMODIFY
EM_SETMODIFY(bool isModified)
EM_GETRECT(RECT *rect)
EM_GETSEL(int *start, int *end)
EM_EXGETSEL(<unused>, CHARRANGE *cr)
EM_SETSEL(int start, int end)
EM_EXSETSEL(<unused>, CHARRANGE *cr)
EM_GETSELTEXT(<unused>, char *text)
EM_LINEFROMCHAR(int position)
EM_EXLINEFROMCHAR(int position)
EM_LINEINDEX(int line)
EM_LINELENGTH(int position)
EM_SCROLL(int line)
EM_LINESCROLL(int column, int line)
EM_SCROLLCARET()
EM_CANPASTE
EM_CHARFROMPOS(<unused>, POINT *location)
EM_POSFROMCHAR(int position, POINT *location)
EM_SELECTIONTYPE
EM_HIDESELECTION(bool hide)
EM_FINDTEXT(int flags, FINDTEXTEX *ft)
EM_FINDTEXTEX(int flags, FINDTEXTEX *ft)
EM_GETMARGINS
EM_SETMARGINS(EC_LEFTMARGIN or EC_RIGHTMARGIN or EC_USEFONTINFO, int val)
EM_FORMATRANGE

The following are features that are only included if you define INCLUDE_DEPRECATED_FEATURES in Scintilla.h. To ensure future compatibility you should change them as indicated.

SC_CP_DBCS Deprecated
This was used to set a DBCS (Double Byte Character Set) mode on GTK+. An explicit DBCS code page should be used when calling SCI_SETCODEPAGE

SCI_SETUSEPALETTE(bool allowPaletteUse) Deprecated
SCI_GETUSEPALETTE Deprecated
Scintilla no longer supports palette mode. The last version to support palettes was 2.29. Any calls to these methods should be removed.

SCI_SETKEYSUNICODE(bool keysUnicode) Deprecated
SCI_GETKEYSUNICODE Deprecated
On Windows, Scintilla no longer supports narrow character windows so input is always treated as Unicode.

The following are features that should be removed from calling code but are still defined to avoid breaking callers.

SCI_SETSTYLEBITS(int bits) Deprecated
SCI_GETSTYLEBITS Deprecated
SCI_GETSTYLEBITSNEEDED Deprecated
INDIC0_MASK, INDIC1_MASK, INDIC2_MASK, INDICS_MASK Deprecated
Scintilla no longer supports style byte indicators. The last version to support style byte indicators was 3.4.2. Any use of these symbols should be removed and replaced with standard indicators. SCI_GETSTYLEBITS and SCI_GETSTYLEBITSNEEDED always return 8, indicating that 8 bits are used for styling and there are 256 styles.

Edit messages never supported by Scintilla

EM_GETWORDBREAKPROC EM_GETWORDBREAKPROCEX
EM_SETWORDBREAKPROC EM_SETWORDBREAKPROCEX
EM_GETWORDWRAPMODE EM_SETWORDWRAPMODE
EM_LIMITTEXT EM_EXLIMITTEXT
EM_SETRECT EM_SETRECTNP
EM_FMTLINES
EM_GETHANDLE EM_SETHANDLE
EM_GETPASSWORDCHAR EM_SETPASSWORDCHAR
EM_SETTABSTOPS
EM_FINDWORDBREAK
EM_GETCHARFORMAT EM_SETCHARFORMAT
EM_GETOLEINTERFACE EM_SETOLEINTERFACE
EM_SETOLECALLBACK
EM_GETPARAFORMAT EM_SETPARAFORMAT
EM_PASTESPECIAL
EM_REQUESTRESIZE
EM_GETBKGNDCOLOR EM_SETBKGNDCOLOR
EM_STREAMIN EM_STREAMOUT
EM_GETIMECOLOR EM_SETIMECOLOR
EM_GETIMEOPTIONS EM_SETIMEOPTIONS
EM_GETOPTIONS EM_SETOPTIONS
EM_GETPUNCTUATION EM_SETPUNCTUATION
EM_GETTHUMB
EM_GETEVENTMASK
EM_SETEVENTMASK
EM_DISPLAYBAND
EM_SETTARGETDEVICE

Scintilla tries to be a superset of the standard windows Edit and RichEdit controls wherever that makes sense. As it is not intended for use in a word processor, some edit messages can not be sensibly handled. Unsupported messages have no effect.

Removed features

Previous versions of Scintilla allowed indicators to be stored in bits of each style byte. This was deprecated in 2007 and removed in 2014 with release 3.4.3. All uses of style byte indicators should be replaced with standard indicators.

Building Scintilla

To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE directories. For Windows, GCC 4.7 or Microsoft Visual C++ 2010 can be used for building. For GTK+, GCC 4.1 or newer should be used. GTK+ 2.8+ and 3.x are supported. The version of GTK+ installed should be detected automatically. When both GTK+ 2 and GTK+ 3 are present, building for GTK+ 3.x requires defining GTK3 on the command line.

Static linking

On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to link Scintilla directly into your application .EXE or .DLL file, then the STATIC_BUILD preprocessor symbol should be defined and Scintilla_RegisterClasses called. STATIC_BUILD prevents compiling the DllMain function which will conflict with any DllMain defined in your code. Scintilla_RegisterClasses takes the HINSTANCE of your application and ensures that the "Scintilla" window class is registered.

Ensuring lexers are linked into Scintilla

Depending on the compiler and linker used, the lexers may be stripped out. This is most often caused when building a static library. To ensure the lexers are linked in, the Scintilla_LinkLexers() function may be called.

Changing set of lexers

To change the set of lexers in Scintilla, add and remove lexer source files (Lex*.cxx) from the scintilla/lexers directory and run the scripts/LexGen.py script from the scripts directory to update the make files and Catalogue.cxx. LexGen.py requires Python 2.5 or later. If you do not have access to Python, you can hand edit Catalogue.cxx in a simple-minded way, following the patterns of other lexers. The important thing is to include LINK_LEXER(lmMyLexer); to correspond with the LexerModule lmMyLexer(...); in your lexer source code.

Building with an alternative Regular Expression implementation

A simple interface provides support for switching the Regular Expressions engine at compile time. You must implement RegexSearchBase for your chosen engine, look at the built-in implementation BuiltinRegex to see how this is done. You then need to implement the factory method CreateRegexSearch to create an instance of your class. You must disable the built-in implementation by defining SCI_OWNREGEX.

scintilla/doc/Lexer.txt0000644000175000017500000002110012210260370014050 0ustar neilneilHow to write a scintilla lexer A lexer for a particular language determines how a specified range of text shall be colored. Writing a lexer is relatively straightforward because the lexer need only color given text. The harder job of determining how much text actually needs to be colored is handled by Scintilla itself, that is, the lexer's caller. Parameters The lexer for language LLL has the following prototype: static void ColouriseLLLDoc ( unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler); The styler parameter is an Accessor object. The lexer must use this object to access the text to be colored. The lexer gets the character at position i using styler.SafeGetCharAt(i); The startPos and length parameters indicate the range of text to be recolored; the lexer must determine the proper color for all characters in positions startPos through startPos+length. The initStyle parameter indicates the initial state, that is, the state at the character before startPos. States also indicate the coloring to be used for a particular range of text. Note: the character at StartPos is assumed to start a line, so if a newline terminates the initStyle state the lexer should enter its default state (or whatever state should follow initStyle). The keywordlists parameter specifies the keywords that the lexer must recognize. A WordList class object contains methods that simplify the recognition of keywords. Present lexers use a helper function called classifyWordLLL to recognize keywords. These functions show how to use the keywordlists parameter to recognize keywords. This documentation will not discuss keywords further. The lexer code The task of a lexer can be summarized briefly: for each range r of characters that are to be colored the same, the lexer should call styler.ColourTo(i, state) where i is the position of the last character of the range r. The lexer should set the state variable to the coloring state of the character at position i and continue until the entire text has been colored. Note 1: the styler (Accessor) object remembers the i parameter in the previous calls to styler.ColourTo, so the single i parameter suffices to indicate a range of characters. Note 2: As a side effect of calling styler.ColourTo(i,state), the coloring states of all characters in the range are remembered so that Scintilla may set the initStyle parameter correctly on future calls to the lexer. Lexer organization There are at least two ways to organize the code of each lexer. Present lexers use what might be called a "character-based" approach: the outer loop iterates over characters, like this: lengthDoc = startPos + length ; for (unsigned int i = startPos; i < lengthDoc; i++) { chNext = styler.SafeGetCharAt(i + 1); << handle special cases >> switch(state) { // Handlers examine only ch and chNext. // Handlers call styler.ColorTo(i,state) if the state changes. case state_1: << handle ch in state 1 >> case state_2: << handle ch in state 2 >> ... case state_n: << handle ch in state n >> } chPrev = ch; } styler.ColourTo(lengthDoc - 1, state); An alternative would be to use a "state-based" approach. The outer loop would iterate over states, like this: lengthDoc = startPos+lenth ; for ( unsigned int i = startPos ;; ) { char ch = styler.SafeGetCharAt(i); int new_state = 0 ; switch ( state ) { // scanners set new_state if they set the next state. case state_1: << scan to the end of state 1 >> break ; case state_2: << scan to the end of state 2 >> break ; case default_state: << scan to the next non-default state and set new_state >> } styler.ColourTo(i, state); if ( i >= lengthDoc ) break ; if ( ! new_state ) { ch = styler.SafeGetCharAt(i); << set state based on ch in the default state >> } } styler.ColourTo(lengthDoc - 1, state); This approach might seem to be more natural. State scanners are simpler than character scanners because less needs to be done. For example, there is no need to test for the start of a C string inside the scanner for a C comment. Also this way makes it natural to define routines that could be used by more than one scanner; for example, a scanToEndOfLine routine. However, the special cases handled in the main loop in the character-based approach would have to be handled by each state scanner, so both approaches have advantages. These special cases are discussed below. Special case: Lead characters Lead bytes are part of DBCS processing for languages such as Japanese using an encoding such as Shift-JIS. In these encodings, extended (16-bit) characters are encoded as a lead byte followed by a trail byte. Lead bytes are rarely of any lexical significance, normally only being allowed within strings and comments. In such contexts, lexers should ignore ch if styler.IsLeadByte(ch) returns TRUE. Note: UTF-8 is simpler than Shift-JIS, so no special handling is applied for it. All UTF-8 extended characters are >= 128 and none are lexically significant in programming languages which, so far, use only characters in ASCII for operators, comment markers, etc. Special case: Folding Folding may be performed in the lexer function. It is better to use a separate folder function as that avoids some troublesome interaction between styling and folding. The folder function will be run after the lexer function if folding is enabled. The rest of this section explains how to perform folding within the lexer function. During initialization, lexers that support folding set bool fold = styler.GetPropertyInt("fold"); If folding is enabled in the editor, fold will be TRUE and the lexer should call: styler.SetLevel(line, level); at the end of each line and just before exiting. The line parameter is simply the count of the number of newlines seen. It's initial value is styler.GetLine(startPos) and it is incremented (after calling styler.SetLevel) whenever a newline is seen. The level parameter is the desired indentation level in the low 12 bits, along with flag bits in the upper four bits. The indentation level depends on the language. For C++, it is incremented when the lexer sees a '{' and decremented when the lexer sees a '}' (outside of strings and comments, of course). The following flag bits, defined in Scintilla.h, may be set or cleared in the flags parameter. The SC_FOLDLEVELWHITEFLAG flag is set if the lexer considers that the line contains nothing but whitespace. The SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point. This normally means that the next line has a greater level than present line. However, the lexer may have some other basis for determining a fold point. For example, a lexer might create a header line for the first line of a function definition rather than the last. The SC_FOLDLEVELNUMBERMASK mask denotes the level number in the low 12 bits of the level param. This mask may be used to isolate either flags or level numbers. For example, the C++ lexer contains the following code when a newline is seen: if (fold) { int lev = levelPrev; // Set the "all whitespace" bit if the line is blank. if (visChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; // Set the "header" bit if needed. if ((levelCurrent > levelPrev) && (visChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; styler.SetLevel(lineCurrent, lev); // reinitialize the folding vars describing the present line. lineCurrent++; visChars = 0; // Number of non-whitespace characters on the line. levelPrev = levelCurrent; } The following code appears in the C++ lexer just before exit: // Fill in the real level of the next line, keeping the current flags // as they will be filled in later. if (fold) { // Mask off the level number, leaving only the previous flags. int flagsNext = styler.LevelAt(lineCurrent); flagsNext &= ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } Don't worry about performance The writer of a lexer may safely ignore performance considerations: the cost of redrawing the screen is several orders of magnitude greater than the cost of function calls, etc. Moreover, Scintilla performs all the important optimizations; Scintilla ensures that a lexer will be called only to recolor text that actually needs to be recolored. Finally, it is not necessary to avoid extra calls to styler.ColourTo: the sytler object buffers calls to ColourTo to avoid multiple updates of the screen. Page contributed by Edward K. Reamscintilla/doc/Indicators.png0000644000175000017500000002047512226611247015065 0ustar neilneilPNG  IHDR$sRGBgAMA a pHYsod IDATx^흿,qgpd81\M9qԀ tȎdӋ0``=Μ`9Pb;I "{ⷺÝ_Pm6*mμ}:BB2Pd "#d0! EF`(2BC2lǗdWS .ګ=_rGx|y.ۋ}EbCl?ռOrw,7sGn};I,xY YЁHj'tp|ĵ )Iڊ(&WXa!U$mEv YH(IQA Q_vLPT, ?8Mo'#,IdO-m+I`(2BC2Pd "#d0!,Ԃ= rDƚ>ўiO43йK:fb;0i/?Co's.7aMܲ%)sǪ$Svދ'}ȹ$3"Pb&jtw`%wB]D~Dy-2qdP3& d8(`t~4E֓=dVMT#"`4ޮLqQxeY0"OX(sd(v2#[ϩtCdx,T IzߌvbHO|ƵGdsIo~@QdW,SvId?&H~)P'_U\̺jچe'c oW)pE]E6 'Ym¶Wk~+ ERDCbsMf?; \59E& _? BO? ^wߞΗnw+|L u]]~v2EF`(2BC2Pd ffO|H9~Z=N||n.mܳ,a,$$ܤEZ%Q"#'$nny Xf}wFQddCE.®E ,~&(Ɗ,/2d.23"#x2%,I8r~dL"+ګ 9v2mhO{*<{K'/;¼Tsf6> 9D^vFTPdBLY>3֕u ߇%5''aHSHX0Qd's6iQ+ )?JciZ C ȜxkG4/ m.Pi~I="I%Cd&f\p@%{/R|~9+@N~ć";Gb̈s'kO_-[|9^s= 6ct~bZ'gc]s C}~y1=Qdy2Y%@B?xORޝ1XI\H6^o\xAY=̓(l$P<9Ȋjmb{~SbGEVoIP0q}[J{Csʿy6L /=adA>zi,Z{{-Id "_+}AY"#d0! EF`(2BYd'>Gg?NQ9!̝NX̩o f:5Q3rɪ3p鶾 hV91r_0Fdi\US4~r3 YH8]"bݨ'97z̩4$0"iƉ,, tʟ:鼄 w.Pfuo؋-zvId*2M/2Me>wᄞYվ_,QdQ`|h5'.6L :\?cw:7+P ٝ,_٪lڑ D$yD{]@4-cBC'7fMIs'bJܶWsvNoe>$}8"c˵oG+@~>ç5 zBs";ea`!d EF`(2BC2Pd "#d0E`){*kt~͉𵚈)'0['kC'Sٓx;D֝v!oþ S1ߌ*k26ǬJ!_Y"Z,$,,b2v1BdmDq(|SdW8%art %xOuLfl" ?KSdWP~i- bj>$#sȊ9Ȋ&b-j+@LȸudB3Ev &ح"}qY@^(k DB-,d )sIZ1BdZX@>\PdWfMIPmjmx~oekSdS'; .O E6W ;Ȯ};!d) kv[BPd "#d0DhZcz8o Ep =&E6{CiX~hRiO|ߡ6 =uat Aٷgo*,Z,ˢic2HdA<\3"bRYQdX`Ev,P ;pi7n&./(ER [Y$=J(FR->Gd_!䫪PE_cYdp;>ڷ^%[YۇOڥh}Y-{k|F=&v2 cr";ean;1,26#WPd fȾ7_o_id۔"|M{ J,2yEݿړ~(2jֱYd??;>d~ OG鉶.ګ}zק6^bmOOU.1O˸~N(T}5'M]њ> R_M4PNcNf"]X2`~4qA2H9J.h8o(>9m=nCXCmOlD# 5#*{=MH1}HF` E_]XFTHdѬ׌'ҷ"[8ev %~I*'ك"y}孅;"[P /2]enz>`A[Y5;%a27߾ԯ(uY,~]p'~xdr= ƎoŝLl?ӗpi;~+2bOd[P u4p+S SeyqR|18(ur։ EJ4MrHy.ՊJʐHGU'*7E*k 9ֱYd' iEVW3 Չ7`$~ <xL_̓|PdطU@{q";eanK5lESij6'{L5ֱYd>v}&ev"sh2́"(2f#NX>׎8Ք;H& 'Wz/|Tg&dxPLf4$;XcYh :S/|WeiRx<)Gg0b:O.N9\^ŠUoĠȜ^mYh "˫`Y%w֋R4WiRd]" c˽On(`1Ay1[DuD){^rI?/3W0'dLZ혓@}" ۛ$Me8- ϝ++@/"acE‚p!b`ဟ)iѿ O^c9%Rjڢn}beliz WE97[CcHr[9X!:sV=_ž:x[K=CɪIѶw2k|ve"sNF;Qd214ڹ,2BH! EF`(2BYd_OOO?M ˟_뢽%WHx~Ǘ粽XۇjyWYӼrr@bCHRPd6QcOg9ٍc-sQY{>o`">1HdA<3"xL?Qb"p|C-ʹ늉"{8Ɖ,,Is[d(?|b1{c_WNn"D"n{D־][ό.zZiU8({dY0"ҝx`d9x.P)p|ٕ~&ծmIEpȊ]Y$=J(Чw, Ul--l(䕓g=' OHy{3IQRDwQAcTlEp!l ]Xɵ܋;W0^5#WPd "#d0! EF`(2BYdIܜANF뢽ƀmHV>/'#w R17oT}r+nr YH4]"xL?o} ?7:Ɖ,,[d(9?JT_dxf깱xmٙ2Tdz_d*e$cNb}gF+cEȂHλ0(v &3:7Nd~?y2yK$HLGMʻŇMxݱj,LbuELn",ONF+Z$(*}07Nd*bcrk!lY50]J^sk|%WPd "#d0! EF`(2BYd'>̜`g?Nl=O}'5%! au,3źw`*!:fIGNfse44[gNAt[ߌ}4jr˖DΨψ$eo_@{D:{5cMc,LLd1]"Pb&jSQqyIܝ;H%i1c~?ԢuYY&;u7~zCIGd(|;E6sY*?7A""_YOBVZk6Q"`4ޮ|[m5B*iڕ1˜齓V+@Lt—E6nQ&4l7?ӽUX@3Nvy_w·1\dR|r]74/]$)7~I}I|J !p>x2y.,-vZf1 Wo&k?*SRs| E6 'Y#(Z8%/\i^Rab>p^hDmŐCS'~&_I>:(u5MdB‡)~[gN[7OT>]q.,;<[Xx}+"#d0!,뷯|WrY6L\?\˳k'#p'sNg>˧9N|H~,?tja͉Cy_pOX$|﹓]};8ۦbߌbYꯊ!Nvy}&sE# =#*(2!&Ip' [Lx#kDfA$R^dLQ'/vP6~Dڎ/Z<3X6\(:3>OiÝbz/2GdhX˒xw//?gqwG%f=];/2w*3Nvs"0'zuɰ@];/,%VLnR-> G2+EXL2_w˳Yd'k)Ȋj`'&L[Qf^dej(v|Vގ طty}&bNY[Lvy9\˳k'˲Yd>(2BC2Pd fȼS9~XsC'0ړ˧/Bcu,{w`yD'ṱrz$[~ :˓I$_Ǜ Z2'DGq-1柝|k/^3ڵwy->N ʛ>ְhw. CEA~ iĢXILB5W{vK"K9AD_&׬?a櫪c>ܾ_;l?;Gj'o>w0Vd,~ 4~x&lZh*YzyN,~i fk536n{;n'(o[Â.C,JL'ft֡u&_K/t@4st6ux,m`,x`DB ',y*Ӆ}eZRl,&m{RUnIT&0'\Z(e9YdpAx~oe&dZl¥wQX "`(YN/Lܯ7Pέ)Olk(6cNFYnEwšݖ1|F{ EFuV"!EF`(2BC2Pd "#d0! EFPi+HIENDB`scintilla/doc/annotations.png0000644000175000017500000010141512075650364015322 0ustar neilneilPNG  IHDRGӠsRGBgAMA a cHRMz&u0`:pQ<IDATx^{eU}yz܌ѣhc F,,DˣXQ0HiA<"" teiÑ7yT=z(R9fT@ % \{{Ƣ{k>7\ sY_J5P @(@?o81ܗc$(P @+ ͰܜAS7__|.xϵ8P @(c6Fn qco$ҝkp@(P L81[Ϲ*P @(8r|k>xօW͛_/؋;oͯȂP @(:S#:CuWuy6lx_}駟z~~뵯}k ^0@(P`:8Nt>κPYwIgWV{l<3q)Uء;1;7|+>l{^ǐc;,̋3P @(ҽⵛ.jKqs&7Ő|piC}O>v#ۮٷ*v<>+yOk_Pݵ_}_¿.>__t#ӫ>Syst=򖷼 ox+^qW[N9~=\Fu7ndѻEs ?/7ߘ{~2U8o:ܰ?|M}u6]`^%T?OZ Y[~dHP t/.,K,Mjۮ'_wwO w?dvR~_[[| l8ϸ*{ի^w5\wK/?>yl2;i l7|y~|y'*g]| ~%u{?}L|m ֿCE~ys2g}L6ў`07=!ku"=O=3Gk[1P @(3ϻT'7E\)b߻rz+e}|mbnz7KLQ-qp9h9^ Iu;?ݮ1I^~}s]ObUӴ";N?H־olYeyzqo>za'z۷GT]5 OXST) $P @(F_}n8 o9XDe PK\G7V=?=nC+kv#7WV3s|K^'Fu'|2*]v{޻a_?/ җo}+[lnqg[p}_9ɯzQ#|tvV(/bUӤޯ[9t 73%bϖm OV> ~e^Z&buO;* @(8WZ{driK\9K^#^ͪ0MfP1'/y<q,bu]w:0}s_~9rw~dϱ~813ŋp{࿟ w* h;T~^Zʞw}Md޷=m?xxWs?HVCu*Fx̌"^(V5M)O0XXq?ΈIӿa&Ϋx0GΨ$T/*UC(#P7=MoNaY9xE,t^./%::h~vGu ռ~_zYb {+O9츍`TX-c9vaݕm` cw9a#f%6{`=yϓ:]&cuA79]7O;J_Wt(!7=q!;;ಃyy[U~(RF݂︓򿽟%zR <2Fe[L) A6^7zʤ65P @(0~obGu9X2X\hg;橫|gdz<?yq͙,AFq|'^x<^3֯_6@{Vrc{#n 0v;}<砃_g8E}V<t;CZE}-{q\vy<& ?E2;gnUp;*V?TSSy] [7?I[T;7V&>VZ)зi[Zf-HP Ngr̹/o=X2XZ,ׯ;7. ~ܗ{#mw';~pޱc'Go?7%6fw[⪭7xés<ϕl?,ie7f;vaǐݦ֭[x3LW}gyIu뎾Dru]l85ޠw6+xixioc_ybMuz[f~;AuGF>SbR~3ܘ}l]Ϻ;YMDVCa-ߵܒC6&ɦ!NwTՒi A( W9(06ʂsEB:tؿqм!Gmޟ{𣃞d?t!G}?m<9}QLi,*0҃GS^~W]Xꙇ^jի Q xd爐*lwnօ昪i.E @(:˯9翫`Hǒf{7.즅'ng~{ԍ77邧~m[?eY=U`&XرXFrؔ+c;/__2-P @(CuG/|9` X2XY<s‡o展?_wקS_%cŒ˩X5/9iXE!=!] gP @(0 ;?#^y/? r1Pc3>;XEQQc9Ku'M?㘗)WFxy0P @(:RగrXn6uTwQ;P @(@Xj88P @(0) 2n?P @(7P @(npR~@N(P` @uP @(o}tÆ~{FWrk{eL,עVd[!+̉W~0}ݽ0k dSNE]"ܰ[K+"ove78޶aö!t {f-֪ۤL-UW}#-i宋Ygn^J̉y2V1af:wx]Y6S Kߥ嗦'pF#˺+\a9ǰ4ࢉ㔅{32 sTL˺1?0L&VF-!Ï=B^ DϿf @(*R|:t$)R*m8o1Bqc?v^gF4P,P @(ЍRYW'bG2C=/G1 ddebWxp @(R]& noK}Ko 3+XHϥ:θ:P݈FP @(QӴff%MliS_ي:F:[B0v`0Xtw挿T̀C-P @(hBudYHN퍸+LҞ>]lIFtvKExn vKLýGtIX(@ЦVXTv+P`v(:{aj:MG?P @(fVbV@uڳhP @QTVfdģP @(UP;'P @iPTq<.(  @( 7 s"UyP @(&K=X P @(Wg8P @(&EdL P @(l)`M N(P ̲l`=_LM8 [P @7}|'?-zw??E'浼@G:P @(0 0?>P%qp2t3P @Iu:ꆃ܈JP @(~ڃBc߱W9[~&]TXR6P @(0TTRMp `s Hsmۦ" #VW4 @(0Twzy{3TRTA`n׮)~tC)P @(0T9Ƀdm:Pw+H P ~B srs_u,NuzqP`X.N(PHCu_#0H罖N50]2g`d_J;1C(c᝙ZG$UR. o KuP @(0Tw s3Iu Kcx6w4/}]y!;1C(yH罝Jw4ܘ}Q89[Ѱw8A'P @(P./ty*1C(y-BpqB(E Tc$P @($}Oҥ^dS΁-BpqB(E 0cR{\D vv7x{`?z~W_w>c{vV&$ VW4 @(X{hǃ?<`G<<?_uP @(uh @h#1P @(k@\]dA'P @(P DkPGanmqnܖŝENgu#/pyl8 )x確skg< y7? 1IuJsmߌfêx|B@uA}VD93*0V!i׬5,#i,,YkJ} Ts*[\ӹY LeR:Y @"(@1H3Orjmdc7 ԕ,7i]w4&a7"vEur1S,F*VH@uq`,rfI}w= iN;"#{L|Tȼ% AILO4N۷ˉŝE9ȳLU~4n %NtЌ!LG2BN?B1r]8-PC,@uI`(PTG|:7gJIfaw mev鏆::PWb3TËUα8 vK̐/BShCP]x9Mm΍阋QZ =O⓸$d&Vm̫ڍvʕ4=!Uvc,2WJVQMEEXTgopXcEI.-UfXMurvI A5Pe6Q3 ru'rS܈g+$0L!V?v$Ȃ: u1lPӣBkREanzFč! Cq5 Q>4g,݉J Wy+cOEzVw$U'cP+P@uZ*` (Ӥ rui((КTQަ'(%P L&AXsރ}p@T~A(PT54VKwcenneGn^Zۚ%׵k*!oSF۳cAțуTQYi  @(`5ALIk,qKK"R~3z#8). XVlبNٱ=ͪk͓eϠl*"V'n12ӡZؽ:OFbuTkjMf=D.PP`XFyJbuaЙ9S("6V +Ԧo7 4)QUTy=Xݰ,( Ur:2ɑEeh%jna-<#iLS<5TG*~NœHu|E]ءw9jTY!zg,MfxǒJO Ɂuš%ڠj:+&}:=Kj%";[E;Ym)ǀti2=_ZݛarjO ,8* @L@uC2|?g = V9?O3PtP¼5:RZ5 з(̩ךYm in{j˅%&1U lmA#FaeYZ-RyD\:TD_k3 "qVog&ij'G2(fAPl[1:{pN(aꅔ3;)0oT̟v!~#4>?VG&+\鰢lWnY,An\@#@uC2sE13˭edl=,܊9ٺXuN]W7X]HiYWif۝ ml;y+?`UR~puﲇ/o":d_[)q'T!};!+¥{H._T@C@u `s PݶM(XxSꔣ3{݈$=un/.ݹ~Ԗ|O9*[գ$)[]p;2wa XDl\}X~guP`vˠsZDҺP UP[4!v회XݞՍ,6}xQNlga9~B:s'^[o7n~w6}dxqzאKesP :-'l K4'"D$tO”A*5Nd>,iJ*v 2Rllbkw,@0H<1sGF$`R*iدu3Vʡp9*sb{4!+'-bɈ)Aƽ7[Kuds8j.R849MPG!ILқ}'rY+Mu|ATC"rnܰ![jM,W7Zzc:քX)SS1jt -]+οqӋ(9 fc]1GG`b[&;Ք{9#)#T'"nQ>]'ɲQEڐ8t1T^;4DTlj ٍv%XW7zKsZ\1wPizaX|`fbInbu,~U/$t|͆ęlMIr"; Kj).P 6n`qȌщ<] ɪϴiYNn8- 7@u(rB)Ua̔l<6cui:,E;/*Jaŝ+|>/$)24ָ!&w,K-J.;c2)Stآ @JTdmHD5KJ; N-S%XLgձ*\LC6tVץKЋ_JYQh 4Aj=YZj]KYCHMM["f6lPKۚM6Vw7luߒ[>6ݱ7CuP =b xt}x𧃇}|ǞU4ӯ#` )RYR+r%R uqbrTL54} á@ `Ԭv w %uhP ifLa Nh@uqZYE@/2=k>  )W!Cٸ-Sqf!3 :KXL]h,P @uie!V7F P @(fJP]luX(+*BnP ̔2,5bu3uP @(WTUT#~G,JP @( C`a]'>ZbWX  @(*c(f}|4` Xc ^@h8P @(s&F\$VG3 kSO3~zs()s.c3YHLY+k]X~;+A(:Xy8Y;7˱..D cub\1C}ذ @()0Rz |tű:X4V'`gJFP >29o]95uuP ̬] ],mD"w5%f1^X알C(qs497cIԞV' UB TK @(*ˊuұA알C(ulY5pW\P @(fRP]cuYn&0 P p@u[V:f(P`e1VKP @(P{`˪‘P @(f]P]cuY4~( +HP`e1VKP @(Pn rgIHr ‘P @(f]PC1CfwabFgCzSs29bu~iP @( 9 bu:uH]Cp$#9P @YWTWBcdR,=oIxC((TTg)+>oQRbu#ɡP ̺:Mub{\sV5wjbu~)P @(ƬNsuviҊTEP @(UT'66T܈$ 5P tNuӈ϶[ә[~u]YP DeI:⊅P @(uk^ e$P @(0 2)d@2|( Ƶ+HP`eRV+͇P @(Pk\ˬ:Wt!=P @(ЍL:Y?cun.KPq->fdP @(0 2)de=-o3\۳}&\T7^9ZG]zca ,ዚ J-,M?W]]};wF..v:b1eOkxˊooP.O O>pdtX2T~f#q^xr[~) NuA:ǤG&3܀tk-۹ȸpZtZŤuD겧/O&yMJNՙcf}~Ž Uϥ9Q4M u8PdA>W)V" _;(g<"--P9LTQv;h!R_-H0Dc:}"%i&YxM9 bu_?cuo(~pc*' (,T/k3INHcud\E/@879:]$0ˆ-t7c)y8kל+H"3Ié LE6eF.3WE P݄wૻTb#3.KAuHu˻>X?wUr({'ՃߦC % +1P|/c:az&SSJ;W$0%3K &2%Ԫ=.H|u>-&-rkHDT3J4 ꒡ꪮq.EZ}-8zC'9ASyNfG\?^b>'=M++w|Ì]n+ҟ4q\rpZV:һ+4VGp׬-@ɯeGUCuĢhXşmɋQ_j tqW ybY=ǁy ؏RũɶFV:}>2fŸVÄwݕ7Ί7fV\]aYSĨZGaeŞ+MS;cEYW-S#v@+u!x=og+.pT7r/ޘ_#_:ᤐBtf~tc}bؓmSx烧~F7 vv7x{`լ?z~W_w>c{vV&*š.ǣt҂ JX]{e^gZu̵b*U>Y"Mr̫'%"afwA$m{:NvSu*>M!&R] JnlfuWY~a\?JqMNG @y-Qq!$/w>#pTGک jWe-u)*buzDgN"V'U܊dLT7uuk2.8tVn:jfI&G沤j]XXwh9?{%3uu:[SLwA zjHu9R$JR~ܲU⿌lyẅZ Gz6:dK,.[qe1 EzE/Ec$])K}T|ӝ˖wgXZ/ךLS"T':ig[]w6K[7gWi(t*{l ngEu] !ȷBYQc׌Mk~ۅ`M"ti-uzߛX#7XGXST gRNrA5|Dx̃DNnFωP!vZ[נd5Xrd4TgH>Kwؑ tHpxGH@_AjUBRaL =CHTKu#"W 6rS^'jS&[5\jYm}Th%H]esWjfIvLMtGL^ QݯuedҲ -G\~opTײc,rkvuXj[U*5: tİO(/QWCvR]H݀TAn/^s^X۾ V\e7%:t:w&}upNDzJuc%f@uP#@u=cu9#T@(R]QŋP @cq3 @buQA(*@3ϊJcuwg,-k/xA!Ŵ`^-m NYtCvca*҆q9Z :STSX]Mn 2f`6T6GT}aN3j~{@u9@TNP]Onɠ;U|aQ䞥LJ=յH 5 _Ef eV]؃Xyp4 zJucxL3j*s2m)UULL8%t*rmu u TSTNNbWЩF}}׫䌝$ sKcؚI썆yQBk9B(Hr^U\]~T@`1RbC:Bv,Ҥ)qlXY՟2KTaL4޾ڼ)U%,br x;R8Î)Gx㫀C I5T7 R]k:Ɉ#57wX">^ynR~.Ӌt>RM"a0 UT[O%nؑsWKJL]W*C;H*H7mCҢ}mó?UNWyo=NQds. R;vu$n?. LR];:Pr2i?PGKH#5T?_ d$/?k8oc-c+j)IM ga^ڷ sV/ 87,f;=i!:D FZ3kX^\jQzoBTVDPG!Mo&na]sϻwF"0⒤,11*(ԥZꣅN0='' *$Yd+:qW\z9x#aSdOLXuxWA< UCWTSk+V'D|GtY=P] !F +)˃8$@M"˂ p X:VȮDyk l [J[$z=$`1H'aaaYYZ1 )$ޛP7Xutά+&e4b+\`%u N=KsTO㥃?^(v*.b2Swd]]ja@TUk9whsVeQR!K6(mrUpGAD3Gz\9@upP`&@dN.6J]?Wcbtwtq,ۦ*%BlR,`lz-/eXwVD0sV{-%ӭ%x Dw8fK5t&|=m7׉GK Oɨ$ 0(tA+6- ҭ_  ؙhl+)յ M!jo3؉BKi4ͶGgBP]OX݄9 V@2Y49dQCN^̈́WG#g[P]O^C3 YsD&:.+ѤͶGgBP]O5 fWPLxu4r]ߋC(mwτR]in0؇ @(Pn&:9 zJu:83(@vhL()M^nmaօVB{m:6(|$%cpJJbQ*ʯJFIFhl+)M^Eiʈث2c1!,-U%NAk+ WAy*]i8fݣ3T7yWn"i=T4qT虑#2ʵ|sO)7M]JP)+T7^m@u=ɋյU2WW.b.+VJW4=nmwτR]+gPJ NfP8 LVmQ)PZi-DMEgYk+;|q֤JUNĖU͖FM6'L~^^ڻ"d fݣ3TJV6յ2 X (/L4;7'1NG.]/DHpʣ+(l Kͨ $||B5TgI˖+AtVVW$^]+j¥R?խ9vՙ]Ѧ%иͬϛhc^ '@u3VTSk+VId=jPYdq% %TW⳽&WKFiG$%f[zʂflcxܼd||*;/|Ҫ©!8ߥv.b&aB{% )T7۾TRy&h)q)8,d܃%G8dBm,3 vKIuEfq!-8>V,;gE:?怦 !Vmt3MP@P]OXdvuG.w#:s m1dQ]FY-6'W9uub׭ "38%R)l|Nw8 Cugu06mmSGuՓU3z8[DhS5 )=STSk)V'Jo]L^j6Wr-S0CK/=^'MckY^Q3ͧ"~Om5^\apq^4vnʂQAzmaEn7VaB:͜Pbxv.i9i뢃jeKْL K2h3H^w5Mr%EmvOZ:Cg@ډՍu'1n8'{ t L"&-?dq2a0fAuPzTVmYi2 9v[v?տQ/g@,V8/t;\ƃdێ:{F${FՍAuPzT7] ?Vo7!ʄ}ST3 s@ zJuS{=P`յBQ"R]qn߾(@ZP]/́+)̠ w( LP]On*bu;VVvw/-mIzk*9*hڱ=;=H,iS T3 s@ zJuScx~i=K\`n@yG<ޥyw)hIqabFtiӬf|eЃptCT׾ EPg zJuS^sҊB7vYGPP޽:OFso.ZZm TnEJ(оRݔ¸3sQDlV<ʩMA2tGUQ]<T:@ k߅D(3@u=6cudޓ#zJ@ZxFҘ^#eJ)yk~)˓T'&R-cxdQ3v]@*?UgVvȼK<&ޱғilr`$W\XDTMg$o^'gID}gkz'-1.M'+S{3YN+z<u~P]/́+)յ|?g = V9?O3PtPXw߾fTG @{VP9Z3-P!mOm1F4-P2b6Uh",K^EY>/<8hK*kmF4a?A$M>l$MY2@׸PzAuPzTRW  s"@ Hl_ϯ x:%A+X1W)TL 2 -K{rtѓsQaNf%E _WTSk'VG6h3mp,hK΍̥Z߅fv;dDuUǨN 6']>e&揓Ig%e TkoD(_@u=vbuq'L&rG5-T̟v!~#4>?VG&+\鰢lWnY,5UbXZRTSk'V笋b0g[yܙ{&XH)0H){^ȬktjFLȺ:mL3ɖ"BKLd8z2f7ffOU*ݑ\C)M_-&UTSk'V޹t#<0")KۍܭD)ܺ`6'I0\XћF kZRp"F[wMiՅ{`yF^z+ F`w kY8?>:ho?`D@uuŰ TNQ (VTגD1P zJumo -PbXZRTSCB.(R Z( WP]O:f(UT_W ˠ@K zJuյP&UTSC> @v2(ВRbu3%b@"VW|ݶ7omɭ7G%MUSu7GI˜{ahIP]OnJbuc-757~7Lؑ<-7x}rUt̡,aPeNOP]K~@*)MEN8K+Kx}ޥlң 'c3ϊ5ӧYr+n0tMRzP]]1,-))MI+}y>>eڃB8qZ{ykmNQw$ko(_@u=6cuԧzE>sa-<#i<ӰW"%0Lcea }!"ZC?~>{}3cyf}e1޴KuR ;h@d:kj$"Oe 1|Jy<9I 3PG OYb;1'Ym\XGRءȟߵKbGu?ahIP]OXäORCPu3&:kyT70X~׼ݽIN9o5w*zPA>gVWZwkL-)܌#ǰdn&“ڕS)}D Lm *>xQ)R8YĆv*Y(*ET7:l9yFTגD1P zJu-OTẢ{3p8l 8! a[VxH/#ڵIJ᝴BNnT|VzbXZRTSk'VIdmAz5[pƏr 5|&j(n٨ޠ$(RxN8T(1.Zfmd]]dQnLP غ:r^.Ued-9ڊX0Zxʒ人X;ڱJQ%4MTKc!=P]K~@*)յsv{@A w 7@uYniNJ[Uz-1s&DŞp܎Kfk^g q; zJu#(0 fǵ3TXݤ{Pnf==>; zJu#(0 fǵ3TXݤ{Pnf==>; zJuՍ#D+YY9$nfx5=zD߻.Ĉ<&Qqh*)!V7B6[d#ƵFٍB H,p<Le~ YOώRbuT4Q)cBc3UNQvw-S]cDBb@u=: A1D=ZCz(qoy!rH mFC"4@u=6cuz-zzV#ɧU.g2O4L> SFC9dktyPԥ%DW~!\N0SьNcX3T]+;d^ zO<4,vy)/YZ46څш>55Py+f aiɵ K=Tjk42FGLKĤ}MZQ sop󱡻{IۜŎIsа +)յ8clrVŧᥴ/לm}G|Vv۠{v,KH?( DkiTi`)34ZhuS"4&푰Xy~#uۭh+5Yڂ*G|; RHEc_Wnx߿z&ZD5!M6W;?dSTR9!S2` qK6p"l&6fy(h I^X1]0n8ZEL*P]4c$cq#%OK.KHTL\[baȘnE۰I}LiSmNJ:-6.$WZp[&.Gm8tAuS((PTN" 3o&.)bʉjHp'^o[YfWLyiGcD僎I&!97充 ` Ig]ute/2cG'4cz JkeǤOCR)^zЖ ]P]C(0 zJuħGgXF o|@jOqg/n>~ƃ+N˚7Xٶ=JX,,s}v+Ww6c,641@C0VWAT'Yj}h]PT:h4 +)յsW-HwˢAުLNS`4,;ePs 'M0 y0ЩNF"=AnlYԤ$b3C,M FW\t.u&6.b ljA^+ɕ| Ll^$lu0CTW LR];:TM#g& / FRҽ PsOUGǘ#XrG j@)"ڝ:/ۆ^?0tO)c>e*^%tdo YX i]᪉bM eQlu.`2N;RE˲DjVwy}R _X+A}˝V68MyC-CT7 zJup3,J=R+>%Z{^BlKHжlPRŝM=$2@ISTSk+V94=q!&m3!@L"&A^(PT7Kl`fȽU+J5AF@'[]2hkJazP]D(0i zJu3k&ͻP` &A^(PT7Kq9p!@u))!V7;-(4 {@Rbu9fGP]D(0i zJuՍ^5J&Ƴ:<5z;zG/ IBK T7iBb@u=:FHuPA|nmGʰBvo?az a;DfP]D(0i zJuzS~ [Cӈ'Z3GJGJ i|CT7inB+n!ꙠZ*P#Eޱ乷yZH mFCߊxڌedjݒzV#gb.gҫJ) sCEeM? S=$^qW)weI-roIBqI6cdՍnl/e>C5Fy{Z#R ]JEc~ %""\>={GQ9P)p+f aiɵ K=TOU&%Z /<Є\)<~%+({ZT77Z@ zJu;!XzYVZ"ipFxnSͻOOuъOI&y.pcʱ M^ Oxh<*-)e_NJdԒ=+4ϖH>:mcŲ&kX[C;/zœzjh{-[$fD+B&dy^—34&=VTSk)Vǜ2 㼍/rbIhE.VbLfp"ThƤINĶ:p6E=}kt.KΎM##זhV kOQDp`P< _S=hbl"!o*S.-Ky)˫bQTSk'VG}ES'.)rjHp'^o[YfkjY 0q0Er NZ^ZN;s[6ddrm 'ڧiKG7-mª}1_R2 cCv<"JTN.@|ύ+gXF o|@jOqg/ɢРɖh*͠cu^/@YXVnxEfWkCSb4ϰX]5SlHTgjt![=tAua?hGP]OXzlmA[ V5gty6xdPs UYX H'^W2Í-y}2Z9EH&4ĪV K26KͰ˥ct[J1w@bA^+ɕ| Ll^$lu0CT׎GD)P`ډwzcș:K.c9"CD $%;,x;MLQ?i _w~>0v|J)S)[/]ܴVOwR۰Q5]gv&$#U*X!Tq."olTNbW;Hmp6x+;*;ZL]PݤbQTSk'V7iey=PJ!ܬ\i\'hy /[`ӲJGT'*vK6Q R][ ;nOpjfHI=`܍W<b >gt4(ЎR,R q!:Ѝ#3Q#>3\6wf'4deյ6Q R݌ʜӤ9u BP]}1L()R^P];n@+)Օ}8I@u=0 TW3P T)km(c@u=cuWnۺ[[%l[^ݼ0{˪Cst X'7+Tc_ Ӡ@; zJumͯmE1wVQ9rT4k+T[T#u\P];n@+)յc1好5Q<\ۻua  Q`|^l#X)Ġ,@u=0 T^y9Sk䷯o&FіW%zSX&R@ډI|I3;̮ԤDn~0gpc]~MmyO&qھzͭUyźMۨ켞 f+ ڙY:o- d*US:Umӳ*,5P>uA(k_h~Iw]]Q)dozahGP]OXZB.\;cKdLA@uƩ4 k]>?_sv;VPY4NT*rɭڭbjS:ui6r83] wE(_t0Fca QR7Y%YH׎v&J=VTSk'VO Ǔ1U4YƢ:5bbKeVVu{9FFYbbHH'#qwV9&Xo4z]Po$Zl-k/iP@u=budeGWeA ; B2.)4ʩ b9M,L*:7?p_rJ['  .Y(y2(q> ev&J=VTSk)V|?ru#sarY[<-*92PiJS+k2 M]%\#l9P pJ;dR5R:'@tABqj<*(1bu-)/iP@u=vbuхkrZYTGA8ɂ؍QÙuu͓tL SZ˴0< .Λ棫R:F0h]NvA¤DQbJ ["9 T׎D)P zJuV5ݭK 4+KWǔo@=lU 4j7nN^f/'+mUɭ0끝ڨ#V:M-ᙚ=z&7\%Rj,h'.[/q*U -bXÓ[ǠbQTSk#VLv3P}VT׎D)P zJu-5jv@(0 zahGP]OnXo# @.յ6Q R] .(UTc_ Ӡ@; zJu:}?(@ @_bu}] @(NP]O(VxAMP @(@_%P TP]O^1fپqn=g`M ߳qnd6|;'6=ifww#T+닏vYh&o6BzXE-:ع)o3&oXEI$lvT63-z2#^6LdGۜC.{6W<7xh4Xo\-Y@+*ʘסEE'n-oms2`p4ԉr yN&X]cu@gg KKOZvS̨Ҩ:qeb@n Q;~rT$P;k,#oh|(ˎON5_].r[١UDQ'yFܴDt j¸3aNj+¦Eی蘎ri‚Z=|iȩwU洱b&o'}OM:i!D2xH98MFN9T8)5vvhYr|H":B$/a c[-N&b0P8x4F:ʢnuf`(VJ]<XWdmdV}6zPƄ96QIuPby-W:QdUNq[Vu")uե*]ui+kF΍&T/2nՍ AuW\R^KP]Bccb.\S1uuTG;E9 rWS<fy^kK}*V8lq&iz핻*Qѭ1ӀIa)-v{vGOA?&u 7mڔR|7H#1S$Ӝu̱5 ff C|a/t0G_G/< ꬳ)[RJ&K-ޡ0/[LP-k]n'Mlr nGW3v7T\$nvQDoRo7%b=Ⱅ'8A@m x&Lr[FfeQ68pE:$2l:Ia2<m9buQ)0̝m2GI(MP`jӍJ]^# Kuwt?"pwk u:N[Uѵ%rA(?IV0OqŸ׆bԯN<펨7'_QPǺdEژ*"aT'+FabHY^L0OFHpi:Q Xln'tx .Nu0?E:r~P'܁kZ6؟,'JnH ()gԫk8-r J.xMu-&q]' #vF%HRk%[0pDEhC R lM}o;`bNdeGO>FYLO,FrjZW׭΄¡RGuzÝɑE9uun1NazmT\?큅G؊Q"$"j .Ok.uߙzVъj.zi/4$OQ]J$K7Kgh_* *ws4vW'V.pucu XzZ=Pnt𖺇{`[:w~ ǃ637Xx#~mѭf0ѱ3T`(c Vc 1*7p69CۥPIS]:FuoallSƍ"2qkk&-C?ퟱkdI7EMl];:D~RMj.1HR \xՐ+1\a/,L53I?M7ֆ{j *8Un\Ĥ̭~Li4T};1I/Ne(-z BӊT&-} \?w?;޲d, z 7|X=?櫯icW=;+&RP @(Ƭoc9vd,1 vD.gD" P @(`T>GqG7{d׿ӝ>W+K&~uP @(Cun/#3 Vכk@( RTՁF:&ꁕP @(@N3cXG}` P @T=տIM:O O) (;>f,ήTPo 0?c|黳 1Cfw10jTmSB [؃=P @(@ .sEsX:<BkSCYP @((9'UmM|RK$wIsc~<7LNFqL(VTg+bQPٖ]XlqP @(@: [b,R%B.Koef4alG*(SNϲ3*-nWd*7d: St)P @(2 0ͥmH!5ef^Xf{$P @(0} ]?Mgl-4uuD"( 2fH,Vg{$P @(0} ƁluVvaXT7})ZP CP]a#I e3@(ӮnȖQgan)P ) q$Ans(PQG߼컷;Yb;nn=r=?櫯icW=;+&NpB(E 0?>%cAu]"bu9#iP @|A@u] ]gK$RB(ӥ_`MuDuMׅ@(٠Ns!>"00#ROfB5n@(" JcfLNեgJ MP @(Ѕv?8`ǙG0=3TV$0թsեΗ"u1QP @RP_ ^;3T'O[Hu, yT:߀vBn.4 @(0T=qkS;Ỵ:}R!bu# @()`/< <{1TDZ,~NygkXs'ݥ7:RCP XCuqadQ:Id= !`]cZcvăC(*TtSKu B1Qn34 @(HQ]tJurΟogU[ӥbrՍ~(PST`v,ZP @(uh `+H P`T=eQW%s`Z,@2|( 0c R{\ !1`mqÍ7߻VO|u7s?gge"VY'P x =4ӭ@)2J9=XLu߼컷;Y㿹wP)}i:G8P`h@M<'7:6}|,3Rx9 Lr` p@(t+Ѐ"+eyIP pn:(T@"Phc9nyK6-S@^t @([@ Eޡ 5j}gaOb$RٴA^=6ӭ:JG)dbiFuBM}0,dfұ^~y%{ Otoj8P`NWilTyݲ'LP @V 2B.(0 H{P @(0 D.LFuuϿP)/q @(`J;R'p@(`ҭo=(zRSO c羒s\G_˿I4P`Ү5vQ= @(\ݻP @(W-YI<|^,#>P @(&D$ձp@(P LX; @(P`pf`P @(ZW @(P`ۘTQcIENDB`scintilla/doc/SciWord.jpg0000644000175000017500000001402412075650364014332 0ustar neilneilJFIFGGCreated with The GIMPC      C  N" b\^ f"NfpbZG8&}LqW|b#T.3hxxUզ-] ЪXk +oѱ=P1+k2zNH|鏁>ʵ!o&,n ,^UZIoڭuE6VU j!Wg]"n)llMlV!A{o|~7 霗4  ]b/*)69$<%{hT 3- \4:tѳfz3yգZĘ-ȆS:ULؽp,xM"yRqގ _z;r7jZ/-mu\̄-ӦJ¿aDŗT{,Ht5OMwUkmeƵK-!"#34 %12B$5D0 ! WU~(Ʌm[VՏ*:CQt^q{NOT{@e:LZRxz '΍A2:s I)єku2"d+k#2[3!z]2rE2EmA{ncO;O+O)hmi3`7,L*!13AQaq"2?'QQ;܀2:ٸrN; YaWG} D½ b1dM\xQ_ax_]f_-<k1agWcҍWY[؆,P |{CL/{-ou%;dDW=NO0ܦ~+3-[l2fGSݿīÑoQC Wvݞ= 3RύO]뙫u^P5MeUf2~cڝ虍(3cnV TCX3gHBpNbuiS @6 !1"Aqr2Qa R#3@Bbc0P?_0ֈ*ZmTb{}B5?1@p`YwoDoOmg$bŲv]EVr{Lj+btʫr* t=u3Fۮ;mQPg]{LΛ8h,wP[ɥ h}NY3Xy4W/Lp p-δp ~GݨgCMKA~mk W 3*dx^X4fD yG+[{T*;{/+]JW%/}jkFycǢЋF n5jY]ET9T"@:#U7?^3g-V٭&!1AQaq ?!7##%.Q׈O -5`DD"Y//-`\tS9̡k#U'_@.V%I]dbVm [%&>~'҉][:Ś ֯ w&.ӾVw3y}{ )L*k8.T9\0SWumE!LŞ ~1>)Ksز&@.%Nm*POE'؈'%Чue.g\_D(MH5wěbRHSf|IQL}jm?ȼw jv 3BZOO~lB1CO ö #ZH neә>'ߘ9ŅGu|J# a8[w ܢzkq XJqfOR!(nj׹˸h\cⲢ}yEq%!1AQaq?!VsXf~nY(f#xM_P?ZN% [kgNd4 itjV>δKx7ks(*Q|1Xe.Rq H+V6G\g8L6;WЙn v[]^f?E8?"4C&B5ÞM;sP H hQ܂vQEˬ[KqHdz/4}1ۼf3l.;B# eӗ9s`n8'!1AQaq ?#΢3L3A* $ %61~/ԦT~<0%BRBDްh*&ĥcLBX\њMSAD7B 0^`8V_ @ h#_ z<A*􃲉O0QZxۉ#7 fD0|`Ѹ(ag [^WŦaDr]v-Rv`HձIGd r|Jd*,*`ߋ,C~Aټ$z;4x[ZijqJ>ag>/-Y ǔ>Ke/QŴAя cӑ!l،v@{ 6[t묻Ȫbq*Pg+ajwm`j=&]P<2 m8;yfؔ@V`UQG0y, ܮMyaE`k5J ~u[=X)n\ 4x_DED敎IOzk;La63A~8M^S?pRudybD_Jx6x)zV~%}?|0ݩ2VP;䣨~+y|Rܡ.18 Ec3Dp';L0͟i'ޏω PrWүYOPB]-f~Q6S:!mXo`t=%e=uu]|&Ϻ.yejL.oLTNVAe(Wz%ZvPbuoٖ dq}v!oG Dl&Ykk~ q[{M#WM,Ȉ'ΠZG.<.y~)YJ`4_Yi0A7b !li͙E3I0(/eRg.W= A~!F 6 ucÄlsTV[K8T1Qֈs^|~![G[%b uwe/ ZxӝyYߘ;oqpN~!|5 nUn1bD,fsk\Zsj[o-o_Ygi3LjbNqc?q=j++p9Uscintilla/doc/SciRest.jpg0000644000175000017500000004045012075650364014336 0ustar neilneilJFIFHHCreated with The GIMPC   (1#%(:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egcC//cB8Bcccccccccccccccccccccccccccccccccccccccccccccccccc" icm C2)iՕrtkiN=sjggq/&\&XfṪFM%jjBK)e>] .nHCj[%CCHϧgxG^OݍT4dI*ʴjƛ)Z+I-$Ę%Qc^w53r˩+hF LN Rc%iHM44  ` rЀz(.z7X9N"VH]qlX4KL6)RE:I3^Vj5`"l0@4ɛDKDM%4sU6NZSs:Ӈ]x*Yc 0ãMu^M@憇SH I&P% 0g+bhi@UF(|5ΝC)ܮS53sUhqNn~}w]L$4M"L+ IUN. C@!@CB¤/&Vzİ~mx)c\p0k= y..0*R``4)Pmi"*fYJ9iP [id'E@A.vh&R ӌ.{t} s 7Ps뭇>ZA@ so@#@:  Ph6M$03r2=@ges=nßn`:h@0F` h6 ?& !10@AP"2#B~I["!Y??Cc{ݸ|6(ÑodHY Z$*GxNԯqtexp㼶78CNr\yIJx ^%>~>6QVU '3t:#^_RK.%n"ؼ u\~trĸ;:9Db\$=FO-ȇBY}zf[9Iϯ7BKyXUc 7FRD~(8O/P^y>=TIat{fY YtK%:iIT?i߫xyyE!+WUݑ[M6VK iI|\UI2OClPKG/!q+t *οYbrm,пpT._I6&Iϋ9kG5>*{F'tjF[-RiMi$isKlTpV*ijDzfP&}Go&kOp!HZLi6}OYV4,=DzR݉s:wc_J|۾u4@˨HqBNB/d,}ezat'b~T[Cv=x:"1Jr,RBmsO%[fJ".S9_^unL)"p;Mcw!;MV$ #+rKԭu,TE%脬^vY{ B=П [Υ_.M/=cȌ$zDBa'­7qDE6_a:kV:pU=PLCr}0Iem?h/$kЖpmqb414$ϒCy,$h:X[r!|(pbQ-9P7pE1QxF5}CEEq2V .z^G-\\6x{=b7iKE'VPvaI;%ldmi2 u\gȎ2e!)և1Ɂ4<1xpOxDCBqXp5/fࡸ\%HB.!+1cfkB! CX 6ݱw+k򿡩Y0ݳ )E PF~Muk\v3GF56T!C ^3F~^KYvQgPNnqB\7)`u GfBm;}#5L?ɾ Ã0v1< ZIGgf8c(NM;ƽd}u/QN R1ĭh2RNdLj:.arsȣ`S+Ć^#vv7HoRa|7uͨT2C,TR=5>ЙEb:<9|~^ױ..:lY>=pnW !yB8[} gv3¦BuPU1C-[ ZdЋqg{/$aiL~F77΄ObOCD'5P=ppBΔi1phwJ5f3? ȧbweʞ͍#0%ԩ|{t\%=>M\.)4]4<zJX\y{GZ:[#~Ĵ]EV _^lln: .,meQk}IP(ՃhE!e -Zr΃"֊\QE~%…\*08Ew+BDUДuJ# 8)ñʬav!/lPpQlЄub9PEEYCS݈+hEB"6Q鈩^PB⊆Y6GEdF_&{(f߁Cp#)_{9!(ey)=X {Q=&'c>Ѧ8z8n(8Ў2G KI5),2`[xT,BxҴ!^ƍZSKb,GZ;B(c_(:Cw/] JģdwE}/&i|t)z^ Rk435Oe[٣m:/,=3 3 s`2hH*/Ch[ KJ(gPʅ'(XhGsԨ\z4}*AՌļ඼OZ/;Keۅٿ-hBt7ӫ2c7xf,B8dzk1-,\sKH PŕbY:>K+OCǦQPqg\Vh\+~óY2E `Ve3 yԽ-c\YY:10 !L؊76PB5; PQzih)/qt/f*y!3yCȡdر6`8pj;,¦!hx2]KZȐ:bo9Mb~ĽQPضX"]Avw|{(1F P)>.-b!FE͆Pbv,& ׸BoHl;e(QǾhEʥq|4gYGqU# ɷJf¥^(S&J7po:DC|kP]”/ʋ5vhͱy1H4k̞01efR' sB˨8Q\; K5.,l2 {EÏڱB:~WpǘwgjV1VeCĭFy1xb4)z~'+x;2 V$elڱþ9a:ڋd8$10 KLg1>$`r@ ƚmjIW ~7} +CL 3 &W&N)2fpN1<4r@9x1q&߿|'BMKpirINMu"{a aLel'Һ_[ EI=& { M.+OҸ,s( +{([ ̟h=~z~Br> b.rp \B33a pl(;"lWnnZ`D= P.p@$L+)7y[ڲ=tD2^ƿKw];ʨz6 *Y06]q0яDi/Ls߿NjK^m8* vP8v)'MX ]7p.2߽ޑG(ORY<1pJTqjPa+ۍd$$Ϝ5$9t&އ$, 0 ˆ/߃B||8p"" p !! 1A0@Qqa?8 w|,vNz,X2r5p{2max.bL =[)# ;eVOaZŸm&wb X3z῀0{ oL'-zK6~91PD!׹O>YBu 5k?:d>Yo>~_a^{"M g[߸g=y,pzov@ 9lA4q e{eSe׆y<:6ZpKwd#rC8'BKOâ&gx֎2O2?ADُ]ۥM>pd[r,רw$x |}|rnɞ,6BH7 L"8) 6>YpqX[.ޠ&|ugÌspj̹OS۟r], ]|$-Q;g c&="ٜ]{^܏Q⭞_܏Sӂ=#?#! 01@AQaq?pc*%[YX"mJF A* 3W?',x*r8 #,T B*TWEafW%X~Į0Ũ˖!_p>슭"W)(¸bp#*.,` ?p/ob|6Jn55w)oӈ_˱Q(Oj(2+DdT )uPPlOO6z/0ځEG ?"WUةW[Pxx\L}D(w_}a?ѩH?:Eא+X.ِs[T.V/a=@nEz[PԩGB +XQD;W.8!F{@y51GD TXU lj.gD*xR+2cpl vLZ9X5űPo׉w10e_ TWvFa+W$C )ĭa/0hl Eİ`q Q[F{ep2KaK7Pk=;nʲ!2wİW2'\ei#URlQkĽ}O&j/OP[?sA&2r ҝ .00Z21c52*bs70Qj+u1ߘ=sӁ5֠7]s>^˂Q"q T٩Xb?]}:xj^J]#orpCs#) }I)"MĢi˿2Զ)IbQk4NԃWWyk ~zP,pc& 3} 爹fø:m(Cfm8ĭ; hW1#UE& qiWu1_2l nsCWsj^ 2}B<>Nᒫ0Nq\0h1n1 )]&e喵 vDuC?"n08(3rGw8;C+fUJvzl-̰UF3)AVhR!,ֱj\yL:\>`aJ,$$*]^ +M"5#Qq\8zwܥ,)L2!L0p0x_©Җ6S xYMGJF KEgU y!2;^||㚅hJ\;@sĺ㹃f/)f*nYyx()bԳNtPJ;4=?.nU]AшVq& JpʢsTU=TWԵX.q8J881~b[W8!g~&oS9tu\3 1ĺVw7T`̶M.H@1GYv}JE.єP["+ak屬<?ښȯȹ(]d̜耋h-mL=ƽzU[,09iaY]AI]'+@׸x1+5s|QwJj87fmGĪo|A-3iCj`.4}KD_nsEtpjG[{iQ:Z0t8b6qXSSGrndoĻָpj('q^&8X A\73\-qOhL%k+.-ok?ŌN1yVfFb.5TLVsѸ6x/cމ_QBo3Z9ÉXji+M-\ USh"nsuq-\Tz6 .ˀԡk?'}Dij6k9DDy(שjKF!2yk }ATYx2@)U6'R^LhsUa&paƜy^lZtJJkqĪeqVRy;[qvkeJ1K {.`'X%$Kֈ?A* 2j'ZŨZ9XpXާJ?en5ZМ\ІCsf8' Qþ#mOԡVDiarAĮ+Sn9K#U0mF]Cx;Do/;?1*\.89`o'0f8Ԧh+e[mX LˡKz%^8*k|̗Z%RG@v׸JYU><+yrU^.P`™Kp %a5q F`Mq7( bf-[c9oTt &wRâTyṷ`B`U OYNA`2Jp2 rĽUh{5SQЮ j:N,f9*PW;rAJ^e?qQ|Q=ȜndL|s/Xw ~"n#PoZ|k10 (*qzb+qiYĠrF&^ZPˎW$23@xʼn!qr0 XiΦY[* y}k,,(iup3{A㈗Ѣ nC! Dm!d6p BQW!ʇTP1<\s\LPpL]eӻ>:od:f Fdŷ}MB'08Q&n& iP(hu. G2XATwcme&G N T7}ԣ[J%8GQvDswĺ.=)+_)rvB!ypjisg y35H󏸋}/Y m&UxfFI\l̲q8o[1s\ uUK̰Xè#eW}fĴ⡜^L|eA@w8 (bYQsnLu0F -WVQlTt =Ե@NU*ܘP9j0*:%@9[촸?/2ئLULYZ[ lO$6F}K~EBv&̹zqn;pKQuPiI]0CJrbnT>eɸle7s.1aqfq(1iqa(q <i(2ͣ5ĻL5z2=j_<T^Q[Dxib/fU6\ 8R373X!ͻ.lu6%." nKnRQme4Vޒe"ݰve_Rƙ|* bncpכjnft.fe!kHaØpIvcP[Z^M3l&1 ysn\.gza2/2i;Wpd1Xj /y^e."Jͬ>㵰9̬30*ŋRܰUPkl@%,KZ P̹5-,;"R7Ph* WVu0mRŴ4SDKV.!b΂5[Qu)f۶7:q<_F YjW}ƐJľk pM&eLKG3=Bb<#+xKBa0S _ )D_01Z Ž01g3lŒ*os7) 1 \,.a5'̫lD";EmxT# %9Vg(P1 ^EX5[䅗Y`΄i"^E=Jh%6R}񱇆4˙CTSyg =@kuuwģ7 K9VU`w`䆕7Yep/i9Rt(Bhnv% t)6Si@856E8|x̧ݽCScn`JQ0gaM`u}@o5,982ۆx*`9Qο)pu-4f/zIjrQ87A#pRn8s E_}ts+588g  ~c߸S%ÃcWW9 `+2}ƶULg.F A}@R qtT})x5z 8`Uq_jbyToP50ާ ԫtQ ~+ܥV{cGZ*MĻ!ĥn;Y0So؆.E Q V!p01湅(PSd6esjm͆CV?82K "&{%)ߦ8k@2PsQ} D)v}Joɘ^\j K5L͌%ݱdt@|* 7,dduJGUFe2 (6dBsaf*Amj.w9EÌỨaˈeɨ蜪[DfRT0UPpSQR``'Pb3 FPS1v:C@7}\4fLZ pnRWQ5[TnൟWPշ.X,5SQ."J9sL~]_3#/5 셋/$'&O6Kgpcֹ&#gԤi̥Fqgdد$n(φabF.-:1幑ɹ0qPm#@` *,rTވӋ U:T`gĽ*hM!-KZ,Ui!}sP"ql?3pcRK+ƺ͚Z̡FvwX'圃2娷O9ݤ%ANrB.y@3,nPјGp+ܼWq/W~%3zX%уfh}D]=B`0U9D61T-G20gj6_24 Y#jW2e;H|us6z51. cY4QSy6)Xz`Wtޞ 3LobZ#GV3]$䝲8:gP+󪉡\}C1\̎#eR'$d\B,&ey$4v Y̧{Jss:ywp2CpH'68Ǵ>N%TÛʛ[ȢKWuӸ1n:,/Qu2xVqsYB0s5L>W$G>X &ɹj?ۖ )\s) Vj NӭMUq{Ծ978DPrlͺdfsܵ&֟[wGEjKk*~,f^,cI+iuħ]QX4A',sP kjC, i)+p 4L$a֞j j%J5lR豅Pf%a. sgjSS)]up@;eb >g7p|yb7j)U)'SF.(93$CH%zrpXm`U2z\rT~ |OY Ⓗ Bx" ᅮPhew/( $eY1("j`.\˺K0]2svYԷ:C@YiqC&mu\ĎYn`o0fq1ka@%ψ1"抅)xa~`584ݳ,n j_ffN8ܭp3Bħ(Mn,d8%^&eu4+be,6[2mqw 5TD-'3K,fLY U7ܵp'mL J/ !m )1稂LW"R-]fK&Cw85Wrʑw+Y8|\:~"ψ%T&KS5kZ\ݤq4yaMy& LXݓX g!hSȇNĽ|AY2jT>j>hO0s J,2lKgeṎƟef~9Q稶%GV0e`56p&5T?aN^ |B;`ŢN#5C~Ap6VYP!^e Ej̰3/ scL*8[2TեQtOģNGXAiy\ÁW%]K39){K*(M+̫HKŽ\eO,)gIJpU4faL0F\ 1Fd{ x*da@eqyNu.!oQ%?N#-m᪩@@Xr=Z԰ 0)gj-ZdeRn4gg_pUT0fqS"L4O=Wj׉\K J,6G.0p qp.r*j |\tvOST7ܦEg/Nscintilla/doc/Icons.html0000644000175000017500000000316512075650364014223 0ustar neilneil Scintilla icons
Scintilla icon Scintilla and SciTE

Icons

These images may be used under the same license as Scintilla.

Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.

zip format (70K)

For autocompletion lists For margin markers
12x12 16x16 24x24 32x32
scintilla/doc/ScintillaUsage.html0000644000175000017500000005556412075650364016071 0ustar neilneil Scintilla Usage Notes
Scintilla icon Scintilla Usage Notes

Implementing Auto-Indent

The key idea is to use the SCN_CHARADDED notification to add indentation after a newline.

The lParam on the notification is a pointer to a SCNotification structure whose ch member specifies the character added. If a newline was added, the previous line can be retrieved and the same indentation can be added to the new line.

Here is the relevant portion of code from SciTE: (SciTE.cxx SciTEWindow::CharAdded)

if  (ch  ==  '\r'  ||  ch  ==  '\n')  {
    
char  linebuf[1000];
    
int  curLine  =  GetCurrentLineNumber();
    
int  lineLength  =  SendEditor(SCI_LINELENGTH,  curLine);
    
//Platform::DebugPrintf("[CR] %d len = %d\n", curLine, lineLength);
    
if  (curLine  >  0  &&  lineLength  <=  2)  {
    
int  prevLineLength  =  SendEditor(SCI_LINELENGTH,  curLine  -  1);
    
if  (prevLineLength  <  sizeof(linebuf))  {
        
WORD  buflen  =  sizeof(linebuf);
        
memcpy(linebuf,  &buflen,  sizeof(buflen));
        
SendEditor(EM_GETLINE,  curLine  -  1,
                   
reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
        
linebuf[prevLineLength]  =  '\0';
        
for  (int  pos  =  0;  linebuf[pos];  pos++)  {
            
if  (linebuf[pos]  !=  ' '  &&  linebuf[pos]  !=  '\t')
                
linebuf[pos]  =  '\0';
        
}
        
SendEditor(EM_REPLACESEL,  0,  reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
    
}
}

Of course, fancier handling could be implemented. For example, if the previous line was the start of a control construct, the next line could be automatically indented one tab further. (Assuming that is your indenting style.)

Implementing Syntax Styling

Syntax styling is handled by the SCN_STYLENEEDED notification. Scintilla keeps track of the end of the styled text - this is retrieved with SCI_GETENDSTYLED. In response to the SCN_STYLENEEDED notification, you should apply styles to the text from ENDSTYLED to the position specified by the notification.

Here is the relevant portion of code from SciTE: (SciTE.cxx)

void  SciTEWindow::Notify(SCNotification  *notification)  {
    
switch  (notification->nmhdr.code)  {
    
case  SCN_STYLENEEDED:  {
            
if  (notification->nmhdr.idFrom  ==  IDM_SRCWIN)  {
                
int  endStyled  =  SendEditor(SCI_GETENDSTYLED);
                
int  lineEndStyled  =  SendEditor(EM_LINEFROMCHAR,  endStyled);
                
endStyled  =  SendEditor(EM_LINEINDEX,  lineEndStyled);
                
Colourise(endStyled,  notification->position);

Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in keywords.cxx. It starts the process by calling:

    SendMessage(hwnd,  SCI_STARTSTYLING,  startPos,  31);

and then for each token of the text, calling:

    SendMessage(hwnd,  SCI_SETSTYLING,  length,  style);

where style is a number from 0 to 31 whose appearance has been defined using the SCI_STYLESET... messages.

Implementing Calltips

Again, the SCN_CHARADDED notification is used to catch when an opening parenthesis is added. The preceding word can then be retrieved from the current line:

    char  linebuf[1000];
    int  current  =  SendEditor(SCI_GETCURLINE,  sizeof(linebuf),
        
reinterpret_cast<LPARAM>(static_cast<char  *>(linebuf)));
    int  pos  =  SendEditor(SCI_GETCURRENTPOS);

    int  startword  =  current  -  1;
    while  (startword  >  0  &&  isalpha(linebuf[startword  -  1]))
        
startword--;
    linebuf[current  -  1]  =  '\0';
    char*  word  =  linebuf  +  startword;

Then if a calltip is available it can be displayed. The calltip appears immediately below the position specified. The calltip can be multiple lines separated by newlines (\n).

    pos  =  SendMessage(hwnd,  SCI_GETCURRENTPOS,  0,  0);
    SendMessageText(hwnd,  SCI_CALLTIPSHOW,  pos  -  wordLen  -  1,  calltip);

The calltip can be removed when a closing parenthesis is entered:

    if  (SendMessage(hwnd,  SCI_CALLTIPACTIVE,  0,  0))
        
SendMessage(hwnd,  SCI_CALLTIPCANCEL,  0,  0);

Obviously, it is up the application to look after supplying the appropriate calltip text.

SciTE goes one step further, counting the commas between arguments and highlighting the corresponding part of the calltip. This code is in ContinueCallTip.

Page contributed by Andrew McKinlay.

scintilla/doc/SciBreak.jpg0000644000175000017500000010147012075650364014445 0ustar neilneilJFIF``C    $.' ",#(7),01444'9=82<.342C  2!!22222222222222222222222222222222222222222222222222" }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr $4%&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ?*: C[wui~n6FMN71h_?i%tfƅ$ pkDxKĬ&q F<9K}-t4nޭȈ>fu?Quv9#jJ&u8滚F~nz?ANS!qhU>Vڒl xQ?!^u|$5;)ס'SFz\j#@v %(!~FvXu5'2 cKuYb =p£;IZ:S\6CFۛtw7+v.#bq`+МcgUoFfk$MOB?նf\qR8џ;JȐ(7S.r6"sOϧ\5$l"dR ԪU $%#ZMԴ WF?_{=DW@ðj"c+>ySVEa4ϩi"}ƻNZ/-뎾֮NI"tԣdyQ䌱PW&\A%(á#f>hZp2=*9nae1RUSXb*8˩(gxPy{ʟ·<-` \“C")"8ltWXm%?ϝDɏ-gFѦ݊G-#ىcJLz[%sG. GN{T, j}jƓaDIQenLg+E sy+F3Ƴf4rDu7jy֑_) oQZ| 6+2] ֍r ef=0~BRk*[>m3I;[4j+'?JKI~x֗1?]KDF9CxOK#.n#`x(?t֋mnV7q8*"_BSc)~,Z~Sܯl1/0Ƨjd񶰣}|XF=i>='G gfJߥr&pŧpk(:t)8[Wcmz {hֲNwog#1+FuI32 J_ 2 ]Xň2Ŏ)M$\UHiCUK:KbeAR} #ZβeVb$i:ʇ MT.pV+GF EW9izg}+Ye[Ը("7i6W(^3% d'@T1cg2R2ut[w$.Y`O˷W`cdeQzJcrQ]+ ܮOIŒ 䎆;K9ZW3Hќpz$Q:5ܚ]f'd`}O^w$Qd qI]1׷QgjgA e' w'Dz7Z9Gq U- OL uW, q-Џֳ锪-s:w3$ɊA]:+p@x Okj@%7/"DhU]bzoIܵgAy8t;q^Kݔe!@gN}Gn4{%]OH8_ } Rܖ;f;_qko^5Z\&#ĽW?cӞ=+ Ve`A^=ֵ#8S.]Q}> ;>teYIٶ<7xE O^sgr28k'^E &0}GsbTuPzt=N5!s̼gtNc^t;;9P{FopבZ6B4&2*昴\6j]—w"I9N)]7΀^ĿԱةfh Y}@aco#zmڡX~ik9{Rɹ7HAVGq M%nRA~5Z WkbFV|}+ `C!e;,VhNAe%6H7gۨ)m2x]bqfYMꩌ]F $9{}xr*Tʧ'F-k'^siSy*eS''54sH5$ W4l5d?OaI4 ;؋&Cr+K͑ q>ݫŒ98˕limt){Ȇ6;\oSЕ=sJJ݉A)'Oz HWIZ8S|{KEU[*GϧaWW$PRV=j֐]/nU)VM%k^t0GοQ WdʒdjzeK\E_ ץCd4rT=ys(h" u]e#+}y?Xg 8r uQ[ʿ³xZˡ_XsaT /dlϨ"[ŗ`u3e?= m !60I8AnadF809HY^Fh\SƅXj`VVv#ӯP(c>fDb\Sbb`RЕE-|R<˺c6['lb#\~fآ[: lBvst_ fsUqe;^[\ۤ&K bԖc&(=|ɧV˦W7Ph*$Hּ:rhaqfY^&u&_jYUGRAQD1`1LK}{ M#du_oi^hm`{W_GTH-1N3kA=4JI9=Mz|Ta,T/uƫx!siKLz3uVݨL}&HSR)'އC/3kdasn\ƖOzmM&CUb]OJ+iy0j+3şӬ?ڵU/ݿQhINRi=Ԙ85VMB%jƖI9gP;Uq®ԛRBxF??"cVۮ֭v5t'5IiGV&X#4K[ Q?/ڿ4*?ʗbA;z,7==ItRdWE' $ot3cVx•$sdv䤧 Z\*Wٍk4,Cv4W|59ޥ9oD?>$\5dϖO9WD2@S(*{V>NF3ޡN M\3Yku(Ɵ|zN}Sқ#%ynzֳ>D}F{t?ppg~iՔ7:%娹fY?2}ucj(ouW(ea]mJ&ȋ1w1~9Rr:VnƤ=;]Cyޟ;-ޱ-J4/oJսxʁz_2j s [T9tL|a>ކXYoASUjx%ehsظ>㱭,ZjR9|df.~j}TAJ7FRt^~jDiխϪgILȻdS G2E;vv'҄W2 = $ק}2;ih 8 i u=+ձqBXEv^4tܹB%~}kmMBO6=~qb]T@ 0)J3M'5u$&qJzSh©JjMR-[*x$=y>|_+cܸ\ռ$-9h7sc4D2FᚤA㚭woov14'I "v²;`N$;BIUHE>nGehg]8/xu<@WW i=XY;/蚝7O!9*b@;r~ .M6]K[?.2i]_^[م[&C*Jf~Fn$va+uHF<+b.g25}wUbX+$H5Tj7,퓓)mx"OԓW<P(J:nu6FXƨXQ\MѵBmJwPxb33NQO応.d= di%NR6J:[+yIWa,gb&ʮ Bn3\-藗SŴ{׎kJQAzh# JKwPWV9+; u@+L>glFֹ]"k?Ls^*\d)+Hn$?p}?M 'Ҫ^Spi"UXξǬ֖9Kì?笪W #6?rڍn*W X $fz^q tD y=zS6.'h"L٪+O̪rWQG/N+2R !cN>!z.MBOlP}Zk,.<. ٶF^]SonH ~&r j6.kz9YEӭ]U[x3*lK Abrxh!%WA`Melq$)eLmh>+Ŵe\@+~'ȇ}_1k4f[kNjx5fAt:SgOAHkfˋWta_<Ҋ1@^iV'D(QδPpzoq/s+u~U20zW6ma^ڷXq9J[UJVVq# 74gaUSFcS!}ϭBn"a~cP=܍pr=VؾUTe^%wV{9',I>\; ,,I>p,d5hw+F:Jҥv1E0+nt- hj誔DtXW:c!Lvf5a`0u8#Pt09',4o 4q#&ϡjKpVt܍1TuYP)jv'R޶t:j%W^hXSKV cpp+>{\Ivdɘb,"G\U{T\1z@4MI.0fi:󗱜!TvdWc]&9bCpCUCtm#erc=2I !`rxzQQ.pQ֧R?Nˋ]+gwʨ$hw&돸jiOp ,xڒ<} 6s@XmKY-k~XX}@W?Ҭ['Zo,=sm? &\bDV@3lP('kTy{*|r]*cV -F5Txd~tK46w|brvK~t[vۉz]H-N.  wS4fOkQlW;WwO2Ao .3=OZϮZBd:6EHMtvN[U u"֯U8H_zhw02s~^BrWh˳Ӟfgl~Yv(Z%.ͻ#;(H9劃FVPT`=7$c'YokxeȪWQg{nqzu̲䯧(ùC'?{DV7I 1eNޞ nZ$)SՕliUnm$x~/mA12Zt7y[/DQRnsGR5 :T+FfȮ? ݺO$l2NksII^${)3VhPH82iSHjTb尚|+:ew;Ou@ pWtf]Kkr:+ҵ9f˺G29W^V2.n>Yu7K za5rF7^SqZk*s&P,ǨHjpeR6$Te^ ]yiOݱ999.]nxe\ j t'~Lgc$M_< ;7T3X`@<Ϊr1O5L_F#?Oֽ(~[Pgiv2>OM=sH' !3HsR#jEw1|5i -̣Ӭ̳Ϛ>RIb?(ڲ k sT{5\\tc&QZ&])"Kռ8ċyx~z8Z[@O#nN]MлY^= rL6mDtg$txLJ^N@$=҂ӡ^t'c(jn<ݣn\Q* AFy@=:rQM FM(cgos BX%INFkaa)ڣ5c"<0x_=uVNg Ma^!Pziixx(rl\)NՎs-/9 RlTu,qMZҡqb#FTy'hNi,f=a $ 9<.Or]CA>aI]n [9;JоอigxxKmc"y  {+Qc2+9osYmf+r?:6,$֫S[Vdү- aUP 'ҧ(;4e떿le_>둂wvUa%uzʌ7v&j/i"Jg(¤/_TӊVI'hg旨,qXf)VCbdkIՐQሶK)7\s۬V#XfmŦ[G3('y^]mAjIr뼱E8o +$iiH%~z)$Lu޵2KS@qu@i6eia]3ǹgV4榮*'dQ~{t58 /5QBnOቜ\l[ x};0-ש3 kTu$t"F}FMMfX>,ݿjkm3LQx}oYj#*JɍId_#r߷brpqIʱ0{ʷFٽ'UԴ 7Q߽5[̸i{/ʢqonoT(|<(5oo#fhg'$Y1F?5|^\5El|`0ܨ$x.2eÎJs\"M𝿕ۓղ?Wۻ "K7B"S"BM_׃z|F:c\GMt~6G0~X?s\'ޫ⾓ Z1^G7y3'$ֽ+WP܁c͟ҽݞ?Pj+Qfuzi-Vyp/$Vlosz,Cׅ=CoLW?$J⯛f;ϊ_.TtÀ+_fG+QGYlSv[Zm̸?~ gB4ߩ[s]- YTu'~@s*7Qg9?4Y:S.)\tP¸_ItzҼXg|~u׀WdM} D*WM/R3Zȋ_& #dxyjK%쥔vq?@O`kGI'{E["eop+ 56>k ]NoWE6X=W?5>/h#T^_'G6#մ*Vb9Q]= k_Dn'i^>t`Mvҁ֔}Xѝª'0 C$kEE&jn?etSn Ӫ +Uc)KC/$pOo n*)$xk,啤?CƩ]:!Q}O=wS5.ėr45x_ICiuiqQ8+?oW Cc)r1] ~@yݣ(G8fh+sǭ~\3U}:~pnu OQzIN+zӘPSXo$V+(;m6 ;3&f4Qh뤪]ώcn@Mk|'CFU+H0]lkq=4(G;85\!ɴOP]uk5,/3z .K \A"X,WcmŚ2R/$'6HV3_ fi|ЊFdλ {'kT?Z[/ 8m(zTk~S Q/TZz#i1XK)(jݶy:T1~3^AxVZBu9sU_ƞ%7jA@Q){ pu\}Ibq4>OP]:׵3=7r mȇ hZk[G+?J,ﭾfIbxp3\.𷚽Q$u/TfusrRVBd=*U v-TW;}O'i 5]At3WjΈ5+qZ: !,Dz-o/i%MEEK0 ?ꈰEct@aO֮//,O4y!9'Vcu^ɚN H2IX%MdGk+ f=#ks57r}i%-tAUSk8';ޯy:=>{>u9@R4x^& ^\cy[S\ų%S&9SA>UWGeqk ђ[g$Č~OfsUg՟qV܀#LI#kgOr]Oڵ%4OBPLȨ+)=<9nbT HrSJЬV x۝ֻ[)}ͤID/+,ϠJX<74}/0<5BsIʴtB"ÿuz; VkiMTbWYTȾ|dtЋ/yjsզЛ.I>Yh|Ҋѓ^w&uy`Yyv臱4ӋZjP^DyW=x(K -є.֨4X%XhDf):Fp~5CVBԥT"yN!50]%?5yI9zΝ3J24Q΄x÷3{Nv<}}Gl+D兄ᡃX wFy) *:T Ϝ_EdƼ}}K˻ܳFm_J+SIy/+LDžrw g8uCWJƮakPte~H۪z枣ޛ'5urbSA>uM cO]JɑNٔf6>ƼxfUdumPk ^G9~ g.' sF5YZ8 5cdfa$հ@`WOH23To]!#cE% -'ckıi7l>`lVt'h?^cRO-?"սM'I)j5E"m6* Wu+5"([j&l7[~e)ŵb!4ȯs!]1Yw\Ldlg NV݄8GM6?iHH;[xIDtmǢkȽrgzu"}7}sWuҪVR9O"<QF LYɤ'8(t&ƱT)cߊ|ρޮ*Td1ySgDR&UHTȶ@9>ǻwP\ܚy,v,NMii݆6 z}j ړ:qM\pw;?WԆ"l~Wp+| GjakY|L6p}{?xikztqPbqoX{c<0luc%*ij2) ➣EIU桚 %l?YHR%&%s>bZ&#pGzEtoPqf4.H6*øatcRdyаTD+έ26w':(s QcH}z#q]Ӊ<3'bF@޳G+bS_+Ӯ~rm/]?ٕC~%C4AЊ.f~kWZK+s#_פ<՚ݣ!AfcKmGtrO8l(zzrZքZnYP&AW)?2?2F+rPEi2~?tT6V*d"B_jBS2l knMSJ'9xHuʯxV cҲ$|cMV#uUbߐ&>T>,[3ESHCGFA6v2\o37:mI$uǘz3Hl] 3/a"}8vg,>$~|T:*K6GOWozQ^\󧢰ׯXAM6OcUy~o^d<J_W.g?'F7m[7ZpE5^KEr>.*ڴԮ>ת]g>lI5xM*AEk;9341uK~g_QkF7f  ,&# 1yO_Sx~;ö`mQּV^gVj&z6Ǡso#AWvwT|j"I'+ן ~Yo3Y>N)n|4q"z5j%sɷ4*K[LʻZS5h)SS'Zxۮ_y=UZV:$RY; }Oք-z5Z"ҩ`unarƼDuYzc.^Be=]~frͣ8r?5+W~Z)b^Cֲ<>A/X /RXν)/A^:ה 7x3Ȝ^F1wQIi?|ְe$#iuֲ%HW(Mpz9o1 _i ȩ^Hkk:TLbYJrFX֟ 40gM$hq FR5iR<`BZn}|?l矞X~u~,=j:93~g&@` f?*~׮p^;u=!]ѬR YJf'ҽXVz"N1w11ہZR; cz"Z+vip!bkO\ιEНX'.2(A{ugFU䶘`GnƴCw^kύgefc\h,7̱FKbyk -ndpGX=ҎG;l_j72jcw+.Z,&yTg\_u߲\ 6oݳtFסd\NsdE$O55sR{yc # RZeR/X8oTrա%+uy6 ?ݍwK; =1 @3y:6KW>!lW5+IG[XӠl0N4Dϧ *\pAk.!o2SZKKζJZtYjK#~>cOeyzcxsJ?fb=3Wޡ ^7gW_<"PyR{Y6"N&rI;CSzJVC*˜d`QZ{Xw>PkGbeG ck)86i̋\G>|ҹ<OdVWZ:~-}h$OQ$26PN\"ە9 yjY9V =*jn ܞ S۫G>c@T( I\*I-LAY7W~t=7 --ilaJsv\>a;KYuŞs5F;W-s?}#gaNW7g.PJDnt~C+GE}{ZgMRܱ.SVk33Zͱ].f#C֐zޜKR-킒SJYɴjخSp[pk(4n6' XVY$Jb[S| 0y{cfbl}*6IKbݴ=8X,dq1^cE|= ;7##ЂA+-'VSnrOYʝrg[[zKIMc/ 0W=ЎƖ9V.#C.xvPvS-l ҏ:gU6լuu#+{sSeSOwAo`-ؾ{K&u5f c:uȍ̇ mo Kče? 1 =2#RCAltakI籭-WNOw%T8x&P=ѦKQYx .ʓȐx'N>2H2Mzp * sDKn>TZԬ#F1/dtQ[A<]հxRQG KM Փ0GZBiUp:p*MHe*,/@u0Fj:s׎ozZ `\e&؜:f׵c9FקV" xYAc ۤRǰjpjJiPqŕ>oZ$eq1뽀:u'..u[YZGNR]4jyv#XR#]ۊcjv\dfh7RP;VP5nMle9w٣`Xt 4I Fಜ8\ڦXJYw=JtB ,fLFQkOʯWhHV9ۤ3|~[E+͜ei+3VR/Ƕ;-Ak10FA'fe^=>QsEKڬmVO VSZ>yFsVcƑ.E}ֽ䪡'Nz;eNO&LcYH`9-fE3xwa *{ULFX=Mc}-2>d9vϷaH(ka3 oi2drOssYHlu?5P+hCi:q}Pxj EH|6?f\i:h%' YAX\1H d{SF/Ƭp oca@3 fR5k_C?7 s^.⽞h$ʺ7>]ۡنi[V/2gHkT*`Q"uRHQ s*F052GۦqW0 cs;4IAv-KjgVʢ^g#C,3fC8=CUX-3#H)= emב<+|F=̞R4Tp1]=ލqqŖ5^y<ݪHLǯr[sZz?4{fn9s֥lu7 JW>_j}ia}?zb(Ӓ՞^s{憘Gl~C]> с3#C[>mT*YBЮ,N.$KM\lj='Uvia'`1!O^E=k5j9gN൷gH*.sjk$zAkzVqR:Jnx>qR4[$T{AefQסfc*˨(5x:$uv$ܑ~Gm?ꡍ?P*jJRrLRRY8J)qIQ-U$ ZKIKZ!(!40?O PW;{v`򪻏a:##܏SYLr6}$cޮBQ[F#1R]Y&Xēh#:`OzCV;ָhU,1HeL2ب0HjD Osl2*ʹfYGCc/X[FJݶ QPtjx#y;6"mek7gC[ "F^Yo6g}YXHs˞[#=C`dV͎ ^X|[ra,@ VgVV!5sJ\1Y[}ZK(Is[WMShW·ҹV d'k-sFA;`6\굦!^}뤲q-L;r݋G29O0˒롭墶2/"Q.3´X9e4xV+Q%s*ThP˩Ĩ=q.d? sʄꇠT$zU28ۦ'XRnRUB*[)*aބƥpUvk%`ʹTǡ>"`3*X匒:Z~[M7w^Z1r:;4vJ"ps`z;-55 Ex>G<7˱YHB/VVZfW[ &́n*}_w:''yntq GF`t{A{;W蚬Zƞ (eFvI}Zk] #n#k:xQ'~fQ'TԒ SOYp7!5sOETJ1#^^K9,ѿC^ x<=%{{6z^bx،pzxؚ1vSΕ[I(e`TAҸGMLMBh*$-Q2"E3tXb".$}GFspZӯֽ%$UF1>*Ҧ*QSGxCMxg&V!?tewkmǗ7i޹KIm&IWR'hy5"Zǭt+y䑚\]ձ',NT6S"I?=`}G+4:1vD'^?EW[I$cl̘ɺH|\50i7Uc-^)Deɫձ'֦XFbUҤrd{i ҚG X"E2ԈBN.)G4 RKbtN4 M7y )D1l!/ҝb{R5٥Z*:KWPRfS4U]tQEƒI)\)*[ )(4Vr A"t槦8ȬR3&Z3&2m&pGtX0M]5ǽ)Xj夛#3✑Y6]RivwcRcO H:)"B)j(VŠJZ&)h)i)jQVZJ(>sl  AI"'#TneX;]<K7JTtQWgUsHg Wb4riZz6ItU{vvΡ(phM&0> ilV _ o%XeGhmȬ!z ޅBĠtD91lN2*ǿET'W. YJO>PrԂd%Q+GWүcQ-E%v[eUE-YapRT^+QC[R.A튳gH:VWp3>%$P@l*~lI%B .0\~جWFT$*msMĸC )E64+c0+tpVOʻk ƶDM0[+>JGƚW_y~ZhڃT}Rcſֺ? śឡ⹻59I'y9v$\Qz|Z&c? ?)U;F f[ lj9 dFQ}NAiSȏ;}??ʚ+Ts(iz=5Wl s _˂Ws Ǘ,a~T8lfnCOzNXѧUQ%ծD^bu0CBÈDyʌ*vU7K5}-ѷTnERmhZJ=LwRBPhzkir/QS]>~U_"BF<ɤRߐ'^q÷½kEgecKaܦPrW:b!,#\!hGhxغX ߜ?׾Esm45FY(&Y`=KE[9 #l1} tJb[80XȰNGB8IX>W{~[{=9Z"k60 z~8w׿ kv)B}gSRP& [lTs6Q]#io8bЉJ #V xӬHgVeuڕCW;[@7|p<֝ޏ{}XHݻv ]qjKA([htm ӕ>ҥLו4FD9SMB0AA-tꎳQJFWm%g .Ȱ; %!;Yy+YE *>K4!%n;QB?b4$ԚW-BkѥB9Ks𿈎uNI]jYf :W]ׄ5; :}1#S7O72)/k4&tT ?Aǩ)n>-xV5*?1*x⧨hشG&N{Hn-)T:8ZsQR#*YX5[a }"%#5ۼxaיx2Z9$>ν5T\3;jJk 2)D$dH/*G9э{8|hQR${bd~d zWc,KJ[q*(f$mQ7{8 7*ߡD5d'+?»{{n@r®_ͧKG)Zni/x|KTzoʜ܊ɰ࿏;%捏#*IuLNP,F\.d - /tM+3UI#E mi-SV/ȹnzԹX(Z,y֙wٓ܁[95$B2RwrhCre"'XFXBһ{'CM@̛dP»23'>X >Wmx:2عI,coZYw6E?:׭BpsQJxRJϏTsYNř>~W 6HUꄥ9,ߝSI]vjuqnn#!2wRWS1TNҧEW (kuwW"=.3 C]o/p#s0 &ҺI'Yvy!lc%aK6 ʣoҺh(txCsD9{+2@KH oT%}?]G8sYS-Oat^QbP\p :%ۇ,;Qs /᷇Lܳ0yJ2ZgJ2Co]8#ہDZe %1lzʑқsO;,XKys'OMi[|ݻy }LqyO)uB=b᷄r$ߡ8Xt.G4( Pom3TNu[W4R 8~sYIΧVR>ē7U3ɲUI%GW#\V =`&#āLtz,5F쑺Fǡ%Ȥˈuy\(y?<"F=kִ h`<2/bA[cZ4]grú*;d Jxt%\`˯^$z-##KʹCe ֞,^(!cΫwf;ϭu[)s(+کN%c̎׹xNYۈY%?^0!yd/CC_H5wo#( )EWv,#l#q\Ɲ74=N+Ѭ:2'yOr)0e#S8RriFVeFoCZ=6xnWVJUH$&8p2br*k=b6=>b#:vqi)X᱅$>Zpꐙ`ށk\`~LҢN% /y5iiA=QAR+gU)*ɸ`ЊZ7qMb%7enIMIxK g^ \ۀm'!'ھ˚7TWV{w;}MB63a=(b%LF}s8ʮ})^/,O:Id#=s<"NUʷM">fW#ϰ9ۖ`䢞1ۃǗia;QA.+9JȴcGa9+F\FݰW&0Ұ(5=dW."+HލYRw Lꑌt}4AyK1`tJVmqWԣb"=Iю1OIKj{[\7,"V%EI$јeMb]YO*~z@֖Xc#(Rg2io0kJdܩP[Fn.d9[hh||𬒥N1^^i׀Nb֕U:D'77 ά" : o<X_Kw}2K>cʱ%pzFHT]iFP|I[Ӡ#NOkZڍ}cM%vBs4bH',x/b,U.I_y|Ix<%zF2}-m"KH{p*{a&IE&ʅ9n4,v}zFmf3D;vW!^^¨8njۓp3[5/[`c?쎿Ɠ)?.!{&toE9-=k,D#JQ{[oG`[#e%!TVq5x8'/vI1X30ҨӦRQrNIUp 1rx B=Z6jl-[1?/dRwqS[e`zOaV;M⹅Ց گ\iaQ@Q"њ(RPQIY9 Z)(p(Fiy1J%rR pj?3M+ܑ$йjH=դE $S8dR3Z^gȪ94Q,`VdRI>r3T|+HlޕzmEH=؟ᯤ5)Z9o5IaGOU/Ǜr3|2i$[GG_B҃}K<q?ɭdTpz(RIl:(}ZkQE>BR1E\cHY?~7EW5OvI!2lV WWw>;XْW /OΊ*eݘ&s"so*H{%4ߊ:*XZ[r3Q^<%*SL/6F ~C~ xe_x>P0Rt)FVQ_qJڽźVORZ +\6 (R~FR&$xj; EoB9SD d2d8Q؎E5''˫=Mk2PYtjLF0UQG,mkK-E D$a3i>3%ƣo5쫌);P~ (\Ldj՝c H~mf\&AQEyrntQ.m\je$ יͬɯ]Z(#iK/9YF?dծ"ZR@x~ZĂOsg}4D ^}V/r4~EreWDt"LRkֱ(e d(BbYЦuա?`:oRrr,ITBeM>lq$|r}W& 6ӏʊ+j !4gieA,kqF:JĜw=W$Jw:#hӬ6EQF *r=(rEɭNlLzhUıGF&Q^>* kMq0+t IsEF͚B\(lrޓBp} 8Q_CE]N*)Tvmí c OOŠ+zcy<4LrMO]fU!rރ(jqq5NVdڌ22]x ɒMwL-6VEhT EFIc>V9e8ӭ(YNTԥ*52F@ cW/uC@Vx6$@ňWTLIge0 ,h;$sWž~n(rGI"pQg.F⹽?{N?EtЄe6gikOJ"k[s鴏+KD)EIlQEd&( RERZSI4@sP3(T'!EؤQE#sE Scintilla and SciTE
Scintilla icon Scintilla and SciTE

History of Scintilla and SciTE

Contributors

Thanks to all the people that have contributed patches, bug reports and suggestions.

Source code and documentation have been contributed by

Atsuo Ishimoto Mark Hammond Francois Le Coguiec Dale Nagata
Ralf Reinhardt Philippe Lhoste Andrew McKinlay Stephan R. A. Deibel
Hans Eckardt Vassili Bourdo Maksim Lin Robin Dunn
John Ehresman Steffen Goeldner Deepak S. DevelopMentor
Yann Gaillard Aubin Paul Jason Diamond Ahmad Baitalmal
Paul Winwood Maxim Baranov Ragnar Højland Christian Obrecht
Andreas Neukoetter Adam Gates Steve Lhomme Ferdinand Prantl
Jan Dries Markus Gritsch Tahir Karaca Ahmad Zawawi
Laurent le Tynevez Walter Braeu Ashley Cambrell Garrett Serack
Holger Schmidt ActiveState James Larcombe Alexey Yutkin
Jan Hercek Richard Pecl Edward K. Ream Valery Kondakoff
Smári McCarthy Clemens Wyss Simon Steele Serge A. Baranov
Xavier Nodet Willy Devaux David Clain Brendon Yenson
Vamsi Potluru Praveen Ambekar Alan Knowles Kengo Jinno
Valentin Valchev Marcos E. Wurzius Martin Alderson Robert Gustavsson
José Fonseca Holger Kiemes Francis Irving Scott Kirkwood
Brian Quinlan Ubi Michael R. Duerig Deepak T
Don Paul Beletsky Gerhard Kalab Olivier Dagenais Josh Wingstrom
Bruce Dodson Sergey Koshcheyev Chuan-jian Shen Shane Caraveo
Alexander Scripnik Ryan Christianson Martin Steffensen Jakub Vrána
The Black Horus Bernd Kreuss Thomas Lauer Mike Lansdaal
Yukihiro Nakai Jochen Tucht Greg Smith Steve Schoettler
Mauritius Thinnes Darren Schroeder Pedro Guerreiro Steven te Brinke
Dan Petitt Biswapesh Chattopadhyay Kein-Hong Man Patrizio Bekerle
Nigel Hathaway Hrishikesh Desai Sergey Puljajev Mathias Rauen
Angelo Mandato Denis Sureau Kaspar Schiess Christoph Hösler
João Paulo F Farias Ron Schofield Stefan Wosnik Marius Gheorghe
Naba Kumar Sean O'Dell Stefanos Togoulidis Hans Hagen
Jim Cape Roland Walter Brian Mosher Nicholas Nemtsev
Roy Wood Peter-Henry Mander Robert Boucher Christoph Dalitz
April White S. Umar Trent Mick Filip Yaghob
Avi Yegudin Vivi Orunitia Manfred Becker Dimitris Keletsekis
Yuiga Davide Scola Jason Boggs Reinhold Niesner
Jos van der Zande Pescuma Pavol Bosik Johannes Schmid
Blair McGlashan Mikael Hultgren Florian Balmer Hadar Raz
Herr Pfarrer Ben Key Gene Barry Niki Spahiev
Carsten Sperber Phil Reid Iago Rubio Régis Vaquette
Massimo Corà Elias Pschernig Chris Jones Josiah Reynolds
Robert Roessler rftp.com Steve Donovan Jan Martin Pettersen Sergey Philippov
Borujoa Michael Owens Franck Marcia Massimo Maria Ghisalberti
Frank Wunderlich Josepmaria Roca Tobias Engvall Suzumizaki Kimitaka
Michael Cartmell Pascal Hurni Andre Randy Butler
Georg Ritter Michael Goffioul Ben Harper Adam Strzelecki
Kamen Stanev Steve Menard Oliver Yeoh Eric Promislow
Joseph Galbraith Jeffrey Ren Armel Asselin Jim Pattee
Friedrich Vedder Sebastian Pipping Andre Arpin Stanislav Maslovski
Martin Stone Fabien Proriol mimir Nicola Civran
Snow Mitchell Foral Pieter Holtzhausen Waldemar Augustyn
Jason Haslam Sebastian Steinlechner Chris Rickard Rob McMullen
Stefan Schwendeler Cristian Adam Nicolas Chachereau Istvan Szollosi
Xie Renhui Enrico Tröger Todd Whiteman Yuval Papish
instanton Sergio Lucato VladVRO Dmitry Maslov
chupakabra Juan Carlos Arevalo Baeza Nick Treleaven Stephen Stagg
Jean-Paul Iribarren Tim Gerundt Sam Harwell Boris
Jason Oster Gertjan Kloosterman alexbodn Sergiu Dotenco
Anders Karlsson ozlooper Marko Njezic Eugen Bitter
Christoph Baumann Christopher Bean Sergey Kishchenko Kai Liu
Andreas Rumpf James Moffatt Yuzhou Xin Nic Jansma
Evan Jones Mike Lischke Eric Kidd maXmo
David Severwright Jon Strait Oliver Kiddle Etienne Girondel
Haimag Ren Andrey Moskalyov Xavi Toby Inkster
Eric Forgeot Colomban Wendling Neo Jordan Russell
Farshid Lashkari Sam Rawlins Michael Mullin Carlos SS
vim Martial Demolins Tino Weinkauf Jérôme Laforge
Udo Lechner Marco Falda Dariusz Knociński Ben Fisher
Don Gobin John Yeung Adobe Elizabeth A. Irizarry
Mike Schroeder Morten MacFly Jaime Gimeno Thomas Linder Puls
Artyom Zuikov Gerrit Occam's Razor Ben Bluemel
David Wolfendale Chris Angelico Marat Dukhan Stefan Weil
Rex Conn Ross McKay Bruno Barbieri Gordon Smith
dimitar Sébastien Granjoux zeniko James Ribe
Markus Nißl Martin Panter Mark Yen Philippe Elsass
Dimitar Zhekov Fan Yang Denis Shelomovskij darmar
John Vella Chinh Nguyen Sakshi Verma Joel B. Mohler
Isiledhel Vidya Wasi G. Hu Byron Hawkins
Alpha John Donoghue kudah Igor Shaula
Pavel Bulochkin Yosef Or Boczko Brian Griffin Özgür Emir
Neomi OmegaPhil SiegeLord Erik
TJF Mark Robinson Thomas Martitz felix
Christian Walther Ebben Robert Gieseke Mike M
nkmathew Andreas Tscharner Lee Wilmott johnsonj
Vicente Nick Gravgaard Ian Goldby Holger Stenger
danselmi Mat Berchtold Michael Staszewski Baurzhan Muftakhidinov
Erik Angelin Yusuf Ramazan Karagöz Markus Heidelberg Joe Mueller
Mika Attila JoMazM Markus Moser Stefan Küng
Jiří Techet Jonathan Hunt

Images used in GTK+ version

  • Icons Copyright(C) 1998 by Dean S. Jones

Release 3.6.0

  • Released 3 August 2015.
  • External interfaces use the Sci_Position and Sci_PositionU typedefs instead of int and unsigned int to allow for changes to a 64-bit interface on 64-bit plactforms in the future. Applications and external lexers should start using the new type names so that they will be compatible when the 64-bit change occurs. There is also Sci_PositionCR (long) for use in the Sci_CharacterRange struct which will also eventually become 64-bit.
  • Multiple selection now works over more key commands. The new multiple-selection handling commands include horizontal movement and selection commands, line up and down movement and selection commands, word and line deletion commands, and line end insertion. This change in behaviours is conditional on setting the SCI_SETADDITIONALSELECTIONTYPING property.
  • Autocompletion lists send an SCN_AUTOCCOMPLETED notification after the text has been inserted. Feature #1109.
  • The case mode style attribute can now be SC_CASE_CAMEL.
  • The Python lexer supports substyles for identifiers.
  • SciTE adds support for substyles.
  • SciTE's Export as RTF and Copy as RTF commands support UTF-8.
  • SciTE can display autocompletion on all IME input with ime.autocomplete property.
  • SciTE properties files now discard trailing white space on variable names.
  • Calling SCI_SETIDENTIFIERS resets styling to ensure any added identifier are highlighted.
  • Avoid candidate box randomly popping up away from edit pane with (especially Japanese) IME input.
  • On Cocoa fix problems with positioning of autocompletion lists near screen edge or under dock. Cancel autocompletion when window moved. Bug #1740.
  • Fix drawing problem when control characters are in a hidden style as they then have a zero width rectangle to draw but modify that rectangle in a way that clears some pixels.
  • Report error when attempt to resize buffer to more than 2GB with SC_STATUS_FAILURE.
  • Fix bug on GTK+ with scroll bars leaking. Bug #1742.
  • LexOthers.cxx file split into one file per lexer: LexBatch, LexDiff, LexErrorList, LexMake, LexNull, and LexProps.
  • SciTE exporters handle styles > 127 correctly now.
  • SciTE on Windows can scale window element sizes based on the system DPI setting.
  • SciTE implements find.in.files.close.on.find on all platforms, not just Windows.

Release 3.5.7

  • Released 20 June 2015.
  • Added SCI_MULTIPLESELECTADDNEXT to add the next occurrence of the main selection within the target to the set of selections as main. If the current selection is empty then select word around caret. SCI_MULTIPLESELECTADDEACH adds each occurrence of the main selection within the target to the set of selections.
  • SciTE adds "Selection Add Next" and "Selection Add Each" commands to the Search menu.
  • Added SCI_ISRANGEWORD to determine if the parameters are at the start and end of a word.
  • Added SCI_TARGETWHOLEDOCUMENT to set the target to the whole document.
  • Verilog lexer recognises protected regions and the folder folds protected regions.
  • A performance problem with markers when deleting many lines was fixed. Bug #1733.
  • On Cocoa fix crash when ScintillaView destroyed if no autocompletion ever displayed. Bug #1728.
  • On Cocoa fix crash in drag and drop.
  • On GTK+ 3.4+, when there are both horizontal and vertical scrollbars, draw the lower-right corner so that it does not appear black when text selected. Bug #1611.
  • Fixed most calls deprecated in GTK+ 3.16. Does not fix style override calls as they are more complex.
  • SciTE on GTK+ 3.x uses a different technique for highlighting the search strip when there is no match which is more compatible with future and past versions and different themes.

Release 3.5.6

  • Released 26 May 2015.
  • On Qt, use fractional positioning calls and avoid rounding to ensure consistency.
  • SCI_TARGETASUTF8 and SCI_ENCODEDFROMUTF8 implemented on Win32 as well as GTK+ and Cocoa.
  • C++ lexer fixes empty backquoted string. Bug #1711.
  • C++ lexer fixes #undef directive. Bug #1719.
  • Fortran folder fixes handling of "selecttype" and "selectcase". Bug #1724.
  • Verilog folder folds interface definitions.
  • VHDL folder folds units declarations and fixes a case insensitivity bug with not treating "IS" the same as "is".
  • Fix bug when drawing text margins in buffered mode which would use default encoding instead of chosen encoding. Bug #1703.
  • Fix bug with Korean Hanja conversions in DBCS encoding on Windows.
  • Fix for reading a UTF-16 file in SciTE where a non-BMP character is split over a read buffer boundary. Bug #1710.
  • Fix bug on GTK+ 2.x for Windows where there was an ABI difference between compiler version. Bug #1726.
  • Fix undo bug on Cocoa that could lose data..
  • Fix link error on Windows when SCI_NAMESPACE used.
  • Fix exporting from SciTE when using Scintillua for lexing.
  • SciTE does not report twice that a search string can not be found when "Replace" pressed. Bug #1716.
  • SciTE on GTK+ 3.x disables arrow in search combo when no entries. Bug #1717.

Release 3.5.5

  • Released 17 April 2015.
  • Scintilla on Windows is now always a wide character window so SCI_SETKEYSUNICODE has no effect and SCI_GETKEYSUNICODE always returns true. These APIs are deprecated and should not be called.
  • The wxWidgets-specific ascent member of Font has been removed which breaks compatibility with current wxStyledTextCtrl. Bug #1682.
  • IME on Qt supports multiple carets and behaves more like other platforms.
  • Always use inline IME on GTK+ for Korean.
  • SQL lexer fixes handling of '+' and '-' in numbers so the '-' in '1-1' is seen as an operator and for '1--comment' the comment is recognized.
  • TCL lexer reverts change to string handling. Bug #1642.
  • Verilog lexer fixes bugs with macro styling. Verilog folder fixes bugs with `end completing an `if* instead of `endif and fold.at.else, and implements folding at preprocessor `else.
  • VHDL lexer supports extended identifiers.
  • Fix bug on Cocoa where the calltip would display incorrectly when switching calltips and the new calltip required a taller window.
  • Fix leak on Cocoa with autocompletion lists. Bug #1706.
  • Fix potential crash on Cocoa with drag and drop. Bug #1709.
  • Fix bug on Windows when compiling with MinGW-w64 which caused text to not be drawn when in wrap mode. Bug #1705.
  • Fix SciTE bug with missing file open filters and add hex to excluded set of properties files so that its settings don't appear. Bug #1707.
  • Fix SciTE bug where files without extensions like "makefile" were not highlighted correctly.

Release 3.5.4

  • Released 8 March 2015.
  • Indicators may have a different colour and style when the mouse is over them or the caret is moved into them.
  • An indicator may display in a large variety of colours with the SC_INDICFLAG_VALUEFORE flag taking the colour from the indicator's value, which may differ for every character, instead of its foreground colour attribute.
  • On Cocoa, additional IME methods implemented so that more commands are enabled. For Japanese: Reverse Conversion, Convert to Related Character, and Search Similar Kanji can now be performed. The global definition hotkey Command+Control+D and the equivalent three finger tap gesture can be used.
  • Minimum version of Qt supported is now 4.8 due to the use of QElapsedTimer::nsecsElapsed.
  • On Windows, for Korean, the VK_HANJA key is implemented to choose Hanja for Hangul and to convert from Hanja to Hangul.
  • C++ lexer adds lexer.cpp.verbatim.strings.allow.escapes option that allows verbatim (@") strings to contain escape sequences. This should remain off (0) for C# and be turned on (1) for Objective C.
  • Rust lexer accepts new 'is'/'us' integer suffixes instead of 'i'/'u'. Bug #1098.
  • Ruby folder can fold multiline comments. Bug #1697.
  • SQL lexer fixes a bug with the q-quote operator.
  • TCL lexer fixes a bug with some strings. Bug #1642.
  • Verilog lexer handles escaped identifiers that begin with \ and end with space like \reset* . Verilog folder fixes one bug with inconsistent folding when fold.comment is on and another with typedef class statements creating a fold point, expecting an endclass statement.
  • VHDL folder fixes hang in folding when document starts with "entity".
  • Add new indicators INDIC_COMPOSITIONTHIN, INDIC_FULLBOX, and INDIC_TEXTFORE. INDIC_COMPOSITIONTHIN is a thin underline that mimics the appearance of non-target segments in OS X IME. INDIC_FULLBOX is similar to INDIC_STRAIGHTBOX but covers the entire character area which means that indicators with this style on contiguous lines may touch. INDIC_TEXTFORE changes the text foreground colour.
  • Fix adaptive scrolling speed for GTK+ on OS X with GTK Quartz backend (as opposed to X11 backend). Bug #1696.
  • Fix position of autocompletion and calltips on Cocoa when there were two screens stacked vertically.
  • Fix crash in SciTE when saving large files in background when closing application. Bug #1691.
  • Fix decoding of MSVC warnings in SciTE so that files in the C:\Program Files (x86)\ directory can be opened. This is a common location of system include files.
  • Fix compilation failure of C++11 <regex> on Windows using gcc.

Release 3.5.3

  • Released 20 January 2015.
  • Support removed for Windows 95, 98, and ME.
  • Lexers added for Motorola S-Record files, Intel hex files, and Tektronix extended hex files with folding for Intel hex files. Feature #1091. Feature #1093. Feature #1095. Feature #1096.
  • C++ folder allows folding on square brackets '['. Feature #1087.
  • Shell lexer fixes three issues with here-documents. Bug #1672.
  • Verilog lexer highlights doc comment keywords; has separate styles for input, output, and inout ports (lexer.verilog.portstyling); fixes a bug in highlighting numbers; can treat upper-case identifiers as keywords (lexer.verilog.allupperkeywords); and can use different styles for code that is inactive due to preprocessor commands (lexer.verilog.track.preprocessor, lexer.verilog.update.preprocessor).
  • When the calltip window is taller than the Scintilla window, leave it in a position that avoids overlapping the Scintilla text.
  • When a text margin is displayed, for annotation lines, use the background colour of the base line.
  • On Windows GDI, assume font names are encoded in UTF-8. This matches the Direct2D code path.
  • Fix paste for GTK+ on OS X. Bug #1677.
  • Reverted a fix on Qt where Qt 5.3 has returned to the behaviour of 4.x. Bug #1575.
  • When the mouse is on the line between margin and text changed to treat as within text. This makes the PLAT_CURSES character cell platform work better.
  • Fix a crash in SciTE when the command line is just "-close:". Bug #1675.
  • Fix unexpected dialog in SciTE on Windows when the command line has a quoted filename then ends with a space. Bug #1673.
  • On Windows and GTK+, use indicators for inline IME.
  • SciTE shuts down quicker when there is no user-written OnClose function and no directors are attached.

Release 3.5.2

  • Released 2 December 2014.
  • For OS X Cocoa switch C++ runtime to libc++ to enable use of features that will never be added to libstdc++ including those part of C++11. Scintilla will now run only on OS X 10.7 or later and only in 64-bit mode.
  • Include support for using C++11 <regex> for regular expression searches. Enabling this requires rebuilding Scintilla with a non-default option. This is a provisional feature and may change API before being made permanent.
  • Allocate indicators used for Input Method Editors after 31 which was the previous limit of indicators to ensure no clash between the use of indicators for IME and for the application.
  • ANNOTATION_INDENTED added which is similar to ANNOTATION_BOXED in terms of positioning but does not show a border. Feature #1086.
  • Allow platform overrides for drawing tab arrows, wrap markers, and line markers. Size of double click detection area is a variable. These enable better visuals and behaviour for PLAT_CURSES as it is character cell based.
  • CoffeeScript lexer fixes "/*" to not be a comment. Bug #1420.
  • VHDL folder fixes "block" keyword. Bug #1664.
  • Prevent caret blinking when holding down Delete key. Bug #1657.
  • On Windows, allow right click selection in popup menu. Feature #1080.
  • On Windows, only call ShowCaret in GDI mode as it interferes with caret drawing when using Direct2D. Bug #1643.
  • On Windows, another DirectWrite mode SC_TECHNOLOGY_DIRECTWRITEDC added which may avoid drawing failures in some circumstances by drawing into a GDI DC. This feature is provisional and may be changed or removed if a better solution is found.
  • On Windows, avoid processing mouse move events where the mouse has not moved as these can cause unexpected dwell start notifications. Bug #1670.
  • For GTK+ on Windows, avoid extra space when pasting from external application.
  • On GTK+ 2.x allow Scintilla to be used inside tool tips by changing when preedit window created. Bug #1662.
  • Support MinGW compilation under Linux. Feature #1077.

Release 3.5.1

  • Released 30 September 2014.
  • BibTeX lexer added. Feature #1071.
  • SQL lexer supports the q-quote operator as SCE_SQL_QOPERATOR(24).
  • VHDL lexer supports block comments. Bug #1527.
  • VHDL folder fixes case where "component" used before name. Bug #613.
  • Restore fractional pixel tab positioning which was truncated to whole pixels in 3.5.0. Bug #1652.
  • Allow choice between windowed and inline IME on some platforms.
  • On GTK+ cache autocomplete window to avoid platform bug where windows were sometimes lost. Bug #1649.
  • On GTK+ size autocomplete window more accurately.
  • On Windows only unregister windows classes registered. Bug #1639.
  • On Windows another DirectWrite mode SC_TECHNOLOGY_DIRECTWRITERETAIN added which may avoid drawing failures on some cards and drivers. This feature is provisional and may be changed or removed if a better solution is found.
  • On Windows support the Visual Studio 2010+ clipboard format that indicates a line copy. Bug #1636.
  • SciTE session files remember the scroll position.

Release 3.5.0

  • Released 13 August 2014.
  • Text may share space vertically so that extreme ascenders and descenders are not cut off by calling SCI_SETPHASESDRAW(SC_PHASES_MULTIPLE).
  • Separate timers are used for each type of periodic activity and they are turned on and off as required. This saves power as there are fewer wake ups. On recent releases of OS X Cocoa and Windows, coalescing timers are used to further save power. Bug #1086. Bug #1532.
  • Explicit tab stops may be set for each line.
  • On Windows and GTK+, when using Korean input methods, IME composition is moved from a separate window into the Scintilla window.
  • SciTE adds a "Clean" command to the "Tools" menu which is meant to be bound to a command like "make clean".
  • Lexer added for Windows registry files.
  • HTML lexer fixes a crash with SGML after a Mako comment. Bug #1622.
  • KiXtart lexer adds a block comment state. Feature #1053.
  • Matlab lexer fixes transpose operations like "X{1}'". Bug #1629.
  • Ruby lexer fixes bugs with the syntax of symbols including allowing a symbol to end with '?'. Bug #1627.
  • Rust lexer supports byte string literals, naked CR can be escaped in strings, and files starting with "#![" are not treated as starting with a hashbang comment. Feature #1063.
  • Bug fixed where style data was stale when deleting a rectangular selection.
  • Bug fixed where annotations disappeared when SCI_CLEARDOCUMENTSTYLE called.
  • Bug fixed where selection not redrawn after SCI_DELWORDRIGHT. Bug #1633.
  • Change the function prototypes to be complete for functions exported as "C". Bug #1618.
  • Fix a memory leak on GTK+ with autocompletion lists. Bug #1638.
  • On GTK+, use the full character width for the overstrike caret for multibyte characters.
  • On Qt, set list icon size to largest icon. Add padding on OS X. Bug #1634.
  • On Qt, fix building on FreeBSD 9.2. Bug #1635.
  • On Qt, add a get_character method on the document. Feature #1064.
  • On Qt, add SCI_* for methods to ScintillaConstants.py. Feature #1065.
  • SciTE on GTK+ crash fixed with Insert Abbreviation command.
  • For SciTE with read-only files and are.you.sure=0 reenable choice to save to another location when using Save or Close commands.
  • Fix SciTE bug where toggle bookmark did not work after multiple lines with bookmarks merged. Bug #1617.

Release 3.4.4

  • Released 3 July 2014.
  • Style byte indicators removed. They were deprecated in 2007. Standard indicators should be used instead. Some elements used by lexers no longer take number of bits or mask arguments so lexers may need to be updated for LexAccessor::StartAt, LexAccessor::SetFlags (removed), LexerModule::LexerModule.
  • When multiple selections are active, autocompletion text may be inserted at each selection with new SCI_AUTOCSETMULTI method.
  • C++ lexer fixes crash for "#define x(". Bug #1614.
  • C++ lexer fixes raw string recognition so that R"xxx(blah)xxx" is styled as SCE_C_STRINGRAW.
  • The Postscript lexer no longer marks token edges with indicators as this used style byte indicators.
  • The Scriptol lexer no longer displays indicators for poor indentation as this used style byte indicators.
  • TCL lexer fixes names of keyword sets. Bug #1615.
  • Shell lexer fixes fold matching problem caused by "<<<". Bug #1605.
  • Fix bug where indicators were not removed when fold highlighting on. Bug #1604.
  • Fix bug on Cocoa where emoji were treated as being zero width.
  • Fix crash on GTK+ with Ubuntu 12.04 and overlay scroll bars.
  • Avoid creating a Cairo context when measuring text on GTK+ as future versions of GTK+ may prohibit calling gdk_cairo_create except inside drawing handlers. This prohibition may be required on Wayland.
  • On Cocoa, the registerNotifyCallback method is now marked as deprecated so client code that uses it will display an error message. Client code should use the delegate mechanism or subclassing instead. The method will be removed in the next version.
  • On Cocoa, package Scintilla more in compliance with platform conventions. Only publish public headers in the framework headers directory. Only define the Scintilla namespace in Scintilla.h when compiling as C++. Use the Cocoa NS_ENUM and NS_OPTIONS macros for exposed enumerations. Hide internal methods from public headers. These changes are aimed towards publishing Scintilla as a module which will allow it to be used from the Swift programming language, although more changes will be needed here.
  • Fix crash in SciTE when stream comment performed at line end. Bug #1610.
  • For SciTE on Windows, display error message when common dialogs fail. Bug #156.
  • For SciTE on GTK+ fix bug with initialisation of toggle buttons in find and replace strips. Bug #1612.

Release 3.4.3

  • Released 27 May 2014.
  • Fix hangs and crashes in DLL at shutdown on Windows when using Direct2D.

Release 3.4.2

  • Released 22 May 2014.
  • Insertions can be filtered or modified by calling SCI_CHANGEINSERTION inside a handler for SC_MOD_INSERTCHECK.
  • DMIS lexer added. DMIS is a language for coordinate measuring machines. Feature #1049.
  • Line state may be displayed in the line number margin to aid in debugging lexing and folding with SC_FOLDFLAG_LINESTATE (128).
  • C++ lexer understands more preprocessor statements. #if defined SYMBOL is understood. Some macros with arguments can be understood and these may be predefined in keyword set 4 (keywords5 for SciTE) with syntax similar to CHECKVERSION(x)=(x<3). Feature #1051.
  • C++ lexer can highlight task marker keywords in comments as SCE_C_TASKMARKER.
  • C++ lexer can optionally highlight escape sequences in strings as SCE_C_ESCAPESEQUENCE.
  • C++ lexer supports Go back quoted raw string literals with lexer.cpp.backquoted.strings option. Feature #1047.
  • SciTE performs word and search match highlighting as an idle task to improve interactivity and allow use of these features on large files.
  • Bug fixed on Cocoa where previous caret lines were visible. Bug #1593.
  • Bug fixed where caret remained invisible when period set to 0. Bug #1592.
  • Fixed display flashing when scrolling with GTK+ 3.10. Bug #1567.
  • Fixed calls and constants deprecated in GTK+ 3.10.
  • Fixed bug on Windows where WM_GETTEXT did not provide data in UTF-16 for Unicode window. Bug #685.
  • For SciTE, protect access to variables used by threads with a mutex to prevent data races.
  • For SciTE on GTK+ fix thread object leaks. Display the version of GTK+ compiled against in the about box.
  • For SciTE on GTK+ 3.10, fix the size of the tab bar's content and use freedesktop.org standard icon names where possible.
  • For SciTE on Windows, fix bug where invoking help resubmitted the running program. Bug #272.
  • SciTE's highlight current word feature no longer matches the selection when it contains space.
  • For building SciTE in Visual C++, the win\SciTE.vcxproj project file should be used. The boundscheck directory and its project and solution files have been removed.

Release 3.4.1

  • Released 1 April 2014.
  • Display Unicode line ends as [LS], [PS], and [NEL] blobs.
  • Bug fixed where cursor down failed on wrapped lines. Bug #1585.
  • Caret positioning changed a little to appear inside characters less often by rounding the caret position to the pixel grid instead of truncating. Bug #1588.
  • Bug fixed where automatic indentation wrong when caret in virtual space. Bug #1586.
  • Bug fixed on Windows where WM_LBUTTONDBLCLK was no longer sent to window. Bug #1587.
  • Bug fixed with SciTE on Windows XP where black stripes appeared inside the find and replace strips.
  • Crash fixed in SciTE with recursive properties files. Bug #1507.
  • Bug fixed with SciTE where Ctrl+E before an unmatched end brace jumps to file start. Bug #315.
  • Fixed scrolling on Cocoa to avoid display glitches and be smoother.
  • Fixed crash on Cocoa when character composition used when autocompletion list active.

Release 3.4.0

  • Released 22 March 2014.
  • The Unicode line ends and substyles features added as provisional in 3.2.5 are now finalised. There are now no provisional features.
  • Added wrap mode SC_WRAP_WHITESPACE which only wraps on whitespace, not on style changes.
  • SciTE find and replace strips can perform incremental searching and temporary highlighting of all matches with the find.strip.incremental, replace.strip.incremental, and find.indicator.incremental settings.
  • SciTE default settings changed to use strips for find and replace and to draw with Direct2D and DirectWrite on Windows.
  • SciTE on Windows scales image buttons on the find and replace strips to match the current system scale factor.
  • Additional assembler lexer variant As(SCLEX_AS) for Unix assembly code which uses '#' for comments and ';' to separate statements.
  • Fix Coffeescript lexer for keyword style extending past end of word. Also fixes styling 0...myArray.length all as a number. Bug #1583.
  • Fix crashes and other bugs in Fortran folder by removing folding of do-label constructs.
  • Deleting a whole line deletes the annotations on that line instead of the annotations on the next line. Bug #1577.
  • Changed position of tall calltips to prefer lower half of screen to cut off end instead of start.
  • Fix Qt bug where double click treated as triple click. Bug #1575.
  • On Qt, selecting an item in an autocompletion list that is not currently visible positions it at the top.
  • Fix bug on Windows when resizing autocompletion list with only short strings caused the list to move.
  • On Cocoa reduce scrollable height by one line to fix bugs with moving caret up or down.
  • On Cocoa fix calltips which did not appear when they were created in an off-screen position.

Release 3.3.9

  • Released 31 January 2014.
  • Fix 3.3.8 bug where external lexers became inaccessible. Bug #1574.

Release 3.3.8

  • Released 28 January 2014.
  • DropSelectionN API added to drop a selection from a multiple selection.
  • CallTipSetPosStart API added to change the position at which backspacing removes the calltip.
  • SC_MARK_BOOKMARK marker symbol added which looks like bookmark ribbons used in book reading applications.
  • Basic lexer highlights hex, octal, and binary numbers in FreeBASIC which use the prefixes &h, &o and &b respectively. Feature #1041.
  • C++ lexer fixes bug where keyword followed immediately by quoted string continued keyword style. Bug #1564.
  • Matlab lexer treats '!' differently for Matlab and Octave languages. Bug #1571.
  • Rust lexer improved with nested comments, more compliant doc-comment detection, octal literals, NUL characters treated as valid, and highlighting of raw string literals and float literals fixed. Feature #1038. Bug #1570.
  • On Qt expose the EOLMode on the document object.
  • Fix hotspot clicking where area was off by half a character width. Bug #1562.
  • Tweaked scroll positioning by either 2 pixels or 1 pixel when caret is at left or right of view to ensure caret is inside visible area.
  • Send SCN_UPDATEUI with SC_UPDATE_SELECTION for Shift+Tab inside text.
  • On Windows update the system caret position when scrolling to help screen readers see the scroll quickly.
  • On Cocoa, GTK+, and Windows/Direct2D draw circles more accurately so that circular folding margin markers appear circular, of consistent size, and centred. Make SC_MARK_ARROWS drawing more even. Fix corners of SC_MARK_ROUNDRECT with Direct2D to be similar to other platforms.
  • SciTE uses a bookmark ribbon symbol for bookmarks as it scales better to higher resolutions than the previous blue gem bitmap.
  • SciTE will change the width of margins while running when the margin.width and fold.margin.width properties are changed.
  • SciTE on Windows can display a larger tool bar with the toolbar.large property.
  • SciTE displays a warning message when asked to open a directory. Bug #1568.

Release 3.3.7

  • Released 12 December 2013.
  • Lexer added for DMAP language. Feature #1026.
  • Basic lexer supports multiline comments in FreeBASIC. Feature #1023.
  • Bash lexer allows '#' inside words.. Bug #1553.
  • C++ lexer recognizes C++11 user-defined literals and applies lexical class SCE_C_USERLITERAL.
  • C++ lexer allows single quote characters as digit separators in numeric literals like 123'456 as this is included in C++14.
  • C++ lexer fixes bug with #include statements without " or > terminating filename. Bug #1538.
  • C++ lexer fixes split of Doxygen keywords @code{.fileExtension} and @param[in,out]. Bug #1551.
  • C++ lexer styles Doxygen keywords at end of document.
  • Cmake lexer fixes bug with empty comments. Bug #1550.
  • Fortran folder improved. Treats "else" as fold header. Feature #962.
  • Fix bug with adjacent instances of the same indicator with different values where only the first was drawn. Bug #1560.
  • For DirectWrite, use the GDI ClearType gamma value for SC_EFF_QUALITY_LCD_OPTIMIZED as this results in text that is similar in colour intensity to GDI. For the duller default DirectWrite ClearType text appearance, use SC_EFF_QUALITY_DEFAULT. Feature #887.
  • Fix another problem with drawing on Windows with Direct2D when returning from lock screen. The whole window is redrawn as just redrawing the initially required area left other areas black.
  • When scroll width is tracked, take width of annotation lines into account.
  • For Cocoa on OS X 10.9, responsive scrolling is supported.
  • On Cocoa, apply font quality setting to line numbers. Bug #1544.
  • On Cocoa, clicking in margin now sets focus. Bug #1542.
  • On Cocoa, correct cursor displayed in margin after showing dialog.
  • On Cocoa, multipaste mode now works. Bug #1541.
  • On GTK+, chain up to superclass finalize so that all finalization is performed. Bug #1549.
  • On GTK+, fix horizontal scroll bar range to not be double the needed width. Bug #1546.
  • On OS X GTK+, report control key as SCI_META for mouse down events.
  • On Qt, bug fixed with drawing of scrollbars, where previous contents were not drawn over with some themes.
  • On Qt, bug fixed with finding monitor rectangle which could lead to autocomplete showing at wrong location.
  • SciTE fix for multiple message boxes when failing to save a file with save.on.deactivate. Bug #1540.
  • SciTE on GTK+ fixes SIGCHLD handling so that Lua scripts can determine the exit status of processes they start. Bug #1557.
  • SciTE on Windows XP fixes bad display of find and replace values when using strips.

Release 3.3.6

  • Released 15 October 2013.
  • Added functions to help convert between substyles and base styles and between secondary and primary styles. SCI_GETSTYLEFROMSUBSTYLE finds the base style of substyles. Can be used to treat all substyles of a style equivalent to that style. SCI_GETPRIMARYSTYLEFROMSTYLE finds the primary style of secondary styles. StyleFromSubStyle and PrimaryStyleFromStyle methods were added to ILexerWithSubStyles so each lexer can implement these.
  • Lexer added for Rust language. Feature #1024.
  • Avoid false matches in errorlist lexer which is used for the SciTE output pane by stricter checking of ctags lines.
  • Perl lexer fixes bugs with multi-byte characters, including in HEREDOCs and PODs. Bug #1528.
  • SQL folder folds 'create view' statements. Feature #1020.
  • Visual Prolog lexer updated with better support for string literals and Unicode. Feature #1025.
  • For SCI_SETIDENTIFIERS, \t, \r, and \n are allowed as well as space between identifiers. Bug #1521.
  • Gaining and losing focus is now reported as a notification with the code set to SCN_FOCUSIN or SCN_FOCUSOUT. This allows clients to uniformly use notifications instead of commands. Since there is no longer a need for commands they will be deprecated in a future version. Clients should switch any code that currently uses SCEN_SETFOCUS or SCEN_KILLFOCUS.
  • On Cocoa, clients should use the delegate mechanism or subclass ScintillaView in preference to registerNotifyCallback: which will be deprecated in the future.
  • On Cocoa, the ScintillaView.h header hides internal implementation details from Platform.h and ScintillaCocoa.h. InnerView was renamed to SCIContentView and MarginView was renamed to SCIMarginView. dealloc removed from @interface.
  • On Cocoa, clients may customize SCIContentView by subclassing both SCIContentView and ScintillaView and implementing the contentViewClass class method on the ScintillaView subclass to return the class of the SCIContentView subclass.
  • On Cocoa, fixed appearance of alpha rectangles to use specified alpha and colour for outline as well as corner size. This makes INDIC_STRAIGHTBOX and INDIC_ROUNDBOX look correct.
  • On Cocoa, memory leak fixed for MarginView.
  • On Cocoa, make drag and drop work when destination view is empty. Bug #1534.
  • On Cocoa, drag image fixed when view scrolled.
  • On Cocoa, SCI_POSITIONFROMPOINTCLOSE fixed when view scrolled. Feature #1021.
  • On Cocoa, don't send selection change notification when scrolling. Bug #1522.
  • On Qt, turn off idle events on destruction to prevent repeatedly calling idle.
  • Qt bindings in ScintillaEdit changed to use signed first parameter.
  • Compilation errors fixed on Windows and GTK+ with SCI_NAMESPACE.
  • On Windows, building with gcc will check if Direct2D headers are available and enable Direct2D if they are.
  • Avoid attempts to redraw empty areas when lexing beyond the currently visible lines.
  • Control more attributes of indicators in SciTE with find.mark.indicator and highlight.current.word.indicator properties.
  • Fix SciTE bug with buffers becoming read-only. Bug #1525.
  • Fix linking SciTE on non-Linux Unix systems with GNU toolchain by linking to libdl. Bug #1523.
  • On Windows, SciTE's Incremental Search displays match failures by changing the background colour instead of not adding the character that caused failure.
  • Fix SciTE on GTK+ 3.x incremental search to change foreground colour when no match as changing background colour is difficult.

Release 3.3.5

  • Released 31 August 2013.
  • Characters may be represented by strings. In Unicode mode C1 control characters are represented by their mnemonics.
  • Added SCI_POSITIONRELATIVE to optimize navigation by character.
  • Option to allow mouse selection to switch to rectangular by pressing Alt after start of gesture. Feature #1007.
  • Lexer added for KVIrc script. Feature #1008.
  • Bash lexer fixed quoted HereDoc delimiters. Bug #1500.
  • MS SQL lexer fixed ';' to appear as an operator. Bug #1509.
  • Structured Text lexer fixed styling of enumeration members. Bug #1508.
  • Fixed bug with horizontal caret position when margin changed. Bug #1512.
  • Fixed bug on Cocoa where coordinates were relative to text subview instead of whole view.
  • Ensure selection redrawn correctly in two cases. When switching from stream to rectangular selection with Alt+Shift+Up. When reducing the range of an additional selection by moving mouse up. Feature #1007.
  • Copy and paste of rectangular selections compatible with Borland Delphi IDE on Windows. Feature #1002. Bug #1513.
  • Initialize extended styles to the default style.
  • On Windows, fix painting on an explicit HDC when first paint attempt abandoned.
  • Qt bindings in ScintillaEdit made to work on 64-bit Unix systems.
  • Easier access to printing on Qt with formatRange method.
  • Fixed SciTE failure to save initial buffer in single buffer mode. Bug #1339.
  • Fixed compilation problem with Visual C++ in non-English locales. Bug #1506.
  • Disable Direct2D when compiling with MinGW gcc on Windows because of changes in the recent MinGW release.
  • SciTE crash fixed for negative line.margin.width. Bug #1504.
  • SciTE fix for infinite dialog boxes when failing to automatically save a file. Bug #1503.
  • SciTE settings buffered.draw, two.phase.draw, and technology are applied to the output pane as well as the edit pane.

Release 3.3.4

  • Released 19 July 2013.
  • Handling of UTF-8 and DBCS text in lexers improved with methods ForwardBytes and GetRelativeCharacter added to StyleContext. Bug #1483.
  • For Unicode text, case-insensitive searching and making text upper or lower case is now compliant with Unicode standards on all platforms and is much faster for non-ASCII characters.
  • A CategoriseCharacter function was added to return the Unicode general category of a character which can be useful in lexers.
  • On Cocoa, the LCD Optimized font quality level turns font smoothing on.
  • SciTE 'immediate' subsystem added to allow scripts that work while tools are executed.
  • Font quality exposed in SciTE as font.quality setting.
  • On Cocoa, message:... methods simplify direct access to Scintilla and avoid call layers..
  • A68K lexer updated.
  • CoffeeScript lexer fixes a bug with comment blocks. Bug #1495
  • ECL lexer regular expression code fixed. Bug #1491.
  • errorlist lexer only recognises Perl diagnostics when there is a filename between "at" and "line". Had been triggering for MSVC errors containing "at line".
  • Haskell lexer fixed to avoid unnecessary full redraws. Don't highlight CPP inside comments when styling.within.preprocessor is on. Bug #1459.
  • Lua lexer fixes bug in labels with UTF-8 text. Bug #1483.
  • Perl lexer fixes bug in string interpolation with UTF-8 text. Bug #1483.
  • Fixed bugs with case conversion when the result was longer or shorter than the original text. Could access past end of string potentially crashing. Selection now updated to result length.
  • Fixed bug where data being inserted and removed was not being reported in notification messages. Bug was introduced in 3.3.2.
  • Word wrap bug fixed where the last line could be shown twice.
  • Word wrap bug fixed for lines wrapping too short on Windows and GTK+.
  • Word wrap performance improved.
  • Minor memory leak fixed. Bug #1487.
  • On Cocoa, fixed insertText: method which was broken when implementing a newer protocol.
  • On Cocoa, fixed a crash when performing string folding for bytes that do not represent a character in the current encoding.
  • On Qt, fixed layout problem when QApplication construction delayed.
  • On Qt, find_text reports failure with -1 as first element of return value.
  • Fixed SciTE on GTK+ bug where a tool command could be performed using the keyboard while one was already running leading to confusion and crashes. Bug #1486.
  • Fixed SciTE bug in Copy as RTF which was limited to first 32 styles. Bug #1011.
  • Fixed SciTE on Windows user strip height when the system text scaling factor is 125% or 150%.
  • Compile time checks for Digital Mars C++ removed.
  • Visual C++ 2013 supported. Bug #1492.
  • Python scripts used for building and maintenance improved and moved into scripts directory.
  • Testing scripts now work on Linux using Qt and PySide.
  • Tk platform defined. Implementation for Tk will be available separately from main Scintilla distribution.

Release 3.3.3

  • Released 2 June 2013.
  • Lexer and folder added for Structured Text language. Feature #959.
  • Out of bounds access fixed for GTK+. Bug #1480.
  • Crash fixed for GTK+ on Windows paste.
  • Bug fixed with incorrect event copying on GTK+ 3.x. Bug #1481.
  • Bug fixed with right to left locales, like Hebrew, on GTK+. Bug #1477.
  • Bug fixed with undo grouping of tab and backtab commands. Bug #1478.

Release 3.3.2

  • Released 22 May 2013.
  • Basic implementations of common folding methods added to Scintilla to make it easier for containers to implement folding.
  • Add indicator INDIC_COMPOSITIONTHICK, a thick low underline, to mimic an appearance used for Asian language input composition.
  • On Cocoa, implement font quality setting. Feature #988.
  • On Cocoa, implement automatic enabling of commands and added clear command. Feature #987.
  • C++ lexer adds style for preprocessor doc comment. Feature #990.
  • Haskell lexer and folder improved. Separate mode for literate Haskell "literatehaskell" SCLEX_LITERATEHASKELL. Bug #1459 .
  • LaTeX lexer bug fixed for Unicode character following '\'. Bug #1468 .
  • PowerShell lexer recognises here strings and doccomment keywords. #region folding added. Feature #985.
  • Fix multi-typing when two carets are located in virtual space on one line so that spaces are preserved.
  • Fixes to input composition on Cocoa and implementation of accented character input through press and hold. Set selection correctly so that changes to pieces of composition text are easier to perform. Restore undo collection after a sequence of composition actions. Composition popups appear near input.
  • Fix lexer problem where no line end was seen at end of document.
  • Fix crash on Cocoa when view deallocated. Bug #1466.
  • Fix Qt window positioning to not assume the top right of a monitor is at 0, 0.
  • Fix Qt to not track mouse when widget is hidden.
  • Qt now supports Qt 5.0. Bug #1448.
  • Fix drawing on Windows with Direct2D when returning from lock screen. The render target had to be recreated and an area would be black since the drawing was not retried.
  • Fix display of DBCS documents on Windows Direct2D/DirectWrite with default character set.
  • For SciTE on Windows, fixed most-recently-used menu when files opened through check.if.already.opened.
  • In SciTE, do not call OnSave twice when files saved asynchronously.
  • Scintilla no longer builds with Visual C++ 6.0.

Release 3.3.1

  • Released 11 April 2013.
  • Autocompletion lists can now appear in priority order or be sorted by Scintilla. Feature #981.
  • Most lexers now lex an extra NUL byte at the end of the document which makes it more likely they will classify keywords at document end correctly. Bug #574, Bug #588.
  • Haskell lexer improved in several ways. Bug #1459.
  • Matlab/Octave lexer recognises block comments and ... comments. Bug #1414.
  • Ruby lexer crash fixed with keyword at start of document.
  • The PLAT_NCURSES platform now called PLAT_CURSES as may work on other implementations.
  • Bug on Cocoa fixed where input composition with multiple selection or virtual space selection could make undo stop working.
  • Direct2D/DirectWrite mode on Windows now displays documents in non-Latin1 8-bit encodings correctly.
  • Character positioning corrected in Direct2D/DirectWrite mode on Windows to avoid text moving and cutting off lower parts of characters.
  • Position of calltip and autocompletion lists fixed on Cocoa.
  • While regular expression search in DBCS text is still not working, matching partial characters is now avoided by moving end of match to end of character.

Release 3.3.0

  • Released 30 March 2013.
  • Overlay scrollers and kinetic scrolling implemented on Cocoa.
  • To improve display smoothness, styling and UI Update notifications will, when possible, be performed in a high-priority idle task on Cocoa instead of during painting. Performing these jobs inside painting can cause paints to be abandoned and a new paint scheduled. On GTK+, the high-priority idle task is used in more cases.
  • SCI_SCROLLRANGE added to scroll the view to display a range of text. If the whole range can not be displayed, priority is given to one end.
  • C++ lexer no longer recognises raw (R"") strings when the first character after " is invalid. Bug #1454.
  • HTML lexer recognises JavaScript RegEx literals in more contexts. Bug #1412.
  • Fixed automatic display of folded text when return pressed at end of fold header and first folded line was blank. Bug #1455.
  • SCI_VISIBLEFROMDOCLINE fixed to never return a line beyond the document end.
  • SCI_LINESCROLL fixed for a negative column offset. Bug #1450.
  • On GTK+, fix tab markers so visible if indent markers are visible. Bug #1453.

Release 3.2.5

  • Released 26 February 2013.
  • To allow cooperation between different uses of extended (beyond 255) styles they should be allocated using SCI_ALLOCATEEXTENDEDSTYLES.
  • For Unicode documents, lexers that use StyleContext will retrieve whole characters instead of bytes. LexAccessor provides a LineEnd method which can be a more efficient way to handle line ends and can enable Unicode line ends.
  • The C++ lexer understands the #undef directive when determining preprocessor definitions. Feature #978.
  • The errorlist lexer recognises gcc include path diagnostics that appear before an error.
  • Folding implemented for GetText (PO) translation language. Bug #1437.
  • HTML lexer does not interrupt comment style for processing instructions. Bug #1447.
  • Fix SciTE forgetting caret x-position when switching documents. Bug #1442.
  • Fixed bug where vertical scrollbar thumb appeared at beginning of document when scrollbar shown. Bug #1446.
  • Fixed brace-highlighting bug on OS X 10.8 where matching brace is on a different line.
  • Provisional features are new features that may change or be removed if they cause problems but should become permanent if they work well. For this release Unicode line ends and substyles are provisional features.

Release 3.2.4

  • Released 17 January 2013.
  • Caret line highlight can optionally remain visible when window does not have focus. Feature #964.
  • Delegate mechanism for notifications added on Cocoa.
  • NUL characters in selection are copied to clipboard as spaces to avoid truncating at the NUL. Bug #1289.
  • C++ lexer fixes problem with showing inactive sections when preprocessor lines contain trailing comment. Bug #1413.
  • C++ lexer fixes problem with JavaScript regular expressions with '/' in character ranges. Bug #1415.
  • LaTeX folder added. Feature #970.
  • LaTeX lexer improves styling of math environments. Feature #970.
  • MySQL lexer implements hidden commands.
  • Only produce a single undo step when autocompleting a single word. Bug #1421.
  • Fixed crash when printing lines longer than 8000 characters. Bug #1430.
  • Fixed problem in character movement extends selection mode where reversing direction collapsed the selection.
  • Memory issues fixed on Cocoa, involving object ownership, lifetime of timers, and images held by the info bar. Bug #1436.
  • Cocoa key binding for Alt+Delete changed to delete previous word to be more compatible with platform standards.
  • Fixed crash on Cocoa with scrollbar when there is no scrolling possible. Bug #1416.
  • On Cocoa with retina display fixed positioning of autocompletion lists.
  • Fixed SciTE on Windows failure to run a batch file with a name containing a space by quoting the path in the properties file. Bug #1423.
  • Fixed scaling bug when printing on GTK+. Bug #1427.
  • SciTE on GTK toolbar.detachable feature removed.
  • Fixed some background saving bugs in SciTE. Bug #1366. Bug #1339.

Release 3.2.3

  • Released 21 October 2012.
  • Improve speed when performing multiple searches.
  • SciTE adds definition of PLAT_UNIX for both PLAT_GTK and PLAT_MAC to allow consolidation of settings valid on all Unix variants.
  • Signal autoCompleteCancelled added on Qt.
  • Bash lexer supports nested delimiter pairs. Feature #3569352. Bug #1515556. Bug #3008483. Bug #3512208. Bug #3515392.
  • For C/C++, recognise exponent in floating point hexadecimal literals. Bug #3576454.
  • For C #include statements, do not treat // in the path as a comment. Bug #3519260.
  • Lexer for GetText translations (PO) improved with additional styles and single instance limitation fixed.
  • Ruby for loop folding fixed. Bug #3240902. Bug #3567391.
  • Ruby recognition of here-doc after class or instance variable fixed. Bug #3567809.
  • SQL folding of loop and case fixed. Bug #3567905.
  • SQL folding of case with assignment fixed. Bug #3571820.
  • Fix hang when removing all characters from indicator at end of document.
  • Fix failure of \xhh in regular expression search for values greater than 0x79.
  • On Cocoa on OS X 10.8, fix inverted drawing of find indicator.
  • On Cocoa, fix double drawing when horizontal scroll range small and user swipes horizontally.
  • On Cocoa, remove incorrect setting of save point when reading information through 'string' and 'selectedString'.
  • On Cocoa, fix incorrect memory management of infoBar.
  • On GTK+ 3 Ubuntu, fix crash when drawing margin.
  • On ncurses, fix excessive spacing with italics line end.
  • On Windows, search for D2D1.DLL and DWRITE.DLL in system directory to avoid loading from earlier in path where could be planted by malware.

Release 3.2.2

  • Released 31 August 2012.
  • Retina display support for Cocoa. Text size fixed. Scale factor for images implemented so they can be displayed in high definition.
  • Implement INDIC_SQUIGGLEPIXMAP as a faster version of INDIC_SQUIGGLE. Avoid poor drawing at right of INDIC_SQUIGGLE. Align INDIC_DOTBOX to pixel grid for full intensity.
  • Implement SCI_GETSELECTIONEMPTY API. Bug #3543121.
  • Added SCI_VCHOMEDISPLAY and SCI_VCHOMEDISPLAYEXTEND key commands. Feature #3561433.
  • Allow specifying SciTE Find in Files directory with find.in.directory property. Feature #3558594.
  • Override SciTE global strip.trailing.spaces with strip.trailing.spaces by pattern files. Feature #3556320.
  • Fix long XML script tag handling in XML lexer. Bug #3534190.
  • Fix rectangular selection range after backspace. Bug #3543097.
  • Send SCN_UPDATEUI with SC_UPDATE_SELECTION for backspace in virtual space. Bug #3543121.
  • Avoid problems when calltip highlight range is negative. Bug #3545938.
  • On Cocoa, fix image drawing code so that image is not accessed after being freed and is drawn in the correct location.
  • On Cocoa, limit horizontal touch scrolling to existing established width.
  • On Cocoa, decrease sensitivity of pinch-zoom.
  • Fix Cocoa drawing where style changes were not immediately visible.
  • Fix Cocoa memory leak due to reference cycle.
  • Fix Cocoa bug where notifications were sent after Scintilla was freed.
  • SciTE on OS X user shortcuts treats "Ctrl+D" as equivalent to "Ctrl+d".
  • On Windows, saving SciTE's Lua startup script causes it to run.
  • Limit time allowed to highlight current word in SciTE to 0.25 seconds to remain responsive.
  • Fixed SciTE read-only mode to stick with buffer.
  • For SciTE on Windows, enable Ctrl+Z, Ctrl+X, and Ctrl+C (Undo, Cut, and Copy) in the editable fields of find and replace strips
  • Remove limit on logical line length in SciTE .properties files. Bug #3544312.
  • Improve performance of SciTE Save As command.
  • Fix SciTE crash with empty .properties files. Bug #3545938. Bug #3555308.
  • Fix repeated letter in SciTE calltips. Bug #3545938.
  • Refine build time checking for Direct2D and DirectWrite.
  • Avoid potential build problems on Windows with MultiMon.h by explicitly checking for multi-monitor APIs.
  • Automatically disable themed drawing in SciTE when building on Windows 2000. Reenable building for Windows NT 4 on NT 4 .
  • Added ncurses platform definitions. Implementation is maintained separately as Scinterm.

Release 3.2.1

  • Released 14 July 2012.
  • In Scintilla.iface, specify features as properties instead of functions where possible and fix some enumerations.
  • In SciTE Lua scripts, string properties in Scintilla API can be retrieved as well as set using property notation.
  • Added character class APIs: SCI_SETPUNCTUATIONCHARS, SCI_GETWORDCHARS, SCI_GETWHITESPACECHARS, and SCI_GETPUNCTUATIONCHARS. Feature #3529805.
  • Less/Hss support added to CSS lexer. Feature #3532413.
  • C++ lexer style SCE_C_PREPROCESSORCOMMENT added for stream comments in preprocessor. Bug #3487406.
  • Fix incorrect styling of inactive code in C++ lexer. Bug #3533036.
  • Fix incorrect styling by C++ lexer after empty lines in preprocessor style.
  • C++ lexer option "lexer.cpp.allow.dollars" fixed so can be turned off after being on. Bug #3541461.
  • Fortran fixed format lexer fixed to style comments from column 73. Bug #3540486.
  • Fortran folder folds CRITICAL .. END CRITICAL. Bug #3540486.
  • Fortran lexer fixes styling after comment line ending with '&'. Bug #3087226.
  • Fortran lexer styles preprocessor lines so they do not trigger incorrect folding. Bug #2906275.
  • Fortran folder fixes folding of nested ifs. Bug #2809176.
  • HTML folder fixes folding of CDATA when fold.html.preprocessor=0. Bug #3540491.
  • On Cocoa, fix autocompletion font lifetime issue and row height computation.
  • In 'choose single' mode, autocompletion will close an existing list if asked to display a single entry list.
  • Fixed SCI_MARKERDELETE to only delete one marker per call. Bug #3535806.
  • Properly position caret after undoing coalesced delete operations. Bug #3523326.
  • Ensure margin is redrawn when SCI_MARGINSETSTYLE called.
  • Fix clicks in first pixel of margins to send SCN_MARGINCLICK.
  • Fix infinite loop when drawing block caret for a zero width space character at document start.
  • Crash fixed for deleting negative range.
  • For characters that overlap the beginning of their space such as italics descenders and bold serifs, allow start of text to draw 1 pixel into margin. Bug #699587. Bug #3537799.
  • Fixed problems compiling Scintilla for Qt with GCC 4.7.1 x64.
  • Fixed problem with determining GTK+ sub-platform caused when adding Qt support in 3.2.0.
  • Fix incorrect measurement of untitled file in SciTE on Linux leading to message "File ...' is 2147483647 bytes long". Bug #3537764.
  • In SciTE, fix open of selected filename with line number to go to that line.
  • Fix problem with last visible buffer closing in SciTE causing invisible buffers to be active.
  • Avoid blinking of SciTE's current word highlight when output pane changes.
  • SciTE properties files can be longer than 60K.

Release 3.2.0

  • Released 1 June 2012.
  • Platform layer added for the Qt open-source cross-platform application and user interface framework for development in C++ or in Python with the PySide bindings for Qt.
  • Direct access provided to the document bytes for ranges within Scintilla. This is similar to the existing SCI_GETCHARACTERPOINTER API but allows for better performance.
  • Ctrl+Double Click and Ctrl+Triple Click add the word or line to the set of selections. Feature #3520037.
  • A SCI_DELETERANGE API was added for deleting a range of text.
  • Line wrap markers may now be drawn in the line number margin. Feature #3518198.
  • SciTE on OS X adds option to hide hidden files in the open dialog box.
  • Lexer added for OScript language. Feature #3523197.
  • Lexer added for Visual Prolog language. Feature #3523018.
  • UTF-8 validity is checked more stringently and consistently. All 66 non-characters are now treated as invalid.
  • HTML lexer bug fixed with inconsistent highlighting for PHP when attribute on separate line from tag. Bug #3520027.
  • HTML lexer bug fixed for JavaScript block comments. Bug #3520032.
  • Annotation drawing bug fixed when box displayed with different colours on different lines. Bug #3519872.
  • On Windows with Direct2D, fix drawing with 125% and 150% DPI system settings.
  • Virtual space selection bug fixed for rectangular selections. Bug #3519246.
  • Replacing multiple selection with newline changed to only affect main selection. Bug #3522251.
  • Replacing selection with newline changed to group deletion and insertion as a single undo action. Bug #3522250.
  • Auto-completion lists on GTK+ 3 set height correctly instead of showing too few lines.
  • Mouse wheel scrolling changed to avoid GTK+ bug in recent distributions.
  • IME bug on Windows fixed for horizontal jump. Bug #3529728.
  • SciTE case-insensitive autocompletion filters equal identifiers better. Calltip arrows work with bare word identifiers. Bug #3517810.
  • SciTE bug fixed where shbang lines not setting file type when switching to file loaded in background.
  • SciTE on GTK+ shows open and save dialogs with the directory of the current file displayed.

Release 3.1.0

  • Released 20 April 2012.
  • Animated find indicator added on Cocoa.
  • Buttons can be made default in SciTE user strips.
  • SciTE allows find and replace histories to be saved in session.
  • Option added to allow case-insensitive selection in auto-completion lists. Bug #3516538.
  • Replace \0 by complete found text in regular expressions. Feature #3510979.
  • Fixed single quoted strings in bash lexer. Bug #3512208.
  • Incorrect highlighting fixed in C++ lexer for continued lines. Bug #3509317.
  • Hang fixed in diff lexer. Bug #3508602.
  • Folding improved for SQL CASE/MERGE statement. Bug #3503277.
  • Fix extra drawing of selection inside word wrap indentation. Bug #3515555.
  • Fix problem with determining the last line that needs styling when drawing. Bug #3514882.
  • Fix problems with drawing in margins. Bug #3514882.
  • Fix printing crash when using Direct2D to display on-screen. Bug #3513946.
  • Fix SciTE bug where background.*.size disabled restoration of bookmarks and positions from session. Bug #3514885.
  • Fixed the Move Selected Lines command when last line does not end with a line end character. Bug #3511023.
  • Fix word wrap indentation printing to use printer settings instead of screen settings. Bug #3512961.
  • Fix SciTE bug where executing an empty command prevented executing further commands Bug #3512976.
  • Fix SciTE bugs with focus in user strips and made strips more robust with invalid definitions.
  • Suppress SciTE regular expression option when searching with find next selection. Bug #3510985.
  • SciTE Find in Files command matches empty pattern to all files. Feature #3495918.
  • Fix scroll with mouse wheel on GTK+. Bug #3501321.
  • Fix column finding method so that tab is counted correctly. Bug #3483713.

Release 3.0.4

  • Released 8 March 2012.
  • SciTE scripts can create user interfaces as strips.
  • SciTE can save files automatically in the background.
  • Pinch zoom implemented on Cocoa.
  • ECL lexer added. Feature #3488209.
  • CPP lexer fixes styling after document comment keywords. Bug #3495445.
  • Pascal folder improves handling of some constructs. Feature #3486385.
  • XML lexer avoids entering a bad mode due to complex preprocessor instructions. Bug #3488060.
  • Duplicate command is always remembered as a distinct command for undo. Bug #3495836.
  • SciTE xml.auto.close.tags no longer closes with PHP code similar to <a $this-> Bug #3488067.
  • Fix bug where setting an indicator for the whole document would fail. Bug #3487440.
  • Crash fixed for SCI_MOVESELECTEDLINESDOWN with empty vertical selection. Bug #3496403.
  • Differences between buffered and unbuffered mode on Direct2D eliminated. Bug #3495791.
  • Font leading implemented for Direct2D to improve display of character blobs. Bug #3494744.
  • Fractional widths used for line numbers, character markers and other situations. Bug #3494492.
  • Translucent rectangles drawn using Direct2D with sharper corners. Bug #3494492.
  • RGBA markers drawn sharper when centred using Direct2D. Bug #3494202.
  • RGBA markers are drawn centred when taller than line. Bug #3494184.
  • Image marker drawing problem fixed for markers taller than line. Bug #3493503.
  • Markers are drawn horizontally off-centre based on margin type instead of dimensions. Bug #3488696.
  • Fold tail markers drawn vertically centred. Feature #3488289.
  • On Windows, Scintilla is more responsive in wrap mode. Bug #3487397.
  • Unimportant "Gdk-CRITICAL" messages are no longer displayed. Bug #3488481.
  • SciTE on Windows Find in Files sets focus to dialog when already created; allows opening dialog when a job is running. Bug #3480635. Bug #3486657.
  • Fixed problems with multiple clicks in margin and with mouse actions combined with virtual space. Bug #3484370.
  • Fixed bug with using page up and down and not returning to original line. Bug #3485669.
  • Down arrow with wrapped text no longer skips lines. Bug #1776560.
  • Fix problem with dwell ending immediately due to word wrap. Bug #3484416.
  • Wrapped lines are rewrapped more consistently while resizing window. Bug #3484179.
  • Selected line ends are highlighted more consistently. Bug #3484330.
  • Fix grey background on files that use shbang to choose language. Bug #3482777.
  • Fix failure messages from empty commands in SciTE. Bug #3480645.
  • Redrawing reduced for some marker calls. Feature #3493530.
  • Match brace and select brace commands work in SciTE output pane. Feature #3486598.
  • Performing SciTE "Show Calltip" command when a calltip is already visible shows the next calltip. Feature #3487017.
  • SciTE allows saving file even when file unchanged. Feature #3486654.
  • SciTE allows optional use of character escapes in calltips. Feature #3495239.
  • SciTE can open file:// URLs with Ctrl+Shift+O. Feature #3495389.
  • Key modifiers updated for GTK+ on OS X to match upstream changes.
  • SciTE hang when marking all occurrences of regular expressions fixed.

Release 3.0.3

  • Released 28 January 2012.
  • Printing works on GTK+ version 2.x as well as 3.x.
  • Lexer added for the AviSynth language. Feature #3475611.
  • Lexer added for the Take Command / TCC scripting language. Feature #3462462.
  • CSS lexer gains support for SCSS. Feature #3268017.
  • CPP lexer fixes problems in the preprocessor structure caused by continuation lines. Bug #3458508.
  • Errorlist lexer handles column numbers for GCC format diagnostics. In SciTE, Next Message goes to column where this can be decoded from GCC format diagnostics. Feature #3453075.
  • HTML folder fixes spurious folds on some tags. Bug #3459262.
  • Ruby lexer fixes bug where '=' at start of file caused whole file to appear as a comment. Bug #3452488.
  • SQL folder folds blocks of single line comments. Feature #3467425.
  • On Windows using Direct2D, defer invalidation of render target until completion of painting to avoid failures.
  • Further support of fractional positioning. Spaces, tabs, and single character tokens can take fractional space and wrapped lines are positioned taking fractional positions into account. Bug #3471998.
  • On Windows using Direct2D, fix extra carets appearing. Bug #3471998.
  • For autocompletion lists Page Up and Down move by the list height instead of by 5 lines. Bug #3455493.
  • For SCI_LINESCROLLDOWN/UP don't select into virtual space. Bug #3451681.
  • Fix fold highlight not being fully drawn. Bug #3469936.
  • Fix selection margin appearing black when starting in wrap mode.
  • Fix crash when changing end of document after adding an annotation. Bug #3476637.
  • Fix problems with building to make RPMs. Bug #3476149.
  • Fix problem with building on GTK+ where recent distributions could not find gmodule. Bug #3469056.
  • Fix problem with installing SciTE on GTK+ due to icon definition in .desktop file including an extension. Bug #3476117.
  • Fix SciTE bug where new buffers inherited some properties from previously opened file. Bug #3457060.
  • Fix focus when closing tab in SciTE with middle click. Focus moves to edit pane instead of staying on tab bar. Bug #3440142.
  • For SciTE on Windows fix bug where Open Selected Filename for URL would append a file extension. Feature #3459185.
  • For SciTE on Windows fix key handling of control characters in Parameters dialog so normal editing (Ctrl+C, ...) works. Bug #3459345.
  • Fix SciTE bug where files became read-only after saving. Drop the "*" dirty marker after save completes. Bug #3467432.
  • For SciTE handling of diffs with "+++" and "---" lines, also handle case where not followed by tab. Go to correct line for diff "+++" message. Bug #3467143. Bug #3467178.
  • SciTE on GTK+ now performs threaded actions even on GTK+ versions before 2.12.

Release 3.0.2

  • Released 9 December 2011.
  • SciTE saves files in the background without blocking the user interface.
  • Printing implemented in SciTE on GTK+ 3.x.
  • ILoader interface for background loading finalised and documented.
  • CoffeeScript lexer added.
  • C++ lexer fixes crash with "#if defined( XXX 1".
  • Crash with Direct2D on Windows fixed.
  • Backspace removing protected range fixed. Bug #3445911.
  • Cursor setting failure on Windows when screen saver on fixed. Bug #3438780.
  • SciTE on GTK+ hang fixed with -open:file option. Bug #3441980.
  • Failure to evaluate shbang fixed in SciTE. Bug #3441801.
  • SciTE failure to treat files starting with "<?xml" as XML fixed. Bug #3440718.
  • Made untitled tab saveable when created by closing all files. Bug #3440244.
  • SciTE crash fixed when using Scintillua.
  • SciTE revert command fixed so that undo works on individual actions instead of undoing to revert point.
  • Focus loss in SciTE when opening a recent file fixed. Bug #3440142.
  • Fixed SciTE SelLength property to measure characters instead of bytes. Bug #3283519.

Release 3.0.1

  • Released 15 November 2011.
  • SciTE on Windows now runs Lua scripts directly on the main thread instead of starting them on a secondary thread and then moving back to the main thread.
  • Highlight "else" as a keyword for TCL in the same way as other languages. Bug #1836954.
  • Fix problems with setting fonts for autocompletion lists on Windows where font handles were copied and later deleted causing a system default font to be used.
  • Fix font size used on Windows for Asian language input methods which sometimes led to IME not being visible. Bug #3436753.
  • Fixed polygon drawing on Windows so fold symbols are visible again. Bug #3433558.
  • Changed background drawing on GTK+ to allow for fractional character positioning as occurs on OS X as this avoids faint lines at lexeme boundaries.
  • Ensure pixmaps allocated before painting as there was a crash when Scintilla drew without common initialisation calls. Bug #3432354.
  • Fixed SciTE on Windows bug causing wrong caret position after indenting a selection. Bug #3433433.
  • Fixed SciTE session saving to store buffer position matching buffer. Bug #3434372.
  • Fixed leak of document objects in SciTE.
  • Recognise URL characters '?' and '%' for Open Selected command in SciTE. Bug #3429409.

Release 3.0.0

  • Released 1 November 2011.
  • Carbon platform support removed. OS X applications should switch to Cocoa.
  • On Windows Vista or newer, drawing may be performed with Direct2D and DirectWrite instead of GDI.
  • Cairo is now used for all drawing on GTK+. GDK drawing was removed.
  • Paletted display support removed.
  • Fractional font sizes can be specified.
  • Different weights of text supported on some platforms instead of just normal and bold.
  • Sub-pixel character positioning supported.
  • SciTE loads files in the background without blocking the user interface.
  • SciTE can display diagnostic messages interleaved with the text of files immediately after the line referred to by the diagnostic.
  • New API to see if all lines are visible which can be used to optimize processing fold structure notifications.
  • Scrolling optimized by avoiding invalidation of fold margin when redrawing whole window.
  • Optimized SCI_MARKERNEXT.
  • C++ lexer supports Pike hash quoted strings when turned on with lexer.cpp.hashquoted.strings.
  • Fixed incorrect line height with annotations in wrapped mode when there are multiple views. Bug #3388159.
  • Calltips may be displayed above the text as well as below. Bug #3410830.
  • For huge files SciTE only examines the first megabyte for newline discovery.
  • SciTE on GTK+ removes the fileselector.show.hidden property and check box as this was buggy and GTK+ now supports an equivalent feature. Bug #3413630.
  • SciTE on GTK+ supports mnemonics in dynamic menus.
  • SciTE on GTK+ displays the user's home directory as '~' in menus to make them shorter.

Release 2.29

  • Released 16 September 2011.
  • To automatically discover the encoding of a file when opening it, SciTE can run a program set with command.discover.properties. Feature #3324341.
  • Cairo always used for drawing on GTK+.
  • The set of properties files imported by SciTE can be controlled with the properties imports.include and imports.exclude. The import statement has been extended to allow "import *". The properties files for some languages are no longer automatically loaded by default. The properties files affected are avenue, baan, escript, lot, metapost, and mmixal.
  • C++ lexer fixed a bug with raw strings being recognised too easily. Bug #3388122.
  • LaTeX lexer improved with more states and fixes to most outstanding bugs. Bug #1493111. Bug #1856356. Bug #3081692.
  • Lua lexer updates for Lua 5.2 beta with goto labels and "\z" string escape. Feature #3386330.
  • Perl string styling highlights interpolated variables. Feature #3394258. Bug #3076629.
  • Perl lexer updated for Perl 5.14.0 with 0X and 0B numeric literal prefixes, break keyword and "+" supported in subroutine prototypes. Feature #3388802.
  • Perl bug fixed with CRLF line endings.
  • Markdown lexer fixed to not change state with "_" in middle of word. Bug #3398184.
  • Cocoa restores compatibility with OS X 10.5.
  • Mouse pointer changes over selection to an arrow near start when scrolled horizontally. Bug #3389055.
  • Indicators that finish at the end of the document no longer expand when text is appended. Bug #3378718.
  • SparseState merge fixed to check if other range is empty. Bug #3387053.
  • On Windows, autocompletion lists will scroll instead of document when mouse wheel spun. Feature #3403600.
  • SciTE performs more rapid polling for command completion so will return faster and report more accurate times.
  • SciTE resizes panes proportionally when switched between horizontal and vertical layout. Feature #3376784.
  • SciTE on GTK+ opens multiple files into a single instance more reliably. Bug #3363754.

Release 2.28

  • Released 1 August 2011.
  • GTK+ Cairo support works back to GTK+ version 2.8. Requires changing Scintilla source code to enable before GTK+ 2.22. Bug #3322351.
  • Translucent images in RGBA format can be used for margin markers and in autocompletion lists.
  • INDIC_DOTBOX added as a translucent dotted rectangular indicator.
  • Asian text input using IME works for GTK+ 3.x and GTK+ 2.x with Cairo.
  • On GTK+, IME works for Ctrl+Shift+U Unicode input in Scintilla. For SciTE, Ctrl+Shift+U is still Make Selection Uppercase.
  • Key bindings for GTK+ on OS X made compatible with Cocoa port and platform conventions.
  • Cocoa port supports different character encodings, improves scrolling performance and drag image appearance. The control ID is included in WM_COMMAND notifications. Text may be deleted by dragging to the trash. ScrollToStart and ScrollToEnd key commands added to simplify implementation of standard OS X Home and End behaviour.
  • SciTE on GTK+ uses a paned widget to contain the edit and output panes instead of custom code. This allows the divider to be moved easily on GTK+ 3 and its appearance follows GTK+ conventions more closely.
  • SciTE builds and installs on BSD. Bug #3324644.
  • Cobol supports fixed format comments. Bug #3014850.
  • Mako template language block syntax extended and ## comments recognised. Feature #3325178. Bug #3318818.
  • Folding of Mako template language within HTML fixed. Bug #3324563.
  • Python lexer has lexer.python.keywords2.no.sub.identifiers option to avoid highlighting second set of keywords following '.'. Bug #3325333.
  • Python folder fixes bug where fold would not extend to final line. Bug #3349157.
  • SciTE treats LPEG lexers the same as script lexers by setting all 8 style bits.
  • For Cocoa, crashes with unsupported font variants and memory leaks for colour objects fixed.
  • Shift-JIS lead byte ranges modified to match Windows.
  • Mouse pointer changes over selection to an arrow more consistently. Bug #3315756.
  • Bug fixed with annotations beyond end of document. Bug #3347268.
  • Incorrect drawing fixed for combination of background colour change and translucent selection. Bug #3377116.
  • Lexers initialized correctly when started at position other than start of line. Bug #3377148.
  • Fold highlight drawing fixed for some situations. Bug #3323015. Bug #3323805.
  • Case insensitive search fixed for cases where folded character uses fewer bytes than base character. Bug #3362038.
  • SciTE bookmark.alpha setting fixed. Bug #3373907.

Release 2.27

  • Released 20 June 2011.
  • On recent GTK+ 2.x versions when using Cairo, bug fixed where wrong colours were drawn.
  • SciTE on GTK+ slow performance in menu maintenance fixed. Bug #3315233.
  • Cocoa platform supports 64-bit builds and uses only non-deprecated APIs. Asian Input Method Editors are supported. Autocompletion lists and calltips implemented. Control identifier used in notifications.
  • On Cocoa, rectangular selection now uses Option/Alt key to be compatible with Apple Human Interface Guidelines and other applications. The Control key is reported with an SCMOD_META modifier bit.
  • API added for setting and retrieving the identifier number used in notifications.
  • SCI_SETEMPTYSELECTION added to set selection without scrolling or redrawing more than needed. Feature #3314877.
  • Added new indicators. INDIC_DASH and INDIC_DOTS are variants of underlines. INDIC_SQUIGGLELOW indicator added as shorter alternative to INDIC_SQUIGGLE for small fonts. Bug #3314591
  • Margin line selection can be changed to select display lines instead of document lines. Bug #3312763.
  • On Windows, SciTE can perform reverse searches by pressing Shift+Enter in the Find or Replace strips or dialogs.
  • Matlab lexer does not special case '\' in single quoted strings. Bug #948757 Bug #1755950 Bug #1888738 Bug #3316852.
  • Verilog lexer supports SystemVerilog folding and keywords.
  • Font leak fixed. Bug #3306156.
  • Automatic scrolling works for long wrapped lines. Bug #3312763.
  • Multiple typing works for cases where selections collapse together. Bug #3309906.
  • Fold expanded when needed in word wrap mode. Bug #3291579.
  • Bug fixed with edge drawn in wrong place on wrapped lines. Bug #3314807.
  • Bug fixed with unnecessary scrolling for SCI_GOTOLINE. Bug #3303406.
  • Bug fixed where extra step needed to undo SCI_CLEAR in virtual space. Bug #3159691.
  • Regular expression search fixed for \$ on last line of search range. Bug #3313746.
  • SciTE performance improved when switching to a tab with a very large file. Bug #3311421.
  • On Windows, SciTE advanced search remembers the "Search only in this style" setting. Bug #3313344.
  • On GTK+, SciTE opens help using "xdg-open" instead of "netscape" as "netscape" no longer commonly installed. Bug #3314377.
  • SciTE script lexers can use 256 styles.
  • SciTE word highlight works for words containing DBCS characters. Bug #3315173.
  • Compilation fixed for wxWidgets. Bug #3306156.

Release 2.26

  • Released 25 May 2011.
  • Folding margin symbols can be highlighted for the current folding block. Feature #3147069.
  • Selected lines can be moved up or down together. Feature #3304850.
  • SciTE can highlight all occurrences of the current word or selected text. Feature #3291636.
  • Experimental GTK+ 3.0 support: build with "make GTK3=1".
  • INDIC_STRAIGHTBOX added. Is similar to INDIC_ROUNDBOX but without rounded corners. Bug #3290435.
  • Can show brace matching and mismatching with indicators instead of text style. Translucency of outline can be altered for INDIC_ROUNDBOX and INDIC_STRAIGHTBOX. Feature #3290434.
  • SciTE can automatically indent python by examining previous line for scope-starting ':' with indent.python.colon.
  • Batch file lexer allows braces '(' or ')' inside variable names.
  • The cpp lexer only recognises Vala triple quoted strings when lexer.cpp.triplequoted.strings property is set. Bug #3239234.
  • Make file lexer treats a variable with a nested variable like $(f$(qx)b) as one variable. Bug #3298223.
  • Folding bug fixed for JavaScript with nested PHP. Bug #3193530.
  • HTML lexer styles Django's {# #} comments. Bug #3013798.
  • HTML lexer styles JavaScript regular expression correctly for /abc/i.test('abc');. Bug #3209108.
  • Inno Setup Script lexer now works properly when it restarts from middle of [CODE] section. Bug #3283880. Bug #3129044.
  • Lua lexer updated for Lua 5.2 with hexadecimal floating-point numbers and '\*' whitespace escaping in strings. Feature #3243811.
  • Perl folding folds "here doc"s and adds options fold.perl.at.else and fold.perl.comment.explicit. Fold structure for Perl fixed. Feature #3112671. Bug #3265401.
  • Python lexer supports cpdef keyword for Cython. Bug #3279728.
  • SQL folding option lexer.sql.fold.at.else renamed to fold.sql.at.else. Bug #3271474.
  • SQL lexer no longer treats ';' as terminating a comment. Bug #3196071.
  • Text drawing and measurement segmented into smaller runs to avoid platform bugs. Bug #3277449. Bug #3165743.
  • SciTE on Windows adds temp.files.sync.load property to open dropped temporary files synchronously as they may be removed before they can be opened asynchronously. Bug #3072009.
  • Bug fixed with indentation guides ignoring first line in SC_IV_LOOKBOTH mode. Bug #3291317.
  • Bugs fixed in backward regex search. Bug #3292659.
  • Bugs with display of folding structure fixed for wrapped lines and where there is a fold header but no body. Bug #3291579. Bug #3265401.
  • SciTE on Windows cursor changes to an arrow now when over horizontal splitter near top of window. Bug #3286620.
  • Fixed default widget size problem on GTK+. Bug #3267892.
  • Fixed font size when using Cairo on GTK+. Bug #3272662.
  • Fixed primary selection and cursor issues on GTK+ when unrealized then realized. Bug #3256153.
  • Right click now cancels selection on GTK+ like on Windows. Bug #3235190.
  • SciTE on GTK+ implements z-order buffer switching like on Windows. Bug #3228384.
  • Improve selection position after SciTE Insert Abbreviation command when abbreviation expansion includes '|'.

Release 2.25

  • Released 21 March 2011.
  • SparseState class makes it easier to write lexers which have to remember complex state between lines.
  • Visual Studio project (.dsp) files removed. The make files should be used instead as described in the README.
  • Modula 3 lexer added along with SciTE support. Feature #3173374.
  • Asm, Basic, and D lexers add extra folding properties.
  • Raw string literals for C++0x supported in C++ lexer.
  • Triple-quoted strings used in Vala language supported in C++ lexer. Feature #3177601.
  • The errorlist lexer used in SciTE's output pane colours lines that start with '<' as diff deletions. Feature #3172878.
  • The Fortran lexer correctly folds type-bound procedures from Fortran 2003.
  • LPeg lexer support‎ improved in SciTE.
  • SciTE on Windows-64 fixes for menu localisation and Lua scripts. Bug #3204502.
  • SciTE on Windows avoids locking folders when using the open or save dialogs. Bug #1795484.
  • Diff lexer fixes problem where diffs of diffs producing lines that start with "----". Bug #3197952.
  • Bug fixed when searching upwards in Chinese code page 936. Bug #3176271.
  • On Cocoa, translucent drawing performed as on other platforms instead of 2.5 times less translucent.
  • Performance issue and potential bug fixed on GTK+ with caret line for long lines.

Release 2.24

  • Released 3 February 2011.
  • Fixed memory leak in GTK+ Cairo code. Feature #3157655.
  • Insert Abbreviation dialog added to SciTE on GTK+.
  • SCN_UPDATEUI notifications received when window scrolled. An 'updated' bit mask indicates which types of update have occurred from SC_UPDATE_SELECTION, SC_UPDATE_CONTENT, SC_UPDATE_H_SCROLL or SC_UPDATE_V_SCROLL. Feature #3125977.
  • On Windows, to ensure reverse arrow cursor matches platform default, it is now generated by reflecting the platform arrow cursor. Feature #3143968.
  • Can choose mouse cursor used in margins. Feature #3161326.
  • On GTK+, SciTE sets a mime type of text/plain in its .desktop file so that it will appear in the shell context menu. Feature #3137126.
  • Bash folder handles here docs. Feature #3118223.
  • C++ folder adds fold.cpp.syntax.based, fold.cpp.comment.multiline, fold.cpp.explicit.start, fold.cpp.explicit.end, and fold.cpp.explicit.anywhere properties to allow more control over folding and choice of explicit fold markers.
  • C++ lexer fixed to always handle single quote strings continued past a line end. Bug #3150522.
  • Ruby folder handles here docs. Feature #3118224.
  • SQL lexer allows '.' to be part of words. Feature #3103129.
  • SQL folder handles case statements in more situations. Feature #3135027.
  • SQL folder adds fold points inside expressions based on bracket structure. Feature #3165488.
  • SQL folder drops fold.sql.exists property as 'exists' is handled automatically. Bug #3164194.
  • SciTE only forwards properties to lexers when they have been explicitly set so the defaults set by lexers are used rather than 0.
  • Mouse double click word selection chooses the word around the character under the mouse rather than the inter-character position under the mouse. This makes double clicking select what the user is pointing at and avoids selecting adjacent non-word characters. Bug #3111174.
  • Fixed mouse double click to always perform word select, not line select. Bug #3143635.
  • Right click cancels autocompletion. Bug #3144531.
  • Fixed multiPaste to work when additionalSelectionTyping off. Bug #3126221.
  • Fixed virtual space problems when text modified at caret. Bug #3154986.
  • Fixed memory leak in lexer object code. Bug #3133672.
  • Fixed SciTE on GTK+ search failure when using regular expression. Bug #3156217.
  • Avoid unnecessary full window redraw for SCI_GOTOPOS. Feature #3146650.
  • Avoid unnecessary redraw when indicator fill range makes no real change.

Release 2.23

  • Released 7 December 2010.
  • On GTK+ version 2.22 and later, drawing is performed with Cairo rather than GDK. This is in preparation for GTK+ 3.0 which will no longer support GDK drawing. The appearance of some elements will be different with Cairo as it is anti-aliased and uses sub-pixel positioning. Cairo may be turned on for GTK+ versions before 2.22 by defining USE_CAIRO although this has not been extensively tested.
  • New lexer a68k for Motorola 68000 assembler. Feature #3101598.
  • Borland C++ is no longer supported for building Scintilla or SciTE on Windows.
  • Performance improved when creating large rectangular selections.
  • PHP folder recognises #region and #endregion comments. Feature #3101624.
  • SQL lexer has a lexer.sql.numbersign.comment option to turn off use of '#' comments as these are a non-standard feature only available in some implementations. Feature #3098071.
  • SQL folder recognises case statements and understands the fold.at.else property. Bug #3104091. Bug #3107362.
  • SQL folder fixes bugs with end statements when fold.sql.only.begin=1. Bug #3104091.
  • SciTE on Windows bug fixed with multi-line tab bar not adjusting correctly when maximizing and demaximizing. Bug #3097517.
  • Crash fixed on GTK+ when Scintilla widget destroyed while it still has an outstanding style idle pending.
  • Bug fixed where searching backwards in DBCS text (code page 936 or similar) failed to find occurrences at the start of the line. Bug #3103936.
  • SciTE on Windows supports Unicode file names when executing help applications with winhelp and htmlhelp subsystems.

Release 2.22

  • Released 27 October 2010.
  • SciTE includes support for integrating with Scintillua which allows lexers to be implemented in Lua as a Parsing Expression Grammar (PEG).
  • Regular expressions allow use of '?' for non-greedy matches or to match 0 or 1 instances of an item.
  • SCI_CONTRACTEDFOLDNEXT added to allow rapid retrieval of folding state.
  • SCN_HOTSPOTRELEASECLICK notification added which is similar to SCN_HOTSPOTCLICK but occurs when the mouse is released. Feature #3082409.
  • Command added for centring current line in window. Feature #3064696.
  • SciTE performance improved by not examining document for line ends when switching buffers and not storing folds when folding turned off.
  • Bug fixed where scrolling to ensure the caret is visible did not take into account all pixels of the line. Bug #3081721.
  • Bug fixed for autocompletion list overlapping text when WS_EX_CLIENTEDGE used. Bug #3079778.
  • After autocompletion, the caret's X is updated. Bug #3079114.
  • On Windows, default to the system caret blink time. Feature #3079784.
  • PgUp/PgDn fixed to allow virtual space. Bug #3077452.
  • Crash fixed when AddMark and AddMarkSet called with negative argument. Bug #3075074.
  • Dwell notifications fixed so that they do not occur when the mouse is outside Scintilla. Bug #3073481.
  • Bash lexer bug fixed for here docs starting with <<-. Bug #3063822.
  • C++ lexer bug fixed for // comments that are continued onto a second line by a \. Bug #3066031.
  • C++ lexer fixes wrong highlighting for float literals containing +/-. Bug #3058924.
  • JavaScript lexer recognise regexes following return keyword.‎ Bug #3062287.
  • Ruby lexer handles % quoting better and treats range dots as operators in 1..2 and 1...2. Ruby folder handles "if" keyword used as a modifier even when it is separated from the modified statement by an escaped new line. Bug #2093767. Bug #3058496.
  • Bug fixed where upwards search failed with DBCS code pages. Bug #3065912.
  • SciTE has a default Lua startup script name distributed in SciTEGlobal.properties. No error message is displayed if this file does not exist.
  • SciTE on Windows tab control height is calculated better. Bug #2635702.
  • SciTE on Windows uses better themed check buttons in find and replace strips.
  • SciTE on Windows fixes bug with Find strip appearing along with Incremental Find strip.
  • SciTE setting find.close.on.find added to allow preventing the Find dialog from closing.
  • SciTE on Windows attempts to rerun commands that fail by prepending them with "cmd.exe /c". This allows commands built in to the command processor like "dir" to run.

Release 2.21

  • Released 1 September 2010.
  • Asian Double Byte Character Set (DBCS) support improved. Case insensitive search works and other operations are much faster. Bug #2999125, Bug #2774616, Bug #2991942, Bug #3005688.
  • Scintilla on GTK+ uses only non-deprecated APIs (for GTK+ 2.20) except for GdkFont and GdkFont use can be disabled with the preprocessor symbol DISABLE_GDK_FONT.
  • IDocument interface used by lexers adds BufferPointer and GetLineIndentation methods.
  • On Windows, clicking sets focus before processing the click or sending notifications.
  • Bug on OS X (macosx platform) fixed where drag/drop overwrote clipboard. Bug #3039732.
  • GTK+ drawing bug when the view was horizontally scrolled more than 32000 pixels fixed.
  • SciTE bug fixed with invoking Complete Symbol from output pane. Bug #3050957.
  • Bug fixed where it was not possible to disable folding. Bug #3040649.
  • Bug fixed with pressing Enter on a folded fold header line not opening the fold. Bug #3043419.
  • SciTE 'Match case' option in find and replace user interfaces changed to 'Case sensitive' to allow use of 'v' rather than 'c' as the mnemonic.
  • SciTE displays stack trace for Lua when error occurs.. Bug #3051397.
  • SciTE on Windows fixes bug where double clicking on error message left focus in output pane. Bug #1264835.
  • SciTE on Windows uses SetDllDirectory to avoid a security problem.
  • C++ lexer crash fixed with preprocessor expression that looked like division by 0. Bug #3056825.
  • Haskell lexer improved. Feature #3039490.
  • HTML lexing fixed around Django {% %} tags. Bug #3034853.
  • HTML JavaScript lexing fixed when line end escaped. Bug #3038381.
  • HTML lexer stores line state produced by a line on that line rather than on the next line.
  • Markdown lexer fixes infinite loop. Bug #3045386.
  • MySQL folding bugs with END statements fixed. Bug #3031742.
  • PowerShell lexer allows '_' as a word character. Feature #3042228.
  • SciTE on GTK+ abandons processing of subsequent commands if a command.go.needs command fails.
  • When SciTE is closed, all buffers now receive an OnClose call. Bug #3033857.

Release 2.20

  • Released 30 July 2010.
  • Lexers are implemented as objects so that they may retain extra state. The interfaces defined for this are tentative and may change before the next release. Compatibility classes allow current lexers compiled into Scintilla to run with few changes. The interface to external lexers has changed and existing external lexers will need to have changes made and be recompiled. A single lexer object is attached to a document whereas previously lexers were attached to views which could lead to different lexers being used for split views with confusing results.
  • C++ lexer understands the preprocessor enough to grey-out inactive code due to conditional compilation.
  • SciTE can use strips within the main window for find and replace rather than dialogs. On Windows SciTE always uses a strip for incremental search.
  • Lexer added for Txt2Tags language. Feature #3018736.
  • Sticky caret feature enhanced with additional SC_CARETSTICKY_WHITESPACE mode . Feature #3027559.
  • Bash lexer implements basic parsing of compound commands and constructs. Feature #3033135.
  • C++ folder allows disabling explicit fold comments.
  • Perl folder works for array blocks, adjacent package statements, nested PODs, and terminates package folding at __DATA__, ^D and ^Z. Feature #3030887.
  • PowerShell lexer supports multiline <# .. #> comments and adds 2 keyword classes. Feature #3015176.
  • Lexing performed incrementally when needed by wrapping to make user interface more responsive.
  • SciTE setting replaceselection:yes works on GTK+.
  • SciTE Lua scripts calling io.open or io.popen on Windows have arguments treated as UTF-8 and converted to Unicode so that non-ASCII file paths will work. Lua files with non-ASCII paths run. Bug #3016951.
  • Crash fixed when searching for empty string. Bug #3017572.
  • Bugs fixed with folding and lexing when Enter pressed at start of line. Bug #3032652.
  • Bug fixed with line selection mode not affecting selection range. Bug #3021480.
  • Bug fixed where indicator alpha was limited to 100 rather than 255. Bug #3021473.
  • Bug fixed where changing annotation did not cause automatic redraw.
  • Regular expression bug fixed when a character range included non-ASCII characters.
  • Compilation failure with recent compilers fixed on GTK+. Bug #3022027.
  • Bug fixed on Windows with multiple monitors where autocomplete pop up would appear off-screen or straddling monitors. Bug #3017512.
  • SciTE on Windows bug fixed where changing directory to a Unicode path failed. Bug #3011987.
  • SciTE on Windows bug fixed where combo boxes were not allowing Unicode characters. Bug #3012986.
  • SciTE on GTK+ bug fixed when dragging files into SciTE on KDE. Bug #3026555.
  • SciTE bug fixed where closing untitled file could lose data if attempt to name file same as another buffer. Bug #3011680.
  • COBOL number masks now correctly highlighted. Bug #3012164.
  • PHP comments can include <?PHP without triggering state change. Bug #2854183.
  • VHDL lexer styles unclosed string correctly. Bug #3029627.
  • Memory leak fixed in list boxes on GTK+. Bug #3007669.

Release 2.12

  • Released 1 June 2010.
  • Drawing optimizations improve speed and fix some visible flashing when scrolling.
  • Copy Path command added to File menu in SciTE. Feature #2986745.
  • Optional warning displayed by SciTE when saving a file which has been modified by another process. Feature #2975041.
  • Flagship lexer for xBase languages updated to follow the language much more closely. Feature #2992689.
  • HTML lexer highlights Django templates in more regions. Feature #3002874.
  • Dropping files on SciTE on Windows, releases the drag object earlier and opens the files asynchronously, leading to smoother user experience. Feature #2986724.
  • SciTE HTML exports take the Use Monospaced Font setting into account.
  • SciTE window title "[n of m]" localised.
  • When new line inserted at start of line, markers are moved down. Bug #2986727.
  • On Windows, dropped text has its line ends converted, similar to pasting. Bug #3005328.
  • Fixed bug with middle-click paste in block select mode where text was pasted next to selection rather than at cursor. Bug #2984460.
  • Fixed SciTE crash where a style had a size parameter without a value. Bug #3003834.
  • Debug assertions in multiple lexers fixed. Bug #3000566.
  • CSS lexer fixed bug where @font-face displayed incorrectly Bug #2994224.
  • CSS lexer fixed bug where open comment caused highlighting error. Bug #1683672.
  • Shell file lexer fixed highlight glitch with here docs where the first line is a comment. Bug #2830239.
  • Bug fixed in SciTE openpath property that caused Open Selected File to fail to open the selected file.
  • Bug fixed in SciTE FileExt property when file name with no extension evaluated to whole path.
  • Fixed SciTE on Windows printing bug where the $(CurrentTime), $(CurrentPage) variables were not expanded. Bug #2994612.
  • SciTE compiles for 64-bit Windows and runs without crashing. Bug #2986312.
  • Full Screen mode in Windows Vista/7 improved to hide Start button and size borders a little better. Bug #3002813.

Release 2.11

  • Released 9 April 2010.
  • Fixes compatibility of Scintilla.h with the C language.
  • With a rectangular selection SCI_GETSELECTIONSTART and SCI_GETSELECTIONEND return limits of the rectangular selection rather than the limits of the main selection.
  • When SciTE on Windows is minimized to tray, only takes a single click to restore rather than a double click. Feature #981917.

Release 2.10

  • Released 4 April 2010.
  • Version 1.x of GTK+ is no longer supported.
  • SciTE is no longer supported on Windows 95, 98 or ME.
  • Case-insensitive search works for non-ASCII characters in UTF-8 and 8-bit encodings. Non-regex search in DBCS encodings is always case-sensitive.
  • Non-ASCII characters may be changed to upper and lower case.
  • SciTE on Windows can access all files including those with names outside the user's preferred character encoding.
  • SciTE may be extended with lexers written in Lua.
  • When there are multiple selections, the paste command can go either to the main selection or to each selection. This is controlled with SCI_SETMULTIPASTE.
  • More forms of bad UTF-8 are detected including overlong sequences, surrogates, and characters outside the valid range. Bad UTF-8 bytes are now displayed as 2 hex digits preceded by 'x'.
  • SCI_GETTAG retrieves the value of captured expressions within regular expression searches.
  • Django template highlighting added to the HTML lexer. Feature #2974889.
  • Verilog line comments can be folded.
  • SciTE on Windows allows specifying a filter for the Save As dialog. Feature #2943445.
  • Bug fixed when multiple selection disabled where rectangular selections could be expanded into multiple selections. Bug #2948260.
  • Bug fixed when document horizontally scrolled and up/down-arrow did not return to the same column after horizontal scroll occurred. Bug #2950799.
  • Bug fixed to remove hotspot highlight when mouse is moved out of the document. Windows only fix. Bug #2951353.
  • R lexer now performs case-sensitive check for keywords. Bug #2956543.
  • Bug fixed on GTK+ where text disappeared when a wrap occurred. Bug #2958043.
  • Bug fixed where regular expression replace cannot escape the '\' character by using '\\'. Bug #2959876.
  • Bug fixed on GTK+ when virtual space disabled, middle-click could still paste text beyond end of line. Bug #2971618.
  • SciTE crash fixed when double clicking on a malformed error message in the output pane. Bug #2976551.
  • Improved performance on GTK+ when changing parameters associated with scroll bars to the same value. Bug #2964357.
  • Fixed bug with pressing Shift+Tab with a rectangular selection so that it performs an un-indent similar to how Tab performs an indent.

Release 2.03

  • Released 14 February 2010.
  • Added SCI_SETFIRSTVISIBLELINE to match SCI_GETFIRSTVISIBLELINE.
  • Erlang lexer extended set of numeric bases recognised; separate style for module:function_name; detects built-in functions, known module attributes, and known preprocessor instructions; recognises EDoc and EDoc macros; separates types of comments. Bug #2942448.
  • Python lexer extended with lexer.python.strings.over.newline option that allows non-triple-quoted strings to extend past line ends. This allows use of the Ren'Py language. Feature #2945550.
  • Fixed bugs with cursor movement after deleting a rectangular selection. Bug #2942131.
  • Fixed bug where calling SCI_SETSEL when there is a rectangular selection left the additional selections selected. Bug #2947064.
  • Fixed macro recording bug where not all bytes in multi-byte character insertions were reported through SCI_REPLACESEL.
  • Fixed SciTE bug where using Ctrl+Enter followed by Ctrl+Space produced an autocompletion list with only a single line containing all the identifiers.
  • Fixed SciTE on GTK+ bug where running a tool made the user interface completely unresponsive.
  • Fixed SciTE on Windows Copy to RTF bug. Bug #2108574.

Release 2.02

  • Released on 25 January 2010.
  • Markdown lexer added. Feature #2844081.
  • On GTK+, include code that understands the ranges of lead bytes for code pages 932, 936, and 950 so that most Chinese and Japanese text can be used on systems that are not set to the corresponding locale.
  • Allow changing the size of dots in visible whitespace using SCI_SETWHITESPACESIZE. Feature #2839427.
  • Additional carets can be hidden with SCI_SETADDITIONALCARETSVISIBLE.
  • Can choose anti-aliased, non-anti-aliased or lcd-optimized text using SCI_SETFONTQUALITY.
  • Retrieve the current selected text in the autocompletion list with SCI_AUTOCGETCURRENTTEXT.
  • Retrieve the name of the current lexer with SCI_GETLEXERLANGUAGE.
  • Progress 4GL lexer improves handling of comments in preprocessor declaration. Feature #2902206.
  • HTML lexer extended to handle Mako template language.
  • SQL folder extended for SQL Anywhere "EXISTS" and "ENDIF" keywords. Feature #2887524.
  • SciTE adds APIPath and AbbrevPath variables.
  • SciTE on GTK+ uses pipes instead of temporary files for running tools. This should be more secure.
  • Fixed crash when calling SCI_STYLEGETFONT for a style which does not have a font set. Bug #2857425.
  • Fixed crash caused by not having sufficient styles allocated after choosing a lexer. Bug #2881279.
  • Fixed crash in SciTE using autocomplete word when word characters includes space. Bug #2840141.
  • Fixed bug with handling upper-case file extensions SciTE on GTK+.
  • Fixed SciTE loading files from sessions with folded folds where it would not be scrolled to the correct location. Bug #2882775.
  • Fixed SciTE loading files from sessions when file no longer exists. Bug #2883437.
  • Fixed SciTE export to HTML using the wrong background colour.
  • Fixed crash when adding an annotation and then adding a new line after the annotation. Bug #2929708.
  • Fixed crash in SciTE setting a property to nil from Lua.
  • SCI_GETSELTEXT fixed to return correct length. Bug #2929441.
  • Fixed text positioning problems with selection in some circumstances.
  • Fixed text positioning problems with ligatures on GTK+.
  • Fixed problem pasting into rectangular selection with caret at bottom caused text to go from the caret down rather than replacing the selection.
  • Fixed problem replacing in a rectangular selection where only the final line was changed.
  • Fixed inability to select a rectangular area using Alt+Shift+Click at both corners. Bug #2899746.
  • Fixed problem moving to start/end of a rectangular selection with left/right key. Bug #2871358.
  • Fixed problem with Select All when there's a rectangular selection. Bug #2930488.
  • Fixed SCI_LINEDUPLICATE on a rectangular selection to not produce multiple discontinuous selections.
  • Virtual space removed when performing delete word left or delete line left. Virtual space converted to real space for delete word right. Preserve virtual space when pressing Delete key. Bug #2882566.
  • Fixed problem where Shift+Alt+Down did not move through wrapped lines. Bug #2871749.
  • Fixed incorrect background colour when using coloured lines with virtual space. Bug #2914691.
  • Fixed failure to display wrap symbol for SC_WRAPVISUALFLAGLOC_END_BY_TEXT. Bug #2936108.
  • Fixed blank background colour with EOLFilled style on last line. Bug #2890105.
  • Fixed problem in VB lexer with keyword at end of file. Bug #2901239.
  • Fixed SciTE bug where double clicking on a tab closed the file.
  • Fixed SciTE brace matching commands to only work when the caret is next to the brace, not when it is in virtual space. Bug #2885560.
  • Fixed SciTE on Windows Vista to access files in the Program Files directory rather than allow Windows to virtualize access. Bug #2916685.
  • Fixed NSIS folder to handle keywords that start with '!'. Bug #2872157.
  • Changed linkage of Scintilla_LinkLexers to "C" so that it can be used by clients written in C. Bug #2844718.

Release 2.01

  • Released on 19 August 2009.
  • Fix to positioning rectangular paste when viewing line ends.
  • Don't insert new lines and indentation for line ends at end of rectangular paste.
  • When not in additional selection typing mode, cutting a rectangular selection removes all of the selected text.
  • Rectangular selections are copied to the clipboard in document order, not in the order of selection.
  • SCI_SETCURRENTPOS and SCI_SETANCHOR work in rectangular mode.
  • On GTK+, drag and drop to a later position in the document now drops at the position.
  • Fix bug where missing property did not use default value.

Release 2.0

  • Released on 11 August 2009.
  • Multiple pieces of text can be selected simultaneously by holding control while dragging the mouse. Typing, backspace and delete may affect all selections together.
  • Virtual space allows selecting beyond the last character on a line.
  • SciTE on GTK+ path bar is now optional and defaults to off.
  • MagikSF lexer recognises numbers correctly.
  • Folding of Python comments and blank lines improved. Bug #210240.
  • Bug fixed where background colour of last character in document leaked past that character.
  • Crash fixed when adding marker beyond last line in document. Bug #2830307.
  • Resource leak fixed in SciTE for Windows when printing fails. Bug #2816524.
  • Bug fixed on Windows where the system caret was destroyed during destruction when another window was using the system caret. Bug #2830223.
  • Bug fixed where indentation guides were drawn over text when the indentation used a style with a different space width to the default style.
  • SciTE bug fixed where box comment added a bare line feed rather than the chosen line end. Bug #2818104.
  • Reverted fix that led to wrapping whole document when displaying the first line of the document.
  • Export to LaTeX in SciTE fixed to work in more cases and not use as much space. Bug #1286548.
  • Bug fixed where EN_CHANGE notification was sent when performing a paste operation in a read-only document. Bug #2825485.
  • Refactored code so that Scintilla exposes less of its internal implementation and uses the C++ standard library for some basic collections. Projects that linked to Scintilla's SString or PropSet classes should copy this code from a previous version of Scintilla or from SciTE.

Release 1.79

  • Released on 1 July 2009.
  • Memory exhaustion and other exceptions handled by placing an error value into the status property rather than crashing. Scintilla now builds with exception handling enabled and requires exception handling to be enabled.
    This is a major change and application developers should consider how they will deal with Scintilla exhausting memory since Scintilla may not be in a stable state.
  • Deprecated APIs removed. The symbols removed are:
    • SCI_SETCARETPOLICY
    • CARET_CENTER
    • CARET_XEVEN
    • CARET_XJUMPS
    • SC_FOLDFLAG_BOX
    • SC_FOLDLEVELBOXHEADERFLAG
    • SC_FOLDLEVELBOXFOOTERFLAG
    • SC_FOLDLEVELCONTRACTED
    • SC_FOLDLEVELUNINDENT
    • SCN_POSCHANGED
    • SCN_CHECKBRACE
    • SCLEX_ASP
    • SCLEX_PHP
  • Cocoa platform added.
  • Names of struct types in Scintilla.h now start with "Sci_" to avoid possible clashes with platform definitions. Currently, the old names still work but these will be phased out.
  • When lines are wrapped, subsequent lines may be indented to match the indent of the initial line, or one more indentation level. Feature #2796119.
  • APIs added for finding the character at a point rather than an inter-character position. Feature #2646738.
  • A new marker SC_MARK_BACKGROUND_UNDERLINE is drawn in the text area as an underline the full width of the window.
  • Batch file lexer understands variables surrounded by '!'.
  • CAML lexer also supports SML.
  • D lexer handles string and numeric literals more accurately. Feature #2793782.
  • Forth lexer is now case-insensitive and better supports numbers like $hex and %binary. Feature #2804894.
  • Lisp lexer treats '[', ']', '{', and '}' as balanced delimiters which is common usage. Feature #2794989.
    It treats keyword argument names as being equivalent to symbols. Feature #2794901.
  • Pascal lexer bug fixed to prevent hang when 'interface' near beginning of file. Bug #2802863.
  • Perl lexer bug fixed where previous lexical states persisted causing "/" special case styling and subroutine prototype styling to not be correct. Bug #2809168.
  • XML lexer fixes bug where Unicode entities like '&—' were broken into fragments. Bug #2804760.
  • SciTE on GTK+ enables scrolling the tab bar on recent versions of GTK+. Feature #2061821.
  • SciTE on Windows allows tab bar tabs to be reordered by drag and drop.
  • Unit test script for Scintilla on Windows included with source code.
  • User defined menu items are now localised when there is a matching translation.
  • Width of icon column of autocompletion lists on GTK+ made more consistent.
  • Bug with slicing UTF-8 text into character fragments when there is a sequence of 100 or more 3 byte characters. Bug #2780566.
  • Folding bugs introduced in 1.78 fixed. Some of the fix was generic and there was also a specific fix for C++.
  • Bug fixed where a rectangular paste was not padding the line with sufficient spaces to align the pasted text.
  • Bug fixed with showing all text on each line of multi-line annotations when styling the whole annotation using SCI_ANNOTATIONSETSTYLE. Bug #2789430.

Release 1.78

  • Released on 28 April 2009.
  • Annotation lines may be added to each line.
  • A text margin may be defined with different text on each line.
  • Application actions may be added to the undo history.
  • Can query the symbol defined for a marker. An available symbol added for applications to indicate that plugins may allocate a marker.
  • Can increase the amount of font ascent and descent.
  • COBOL lexer added. Feature #2127406.
  • Nimrod lexer added. Feature #2642620.
  • PowerPro lexer added. Feature #2195308.
  • SML lexer added. Feature #2710950.
  • SORCUS Installation file lexer added. Feature #2343375.
  • TACL lexer added. Feature #2127406.
  • TAL lexer added. Feature #2127406.
  • Rewritten Pascal lexer with improved folding and other fixes. Feature #2190650.
  • INDIC_ROUNDBOX translucency level can be modified. Feature #2586290.
  • C++ lexer treats angle brackets in #include directives as quotes when styling.within.preprocessor. Bug #2551033.
  • Inno Setup lexer is sensitive to whether within the [Code] section and handles comments better. Bug #2552973.
  • HTML lexer does not go into script mode when script tag is self-closing.
  • HTML folder fixed where confused by comments when fold.html.preprocessor off. Bug #2532774.
  • Perl lexer fixes problem with string matching caused by line endings. Bug #2648342.
  • Progress lexer fixes problem with "last-event:function" phrase. Bug #2483619.
  • Properties file lexer extended to handle RFC2822 text when lexer.props.allow.initial.spaces on.
  • Python lexer adds options for Python 3 and Cython.
  • Shell lexer fixes heredoc problem caused by line endings. Bug #2635257.
  • TeX lexer handles comment at end of line correctly. Bug #2698766.
  • SciTE retains selection range when performing a replace selection command. Feature #2339160.
  • SciTE definition of word characters fixed to match documentation. Bug #2464531.
  • SciTE on GTK+ performing Search or Replace when dialog already shown now brings dialog to foreground. Bug #2634224.
  • Fixed encoding bug with calltips on GTK+.
  • Block caret drawn in correct place on wrapped lines. Bug #2126144.
  • Compilation for 64 bit Windows works using MinGW. Bug #2515578.
  • Incorrect memory freeing fixed on OS X. Bug #2354098, Bug #2671749.
  • SciTE on GTK+ crash fixed on startup when child process exits before initialisation complete. Bug #2716987.
  • Crash fixed when AutoCompleteGetCurrent called with no active autocompletion.
  • Flickering diminished when pressing Tab. Bug #2723006.
  • Namespace compilation issues with GTK+ on OS X fixed.
  • Increased maximum length of SciTE's Language menu on GTK+ to 100 items. Bug #2528241.
  • Fixed incorrect Python lexing for multi-line continued strings. Bug #2450963.

Release 1.77

  • Released on 18 October 2008.
  • Direct temporary access to Scintilla's text buffer to allow simple efficient interfacing to libraries like regular expression libraries.
  • Scintilla on Windows can interpret keys as Unicode even when a narrow character window with SCI_SETKEYSUNICODE.
  • Notification sent when autocompletion cancelled.
  • MySQL lexer added.
  • Lexer for gettext .po files added.
  • Abaqus lexer handles program structure more correctly.
  • Assembler lexer works with non-ASCII text.
  • C++ lexer allows mixed case doc comment tags.
  • CSS lexer updated and works with non-ASCII.
  • Diff lexer adds style for changed lines, handles subversion diffs better and fixes styling and folding for lines containing chunk dividers ("---").
  • FORTRAN lexer accepts more styles of compiler directive.
  • Haskell lexer allows hexadecimal literals.
  • HTML lexer improves PHP and JavaScript folding. PHP heredocs, nowdocs, strings and comments processed more accurately. Internet Explorer's non-standard >comment< tag supported. Script recognition in XML can be controlled with lexer.xml.allow.scripts property.
  • Lua lexer styles last character correctly.
  • Perl lexer update.
  • Comment folding implemented for Ruby.
  • Better TeX folding.
  • Verilog lexer updated.
  • Windows Batch file lexer handles %~ and %*.
  • YAML lexer allows non-ASCII text.
  • SciTE on GTK+ implements "Replace in Buffers" in advanced mode.
  • The extender OnBeforeSave method can override the default file saving behaviour by retuning true.
  • Window position and recent files list may be saved into the session file.
  • Right button press outside the selection moves the caret.
  • SciTE load.on.activate works when closing a document reveals a changed document.
  • SciTE bug fixed where eol.mode not used for initial buffer.
  • SciTE bug fixed where a file could be saved as the same name as another buffer leading to confusing behaviour.
  • Fixed display bug for long lines in same style on Windows.
  • Fixed SciTE crash when finding matching preprocessor command used on some files.
  • Drawing performance improved for files with many blank lines.
  • Folding bugs fixed where changing program text produced a decrease in fold level on a fold header line.
  • Clearing document style now clears all indicators.
  • SciTE's embedded Lua updated to 5.1.4.
  • SciTE will compile with versions of GTK+ before 2.8 again.
  • SciTE on GTK+ bug fixed where multiple files not opened.
  • Bug fixed with SCI_VCHOMEWRAP and SCI_VCHOMEWRAPEXTEND on white last line.
  • Regular expression bug fixed where "^[^(]+$" matched empty lines.

Release 1.76

  • Released on 16 March 2008.
  • Support for PowerShell.
  • Lexer added for Magik.
  • Director extension working on GTK+.
  • Director extension may set focus to SciTE through "focus:" message on GTK+.
  • C++ folder handles final line better in some cases.
  • SCI_COPYALLOWLINE added which is similar to SCI_COPY except that if the selection is empty then the line holding the caret is copied. On Windows an extra clipboard format allows pasting this as a whole line before the current selection. This behaviour is compatible with Visual Studio.
  • On Windows, the horizontal scroll bar can handle wider files.
  • On Windows, a system palette leak was fixed. Should not affect many as palette mode is rarely used.
  • Install command on GTK+ no longer tries to set explicit owner.
  • Perl lexer handles defined-or operator "//".
  • Octave lexer fixes "!=" operator.
  • Optimized selection change drawing to not redraw as much when not needed.
  • SciTE on GTK+ no longer echoes Lua commands so is same as on Windows.
  • Automatic vertical scrolling limited to one line at a time so is not too fast.
  • Crash fixed when line states set beyond end of line states. This occurred when lexers did not set a line state for each line.
  • Crash in SciTE on Windows fixed when search for 513 character string fails.
  • SciTE disables translucent features on Windows 9x due to crashes reported when using translucency.
  • Bug fixed where whitespace background was not seen on wrapped lines.

Release 1.75

  • Released on 22 November 2007.
  • Some WordList and PropSet functionality moved from Scintilla to SciTE. Projects that link to Scintilla's code for these classes may need to copy code from SciTE.
  • Borland C++ can no longer build Scintilla.
  • Invalid bytes in UTF-8 mode are displayed as hex blobs. This also prevents crashes due to passing invalid UTF-8 to platform calls.
  • Indentation guides enhanced to be visible on completely empty lines when possible.
  • The horizontal scroll bar may grow to match the widest line displayed.
  • Allow autocomplete pop ups to appear outside client rectangle in some cases.
  • When line state changed, SC_MOD_CHANGELINESTATE modification notification sent and margin redrawn.
  • SciTE scripts can access the menu command values IDM_*.
  • SciTE's statement.end property has been implemented again.
  • SciTE shows paths and matches in different styles for Find In Files.
  • Incremental search in SciTE for Windows is modeless to make it easier to exit.
  • Folding performance improved.
  • SciTE for GTK+ now includes a Browse button in the Find In Files dialog.
  • On Windows versions that support Unicode well, Scintilla is a wide character window which allows input for some less common languages like Armenian, Devanagari, Tamil, and Georgian. To fully benefit, applications should use wide character calls.
  • Lua function names are exported from SciTE to allow some extension libraries to work.
  • Lexers added for Abaqus, Ansys APDL, Asymptote, and R.
  • SCI_DELWORDRIGHTEND added for closer compatibility with GTK+ entry widget.
  • The styling buffer may now use all 8 bits in each byte for lexical states with 0 bits for indicators.
  • Multiple characters may be set for SciTE's calltip.<lexer>.parameters.start property.
  • Bash lexer handles octal literals.
  • C++/JavaScript lexer recognises regex literals in more situations.
  • Haskell lexer fixed for quoted strings.
  • HTML/XML lexer does not notice XML indicator if there is non-whitespace between the "<?" and "XML". ASP problem fixed where </ is used inside a comment.
  • Error messages from Lua 5.1 are recognised.
  • Folding implemented for Metapost.
  • Perl lexer enhanced for handling minus-prefixed barewords, underscores in numeric literals and vector/version strings, ^D and ^Z similar to __END__, subroutine prototypes as a new lexical class, formats and format blocks as new lexical classes, and '/' suffixed keywords and barewords.
  • Python lexer styles all of a decorator in the decorator style rather than just the name.
  • YAML lexer styles colons as operators.
  • Fixed SciTE bug where undo would group together multiple separate modifications.
  • Bug fixed where setting background colour of calltip failed.
  • SciTE allows wildcard suffixes for file pattern based properties.
  • SciTE on GTK+ bug fixed where user not prompted to save untitled buffer.
  • SciTE bug fixed where property values from one file were not seen by lower priority files.
  • Bug fixed when showing selection with a foreground colour change which highlighted an incorrect range in some positions.
  • Cut now invokes SCN_MODIFYATTEMPTRO notification.
  • Bug fixed where caret not shown at beginning of wrapped lines. Caret made visible in some cases after wrapping and scroll bar updated after wrapping.
  • Modern indicators now work on wrapped lines.
  • Some crashes fixed for 64-bit GTK+.
  • On GTK+ clipboard features improved for VMWare tools copy and paste. SciTE exports the clipboard more consistently on shut down.

Release 1.74

  • Released on 18 June 2007.
  • OS X support.
  • Indicators changed to be a separate data structure allowing more indicators. Storing indicators in high bits of styling bytes is deprecated and will be removed in the next version.
  • Unicode support extended to all Unicode characters not just the Basic Multilingual Plane.
  • Performance improved on wide lines by breaking long runs in a single style into shorter segments.
  • Performance improved by caching layout of short text segments.
  • SciTE includes Lua 5.1.
  • Caret may be displayed as a block.
  • Lexer added for GAP.
  • Lexer added for PL/M.
  • Lexer added for Progress.
  • SciTE session files have changed format to be like other SciTE .properties files and now use the extension .session. Bookmarks and folds may optionally be saved in session files. Session files created with previous versions of SciTE will not load into this version.
  • SciTE's extension and scripting interfaces add OnKey, OnDwellStart, and OnClose methods.
  • On GTK+, copying to the clipboard does not include the text/urilist type since this caused problems when pasting into Open Office.
  • On GTK+, Scintilla defaults caret blink rate to platform preference.
  • Dragging does not start until the mouse has been dragged a certain amount. This stops spurious drags when just clicking inside the selection.
  • Bug fixed where brace highlight not shown when caret line background set.
  • Bug fixed in Ruby lexer where out of bounds access could occur.
  • Bug fixed in XML folding where tags were not being folded because they are singletons in HTML.
  • Bug fixed when many font names used.
  • Layout bug fixed on GTK+ where fonts have ligatures available.
  • Bug fixed with SCI_LINETRANSPOSE on a blank line.
  • SciTE hang fixed when using UNC path with directory properties feature.
  • Bug on Windows fixed by examining dropped text for Unicode even in non-Unicode mode so it can work when source only provides Unicode or when using an encoding different from the system default.
  • SciTE bug on GTK+ fixed where Stop Executing did not work when more than a single process started.
  • SciTE bug on GTK+ fixed where mouse wheel was not switching between buffers.
  • Minor line end fix to PostScript lexer.

Release 1.73

  • Released on 31 March 2007.
  • SciTE adds a Directory properties file to configure behaviour for files in a directory and its subdirectories.
  • Style changes may be made during text modification events.
  • Regular expressions recognise \d, \D, \s, \S, \w, \W, and \xHH.
  • Support for cmake language added.
  • More Scintilla properties can be queried.
  • Edge line drawn under text.
  • A savesession command added to SciTE director interface.
  • SciTE File | Encoding menu item names changed to be less confusing.
  • SciTE on GTK+ dialog buttons reordered to follow guidelines.
  • SciTE on GTK+ removed GTK+ 1.x compatible file dialog code.
  • SciTE on GTK+ recognises key names KeypadMultiply and KeypadDivide.
  • Background colour of line wrapping visual flag changed to STYLE_DEFAULT.
  • Makefile lexing enhanced for ':=' operator and when lines start with tab.
  • TADS3 lexer and folder improved.
  • SCN_DOUBLECLICK notification may set SCI_SHIFT, SCI_CTRL, and SCI_ALT flags on modifiers field.
  • Slow folding of large constructs in Python fixed.
  • MSSQL folding fixed to be case-insensitive and fold at more keywords.
  • SciTE's brace matching works better for HTML.
  • Determining API list items checks for specified parameters start character before default '('.
  • Hang fixed in HTML lexer.
  • Bug fixed in with LineTranspose command where markers could move to different line.
  • Memory released when buffer completely emptied.
  • If translucency not available on Windows, draw rectangular outline instead.
  • Bash lexer handles "-x" in "--x-includes..." better.
  • AutoIt3 lexer fixes string followed by '+'.
  • LinesJoin fixed where it stopped early due to not adjusting for inserted spaces..
  • StutteredPageDown fixed when lines wrapped.
  • FormatRange fixed to not double count line number width which could lead to a large space.
  • SciTE Export As PDF and Latex commands fixed to format floating point numbers with '.' even in locales that use ','.
  • SciTE bug fixed where File | New could produce buffer with contents of previous file when using read-only mode.
  • SciTE retains current scroll position when switching buffers and fold.on.open set.
  • SciTE crash fixed where '*' used to invoke parameters dialog.
  • SciTE bugs when writing large UCS-2 files fixed.
  • Bug fixed when scrolling inside a SCN_PAINTED event by invalidating window rather than trying to perform synchronous painting.
  • SciTE for GTK+ View | Full Screen works on recent versions of GTK+.
  • SciTE for Windows enables and disables toolbar commands correctly.

Release 1.72

  • Released on 15 January 2007.
  • Performance of per-line data improved.
  • SC_STARTACTION flag set on the first modification notification in an undo transaction to help synchronize the container's undo stack with Scintilla's.
  • On GTK+ drag and drop defaults to move rather than copy.
  • Scintilla supports extending appearance of selection to right hand margin.
  • Incremental search available on GTK+.
  • SciTE Indentation Settings dialog available on GTK+ and adds a "Convert" button.
  • Find in Files can optionally ignore binary files or directories that start with ".".
  • Lexer added for "D" language.
  • Export as HTML shows folding with underline lines and +/- symbols.
  • Ruby lexer interprets interpolated strings as expressions.
  • Lua lexer fixes some cases of numeric literals.
  • C++ folder fixes bug with "@" in doc comments.
  • NSIS folder handles !if and related commands.
  • Inno setup lexer adds styling for single and double quoted strings.
  • Matlab lexer handles backslashes in string literals correctly.
  • HTML lexer fixed to allow "?>" in comments in Basic script.
  • Added key codes for Windows key and Menu key.
  • Lua script method scite.MenuCommand(x) performs a menu command.
  • SciTE bug fixed with box comment command near start of file setting selection to end of file.
  • SciTE on GTK+, fixed loop that occurred with automatic loading for an unreadable file.
  • SciTE asks whether to save files when Windows shuts down.
  • Save Session on Windows now defaults the extension to "ses".
  • Bug fixed with single character keywords.
  • Fixed infinite loop for SCI_GETCOLUMN for position beyond end of document.
  • Fixed failure to accept typing on Solaris/GTK+ when using default ISO-8859-1 encoding.
  • Fixed warning from Lua in SciTE when creating a new buffer when already have maximum number of buffers open.
  • Crash fixed with "%%" at end of batch file.

Release 1.71

  • Released on 21 August 2006.
  • Double click notification includes line and position.
  • VB lexer bugs fixed for preprocessor directive below a comment or some other states and to use string not closed style back to the starting quote when there are internal doubled quotes.
  • C++ lexer allows identifiers to contain '$' and non-ASCII characters such as UTF-8. The '$' character can be disallowed with lexer.cpp.allow.dollars=0.
  • Perl lexer allows UTF-8 identifiers and has some other small improvements.
  • SciTE's $(CurrentWord) uses word.characters.<filepattern> to define the word rather than a hardcoded list of word characters.
  • SciTE Export as HTML adds encoding information for UTF-8 file and fixes DOCTYPE.
  • SciTE session and .recent files default to the user properties directory rather than global properties directory.
  • Left and right scroll events handled correctly on GTK+ and horizontal scroll bar has more sensible distances for page and arrow clicks.
  • SciTE on GTK+ tab bar fixed to work on recent versions of GTK+.
  • On GTK+, if the approximate character set conversion is unavailable, a second attempt is made without approximations. This may allow keyboard input and paste to work on older systems.
  • SciTE on GTK+ can redefine the Insert key.
  • SciTE scripting interface bug fixed where some string properties could not be changed.

Release 1.70

  • Released on 20 June 2006.
  • On GTK+, character set conversion is performed using an option that allows approximate conversions rather than failures when a character can not be converted. This may lead to similar characters being inserted or when no similar character is available a '?' may be inserted.
  • On GTK+, the internationalised IM (Input Method) feature is used for all typed input for all character sets.
  • Scintilla has new margin types SC_MARGIN_BACK and SC_MARGIN_FORE that use the default style's background and foreground colours (normally white and black) as the background to the margin.
  • Scintilla/GTK+ allows file drops on Windows when drop is of type DROPFILES_DND as well as text/uri-list.
  • Code page can only be set to one of the listed valid values.
  • Text wrapping fixed for cases where insertion was not wide enough to trigger wrapping before being styled but was after styling.
  • SciTE find marks are removed before printing or exporting to avoid producing incorrect styles.

Release 1.69

  • Released on 29 May 2006.
  • SciTE supports z-order based buffer switching on Ctrl+Tab.
  • Translucent support for selection and whole line markers.
  • SciTE may have per-language abbreviations files.
  • Support for Spice language.
  • On GTK+ autocompletion lists are optimised and use correct selection colours.
  • On GTK+ the URI data type is preferred in drag and drop so that applications will see files dragged from the shell rather than dragging the text of the file name into the document.
  • Increased number of margins to 5.
  • Basic lexer allows include directive $include: "file name".
  • SQL lexer no longer bases folding on indentation.
  • Line ends are transformed when copied to clipboard on Windows/GTK+2 as well as Windows/GTK+ 1.
  • Lexing code masks off the indicator bits on the start style before calling the lexer to avoid confusing the lexer when an application has used an indicator.
  • SciTE savebefore:yes only saves the file when it has been changed.
  • SciTE adds output.initial.hide setting to allow setting the size of the output pane without it showing initially.
  • SciTE on Windows Go To dialog allows line number with more digits.
  • Bug in HTML lexer fixed where a segment of PHP could switch scripting language based on earlier text on that line.
  • Memory bug fixed when freeing regions on GTK+. Other minor bugs fixed on GTK+.
  • Deprecated GTK+ calls in Scintilla replaced with current calls.
  • Fixed a SciTE bug where closing the final buffer, if read-only, left the text present in an untitled buffer.
  • Bug fixed in bash lexer that prevented folding.
  • Crash fixed in bash lexer when backslash at end of file.
  • Crash on recent releases of GTK+ 2.x avoided by changing default font from X core font to Pango font "!Sans".
  • Fix for SciTE properties files where multiline properties continued over completely blank lines.
  • Bug fixed in SciTE/GTK+ director interface where more data available than buffer size.
  • Minor visual fixes to SciTE splitter on GTK+.

Release 1.68

  • Released on 9 March 2006.
  • Translucent drawing implemented for caret line and box indicators.
  • Lexer specifically for TCL is much more accurate than reusing C++ lexer.
  • Support for Inno Setup scripts.
  • Support for Opal language.
  • Calltips may use a new style, STYLE_CALLTIP which allows choosing a different font for calltips.
  • Python lexer styles comments on decorators.
  • HTML lexer refined handling of "?>" and "%>" within server side scripts.
  • Batch file lexer improved.
  • Eiffel lexer doesn't treat '.' as a name character.
  • Lua lexer handles length operator, #, and hex literals.
  • Properties file lexer has separate style for keys.
  • PL/SQL folding improved.
  • SciTE Replace dialog always searches in forwards direction.
  • SciTE can detect language of file from initial #! line.
  • SciTE on GTK+ supports output.scroll=2 setting.
  • SciTE can perform an import a properties file from the command line.
  • Set of word characters used for regular expression \< and \>.
  • Bug fixed with SCI_COPYTEXT stopping too early.
  • Bug fixed with splitting lines so that all lines are split.
  • SciTE calls OnSwitchFile when closing one buffer causes a switch to another.
  • SciTE bug fixed where properties were being reevaluated without good reason after running a macro.
  • Crash fixed when clearing document with some lines contracted in word wrap mode.
  • Palette expands as more entries are needed.
  • SCI_POSITIONFROMPOINT returns more reasonable value when close to last text on a line.
  • On Windows, long pieces of text may be drawn in segments if they fail to draw as a whole.
  • Bug fixed with bad drawing when some visual changes made inside SCN_UPDATEUI notification.
  • SciTE bug fixed with groupundo setting.

Release 1.67

  • Released on 17 December 2005.
  • Scintilla checks the paint region more accurately when seeing if an area is being repainted. Platform layer implementations may need to change for this to take effect. This fixes some drawing and styling bugs. Also optimized some parts of marker code to only redraw the line of the marker rather than whole of the margin.
  • Quoted identifier style for SQL. SQL folding performed more simply.
  • Ruby lexer improved to better handle here documents and non-ASCII characters.
  • Lua lexer supports long string and block comment syntax from Lua 5.1.
  • Bash lexer handles here documents better.
  • JavaScript lexing recognises regular expressions more accurately and includes flag characters in the regular expression style. This is both in JavaScript files and when JavaScript is embedded in HTML.
  • Scintilla API provided to reveal how many style bits are needed for the current lexer.
  • Selection duplicate added.
  • Scintilla API for adding a set of markers to a line.
  • DBCS encodings work on Windows 9x.
  • Convention defined for property names to be used by lexers and folders so they can be automatically discovered and forwarded from containers.
  • Default bookmark in SciTE changed to a blue sphere image.
  • SciTE stores the time of last asking for a save separately for each buffer which fixes bugs with automatic reloading.
  • On Windows, pasted text has line ends converted to current preference. GTK+ already did this.
  • Kid template language better handled by HTML lexer by finishing ASP Python mode when a ?> is found.
  • SciTE counts number of characters in a rectangular selection correctly.
  • 64-bit compatibility improved. One change that may affect user code is that the notification message header changed to include a pointer-sized id field to match the current Windows definition.
  • Empty ranges can no longer be dragged.
  • Crash fixed when calls made that use layout inside the painted notification.
  • Bug fixed where Scintilla created pixmap buffers that were too large leading to failures when many instances used.
  • SciTE sets the directory of a new file to the directory of the currently active file.
  • SciTE allows choosing a code page for the output pane.
  • SciTE HTML exporter no longer honours monospaced font setting.
  • Line layout cache in page mode caches the line of the caret. An assertion is now used to ensure that the layout reentrancy problem that caused this is easier to find.
  • Speed optimized for long lines and lines containing many control characters.
  • Bug fixed in brace matching in DBCS files where byte inside character is same as brace.
  • Indent command does not indent empty lines.
  • SciTE bug fixed for commands that operate on files with empty extensions.
  • SciTE bug fixed where monospaced option was copied for subsequently opened files.
  • SciTE on Windows bug fixed in the display of a non-ASCII search string which can not be found.
  • Bugs fixed with nested calls displaying a new calltip while one is already displayed.
  • Bug fixed when styling PHP strings.
  • Bug fixed when styling C++ continued preprocessor lines.
  • SciTE bug fixed where opening file from recently used list reset choice of language.
  • SciTE bug fixed when compiled with NO_EXTENSIONS and closing one file closes the application.
  • SciTE crash fixed for error messages that look like Lua messages but aren't in the same order.
  • Remaining fold box support deprecated. The symbols SC_FOLDLEVELBOXHEADERFLAG, SC_FOLDLEVELBOXFOOTERFLAG, SC_FOLDLEVELCONTRACTED, SC_FOLDLEVELUNINDENT, and SC_FOLDFLAG_BOX are deprecated.

Release 1.66

  • Released on 26 August 2005.
  • New, more ambitious Ruby lexer.
  • SciTE Find in Files dialog has options for matching case and whole words which are enabled when the internal find command is used.
  • SciTE output pane can display automatic completion after "$(" typed. An initial ">" on a line is ignored when Enter pressed.
  • C++ lexer recognises keywords within line doc comments. It continues styles over line end characters more consistently so that eolfilled style can be used for preprocessor lines and line comments.
  • VB lexer improves handling of file numbers and date literals.
  • Lua folder handles repeat until, nested comments and nested strings.
  • POV lexer improves handling of comment lines.
  • AU3 lexer and folder updated. COMOBJ style added.
  • Bug fixed with text display on GTK+ with Pango 1.8.
  • Caret painting avoided when not focused.
  • SciTE on GTK+ handles file names used to reference properties as case-sensitive.
  • SciTE on GTK+ Save As and Export commands set the file name field. On GTK+ the Export commands modify the file name in the same way as on Windows.
  • Fixed SciTE problem where confirmation was not displaying when closing a file where all contents had been deleted.
  • Middle click on SciTE tab now closes correct buffer on Windows when tool bar is visible.
  • SciTE bugs fixed where files contained in directory that includes '.' character.
  • SciTE bug fixed where import in user options was reading file from directory of global options.
  • SciTE calltip bug fixed where single line calltips had arrow displayed incorrectly.
  • SciTE folding bug fixed where empty lines were shown for no reason.
  • Bug fixed where 2 byte per pixel XPM images caused crash although they are still not displayed.
  • Autocompletion list size tweaked.

Release 1.65

  • Released on 1 August 2005.
  • FreeBasic support.
  • SciTE on Windows handles command line arguments "-" (read standard input into buffer), "--" (read standard input into output pane) and "-@" (read file names from standard input and open each).
  • SciTE includes a simple implementation of Find in Files which is used if no find.command is set.
  • SciTE can close tabs with a mouse middle click.
  • SciTE includes a save.all.for.build setting.
  • Folder for MSSQL.
  • Batch file lexer understands more of the syntax and the behaviour of built in commands.
  • Perl lexer handles here docs better; disambiguates barewords, quote-like delimiters, and repetition operators; handles Pods after __END__; recognises numbers better; and handles some typeglob special variables.
  • Lisp adds more lexical states.
  • PHP allows spaces after <<<.
  • TADS3 has a simpler set of states and recognises identifiers.
  • Avenue elseif folds better.
  • Errorlist lexer treats lines starting with '+++' and '---' as separate styles from '+' and '-' as they indicate file names in diffs.
  • SciTE error recogniser handles file paths in extra explanatory lines from MSVC and in '+++' and '---' lines from diff.
  • Bugs fixed in SciTE and Scintilla folding behaviour when text pasted before folded text caused unnecessary unfolding and cutting text could lead to text being irretrievably hidden.
  • SciTE on Windows uses correct font for dialogs and better font for tab bar allowing better localisation
  • When Windows is used with a secondary monitor before the primary monitor, autocompletion lists are not forced onto the primary monitor.
  • Scintilla calltip bug fixed where down arrow setting wrong value in notification if not in first line. SciTE bug fixed where second arrow only shown on multiple line calltip and was therefore misinterpreting the notification value.
  • Lexers will no longer be re-entered recursively during, for example, fold level setting.
  • Undo of typing in overwrite mode undoes one character at a time rather than requiring a removal and addition step for each character.
  • EM_EXSETSEL(0,-1) fixed.
  • Bug fixed where part of a rectangular selection was not shown as selected.
  • Autocomplete window size fixed.

Release 1.64

  • Released on 6 June 2005.
  • TADS3 support
  • Smalltalk support.
  • Rebol support.
  • Flagship (Clipper / XBase) support.
  • CSound support.
  • SQL enhanced to support SQL*Plus.
  • SC_MARK_FULLRECT margin marker fills the whole marker margin for marked lines with a colour.
  • Performance improved for some large undo and redo operations and modification flags added in notifications.
  • SciTE adds command equivalents for fold margin mouse actions.
  • SciTE adds OnUpdateUI to set of events that can be handled by a Lua script.
  • Properties set in Scintilla can be read.
  • GTK+ SciTE exit confirmation adds Cancel button.
  • More accurate lexing of numbers in PHP and Caml.
  • Perl can fold POD and package sections. POD verbatim section style. Globbing syntax recognised better.
  • Context menu moved slightly on GTK+ so that it will be under the mouse and will stay open if just clicked rather than held.
  • Rectangular selection paste works the same whichever direction the selection was dragged in.
  • EncodedFromUTF8 handles -1 length argument as documented.
  • Undo and redo can cause SCN_MODIFYATTEMPTRO notifications.
  • Indicators display correctly when they start at the second character on a line.
  • SciTE Export As HTML uses standards compliant CSS.
  • SciTE automatic indentation handles keywords for indentation better.
  • SciTE fold.comment.python property removed as does not work.
  • Fixed problem with character set conversion when pasting on GTK+.
  • SciTE default character set changed from ANSI_CHARSET to DEFAULT_CHARSET.
  • Fixed crash when creating empty autocompletion list.
  • Autocomplete window size made larger under some conditions to make truncation less common.
  • Bug fixed where changing case of a selection did not affect initial character of lines in multi-byte encodings.
  • Bug fixed where rectangular selection not displayed after Alt+Shift+Click.

Release 1.63

  • Released on 4 April 2005.
  • Autocompletion on Windows changed to use pop up window, be faster, allow choice of maximum width and height, and to highlight only the text of the selected item rather than both the text and icon if any.
  • Extra items can be added to the context menu in SciTE.
  • Character wrap mode in Scintilla helps East Asian languages.
  • Lexer added for Haskell.
  • Objective Caml support.
  • BlitzBasic and PureBasic support.
  • CSS support updated to handle CSS2.
  • C++ lexer is more selective about document comment keywords.
  • AutoIt 3 lexer improved.
  • Lua lexer styles end of line characters on comment and preprocessor lines so that the eolfilled style can be applied to them.
  • NSIS support updated for line continuations, box comments, SectionGroup and PageEx, and with more up-to-date properties.
  • Clarion lexer updated to perform folding and have more styles.
  • SQL lexer gains second set of keywords.
  • Errorlist lexer recognises Borland Delphi error messages.
  • Method added for determining number of visual lines occupied by a document line due to wrapping.
  • Sticky caret mode does not modify the preferred caret x position when typing and may be useful for typing columns of text.
  • Dwell end notification sent when scroll occurs.
  • On GTK+, Scintilla requisition height is screen height rather than large fixed value.
  • Case insensitive autocompletion prefers exact case match.
  • SCI_PARADOWN and SCI_PARAUP treat lines containing only white space as empty and handle text hidden by folding.
  • Scintilla on Windows supports WM_PRINTCLIENT although there are some limitations.
  • SCN_AUTOCSELECTION notification sent when user selects from autoselection list.
  • SciTE's standard properties file sets buffers to 10, uses Pango fonts on GTK+ and has dropped several languages to make the menu fit on screen.
  • SciTE's encoding cookie detection loosened so that common XML files will load in UTF-8 if that is their declared encoding.
  • SciTE on GTK+ changes menus and toolbars to not be detachable unless turned on with a property. Menus no longer tear off. The toolbar may be set to use the default theme icons rather than SciTE's set. Changed key for View | End of Line because of a conflict. Language menu can contain more items.
  • SciTE on GTK+ 2.x allows the height and width of the file open file chooser to be set, for the show hidden files check box to be set from an option and for it to be opened in the directory of the current file explicitly. Enter key works in save chooser.
  • Scintilla lexers should no longer see bits in style bytes that are outside the set they modify so should be able to correctly lex documents where the container has used indicators.
  • SciTE no longer asks to save before performing a revert.
  • SciTE director interface adds a reloadproperties command to reload properties from files.
  • Allow build on CYGWIN platform.
  • Allow use from LccWin compiler.
  • SCI_COLOURISE for SCLEX_CONTAINER causes a SCN_STYLENEEDED notification.
  • Bugs fixed in lexing of HTML/ASP/JScript.
  • Fix for folding becoming confused.
  • On Windows, fixes for Japanese Input Method Editor and for 8 bit Katakana characters.
  • Fixed buffer size bug avoided when typing long words by making buffer bigger.
  • Undo after automatic indentation more sensible.
  • SciTE menus on GTK+ uses Shift and Ctrl rather than old style abbreviations.
  • SciTE full screen mode on Windows calculates size more correctly.
  • SciTE on Windows menus work better with skinning applications.
  • Searching bugs fixed.
  • Colours reallocated when changing image using SCI_REGISTERIMAGE.
  • Caret stays visible when Enter held down.
  • Undo of automatic indentation more reasonable.
  • High processor usage fixed in background wrapping under some circumstances.
  • Crashing bug fixed on AMD64.
  • SciTE crashing bug fixed when position.height or position.width not set.
  • Crashing bug on GTK+ fixed when setting cursor and window is NULL.
  • Crashing bug on GTK+ preedit window fixed.
  • SciTE crashing bug fixed in incremental search on Windows ME.
  • SciTE on Windows has a optional find and replace dialogs that can search through all buffers and search within a particular style number.

Release 1.62

  • Released on 31 October 2004.
  • Lexer added for ASN.1.
  • Lexer added for VHDL.
  • On Windows, an invisible system caret is used to allow screen readers to determine where the caret is. The visible caret is still drawn by the painting code.
  • On GTK+, Scintilla has methods to read the target as UTF-8 and to convert a string from UTF-8 to the document encoding. This eases integration with containers that use the UTF-8 encoding which is the API encoding for GTK+ 2.
  • SciTE on GTK+2 and Windows NT/2000/XP allows search and replace of Unicode text.
  • SciTE calltips allow setting the characters used to start and end parameter lists and to separate parameters.
  • FindColumn method converts a line and column into a position, taking into account tabs and multi-byte characters.
  • On Windows, when Scintilla copies text to the clipboard as Unicode, it avoids adding an ANSI copy as the system will automatically convert as required in a context-sensitive manner.
  • SciTE indent.auto setting automatically determines indent.size and use.tabs from document contents.
  • SciTE defines a CurrentMessage property that holds the most recently selected output pane message.
  • SciTE Lua scripting enhanced with
    • A Lua table called 'buffer' is associated with each buffer and can be used to maintain buffer-specific state.
    • A 'scite' object allows interaction with the application such as opening files from script.
    • Dynamic properties can be reset by assigning nil to a given key in the props table.
    • An 'OnClear' event fires whenever properties and extension scripts are about to be reloaded.
    • On Windows, loadlib is enabled and can be used to access Lua binary modules / DLLs.
  • SciTE Find in Files on Windows can be used in a modeless way and gains a '..' button to move up to the parent directory. It is also wider so that longer paths can be seen.
  • Close buttons added to dialogs in SciTE on Windows.
  • SciTE on GTK+ 2 has a "hidden files" check box in file open dialog.
  • SciTE use.monospaced setting removed. More information in the FAQ.
  • APDL lexer updated with more lexical classes
  • AutoIt3 lexer updated.
  • Ada lexer fixed to support non-ASCII text.
  • Cpp lexer now only matches exactly three slashes as starting a doc-comment so that lines of slashes are seen as a normal comment. Line ending characters are appear in default style on preprocessor and single line comment lines.
  • CSS lexer updated to support CSS2 including second set of keywords.
  • Errorlist lexer now understands Java stack trace lines.
  • SciTE's handling of HTML Tidy messages jumps to column as well as line indicated.
  • Lisp lexer allows multiline strings.
  • Lua lexer treats .. as an operator when between identifiers.
  • PHP lexer handles 'e' in numerical literals.
  • PowerBasic lexer updated for macros and optimised.
  • Properties file folder changed to leave lines before a header at the base level and thus avoid a vertical line when using connected folding symbols.
  • GTK+ on Windows version uses Alt for rectangular selection to be compatible with platform convention.
  • SciTE abbreviations file moved from system directory to user directory so each user can have separate abbreviations.
  • SciTE on GTK+ has improved .desktop file and make install support that may lead to better integration with system shell.
  • Disabling of themed background drawing on GTK+ extended to all cases.
  • SciTE date formatting on Windows performed with the user setting rather than the system setting.
  • GTK+ 2 redraw while scrolling fixed.
  • Recursive property definitions are safer, avoiding expansion when detected.
  • SciTE thread synchronization for scripts no longer uses HWND_MESSAGE so is compatible with older versions of Windows. Other Lua scripting bugs fixed.
  • SciTE on Windows localisation of menu accelerators changed to be compatible with alternative UI themes.
  • SciTE on Windows full screen mode now fits better when menu different height to title bar height.
  • SC_MARK_EMPTY marker is now invisible and does not change the background colour.
  • Bug fixed in HTML lexer to allow use of <?xml in strings in scripts without triggering xml mode.
  • Bug fixed in SciTE abbreviation expansion that could break indentation or crash.
  • Bug fixed when searching for a whole word string that ends one character before end of document.
  • Drawing bug fixed when indicators drawn on wrapped lines.
  • Bug fixed when double clicking a hotspot.
  • Bug fixed where autocompletion would remove typed text if no match found.
  • Bug fixed where display does not scroll when inserting in long wrapped line.
  • Bug fixed where SCI_MARKERDELETEALL would only remove one of the markers on a line that contained multiple markers with the same number.
  • Bug fixed where markers would move when converting line endings.
  • Bug fixed where SCI_LINEENDWRAP would move too far when line ends are visible.
  • Bugs fixed where calltips with unicode or other non-ASCII text would display incorrectly.
  • Bug fixed in determining if at save point after undoing from save point and then performing changes.
  • Bug fixed on GTK+ using unsupported code pages where extraneous text could be drawn.
  • Bug fixed in drag and drop code on Windows where dragging from SciTE to Firefox could hang both applications.
  • Crashing bug fixed on GTK+ when no font allocation succeeds.
  • Crashing bug fixed when autocompleting word longer than 1000 characters.
  • SciTE crashing bug fixed when both Find and Replace dialogs shown by disallowing this situation.

Release 1.61

  • Released on 29 May 2004.
  • Improvements to selection handling on GTK+.
  • SciTE on GTK+ 2.4 uses the improved file chooser which allows file extension filters, multiple selection, and remembers favourite directories.
  • SciTE Load Session and Save Session commands available on GTK+.
  • SciTE lists Lua Startup Script in Options menu when loaded.
  • In SciTE, OnUserListSelection can be implemented in Lua.
  • SciTE on Windows has a context menu on the file tabs.
  • SQL lexer allows '#' comments and optionally '\' quoting inside strings.
  • Mssql lexer improved.
  • AutoIt3 lexer updated.
  • Perl lexer recognises regular expression use better.
  • Errorlist lexer understands Lua tracebacks and copes with findstr output for file names that end with digits.
  • Drawing of lines on GTK+ improved and made more like Windows without final point.
  • SciTE on GTK+ uses a high resolution window icon.
  • SciTE can be set to warn before loading files larger than a particular size.
  • SciTE Lua scripting bugs fixed included a crashing bug when using an undefined function name that would go before first actual name.
  • SciTE bug fixed where a modified buffer was not saved if it was the last buffer and was not current when the New command used.
  • SciTE monofont mode no longer affects line numbers.
  • Crashing bug in SciTE avoided by not allowing both the Find and Replace dialogs to be visible at one time.
  • Crashing bug in SciTE fixed when Lua scripts were being run concurrently.
  • Bug fixed that caused incorrect line number width in SciTE.
  • PHP folding bug fixed.
  • Regression fixed when setting word characters to not include some of the standard word characters.

Release 1.60

  • Released on 1 May 2004.
  • SciTE can be scripted using the Lua programming language.
  • command.mode is a better way to specify tool command options in SciTE.
  • Continuation markers can be displayed so that you can see which lines are wrapped.
  • Lexer for Gui4Cli language.
  • Lexer for Kix language.
  • Lexer for Specman E language.
  • Lexer for AutoIt3 language.
  • Lexer for APDL language.
  • Lexer for Bash language. Also reasonable for other Unix shells.
  • SciTE can load lexers implemented in external shared libraries.
  • Perl treats "." not as part of an identifier and interprets '/' and '->' correctly in more circumstances.
  • PHP recognises variables within strings.
  • NSIS has properties "nsis.uservars" and "nsis.ignorecase".
  • MSSQL lexer adds keyword list for operators and stored procedures, defines '(', ')', and ',' as operators and changes some other details.
  • Input method preedit window on GTK+ 2 may support some Asian languages.
  • Platform interface adds an extra platform-specific flag to Font::Create. Used on wxWidgets to choose antialiased text display but may be used for any task that a platform needs.
  • OnBeforeSave method added to Extension interface.
  • Scintilla methods that return strings can be called with a NULL pointer to find out how long the string should be.
  • Visual Studio .NET project file now in VS .NET 2003 format so can not be used directly in VS .NET 2002.
  • Scintilla can be built with GTK+ 2 on Windows.
  • Updated RPM spec for SciTE on GTK+.
  • GTK+ makefile for SciTE allows selection of destination directory, creates destination directories and sets file modes and owners better.
  • Tab indents now go to next tab multiple rather than add tab size.
  • SciTE abbreviations now use the longest possible match rather than the shortest.
  • Autocompletion does not remove prefix when actioned with no choice selected.
  • Autocompletion cancels when moving beyond the start position, not at the start position.
  • SciTE now shows only calltips for functions that match exactly, not those that match as a prefix.
  • SciTE can repair box comment sections where some lines were added without the box comment middle line prefix.
  • Alt+ works in user.shortcuts on Windows.
  • SciTE on GTK+ enables replace in selection for rectangular selections.
  • Key bindings for command.shortcut implemented in a way that doesn't break when the menus are localised.
  • Drawing of background on GTK+ faster as theme drawing disabled.
  • On GTK+, calltips are moved back onto the screen if they extend beyond the screen bounds.
  • On Windows, the Scintilla object is destroyed on WM_NCDESTROY rather than WM_DESTROY which arrives earlier. This fixes some problems when Scintilla was subclassed.
  • The zorder switching feature removed due to number of crashing bugs.
  • Code for XPM images made more robust.
  • Bug fixed with primary selection on GTK+.
  • On GTK+ 2, copied or cut text can still be pasted after the Scintilla widget is destroyed.
  • Styling change not visible problem fixed when line was cached.
  • Bug in SciTE on Windows fixed where clipboard commands stopped working.
  • Crashing bugs in display fixed in line layout cache.
  • Crashing bug may be fixed on AMD64 processor on GTK+.
  • Rare hanging crash fixed in Python lexer.
  • Display bugs fixed with DBCS characters on GTK+.
  • Autocompletion lists on GTK+ 2 are not sorted by the ListModel as the contents are sorted correctly by Scintilla.
  • SciTE fixed to not open extra untitled buffers with check.if.already.open.
  • Sizing bug fixed on GTK+ when window resized while unmapped.
  • Text drawing crashing bug fixed on GTK+ with non-Pango fonts and long strings.
  • Fixed some issues if characters are unsigned.
  • Fixes in NSIS support.

Release 1.59

  • Released on 19 February 2004.
  • SciTE Options and Language menus reduced in length by commenting out some languages. Languages can be enabled by editing the global properties file.
  • Verilog language supported.
  • Lexer for Microsoft dialect of SQL. SciTE properties file available from extras page.
  • Perl lexer disambiguates '/' better.
  • NSIS lexer improved with a lexical class for numbers, option for ignoring case of keywords, and folds only occurring when folding keyword first on line.
  • PowerBasic lexer improved with styles for constants and assembler and folding improvements.
  • On GTK+, input method support only invoked for Asian languages and not European languages as the old European keyboard code works better.
  • Scintilla can be requested to allocate a certain amount and so avoid repeated reallocations and memory inefficiencies. SciTE uses this and so should require less memory.
  • SciTE's "toggle current fold" works when invoked on child line as well as fold header.
  • SciTE output pane scrolling can be set to not scroll back to start after completion of command.
  • SciTE has a $(SessionPath) property.
  • SciTE on Windows can use VK_* codes for keys in user.shortcuts.
  • Stack overwrite bug fixed in SciTE's command to move to the end of a preprocessor conditional.
  • Bug fixed where vertical selection appeared to select a different set of characters then would be used by, for example, a copy.
  • SciTE memory leak fixed in fold state remembering.
  • Bug fixed where changing the style of some text outside the standard StyleNeeded notification would not be visible.
  • On GTK+ 2 g_iconv is used in preference to iconv, as it is provided by GTK+ so should avoid problems finding the iconv library.
  • On GTK+ fixed a style reference count bug.
  • Memory corruption bug fixed with GetSelText.
  • On Windows Scintilla deletes memory on WM_NCDESTROY rather than the earlier WM_DESTROY to avoid problems when the window is subclassed.

Release 1.58

  • Released on 11 January 2004.
  • Method to discover the currently highlighted element in an autocompletion list.
  • On GTK+, the lexers are now included in the scintilla.a library file. This will require changes to the make files of dependent projects.
  • Octave support added alongside related Matlab language and Matlab support improved.
  • VB lexer gains an unterminated string state and 4 sets of keywords.
  • Ruby lexer handles $' correctly.
  • Error line handling improved for FORTRAN compilers from Absoft and Intel.
  • International input enabled on GTK+ 2 although there is no way to choose an input method.
  • MultiplexExtension in SciTE allows multiple extensions to be used at once.
  • Regular expression replace interprets backslash expressions \a, \b, \f, \n, \r, \t, and \v in the replacement value.
  • SciTE Replace dialog displays number of replacements made when Replace All or Replace in Selection performed.
  • Localisation files may contain a translation.encoding setting which is used on GTK+ 2 to automatically reencode the translation to UTF-8 so it will be the localised text will be displayed correctly.
  • SciTE on GTK+ implements check.if.already.open.
  • Make files for Mac OS X made more robust.
  • Performance improved in SciTE when switching buffers when there is a rectangular selection.
  • Fixed failure to display some text when wrapped.
  • SciTE crashes from Ctrl+Tab buffer cycling fixed. May still be some rare bugs here.
  • Crash fixed when decoding an error message that appears similar to a Borland error message.
  • Fix to auto-scrolling allows containers to implement enhanced double click selection.
  • Hang fixed in idle word wrap.
  • Crash fixed in hotspot display code..
  • SciTE on Windows Incremental Search no longer moves caret back.
  • SciTE hang fixed when performing a replace with a find string that matched zero length strings such as ".*".
  • SciTE no longer styles the whole file when saving buffer fold state as that was slow.

Release 1.57

  • Released on 27 November 2003.
  • SciTE remembers folding of each buffer.
  • Lexer for Erlang language.
  • Scintilla allows setting the set of white space characters.
  • Scintilla has 'stuttered' page movement commands to first move to top or bottom within current visible lines before scrolling.
  • Scintilla commands for moving to end of words.
  • Incremental line wrap enabled on Windows.
  • SciTE PDF exporter produces output that is more compliant with reader applications, is smaller and allows more configuration. HTML exporter optimizes size of output files.
  • SciTE defines properties PLAT_WINNT and PLAT_WIN95 on the corresponding platforms.
  • SciTE can adjust the line margin width to fit the largest line number. The line.numbers property is split between line.margin.visible and line.margin.width.
  • SciTE on GTK+ allows user defined menu accelerators. Alt can be included in user.shortcuts.
  • SciTE Language menu can have items commented out.
  • SciTE on Windows Go to dialog allows choosing a column number as well as a line number.
  • SciTE on GTK+ make file uses prefix setting more consistently.
  • Bug fixed that caused word wrapping to fail to display all text.
  • Crashing bug fixed in GTK+ version of Scintilla when using GDK fonts and opening autocompletion.
  • Bug fixed in Scintilla SCI_GETSELTEXT where an extra NUL was included at end of returned string
  • Crashing bug fixed in SciTE z-order switching implementation.
  • Hanging bug fixed in Perl lexer.
  • SciTE crashing bug fixed for using 'case' without argument in style definition.

Release 1.56

  • Released on 25 October 2003.
  • Rectangular selection can be performed using the keyboard. Greater programmatic control over rectangular selection. This has caused several changes to key bindings.
  • SciTE Replace In Selection works on rectangular selections.
  • Improved lexer for TeX, new lexer for Metapost and other support for these languages.
  • Lexer for PowerBasic.
  • Lexer for Forth.
  • YAML lexer improved to include error styling.
  • Perl lexer improved to correctly handle more cases.
  • Assembler lexer updated to support single-quote strings and fix some problems.
  • SciTE on Windows can switch between buffers in order of use (z-order) rather than static order.
  • SciTE supports adding an extension for "Open Selected Filename". The openpath setting works on GTK+.
  • SciTE can Export as XML.
  • SciTE $(SelHeight) variable gives a more natural result for empty and whole line selections.
  • Fixes to wrapping problems, such as only first display line being visible in some cases.
  • Fixes to hotspot to only highlight when over the hotspot, only use background colour when set and option to limit hotspots to a single line.
  • Small fixes to FORTRAN lexing and folding.
  • SQL lexer treats single quote strings as a separate class to double quote strings..
  • Scintilla made compatible with expectations of container widget in GTK+ 2.3.
  • Fix to strip out pixmap ID when automatically choosing from an autocompletion list with only one element.
  • SciTE bug fixed where UTF-8 files longer than 128K were gaining more than one BOM.
  • Crashing bug fixed in SciTE on GTK+ where using "Stop Executing" twice leads to all applications exiting.
  • Bug fixed in autocompletion scrolling on GTK+ 2 with a case sensitive list. The ListBox::Sort method is no longer needed or available so platform maintainers should remove it.
  • SciTE check.if.already.open setting removed from GTK+ version as unmaintained.

Release 1.55

  • Released on 25 September 2003.
  • Fix a crashing bug in indicator display in Scintilla.
  • GTK+ version now defaults to building for GTK+ 2 rather than 1.
  • Mingw make file detects compiler version and avoids options that are cause problems for some versions.
  • Large performance improvement on GTK+ 2 for long lines.
  • Incremental line wrap on GTK+.
  • International text entry works much better on GTK+ with particular improvements for Baltic languages and languages that use 'dead' accents. NUL key events such as those generated by some function keys, ignored.
  • Unicode clipboard support on GTK+.
  • Indicator type INDIC_BOX draws a rectangle around the text.
  • Clarion language support.
  • YAML language support.
  • MPT LOG language support.
  • On Windows, SciTE can switch buffers based on activation order rather than buffer number.
  • SciTE save.on.deactivate saves all buffers rather than just the current buffer.
  • Lua lexer handles non-ASCII characters correctly.
  • Error lexer understands Borland errors with pathnames that contain space.
  • On GTK+ 2, autocompletion uses TreeView rather than deprecated CList.
  • SciTE autocompletion removed when expand abbreviation command used.
  • SciTE calltips support overloaded functions.
  • When Save fails in SciTE, choice offered to Save As.
  • SciTE message boxes on Windows may be moved to front when needed.
  • Indicators drawn correctly on wrapped lines.
  • Regular expression search no longer matches characters with high bit set to characters without high bit set.
  • Hang fixed in backwards search in multi byte character documents.
  • Hang fixed in SciTE Mark All command when wrap around turned off.
  • SciTE Incremental Search no longer uses hot keys on Windows.
  • Calltips draw non-ASCII characters correctly rather than as arrows.
  • SciTE crash fixed when going to an error message with empty file name.
  • Bugs fixed in XPM image handling code.

Release 1.54

  • Released on 12 August 2003.
  • SciTE on GTK+ 2.x can display a tab bar.
  • SciTE on Windows provides incremental search.
  • Lexer for PostScript.
  • Lexer for the NSIS scripting language.
  • New lexer for POV-Ray Scene Description Language replaces previous implementation.
  • Lexer for the MMIX Assembler language.
  • Lexer for the Scriptol language.
  • Incompatibility: SQL keywords are specified in lower case rather than upper case. SQL lexer allows double quoted strings.
  • Pascal lexer: character constants that start with '#' understood, '@' only allowed within assembler blocks, '$' can be the start of a number, initial '.' in 0..constant not treated as part of a number, and assembler blocks made more distinctive.
  • Lua lexer allows '.' in keywords. Multi-line strings and comments can be folded.
  • CSS lexer handles multiple psuedoclasses.
  • Properties file folder works for INI file format.
  • Hidden indicator style allows the container to mark text within Scintilla without there being any visual effect.
  • SciTE does not prompt to save changes when the buffer is empty and untitled.
  • Modification notifications caused by SCI_INSERTSTYLEDSTRING now include the contents of the insertion.
  • SCI_MARKERDELETEALL deletes all the markers on a line rather than just the first match.
  • Better handling of 'dead' accents on GTK+ 2 for languages that use accented characters.
  • SciTE now uses value of output.vertical.size property.
  • Crash fixed in SciTE autocompletion on long lines.
  • Crash fixed in SciTE comment command on long lines.
  • Bug fixed with backwards regular expression search skipping every second match.
  • Hang fixed with regular expression replace where both target and replacement were empty.

Release 1.53

  • Released on 16 May 2003.
  • On GTK+ 2, encodings other than ASCII, Latin1, and Unicode are supported for both display and input using iconv.
  • External lexers supported on GTK+/Linux. External lexers must now be explicitly loaded with SCI_LOADLEXERLIBRARY rather than relying upon a naming convention and automatic loading.
  • Support of Lout typesetting language.
  • Support of E-Scripts language used in the POL Ultima Online Emulator.
  • Scrolling and drawing performance on GTK+ enhanced, particularly for GTK+ 2.x with an extra window for the text area avoiding conflicts with the scroll bars.
  • CopyText and CopyRange methods in Scintilla allow container to easily copy to the system clipboard.
  • Line Copy command implemented and bound to Ctrl+Shift+T.
  • Scintilla APIs PositionBefore and PositionAfter can be used to iterate through a document taking into account the encoding and multi-byte characters.
  • C++ folder can fold on the "} else {" line of an if statement by setting fold.at.else property to 1.
  • C++ lexer allows an extra set of keywords.
  • Property names and thus abbreviations may be non-ASCII.
  • Removed attempt to load a file when setting properties that was part of an old scripting experiment.
  • SciTE no longer warns about a file not existing when opening properties files from the Options menu as there is a good chance the user wants to create one.
  • Bug fixed with brace recognition in multi-byte encoded files where a partial character matched a brace byte.
  • More protection against infinite loops or recursion with recursive property definitions.
  • On Windows, cursor will no longer disappear over margins in custom builds when cursor resource not present. The Windows default cursor is displayed instead.
  • load.on.activate fixed in SciTE as was broken in 1.52.

Release 1.52

  • Released on 17 April 2003.
  • Pango font support on GTK+ 2. Unicode input improved on GTK+ 2.
  • Hotspot style implemented in Scintilla.
  • Small up and down arrows can be displayed in calltips and the container is notified when the mouse is clicked on a calltip. Normal and selected calltip text colours can be set.
  • POSIX compatibility flag in Scintilla regular expression search interprets bare ( and ) as tagged sections.
  • Error message lexer tightened to yield fewer false matches. Recognition of Lahey and Intel FORTRAN error formats.
  • Scintilla keyboard commands for moving to start and end of screen lines rather than document lines, unless already there where these keys move to the start or end of the document line.
  • Line joining command.
  • Lexer for POV-Ray.
  • Calltips on Windows are no longer clipped by the parent window.
  • Autocompletion lists are cancelled when focus leaves their parent window.
  • Move to next/previous empty line delimited paragraph key commands.
  • SciTE hang fixed with recursive property definitions by placing limit on number of substitutions performed.
  • SciTE Export as PDF reenabled and works.
  • Added loadsession: command line command to SciTE.
  • SciTE option to quit application when last document closed.
  • SciTE option to ask user if it is OK to reload a file that has been modified outside SciTE.
  • SciTE option to automatically save before running particular command tools or to ask user or to not save.
  • SciTE on Windows 9x will write a Ctrl+Z to the process input pipe before closing the pipe when running tool commands that take input.
  • Added a manifest resource to SciTE on Windows to enable Windows XP themed UI.
  • SciTE calltips handle nested calls and other situations better.
  • CSS lexer improved.
  • Interface to platform layer changed - Surface initialisation now requires a WindowID parameter.
  • Bug fixed with drawing or measuring long pieces of text on Windows 9x by truncating the pieces.
  • Bug fixed with SciTE on GTK+ where a user shortcut for a visible character inserted the character as well as executing the command.
  • Bug fixed where primary selection on GTK+ was reset by Scintilla during creation.
  • Bug fixed where SciTE would close immediately on startup when using save.session.
  • Crash fixed when entering '\' in LaTeX file.
  • Hang fixed when '#' last character in VB file.
  • Crash fixed in error message lexer.
  • Crash fixed when searching for long regular expressions.
  • Pressing return when nothing selected in user list sends notification with empty text rather than random text.
  • Mouse debouncing disabled on Windows as it interfered with some mouse utilities.
  • Bug fixed where overstrike mode inserted before rather than replaced last character in document.
  • Bug fixed with syntax highlighting of Japanese text.
  • Bug fixed in split lines function.
  • Cosmetic fix to SciTE tab bar on Windows when window resized. Focus sticks to either pane more consistently.

Release 1.51

  • Released on 16 February 2003.
  • Two phase drawing avoids cutting off text that overlaps runs by drawing all the backgrounds of a line then drawing all the text transparently. Single phase drawing is an option.
  • Scintilla method to split lines at a particular width by adding new line characters.
  • The character used in autocompletion lists to separate the text from the image number can be changed.
  • The scrollbar range will automatically expand when the caret is moved beyond the current range. The scroll bar is updated when SCI_SETXOFFSET is called.
  • Mouse cursors on GTK+ improved to be consistent with other applications and the Windows version.
  • Horizontal scrollbar on GTK+ now disappears in wrapped mode.
  • Scintilla on GTK+ 2: mouse wheel scrolling, cursor over scrollbars, focus, and syntax highlighting now work. gtk_selection_notify avoided for compatibility with GTK+ 2.2.
  • Fold margin colours can now be set.
  • SciTE can be built for GTK+ 2.
  • SciTE can optionally preserve the undo history over an automatic file reload.
  • Tags can optionally be case insensitive in XML and HTML.
  • SciTE on Windows handles input to tool commands in a way that should avoid deadlock. Output from tools can be used to replace the selection.
  • SciTE on GTK+ automatically substitutes '|' for '/' in menu items as '/' is used to define the menu hierarchy.
  • Optional buffer number in SciTE title bar.
  • Crash fixed in SciTE brace matching.
  • Bug fixed where automatic scrolling past end of document flipped back to the beginning.
  • Bug fixed where wrapping caused text to disappear.
  • Bug fixed on Windows where images in autocompletion lists were shown on the wrong item.
  • Crash fixed due to memory bug in autocompletion lists on Windows.
  • Crash fixed when double clicking some error messages.
  • Bug fixed in word part movement where sometimes no movement would occur.
  • Bug fixed on Windows NT where long text runs were truncated by treating NT differently to 9x where there is a limitation.
  • Text in not-changeable style works better but there remain some cases where it is still possible to delete text protected this way.

Release 1.50

  • Released on 24 January 2003.
  • Autocompletion lists may have a per-item pixmap.
  • Autocompletion lists allow Unicode text on Windows.
  • Scintilla documentation rewritten.
  • Additional DBCS encoding support in Scintilla on GTK+ primarily aimed at Japanese EUC encoding.
  • CSS (Cascading Style Sheets) lexer added.
  • diff lexer understands some more formats.
  • Fold box feature is an alternative way to show the structure of code.
  • Avenue lexer supports multiple keyword lists.
  • The caret may now be made invisible by setting the caret width to 0.
  • Python folder attaches comments before blocks to the next block rather than the previous block.
  • SciTE openpath property on Windows searches a path for files that are the subject of the Open Selected Filename command.
  • The localisation file name can be changed with the locale.properties property.
  • On Windows, SciTE can pipe the result of a string expression into a command line tool.
  • On Windows, SciTE's Find dialog has a Mark All button.
  • On Windows, there is an Insert Abbreviation command that allows a choice from the defined abbreviations and inserts the selection into the abbreviation at the position of a '|'.
  • Minor fixes to Fortran lexer.
  • fold.html.preprocessor decides whether to fold <? and ?>. Minor improvements to PHP folding.
  • Maximum number of keyword lists allowed increased from 6 to 9.
  • Duplicate line command added with default assignment to Ctrl+D.
  • SciTE sets $(Replacements) to the number of replacements made by the Replace All command. $(CurrentWord) is set to the word before the caret if the caret is at the end of a word.
  • Opening a SciTE session now loads files in remembered order, sets the current file as remembered, and moves the caret to the remembered line.
  • Bugs fixed with printing on Windows where line wrapping was causing some text to not print.
  • Bug fixed with Korean Input Method Editor on Windows.
  • Bugs fixed with line wrap which would sometimes choose different break positions after switching focus away and back.
  • Bug fixed where wheel scrolling had no effect on GTK+ after opening a fold.
  • Bug fixed with file paths containing non-ASCII characters on Windows.
  • Crash fixed with printing on Windows after defining pixmap marker.
  • Crash fixed in makefile lexer when first character on line was '='.
  • Bug fixed where local properties were not always being applied.
  • Ctrl+Keypad* fold command works on GTK+.
  • Hangs fixed in SciTE's Replace All command when replacing regular expressions '^' or '$'.
  • SciTE monospace setting behaves more sensibly.

Release 1.49

  • Released on 1 November 2002.
  • Unicode supported on GTK+. To perform well, this added a font cache to GTK+ and to make that safe, a mutex is used. The mutex requires the application to link in the threading library by evaluating `glib-config --libs gthread`. A Unicode locale should also be set up by a call like setlocale(LC_CTYPE, "en_US.UTF-8"). scintilla_release_resources function added to release mutex.
  • FORTRAN and assembler lexers added along with other support for these languages in SciTE.
  • Ada lexer improved handling of based numbers, identifier validity and attributes distinguished from character literals.
  • Lua lexer handles block comments and a deep level of nesting for literal strings and block comments.
  • Errorlist lexer recognises PHP error messages.
  • Variant of the C++ lexer with case insensitive keywords called cppnocase. Whitespace in preprocessor text handled more correctly.
  • Folder added for Perl.
  • Compilation with GCC 3.2 supported.
  • Markers can be pixmaps.
  • Lines are wrapped when printing. Bug fixed which printed line numbers in different styles.
  • Text can be appended to end with AppendText method.
  • ChooseCaretX method added.
  • Vertical scroll bar can be turned off with SetVScrollBar method.
  • SciTE Save All command saves all buffers.
  • SciTE localisation compares keys case insensitively to make translations more flexible.
  • SciTE detects a utf-8 coding cookie "coding: utf-8" in first two lines and goes into Unicode mode.
  • SciTE key bindings are definable.
  • SciTE Find in Files dialog can display directory browser to choose directory to search.
  • SciTE enabling of undo and redo toolbar buttons improved.
  • SciTE on Windows file type filters in open dialog sorted.
  • Fixed crashing bug when using automatic tag closing in XML or HTML.
  • Fixed bug on Windows causing very long (>64K) lines to not display.
  • Fixed bug in backwards regular expression searching.
  • Fixed bug in calltips where wrong argument was highlighted.
  • Fixed bug in tab timmy feature when file has line feed line endings.
  • Fixed bug in compiling without INCLUDE_DEPRECATED_FEATURES defined.

Release 1.48

  • Released on 9 September 2002.
  • Improved Pascal lexer with context sensitive keywords and separate folder which handles //{ and //} folding comments and {$region} and {$end} folding directives. The "case" statement now folds correctly.
  • C++ lexer correctly handles comments on preprocessor lines.
  • New commands for moving to beginning and end of display lines when in line wrap mode. Key bindings added for these commands.
  • New marker symbols that look like ">>>" and "..." which can be used for interactive shell prompts for Python.
  • The foreground and background colours of visible whitespace can be chosen independent of the colours chosen for the lexical class of that whitespace.
  • Per line data optimised by using an exponential allocation scheme.
  • SciTE API file loading optimised.
  • SciTE for GTK+ subsystem 2 documented. The exit status of commands is decoded into more understandable fields.
  • SciTE find dialog remembers previous find string when there is no selection. Find in Selection button disabled when selection is rectangular as command did not work.
  • Shift+Enter made equivalent to Enter to avoid users having to let go of the shift key when typing. Avoids the possibility of entering single carriage returns in a file that contains CR+LF line ends.
  • Autocompletion does not immediately disappear when the length parameter to SCI_AUTOCSHOW is 0.
  • SciTE focuses on the editor pane when File | New executed and when the output pane is closed with F8. Double clicking on a non-highlighted output pane line selects the word under the cursor rather than seeking the next highlighted line.
  • SciTE director interface implements an "askproperty" command.
  • SciTE's Export as LaTeX output improved.
  • Better choice of autocompletion displaying above the caret rather then below when that is more sensible.
  • Bug fixed where context menu would not be completely visible if invoked when cursor near bottom or left of screen.
  • Crashing bug fixed when displaying long strings on GTK+ caused failure of X server by displaying long text in segments.
  • Crashing bug fixed on GTK+ when a Scintilla window was removed from its parent but was still the selection owner.
  • Bug fixed on Windows in Unicode mode where not all characters on a line were displayed when that line contained some characters not in ASCII.
  • Crashing bug fixed in SciTE on Windows with clearing output while running command.
  • Bug fixed in SciTE for GTK+ with command completion not detected when no output was produced by the command.
  • Bug fixed in SciTE for Windows where menus were not shown translated.
  • Bug fixed where words failed to display in line wrapping mode with visible line ends.
  • Bug fixed in SciTE where files opened from a session file were not closed.
  • Cosmetic flicker fixed when using Ctrl+Up and Ctrl+Down with some caret policies.

Release 1.47

  • Released on 1 August 2002.
  • Support for GTK+ 2 in Scintilla. International input methods not supported on GTK+2.
  • Line wrapping performance improved greatly.
  • New caret policy implementation that treats horizontal and vertical positioning equivalently and independently. Old caret policy methods deprecated and not all options work correctly with old methods.
  • Extra fold points for C, C++, Java, ... for fold comments //{ .. //} and #if / #ifdef .. #endif and the #region .. #endregion feature of C#.
  • Scintilla method to find the height in pixels of a line. Currently returns the same result for every line as all lines are same height.
  • Separate make file, scintilla_vc6.mak, for Scintilla to use Visual C++ version 6 since main makefile now assumes VS .NET. VS .NET project files available for combined Scintilla and SciTE in scite/boundscheck.
  • SciTE automatically recognises Unicode files based on their Byte Order Marks and switches to Unicode mode. On Windows, where SciTE supports Unicode display, this allows display of non European characters. The file is saved back into the same character encoding unless the user decides to switch using the File | Encoding menu.
  • Handling of character input changed so that a fillup character, typically '(' displays a calltip when an autocompletion list was being displayed.
  • Multiline strings lexed better for C++ and Lua.
  • Regular expressions in JavaScript within hypertext files are lexed better.
  • On Windows, Scintilla exports a function called Scintilla_DirectFunction that can be used the same as the function returned by GetDirectFunction.
  • Scintilla converts line endings of text obtained from the clipboard to the current default line endings.
  • New SciTE property ensure.final.line.end can ensure that saved files always end with a new line as this is required by some tools. The ensure.consistent.line.ends property ensures all line ends are the current default when saving files. The strip.trailing.spaces property now works on the buffer so the buffer in memory and the file on disk are the same after a save is performed.
  • The SciTE expand abbreviation command again allows '|' characters in expansions to be quoted by using '||'.
  • SciTE on Windows can send data to the find tool through standard input rather than using a command line argument to avoid problems with quoting command line arguments.
  • The Stop Executing command in SciTE on Windows improved to send a Ctrl+Z character to the tool. Better messages when stopping a tool.
  • Autocompletion can automatically "fill up" when one of a set of characters is type with the autocomplete.<lexer>.fillups property.
  • New predefined properties in SciTE, SelectionStartColumn, SelectionStartLine, SelectionEndColumn, SelectionEndLine can be used to integrate with other applications.
  • Environment variables are available as properties in SciTE.
  • SciTE on Windows keeps status line more current.
  • Abbreviations work in SciTE on Linux when first opened.
  • File saving fixed in SciTE to ensure files are not closed when they can not be saved because of file permissions. Also fixed a problem with buffers that caused files to not be saved.
  • SciTE bug fixed where monospace mode not remembered when saving files. Some searching options now remembered when switching files.
  • SciTE on Linux now waits on child termination when it shuts a child down to avoid zombies.
  • SciTE on Linux has a Print menu command that defaults to invoking a2ps.
  • Fixed incorrect highlighting of indentation guides in SciTE for Python.
  • Crash fixed in Scintilla when calling GetText for 0 characters.
  • Exporting as LaTeX improved when processing backslashes and tabs and setting up font.
  • Crash fixed in SciTE when exporting or copying as RTF.
  • SciTE session loading fixed to handle more than 10 files in session.

Release 1.46

  • Released on 10 May 2002.
  • Set of lexers compiled into Scintilla can now be changed by adding and removing lexer source files from scintilla/src and running LexGen.py.
  • SCN_ZOOM notification provided by Scintilla when user changes zoom level. Method to determine width of strings in pixels so that elements can be sized relative to text size. SciTE changed to keep line number column displaying a given number of characters.
  • The logical width of the document used to determine scroll bar range can be set.
  • Setting to allow vertical scrolling to display last line at top rather than bottom of window.
  • Read-only mode improved to avoid changing the selection in most cases when a modification is attempted. Drag and drop cursors display correctly for read-only in some cases.
  • Visual C++ options in make files changed to suit Visual Studio .NET.
  • Scintilla.iface includes feature types for enumerations and lexers.
  • Lua lexer improves handling of literal strings and copes with nested literal strings.
  • Diff lexer changed to treat lines starting with "***" similarly to "---". Symbolic names defined for lexical classes.
  • nncrontab lexer improved.
  • Turkish fonts (iso8859-9) supported on GTK+.
  • Automatic close tag feature for XML and HTML in SciTE.
  • Automatic indentation in SciTE improved.
  • Maximum number of buffers available in SciTE increased. May be up to 100 although other restrictions on menu length limit the real maximum.
  • Save a Copy command added to SciTE.
  • Export as TeX command added to SciTE.
  • Export as HTML command in SciTE respects Use Monospaced Font and background colour settings.
  • Compilation problem on Solaris fixed.
  • Order of files displayed for SciTE's previous and next menu and key commands are now consistent.
  • Saving of MRU in recent file changed so files open when SciTE quit are remembered.
  • More variants of ctags tags handled by Open Selected Filename in SciTE.
  • JavaScript embedded in XML highlighted again.
  • SciTE status bar updated after changing parameters in case they are being displayed in status bar.
  • Crash fixed when handling some multi-byte languages.
  • Crash fixed when replacing end of line characters.
  • Bug in SciTE fixed in multiple buffer mode where automatic loading turned on could lead to losing file contents.
  • Bug in SciTE on GTK+ fixed where dismissing dialogs with close box led to those dialogs never being shown again.
  • Bug in SciTE on Windows fixed where position.tile with default positions led to SciTE being positioned off-screen.
  • Bug fixed in read-only mode, clearing all deletes contraction state data leading to it not being synchronized with text.
  • Crash fixed in SciTE on Windows when tab bar displayed.

Release 1.45

  • Released on 15 March 2002.
  • Line layout cache implemented to improve performance by maintaining the positioning of characters on lines. Can be set to cache nothing, the line with the caret, the visible page or the whole document.
  • Support, including a new lexer, added for Matlab programs.
  • Lua folder supports folding {} ranges and compact mode. Lua lexer styles floating point numbers in number style instead of setting the '.' in operator style. Up to 6 sets of keywords. Better support for [[ although only works well when all on one line.
  • Python lexer improved to handle floating point numbers that contain negative exponents and that start with '.'.
  • When performing a rectangular paste, the caret now remains at the insertion point.
  • On Windows with a wheel mouse, page-at-a-time mode is recognised.
  • Read-only mode added to SciTE with a property to initialise it and another property, $(ReadOnly) available to show this mode in the status bar.
  • SciTE status bar can show the number of lines in the selection with the $(SelHeight) property.
  • SciTE's "Export as HTML" command uses the current character set to produce correct output for non-Western-European character sets, such as Russian.
  • SciTE's "Export as RTF" fixed to produce correct output when file contains '\'.
  • SciTE goto command accepts a column as well as a line. If given a column, it selects the word at that column.
  • SciTE's Build, Compile and Go commands are now disabled if no action has been assigned to them.
  • The Refresh button in the status bar has been removed from SciTE on Windows.
  • Bug fixed in line wrap mode where cursor up or down command did not work.
  • Some styling bugs fixed that were due to a compilation problem with gcc and inline functions with same name but different code.
  • The way that lexers loop over text was changed to avoid accessing beyond the end or setting beyond the end. May fix some bugs and make the code safer but may also cause new bugs.
  • Bug fixed in HTML lexer's handling of SGML.
  • Bug fixed on GTK+/X where lines wider than 32767 pixels did not display.
  • SciTE bug fixed with file name generation for standard property files.
  • SciTE bug fixed with Open Selected Filename command when used with file name and line number combination.
  • In SciTE, indentation and tab settings stored with buffers so maintained correctly as buffers selected. The properties used to initialise these settings can now be set separately for different file patterns.
  • Thread safety improved on Windows with a critical section protecting the font cache and initialisation of globals performed within Scintilla_RegisterClasses. New Scintilla_ReleaseResources call provided to allow explicit freeing of resources when statically bound into another application. Resources automatically freed in DLL version. The window classes are now unregistered as part of resource freeing which fixes bugs that occurred in some containers such as Internet Explorer.
  • 'make install' fixed on Solaris.
  • Bug fixed that could lead to a file being opened twice in SciTE.

Release 1.44

  • Released on 4 February 2002.
  • Crashing bug fixed in Editor::Paint.
  • Lua lexer no longer treats '.' as a word character and handles 6 keyword sets.
  • WordStartPosition and WordEndPosition take an onlyWordCharacters argument.
  • SciTE option for simplified automatic indentation which repeats the indentation of the previous line.
  • Compilation fix on Alpha because of 64 bit.
  • Compilation fix for static linking.
  • Limited maximum line length handled to 8000 characters as previous value of 16000 was causing stack exhaustion crashes for some.
  • When whole document line selected, only the last display line gets the extra selected rectangle at the right hand side rather than every display line.
  • Caret disappearing bug fixed for the case that the caret was not on the first display line of a document line.
  • SciTE bug fixed where untitled buffer containing text was sometimes deleted without chance to save.
  • SciTE bug fixed where use.monospaced not working with multiple buffers.

Release 1.43

  • Released on 19 January 2002.
  • Line wrapping robustness and performance improved in Scintilla.
  • Line wrapping option added to SciTE for both edit and output panes.
  • Static linking on Windows handles cursor resource better. Documentation of static linking improved.
  • Autocompletion has an option to delete any word characters after the caret upon selecting an item.
  • FOX version identified by PLAT_FOX in Platform.h.
  • Calltips in SciTE use the calltip.<lexer>.word.characters setting to correctly find calltips for functions that include characters like '$' which is not normally considered a word character.
  • SciTE has a command to show help on itself which gets hooked up to displaying SciTEDoc.html.
  • SciTE option calltip.<lexer>.end.definition to display help text on a second line of calltip.
  • Fixed the handling of the Buffers menu on GTK+ to ensure current buffer indicated and no warnings occur. Changed some menu items on GTK+ version to be same as Windows version.
  • use.monospaced property for SciTE determines initial state of Use Monospaced Font setting.
  • The SciTE Complete Symbol command now works when there are no word characters before the caret, even though it is slow to display the whole set of symbols.
  • Function names removed from SciTE's list of PHP keywords. The full list of predefined functions is available from another web site mentioned on the Extras page.
  • Crashing bug at startup on GTK+ for some configurations fixed.
  • Crashing bug on GTK+ on 64 bit platforms fixed.
  • Compilation problem with some compilers fixed in GTK+.
  • Japanese text entry improved on Windows 9x.
  • SciTE recent files directory problem on Windows when HOME and SciTE_HOME environment variables not set is now the directory of the executable.
  • Session files no longer include untitled buffers.

Release 1.42

  • Released on 24 December 2001.
  • Better localisation support including context menus and most messages. Translations of the SciTE user interface available for Bulgarian, French, German, Italian, Russian, and Turkish.
  • Can specify a character to use to indicate control characters rather than having them displayed as mnemonics.
  • Scintilla key command for backspace that will not delete line end characters.
  • Scintilla method to find start and end of words.
  • SciTE on GTK+ now supports the load.on.activate and save.on.deactivate properties in an equivalent way to the Windows version.
  • The output pane of SciTE on Windows is now interactive so command line utilities that prompt for input or confirmation can be used.
  • SciTE on Windows can choose directory for a "Find in Files" command like the GTK+ version could.
  • SciTE can now load a set of API files rather than just one file.
  • ElapsedTime class added to Platform for accurate measurement of durations. Used for debugging and for showing the user how long commands take in SciTE.
  • Baan lexer added.
  • In C++ lexer, document comment keywords no longer have to be at the start of the line.
  • PHP lexer changed to match keywords case insensitively.
  • More shell keywords added.
  • SciTE support for VoiceXML added to xml.properties.
  • In SciTE the selection is not copied to the find field of the Search and Replace dialogs if it contains end of line characters.
  • SciTE on Windows has a menu item to decide whether to respond to other instances which are performing their check.if.already.open check.
  • SciTE accelerator key for Box Comment command changed to avoid problems in non-English locales.
  • SciTE context menu includes Close command for the editor pane and Hide command for the output pane.
  • output: command added to SciTE director interface to add text to the output pane. The director interface can execute commands (such as tool commands with subsystem set to 3) by sending a macro:run message.
  • SciTE on GTK+ will defer to the Window Manager for position if position.left or position.top not set and for size if position.width or position.height not set.
  • SciTE on Windows has a position.tile property to place a second instance to the right of the first.
  • Scintilla on Windows again supports EM_GETSEL and EM_SETSEL.
  • Problem fixed in Scintilla on Windows where control ID is no longer cached as it could be changed by external code.
  • Problems fixed in SciTE on Windows when finding any other open instances at start up when check.if.already.open is true.
  • Bugs fixed in SciTE where command strings were not always having variables evaluated.
  • Bugs fixed with displaying partial double-byte and Unicode characters in rectangular selections and at the edge when edge mode is EDGE_BACKGROUND. Column numbers reported by GetColumn treat multiple byte characters as one column rather than counting bytes.
  • Bug fixed with caret movement over folded lines.
  • Another bug fixed with tracking selection in secondary views when performing modifications.
  • Horizontal scrolling and display of long lines optimised.
  • Cursor setting in Scintilla on GTK+ optimised.
  • Experimental changeable style attribute. Set to false to make text read-only. Currently only stops caret from being within not-changeable text and does not yet stop deleting a range that contains not-changeable text. Can be used from SciTE by adding notchangeable to style entries.
  • Experimental line wrapping. Currently has performance and appearance problems.

Release 1.41

  • Released on 6 November 2001.
  • Changed Platform.h to not include platform headers. This lessens likelihood and impact of name clashes from system headers and also speeds up compilation. Renamed DrawText to DrawTextNoClip to avoid name clash.
  • Changed way word functions work to treat a sequence of punctuation as a word. This is more sensible and also more compatible with other editors.
  • Cursor changes over the margins and selection on GTK+ platform.
  • SC_MARK_BACKGROUND is a marker that only changes the line's background colour.
  • Enhanced Visual Basic lexer handles character date and octal literals, and bracketed keywords for VB.NET. There are two VB lexers, vb and vbscript with type indication characters like ! and $ allowed at the end of identifiers in vb but not vbscript. Lexer states now separate from those used for C++ and names start with SCE_B.
  • Lexer added for Bullant language.
  • The horizontal scroll position, xOffset, is now exposed through the API.
  • The SCN_POSCHANGED notification is deprecated as it was causing confusion. Use SCN_UPDATEUI instead.
  • Compilation problems fixed for some versions of gcc.
  • Support for WM_GETTEXT restored on Windows.
  • Double clicking on an autocompletion list entry works on GTK+.
  • Bug fixed with case insensitive sorts for autocompletion lists.
  • Bug fixed with tracking selection in secondary views when performing modifications.
  • SciTE's abbreviation expansion feature will now indent expansions to the current indentation level if indent.automatic is on.
  • SciTE allows setting up of parameters to commands from a dialog and can also show this dialog automatically to prompt for arguments when running a command.
  • SciTE's Language menu (formerly Options | Use Lexer) is now defined by the menu.language property rather than being hardcoded.
  • The user interface of SciTE can be localised to a particular language by editing a locale.properties file.
  • On Windows, SciTE will try to move to the front when opening a new file from the shell and using check.if.already.open.
  • SciTE can display the file name and directory in the title bar in the form "file @ directory" when title.full.path=2.
  • The SciTE time.commands property reports the time taken by a command as well as its status when completed.
  • The SciTE find.files property is now a list separated by '|' characters and this list is added into the Files pull down of the Find in Files dialog.

Release 1.40

  • Released on 23 September 2001.
  • Removal of emulation of Win32 RichEdit control in core of Scintilla. This change may be incompatible with existing client code. Some emulation still done in Windows platform layer.
  • SGML support in the HTML/XML lexer.
  • SciTE's "Stop Executing" command will terminate GUI programs on Windows NT and Windows 2000.
  • StyleContext class helps construct lexers that are simple and accurate. Used in the C++, Eiffel, and Python lexers.
  • Clipboard operations in GTK+ version convert between platform '\n' line endings and currently chosen line endings.
  • Any character in range 0..255 can be used as a marker. This can be used to support numbered bookmarks, for example.
  • The default scripting language for ASP can be set.
  • New lexer and other support for crontab files used with the nncron scheduler.
  • Folding of Python improved.
  • The ` character is treated as a Python operator.
  • Line continuations ("\" at end of line) handled inside Python strings.
  • More consistent handling of line continuation ('\' at end of line) in C++ lexer. This fixes macro definitions that span more than one line.
  • C++ lexer can understand Doxygen keywords in doc comments.
  • SciTE on Windows allows choosing to open the "open" dialog on the directory of the current file rather than in the default directory.
  • SciTE on Windows handles command line arguments in "check.if.already.open" correctly when the current directory of the new instance is different to the already open instance of SciTE.
  • "cwd" command (change working directory) defined for SciTE director interface.
  • SciTE "Export As HTML" produces better, more compliant, and shorter files.
  • SciTE on Windows allows several options for determining default file name for exported files.
  • Automatic indentation of Python in SciTE fixed.
  • Exported HTML can support folding.
  • Bug fixed in SCI_GETTEXT macro command of director interface.
  • Cursor leak fixed on GTK+.
  • During SciTE shutdown, "identity" messages are no longer sent over the director interface.

Release 1.39

  • Released on 22 August 2001.
  • Windows version requires msvcrt.dll to be available so will not work on original Windows 95 version 1. The msvcrt.dll file is installed by almost everything including Internet Explorer so should be available.
  • Flattened tree control style folding margin. The SciTE fold.plus option is now fold.symbols and has more values for the new styles.
  • Mouse dwell events are generated when the user holds the mouse steady over Scintilla.
  • PositionFromPointClose is like PositionFromPoint but returns INVALID_POSITION when point outside window or after end of line.
  • Input of Hungarian and Russian characters in GTK+ version works by truncating input to 8 bits if in the range of normal characters.
  • Better choices for font descriptors on GTK+ for most character sets.
  • GTK+ Scintilla is destroyed upon receiving destroy signal rather than destroy_event signal.
  • Style setting that force upper or lower case text.
  • Case-insensitive autocompletion lists work correctly.
  • Keywords can be prefix based so ^GTK_ will treat all words that start with GTK_ as keywords.
  • Horizontal scrolling can be jumpy rather than gradual.
  • GetSelText places a '\0' in the buffer if the selection is empty..
  • EnsureVisible split into two methods EnsureVisible which will not scroll to show the line and EnsureVisibleEnforcePolicy which may scroll.
  • Python folder has options to fold multi-line comments and triple quoted strings.
  • C++ lexer handles keywords before '.' like "this.x" in Java as keywords. Compact folding mode option chooses whether blank lines after a structure are folded with that structure. Second set of keywords with separate style supported.
  • Ruby lexer handles multi-line comments.
  • VB has folder.
  • PHP lexer has an operator style, handles "<?" and "?>" inside strings and some comments.
  • TCL lexer which is just an alias for the C++ lexer so does not really understand TCL syntax.
  • Error lines lexer has styles for Lua error messages and .NET stack traces.
  • Makefile lexer has a target style.
  • Lua lexer handles some [[]] string literals.
  • HTML and XML lexer have a SCE_H_SGML state for tags that start with "<!".
  • Fixed Scintilla bugs with folding. When modifications were performed near folded regions sometimes no unfolding occurred when it should have. Deleting a fold causing character sometimes failed to update fold information correctly.
  • Better support for Scintilla on GTK+ for Win32 including separate PLAT_GTK_WIN32 definition and correct handling of rectangular selection with clipboard operations.
  • SciTE has a Tools | Switch Pane (Ctrl+F6) command to switch focus between edit and output panes.
  • SciTE option output.scroll allows automatic scrolling of output pane to be turned off.
  • Commands can be typed into the SciTE output pane similar to a shell window.
  • SciTE properties magnification and output magnification set initial zoom levels.
  • Option for SciTE comment block command to place comments at start of line.
  • SciTE for Win32 has an option to minimize to the tray rather than the task bar.
  • Close button on SciTE tool bar for Win32.
  • SciTE compiles with GCC 3.0.
  • SciTE's automatic indentation of C++ handles braces without preceding keyword correctly.
  • Bug fixed with GetLine method writing past the end of where it should.
  • Bug fixed with mouse drag automatic scrolling when some lines were folded.
  • Bug fixed because caret XEven setting was inverted.
  • Bug fixed where caret was initially visible even though window was not focussed.
  • Bug fixed where some file names could end with "\\" which caused slow downs on Windows 9x.
  • On Win32, SciTE Replace dialog starts with focus on replacement text.
  • SciTE Go to dialog displays correct current line.
  • Fixed bug with SciTE opening multiple files at once.
  • Fixed bug with Unicode key values reported to container truncated.
  • Fixed bug with unnecessary save point notifications.
  • Fixed bugs with indenting and unindenting at start of line.
  • Monospace Font setting behaves more consistently.

Release 1.38

  • Released on 23 May 2001.
  • Loadable lexer plugins on Windows.
  • Ruby lexer and support.
  • Lisp lexer and support.
  • Eiffel lexer and support.
  • Modes for better handling of Tab and BackSpace keys within indentation. Mode to avoid autocompletion list cancelling when there are no viable matches.
  • ReplaceTarget replaced with two calls ReplaceTarget (which is incompatible with previous ReplaceTarget) and ReplaceTargetRE. Both of these calls have a count first parameter which allows using strings containing nulls. SearchInTarget and SetSearchFlags functions allow specifying a search in several simple steps which helps some clients which can not create structs or pointers easily.
  • Asian language input through an Input Method Editor works on Windows 2000.
  • On Windows, control characters can be entered through use of the numeric keypad in conjunction with the Alt key.
  • Document memory allocation changed to grow exponentially which reduced time to load a 30 Megabyte file from 1000 seconds to 25. Change means more memory may be used.
  • Word part movement keys now handled in Scintilla rather than SciTE.
  • Regular expression '^' and '$' work more often allowing insertion of text at start or end of line with a replace command. Backslash quoted control characters \a, \b, \f, \t, and \v recognised within sets.
  • Session files for SciTE.
  • Export as PDF command hidden in SciTE as it often failed. Code still present so can be turned on by those willing to cope.
  • Bug fixed in HTML lexer handling % before > as end ASP even when no start ASP encountered. Bug fixed when scripts ended with a quoted string and end tag was not seen.
  • Bug fixed on Windows where context menu key caused menu to appear in corner of screen rather than within window.
  • Bug fixed in SciTE's Replace All command not processing whole file when replace string longer than search string.
  • Bug fixed in SciTE's MRU list repeating entries if Ctrl+Tab used when all entries filled.
  • ConvertEOLs call documentation fixed.

Release 1.37

  • Released on 17 April 2001.
  • Bug fixed with scroll bars being invisible on GTK+ 1.2.9.
  • Scintilla and SciTE support find and replace using simple regular expressions with tagged expressions. SciTE supports C '\' escapes in the Find and Replace dialogs. Replace in Selection available in SciTE.
  • Scintilla has a 'target' feature for replacing code rapidly without causing display updates.
  • Scintilla and SciTE on GTK+ support file dropping from file managers such as Nautilus and gmc. Files or other URIs dropped on Scintilla result in a URIDropped notification.
  • Lexers may have separate Lex and Fold functions.
  • Lexer infrastructure improved to allow for plug in lexers and for referring to lexers by name rather than by ID.
  • Ada lexer and support added.
  • Option in both Scintilla and SciTE to treat both left and right margin as equally important when repositioning visible area in response to caret movement. Default is to prefer visible area positioning which minimises the horizontal scroll position thus favouring the left margin.
  • Caret line highlighting.
  • Commands to delete from the caret to the end of line and from the caret to the beginning of line.
  • SciTE has commands for inserting and removing block comments and for inserting stream comments.
  • SciTE Director interface uses C++ '\' escapes to send control characters.
  • SciTE Director interface adds more commands including support for macros.
  • SciTE has menu options for recording and playing macros which are visible when used with a companion program that supports these features.
  • SciTE has an Expand Abbreviation command. Abbreviations are stored in a global abbrev.properties file.
  • SciTE has a Full Screen command to switch between a normal window size and using the full screen. On Windows, the menu bar can be turned off when in full screen mode.
  • SciTE has a Use monospaced font command to switch between the normal set of fonts and one size of a particular fixed width font.
  • SciTE's use of tabs can be controlled for particular file names as well as globally.
  • The contents of SciTE's status bar can be defined by a property and include variables. On Windows, several status bar definitions can be active with a click on the status bar cycling through them.
  • Copy as RTF command in SciTE on Windows to allow pasting styled text into word processors.
  • SciTE can allow the use of non-alphabetic characters in Complete Symbol lists and can automatically display this autocompletion list when a trigger character such as '.' is typed. Complete word can be set to pop up when the user is typing a word and there is only one matching word in the document.
  • SciTE lists the imported properties files on a menu to allow rapid access to them.
  • SciTE on GTK+ improvements to handling accelerator keys and focus in dialogs. Message boxes respond to key presses without the Alt key as they have no text entries to accept normal keystrokes.
  • SciTE on GTK+ sets the application icon.
  • SciTE allows setting the colours used to indicate the current error line.
  • Variables within PHP strings have own style. Keyword list updated.
  • Keyword list for Lua updated for Lua 4.0.
  • Bug fixed in rectangular selection where rectangle still appeared selected after using cursor keys to move caret.
  • Bug fixed in C++ lexer when deleting a '{' controlling a folded range led to that range becoming permanently invisible.
  • Bug fixed in Batch lexer where comments were not recognised.
  • Bug fixed with undo actions coalescing into steps incorrectly.
  • Bug fixed with Scintilla on GTK+ positioning scroll bars 1 pixel over the Scintilla window leading to their sides being chopped off.
  • Bugs fixed in SciTE when doing some actions led to the start or end of the file being displayed rather than the current location.
  • Appearance of calltips fixed to look like document text including any zoom factor. Positioned to be outside current line even when multiple fonts and sizes used.
  • Bug fixed in Scintilla macro support where typing Enter caused both a newline command and newline character insertion to be recorded.
  • Bug fixed in SciTE on GTK+ where focus was moving between widgets incorrectly.
  • Bug fixed with fold symbols sometimes not updating when the text changed.
  • Bugs fixed in SciTE's handling of folding commands.
  • Deprecated undo collection enumeration removed from API.

Release 1.36

  • Released on 1 March 2001.
  • Scintilla supports GTK+ on Win32.
  • Some untested work on making Scintilla and SciTE 64 bit compatible. For users on GTK+ this requires including Scintilla.h before ScintillaWidget.h.
  • HTML lexer allows folding HTML.
  • New lexer for Avenue files which are used in the ESRI ArcView GIS.
  • DOS Batch file lexer has states for '@', external commands, variables and operators.
  • C++ lexer can fold comments of /* .. */ form.
  • Better disabling of pop up menu items in Scintilla when in read-only mode.
  • Starting to move to Doxygen compatible commenting.
  • Director interface on Windows enables another application to control SciTE.
  • Opening SciTE on Windows 9x sped up greatly for some cases.
  • The command.build.directory property allows SciTE to run the build command in a different directory to the source files.
  • SciTE on Windows allows setting foreground and background colours for printed headers and footers.
  • Bug fixed in finding calltips in SciTE which led to no calltips for some identifiers.
  • Documentation added for lexers and for the extension and director interfaces.
  • SciTE menus rearranged with new View menu taking over some of the items that were under the Options menu. Clear All Bookmarks command added.
  • Clear Output command in SciTE.
  • SciTE on Windows gains an Always On Top command.
  • Bug fixed in SciTE with attempts to define properties recursively.
  • Bug fixed in SciTE properties where only one level of substitution was done.
  • Bug fixed in SciTE properties where extensions were not being matched in a case insensitive manner.
  • Bug fixed in SciTE on Windows where the Go to dialog displays the correct line number.
  • In SciTE, if fold.on.open set then switching buffers also performs fold.
  • Bug fixed in Scintilla where ensuring a line was visible in the presence of folding operated on the document line instead of the visible line.
  • SciTE command line processing modified to operate on arguments in order and in two phases. First any arguments before the first file name are processed, then the UI is opened, then the remaining arguments are processed. Actions defined for the Director interface (currently only "open") may also be used on the command line. For example, "SciTE -open:x.txt" will start SciTE and open x.txt.
  • Numbered menu items SciTE's Buffers menu and the Most Recently Used portion of the File menu go from 1..0 rather than 0..9.
  • The tab bar in SciTE for Windows has numbers. The tab.hide.one option hides the tab bar until there is more than one buffer open.

Release 1.35

  • Released on 29 January 2001.
  • Rewritten and simplified widget code for the GTK+ version to enhance solidity and make more fully compliant with platform norms. This includes more normal handling of keystrokes so they are forwarded to containers correctly.
  • User defined lists can be shown.
  • Many fixes to the Perl lexer.
  • Pascal lexer handles comments more correctly.
  • C/C++/Java/JavaScipt lexer has a state for line doc comments.
  • Error output lexer understands Sun CC messages.
  • Make file lexer has variable, preprocessor, and operator states.
  • Wider area given to an italics character that is at the end of a line to prevent it being cut off.
  • Call to move the caret inside the currently visible area.
  • Paste Rectangular will space fill on the left hand side of the pasted text as needed to ensure it is kept rectangular.
  • Cut and Paste Rectangular does nothing in read-only mode.
  • Undo batching changed so that a paste followed by typing creates two undo actions..
  • A "visibility policy" setting for Scintilla determines which range of lines are displayed when a particular line is moved to. Also exposed as a property in SciTE.
  • SciTE command line allows property settings.
  • SciTE has a View Output command to hide or show the output pane.
  • SciTE's Edit menu has been split in two with searching commands moved to a new Search menu. Find Previous and Previous Bookmark are in the Search menu.
  • SciTE on Windows has options for setting print margins, headers and footers.
  • SciTE on Windows has tooltips for toolbar.
  • SciTE on GTK+ has properties for setting size of file selector.
  • Visual and audio cues in SciTE on Windows enhanced.
  • Fixed performance problem in SciTE for GTK+ by dropping the extra 3D effect on the content windows.
  • Fixed problem in SciTE where choosing a specific lexer then meant that no lexer was chosen when files opened.
  • Default selection colour changed to be visible on low colour displays.
  • Fixed problems with automatically reloading changed documents in SciTE on Windows.
  • Fixed problem with uppercase file extensions in SciTE.
  • Fixed some problems when using characters >= 128, some of which were being incorrectly treated as spaces.
  • Fixed handling multiple line tags, non-inline scripts, and XML end tags /> in HTML/XML lexer.
  • Bookmarks in SciTE no longer disappear when switching between buffers.

Release 1.34

  • Released on 28 November 2000.
  • Pascal lexer.
  • Export as PDF in SciTE.
  • Support for the OpenVMS operating system in SciTE.
  • SciTE for GTK+ can check for another instance of SciTE editing a file and switch to it rather than open a second instance on one file.
  • Fixes to quoting and here documents in the Perl lexer.
  • SciTE on Windows can give extra visual and audio cues when a warning is shown or find restarts from beginning of file.
  • Open Selected Filename command in SciTE. Also understands some warning message formats.
  • Wider area for line numbers when printing.
  • Better scrolling performance on GTK+.
  • Fixed problem where rectangles with negative coordinates were invalidated leading to trouble with platforms that use unsigned coordinates.
  • GTK+ Scintilla uses more compliant signalling code so that keyboard events should propagate to containers.
  • Bug fixed with opening full or partial paths.
  • Improved handling of paths in error messages in SciTE.
  • Better handling of F6 in SciTE.

Release 1.33

  • Released on 6 November 2000.
  • XIM support for the GTK+ version of Scintilla ensures that more non-English characters can be typed.
  • Caret may be 1, 2, or 3 pixels wide.
  • Cursor may be switched to wait image during lengthy processing.
  • Scintilla's internal focus flag is exposed for clients where focus is handled in complex ways.
  • Error status defined for Scintilla to hold indication that an operation failed and the reason for that failure. No detection yet implemented but clients may start using the interface so as to be ready for when it does.
  • Context sensitive help in SciTE.
  • CurrentWord property available in SciTE holding the value of the word the caret is within or near.
  • Apache CONF file lexer.
  • Changes to Python lexer to allow 'as' as a context sensitive keyword and the string forms starting with u, r, and ur to be recognised.
  • SCN_POSCHANGED notification now working and SCN_PAINTED notification added.
  • Word part movement commands for cursoring between the parts of reallyLongCamelIdentifiers and other_ways_of_making_words.
  • When text on only one line is selected, Shift+Tab moves to the previous tab stop.
  • Tab control available for Windows version of SciTE listing all the buffers and making it easy to switch between them.
  • SciTE can be set to automatically determine the line ending type from the contents of a file when it is opened.
  • Dialogs in GTK+ version of SciTE made more modal and have accelerator keys.
  • Find in Files command in GTK+ version of SciTE allows choice of directory.
  • On Windows, multiple files can be opened at once.
  • SciTE source broken up into more files.
  • Scintilla headers made safe for C language, not just C++.
  • New printing modes - force background to white and force default background to white.
  • Automatic unfolding not occurring when Enter pressed at end of line bug fixed.
  • Bugs fixed in line selection.
  • Bug fixed with escapes in PHP strings in the HTML lexer.
  • Bug fixed in SciTE for GTK+ opening files when given full paths.
  • Bug fixed in autocompletion where user backspaces into existing text.
  • Bugs fixed in opening files and ensuring they are saved before running. A case bug also fixed here.

Release 1.32

  • Released on 8 September 2000.
  • Fixes bugs in complete word and related code. Protection against a bug when receiving a bad argument.

Release 1.31

  • Released on 6 September 2000.
  • Scintilla is available as a COM control from the scintillactrl module in CVS.
  • Style setting to underline text. Exposed in SciTE as "underlined".
  • Style setting to make text invisible.
  • SciTE has an extensibility interface that can be used to implement features such as a scripting language or remote control. An example use of this is the extlua module available from CVS which allows SciTE to be scripted in Lua.
  • Many minor fixes to all of the lexers.
  • New lexer for diff and patch files.
  • Error message lexer understands Perl error messages.
  • C/C++/Java lexer now supports C#, specifically verbatim strings and @ quoting of identifiers that are the same as keywords. SciTE has a set of keywords for C# and a build command set up for C#.
  • Scintilla property to see whether in overtype or insert state.
  • PosChanged notification fired when caret moved.
  • Comboboxes in dialogs in SciTE on Windows can be horizontally scrolled.
  • Autocompletion and calltips can treat the document as case sensitive or case insensitive.
  • Autocompletion can be set to automatically choose the only element in a single element list.
  • Set of characters that automatically complete an autocompletion list can be set.
  • SciTE command to display calltip - useful when dropped because of editing.
  • SciTE has a Revert command to go back to the last saved version.
  • SciTE has an Export as RTF command. Save as HTML is renamed to Export as HTML and is located on the Export sub menu.
  • SciTE command "Complete Word" searches document for any words starting with characters before caret.
  • SciTE options for changing aspects of the formatting of files exported as HTML or RTF.
  • SciTE "character.set" option for choosing the character set for all fonts.
  • SciTE has a "Toggle all folds" command.
  • The makefiles have changed. The makefile_vc and makefile_bor files in scintilla/win32 and scite/win32 have been merged into scintilla/win32/scintilla.mak and scite/win32/scite.mak. DEBUG may be defined for all make files and this will turn on assertions and for some make files will choose other debugging options.
  • To make debugging easier and allow good use of BoundsChecker there is a Visual C++ project file in scite/boundscheck that builds all of Scintilla and SciTE into one executable.
  • The size of the SciTE output window can be set with the output.horizontal.size and output.vertical.size settings.
  • SciTE status bar indicator for insert or overwrite mode.
  • Performance improvements to autocompletion and calltips.
  • A caret redraw problem when undoing is fixed.
  • Crash with long lines fixed.
  • Bug fixed with merging markers when lines merged.

Release 1.30

  • Released on 26 July 2000.
  • Much better support for PHP which is now an integral part of the HTML support.
  • Start replacement of Windows-specific APIs with cross platform APIs. In 1.30, the new APIs are introduced but the old APIs are still available. For the GTK+ version, may have to include "WinDefs.h" explicitly to use the old APIs.
  • "if" and "import" statements in SciTE properties files allows modularisation into language-specific properties files and choices based upon platform. This means that SciTE is delivered with 9 language-specific properties files as well as the standard SciTEGlobal.properties file.
  • Much lower resource usage on Windows 9x.
  • "/p" option in SciTE on Windows for printing a file and then exiting.
  • Options for printing with inverted brightness (when the screen is set to use a dark background) and to force black on white printing.
  • Option for printing magnified or miniaturised from screen settings.
  • In SciTE, Ctrl+F3 and Ctrl+Shift+F3 find the selection in the forwards and backwards directions respectively.
  • Auto-completion lists may be set to cancel when the cursor goes before its start position or before the start of string being completed.
  • Auto-completion lists automatically size more sensibly.
  • SCI_CLEARDOCUMENTSTYLE zeroes all style bytes, ensures all lines are shown and deletes all folding information.
  • On Windows, auto-completion lists are visually outdented rather than indented.
  • Close all command in SciTE.
  • On Windows multiple files can be dragged into SciTE.
  • When saving a file, the SciTE option save.deletes.first deletes it before doing the save. This allows saving with a different capitalisation on Windows.
  • When use tabs option is off pressing the tab key inserts spaces.
  • Bug in indicators leading to extra line drawn fixed.

Release 1.28

  • Released on 27 June 2000.
  • Fixes crash in indentation guides when indent size set to 0.
  • Fixes to installation on GTK+/Linux. User properties file on GTK+ has a dot at front of name: .SciTEUser.properties. Global properties file location configurable at compile time defaulting to $prefix/share/scite. $prefix determined from Gnome if present else its /usr/local and can be overridden by installer. Gnome menu integration performed in make install if Gnome present.

Release 1.27

  • Released on 23 June 2000.
  • Indentation guides. View whitespace mode may be set to not display whitespace in indentation.
  • Set methods have corresponding gets for UndoCollection, BufferedDraw, CodePage, UsePalette, ReadOnly, CaretFore, and ModEventMask.
  • Caret is continuously on rather than blinking while typing or holding down delete or backspace. And is now always shown if non blinking when focused on GTK+.
  • Bug fixed in SciTE with file extension comparison now done in case insensitive way.
  • Bugs fixed in SciTE's file path handling on Windows.
  • Bug fixed with preprocessor '#' last visible character causing hang.

Release 1.26

  • Released on 13 June 2000.
  • Support for the Lua language in both Scintilla and SciTE.
  • Multiple buffers may be open in SciTE.
  • Each style may have a character set configured. This may determine the characters that are displayed by the style.
  • In the C++ lexer, lexing of preprocessor source may either treat it all as being in the preprocessor class or only the initial # and preprocessor command word as being in the preprocessor class.
  • Scintilla provides SCI_CREATEDOCUMENT, SCI_ADDREFDOCUMENT, and SCI_RELEASEDOCUMENT to make it easier for a container to deal with multiple documents.
  • GTK+ specific definitions in Scintilla.h were removed to ScintillaWidget.h. All GTK+ clients will need to #include "ScintillaWidget.h".
  • For GTK+, tools can be executed in the background by setting subsystem to 2.
  • Keys in the properties files are now case sensitive. This leads to a performance increase.
  • Menu to choose which lexer to use on a file.
  • Tab size dialog on Windows.
  • File dialogs enlarged on GTK+.
  • Match Brace command bound to Ctrl+E on both platforms with Ctrl+] a synonym on Windows. Ctrl+Shift+E is select to matching brace. Brace matching tries to match to either the inside or the outside, depending on whether the cursor is inside or outside the braces initially. View End of Line bound to Ctrl+Shift+O.
  • The Home key may be bound to move the caret to either the start of the line or the start of the text on the line.
  • Visual C++ project file for SciTE.
  • Bug fixed with current x location after Tab key.
  • Bug fixed with hiding fold margin by setting fold.margin.width to 0.
  • Bugs fixed with file name confusion on Windows when long and short names used, or different capitalisations, or relative paths.

Release 1.25

  • Released on 9 May 2000.
  • Some Unicode support on Windows. Treats buffer and API as UTF-8 and displays through UCS-2 of Windows.
  • Automatic indentation. Indentation size can be different to tab size.
  • Tool bar.
  • Status bar now on Windows as well as GTK+.
  • Input fields in Find and Replace dialogs now have history on both Windows and GTK+.
  • Auto completion list items may be separated by a chosen character to allow spaces in items. The selected item may be changed through the API.
  • Horizontal scrollbar can be turned off.
  • Property to remove trailing spaces when saving file.
  • On Windows, changed font size calculation to be more compatible with other applications.
  • On GTK+, SciTE's global properties files are looked for in the directory specified in the SCITE_HOME environment variable if it is set. This allows hiding in a dot directory.
  • Keyword lists in SciTE updated for JavaScript to include those destined to be used in the future. IDL includes XPIDL keywords as well as MSIDL keywords.
  • Zoom level can be set and queried through API.
  • New notification sent before insertions and deletions.
  • LaTeX lexer.
  • Fixes to folding including when deletions and additions are performed.
  • Fix for crash with very long lines.
  • Fix to affect all of rectangular selections with deletion and case changing.
  • Removed non-working messages that had been included only for Richedit compatibility.

Release 1.24

  • Released on 29 March 2000.
  • Added lexing of IDL based on C++ lexer with extra UUID lexical class.
  • Functions and associated keys for Line Delete, Line Cut, Line Transpose, Selection Lower Case and Selection Upper Case.
  • Property setting for SciTE, eol.mode, chooses initial state of line end characters.
  • Fixed bugs in undo history with small almost-contiguous changes being incorrectly coalesced.
  • Fixed bugs with incorrect expansion of ContractionState data structures causing crash.
  • Fixed bugs relating to null fonts.
  • Fixed bugs where recolourisation was not done sometimes when required.
  • Fixed compilation problems with SVector.h.
  • Fixed bad setting of fold points in Python.

Release 1.23

  • Released on 21 March 2000.
  • Directory structure to separate on basis of product (Scintilla, SciTE, DMApp) and environment (Cross-platform, Win32, GTK+).
  • Download packaging to allow download of the source or platform dependent executables.
  • Source code now available from CVS at SourceForge.
  • Very simple Windows-only demonstration application DMApp is available from cvs as dmapp.
  • Lexing functionality may optionally be included in Scintilla rather than be provided by the container.
  • Set of lexers included is determined at link time by defining which of the Lex* object files are linked in.
  • On Windows, the SciLexer.DLL extends Scintilla.DLL with the standard lexers.
  • Enhanced HTML lexer styles embedded VBScript and Python. ASP segments are styled and ASP scripts in JavaScript, VBScript and Python are styled.
  • PLSQL and PHP supported.
  • Maximum number of lexical states extended to 128.
  • Lexers may store per line parse state for multiple line features such as ASP script language choice.
  • Lexing API simplified.
  • Project file for Visual C++.
  • Can now cycle through all recent files with Ctrl+Tab in SciTE.
  • Bookmarks in SciTE.
  • Drag and drop copy works when dragging to the edge of the selection.
  • Fixed bug with value sizes in properties file.
  • Fixed bug with last line in properties file not being used.
  • Bug with multiple views of one document fixed.
  • Keypad now works on GTK+.

Release 1.22

  • Released on 27 February 2000.
  • wxWindows platform defined. Implementation for wxWindows will be available separately from main Scintilla distribution.
  • Line folding in Scintilla.
  • SciTE performs syntax directed folding for C/C++/Java/JavaScript and for Python.
  • Optional macro recording support.
  • User properties file (SciTEUser.properties) allows for customisation by the user that is not overwritten with each installation of SciTE.
  • Python lexer detects and highlights inconsistent indentation.
  • Margin API made more orthogonal. SCI_SETMARGINWIDTH and SCI_SETLINENUMBERWIDTH are deprecated in favour of this new API.
  • Margins may be made sensitive to forward mouse click events to container.
  • SQL lexer and styles included.
  • Perl lexer handles regular expressions better.
  • Caret policy determines how closely caret is tracked by visible area.
  • New marker shapes: arrow pointing down, plus and minus.
  • Optionally display full path in title rather than just file name.
  • Container is notified when Scintilla gains or loses focus.
  • SciTE handles focus in a more standard way and applies the main edit commands to the focused pane.
  • Container is notified when Scintilla determines that a line needs to be made visible.
  • Document watchers receive notification when document about to be deleted.
  • Document interface allows access to list of watchers.
  • Line end determined correctly for lines ending with only a '\n'.
  • Search variant that searches form current selection and sets selection.
  • SciTE understands format of diagnostic messages from WScript.
  • SciTE remembers top line of window for each file in MRU list so switching to a recent file is more likely to show the same text as when the file was previously visible.
  • Document reference count now initialised correctly.
  • Setting a null document pointer creates an empty document.
  • WM_GETTEXT can no longer overrun buffer.
  • Polygon drawing bug fixed on GTK+.
  • Java and JavaScript lexers merged into C++ lexer.
  • C++ lexer indicates unterminated strings by colouring the end of the line rather than changing the rest of the file to string style. This is less obtrusive and helps the folding.

Release 1.21

  • Released on 2 February 2000.
  • Blank margins on left and right side of text.
  • SCN_CHECKBRACE renamed SCN_UPDATEUI and made more efficient.
  • SciTE source code refactored into platform independent and platform specific classes.
  • XML and Perl subset lexers in SciTE.
  • Large improvement to lexing speed.
  • A new subsystem, 2, allows use of ShellExec on Windows.
  • Borland compatible makefile.
  • Status bar showing caret position in GTK+ version of SciTE.
  • Bug fixes to selection drawing when part of selection outside window, mouse release over scroll bars, and scroll positioning after deletion.

Release 1.2

  • Released on 21 January 2000.
  • Multiple views of one document.
  • Rectangular selection, cut, copy, paste, drag and drop.
  • Long line indication.
  • Reverse searching
  • Line end conversion.
  • Generic autocompletion and calltips in SciTE.
  • Call tip background colour can be set.
  • SCI_MARKERPREV for moving to a previous marker.
  • Caret kept more within window where possible.

Release 1.15

  • Released on 15 December 1999.
  • Brace highlighting and badlighting (for mismatched braces).
  • Visible line ends.
  • Multiple line call tips.
  • Printing now works from SciTE on Windows.
  • SciTE has a global "*" lexer style that is used as the basis for all the lexers' styles.
  • Fixes some warnings on GTK+ 1.2.6.
  • Better handling of modal dialogs on GTK+.
  • Resize handle drawn on pane splitter in SciTE on GTK+ so it looks more like a regular GTK+ *paned widget.
  • SciTE does not place window origin offscreen if no properties file found on GTK+.
  • File open filter remembered in SciTE on Windows.
  • New mechanism using style numbers 32 to 36 standardises the setting of styles for brace highlighting, brace badlighting, line numbers, control characters and the default style.
  • Old messages SCI_SETFORE .. SCI_SETFONT have been replaced by the default style 32. The old messages are deprecated and will disappear in a future version.

Release 1.14

  • Released on 20 November 1999.
  • Fixes a scrolling bug reported on GTK+.

Release 1.13

  • Released on 18 November 1999.
  • Fixes compilation problems with the mingw32 GCC 2.95.2 on Windows.
  • Control characters are now visible.
  • Performance has improved, particularly for scrolling.
  • Windows RichEdit emulation is more accurate. This may break client code that uses these messages: EM_GETLINE, EM_GETLINECOUNT, EM_EXGETSEL, EM_EXSETSEL, EM_EXLINEFROMCHAR, EM_LINELENGTH, EM_LINEINDEX, EM_CHARFROMPOS, EM_POSFROMCHAR, and EM_GETTEXTRANGE.
  • Menus rearranged and accelerator keys set for all static items.
  • Placement of space indicators in view whitespace mode is more accurate with some fonts.

Release 1.12

  • Released on 9 November 1999.
  • Packaging error in 1.11 meant that the compilation error was not fixed in that release. Linux/GTK+ should compile with GCC 2.95 this time.

Release 1.11

  • Released on 7 November 1999.
  • Fixed a compilation bug in ScintillaGTK.cxx.
  • Added a README file to explain how to build.
  • GTK+/Linux downloads now include documentation.
  • Binary only Sc1.EXE one file download for Windows.

Release 1.1

  • Released on 6 November 1999.
  • Major restructuring for better modularity and platform independence.
  • Inter-application drag and drop.
  • Printing support in Scintilla on Windows.
  • Styles can select colouring to end of line. This can be used when a file contains more than one language to differentiate between the areas in each language. An example is the HTML + JavaScript styling in SciTE.
  • Actions can be grouped in the undo stack, so they will be undone together. This grouping is hierarchical so higher level actions such as replace all can be undone in one go. Call to discover whether there are any actions to redo.
  • The set of characters that define words can be changed.
  • Markers now have identifiers and can be found and deleted by their identifier. The empty marker type can be used to make a marker that is invisible and which is only used to trace where a particular line moves to.
  • Double click notification.
  • HTML styling in SciTE also styles embedded JavaScript.
  • Additional tool commands can be added to SciTE.
  • SciTE option to allow reloading if changed upon application activation and saving on application deactivation. Not yet working on GTK+ version.
  • Entry fields in search dialogs remember last 10 user entries. Not working in all cases in Windows version.
  • SciTE can save a styled copy of the current file in HTML format. As SciTE does not yet support printing, this can be used to print a file by then using a browser to print the HTML file.

Release 1.02

  • Released on 1 October 1999.
  • GTK+ version compiles with GCC 2.95.
  • Properly deleting objects when window destroyed under GTK+.
  • If the selection is not empty backspace deletes the selection.
  • Some X style middle mouse button handling for copying the primary selection to and from Scintilla. Does not work in all cases.
  • HTML styling in SciTE.
  • Stopped dirty flag being set in SciTE when results pane modified.

Release 1.01

  • Released on 28 September 1999.
  • Better DBCS support on Windows including IME.
  • Wheel mouse support for scrolling and zooming on Windows. Zooming with Ctrl+KeypadPlus and Ctrl+KeypadMinus.
  • Performance improvements especially on GTK+.
  • Caret blinking and settable colour on both GTK+ and Windows.
  • Drag and drop within a Scintilla window. On Windows, files can be dragged into SciTE.

Release 1.0

  • Released on 17 May 1999.
  • Changed name of "Tide" to "SciTE" to avoid clash with a TCL based IDE. "SciTE" is a SCIntilla based Text Editor and is Latin meaning something like "understanding in a neat way" and is also an Old English version of the word "shit".
  • There is a SCI_AUTOCSTOPS message for defining a string of characters that will stop autocompletion mode. Autocompletion mode is cancelled when any cursor movement occurs apart from backspace.
  • GTK+ version now splits horizontally as well as vertically and all dialogs cancel when the escape key is pressed.

Beta release 0.93

  • Released on 12 May 1999.
  • A bit more robust than 0.92 and supports SCI_MARKERNEXT message.

Beta release 0.92

  • Released on 11 May 1999.
  • GTK+ version now contains all features of Windows version with some very small differences. Executing programs works much better now.
  • New palette code to allow more colours to be displayed in 256 colour screen modes. A line number column can be displayed to the left of the selection margin.
  • The code that maps from line numbers to text positions and back has been completely rewritten to be faster, and to allow markers to move with the text.

Beta release 0.91

  • Released on 30 April 1999, containing fixes to text measuring to make Scintilla work better with bitmap fonts. Also some small fixes to make compiling work with Visual C++.

Beta release 0.90

  • Released on 29 April 1999, containing working GTK+/Linux version.
  • The Java, C++ and Python lexers recognise operators as distinct from default allowing them to be highlighted.

Beta release 0.82

  • Released on 1 April 1999, to fix a problem with handling the Enter key in PythonWin. Also fixes some problems with cmd key mapping.

Beta release 0.81

  • Released on 30th March 1999, containing bug fixes and a few more features.
  • Static linking supported and Tidy.EXE, a statically linked version of Tide.EXE. Changes to compiler flags in the makefiles to optimise for size.
  • Scintilla supports a 'savepoint' in the undo stack which can be set by the container when the document is saved. Notifications are sent to the container when the savepoint is entered or left, allowing the container to to display a dirty indicator and change its menus.
  • When Scintilla is set to read-only mode, a notification is sent to the container should the user try to edit the document. This can be used to check the document out of a version control system.
  • There is an API for setting the appearance of indicators.
  • The keyboard mapping can be redefined or removed so it can be implemented completely by the container. All of the keyboard commands are now commands which can be sent by the container.
  • A home command like Visual C++ with one hit going to the start of the text on the line and the next going to the left margin is available. I do not personally like this but my fingers have become trained to it by much repetition.
  • SCI_MARKERDELETEALL has an argument in wParam which is the number of the type marker to delete with -1 performing the old action of removing all marker types.
  • Tide now understands both the file name and line numbers in error messages in most cases.
  • Tide remembers the current lines of files in the recently used list.
  • Tide has a Find in Files command.

Beta release 0.80

  • This was the first public release on 14th March 1999, containing a mostly working Win32 Scintilla DLL and Tide EXE.

Beta releases of SciTE were called Tide

scintilla/doc/Design.html0000644000175000017500000002645312075650364014366 0ustar neilneil Scintilla and SciTE
Scintilla icon Scintilla Component Design

Top level structure

Scintilla consists of three major layers of C++ code

  • Portability Library
  • Core Code
  • Platform Events and API

The primary purpose of this structure is to separate the platform dependent code from the platform independent core code. This makes it easier to port Scintilla to a new platform and ensures that most readers of the code do not have to deal with platform details. To minimise portability problems and avoid code bloat, a conservative subset of C++ is used in Scintilla with no exception handling, run time type information or use of the standard C++ library and with limited use of templates.

The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in many ways. Each has windows, menus and bitmaps. These features generally work in similar ways so each has a way to move a window or draw a red line. Sometimes one platform requires a sequence of calls rather than a single call. At other times, the differences are more profound. Reading the Windows clipboard occurs synchronously but reading the GTK+ clipboard requires a request call that will be asynchronously answered with a message containing the clipboard data. The wxWindows platform is available from the wxWindows site


Portability Library

This is a fairly small and thin layer over the platform's native capabilities.

The portability library is defined in Platform.h and is implemented once for each platform. PlatWin.cxx defines the Windows variants of the methods and PlatGTK.cxx the GTK+ variants.

Several of the classes here hold platform specific object identifiers and act as proxies to these platform objects. Most client code can thus manipulate the platform objects without caring which is the current platform. Sometimes client code needs access to the underlying object identifiers and this is provided by the GetID method. The underlying types of the platform specific identifiers are typedefed to common names to allow them to be transferred around in client code where needed.

Point, PRectangle

These are simple classes provided to hold the commonly used geometric primitives. A PRectangle follows the Mac / Windows convention of not including its bottom and right sides instead of including all its sides as is normal in GTK+. It is not called Rectangle as this may be the name of a macro on Windows.

Colour, ColourPair, Palette

Colour holds a platform specific colour identifier - COLORREF for Windows and GdkColor for GTK+. The red, green and blue components that make up the colour are limited to the 8 bits of precision available on Windows. ColourPairs are used because not all possible colours are always available. Using an 8 bit colour mode, which is a common setting for both Windows and GTK+, only 256 colours are possible on the display. Thus when an application asks for a dull red, say #400000, it may only be allocated an already available colour such as #800000 or #330000. With 16 or 2 colour modes even less choice is available and the application will have to use the limited set of already available colours.

A Palette object holds a set of colour pairs and can make the appropriate calls to ask to allocate these colours and to see what the platform has decided will be allowed.

Font

Font holds a platform specific font identifier - HFONT for Windows, GdkFont* for GTK+. It does not own the identifier and so will not delete the platform font object in its destructor. Client code should call Destroy at appropriate times.

Surface

Surface is an abstraction over each platform's concept of somewhere that graphical drawing operations can be done. It may wrap an already created drawing place such as a window or be used to create a bitmap that can be drawn into and later copied onto another surface. On Windows it wraps a HDC and possibly a HBITMAP. On GTK+ it wraps a GdkDrawable* and possibly a GdkPixmap*. Other platform specific objects are created (and correctly destroyed) whenever required to perform drawing actions.

Drawing operations provided include drawing filled and unfilled polygons, lines, rectangles, ellipses and text. The height and width of text as well as other details can be measured. Operations can be clipped to a rectangle. Most of the calls are stateless with all parameters being passed at each call. The exception to this is line drawing which is performed by calling MoveTo and then LineTo.

Window

Window acts as a proxy to a platform window allowing operations such as showing, moving, redrawing, and destroying to be performed. It contains a platform specific window identifier - HWND for Windows, GtkWidget* for GTK+.

ListBox

ListBox is a subclass of Window and acts as a proxy to a platform listbox adding methods for operations such as adding, retrieving, and selecting items.

Menu

Menu is a small helper class for constructing popup menus. It contains the platform specific menu identifier - HMENU for Windows, GtkItemFactory* for GTK+. Most of the work in constructing menus requires access to platform events and so is done in the Platform Events and API layer.

Platform

The Platform class is used to access the facilities of the platform. System wide parameters such as double click speed and chrome colour are available from Platform. Utility functions such as DebugPrintf are also available from Platform.

Core Code

The bulk of Scintilla's code is platform independent. This is made up of the CellBuffer, ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap, ScintillaBase, CallTip, and AutoComplete primary classes.

CellBuffer

A CellBuffer holds text and styling information, the undo stack, the assignment of line markers to lines, and the fold structure.

A cell contains a character byte and its associated style byte. The current state of the cell buffer is the sequence of cells that make up the text and a sequence of line information containing the starting position of each line and any markers assigned to each line.

The undo stack holds a sequence of actions on the cell buffer. Each action is one of a text insertion, a text deletion or an undo start action. The start actions are used to group sequences of text insertions and deletions together so they can be undone together. To perform an undo operation, each insertion or deletion is undone in reverse sequence. Similarly, redo reapplies each action to the buffer in sequence. Whenever a character is inserted in the buffer either directly through a call such as InsertString or through undo or redo, its styling byte is initially set to zero. Client code is responsible for styling each character whenever convenient. Styling information is not stored in undo actions.

Document

A document contains a CellBuffer and deals with some higher level abstractions such as words, DBCS character sequences and line end character sequences. It is responsible for managing the styling process and for notifying other objects when changes occur to the document.

Editor

The Editor object is central to Scintilla. It is responsible for displaying a document and responding to user actions and requests from the container. It uses ContractionState, Indicator, LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to map key presses to functions. The visibility of each line is kept in the ContractionState which is also responsible for mapping from display lines to documents lines and vice versa.

There may be multiple Editor objects attached to one Document object. Changes to a document are broadcast to the editors through the DocWatcher mechanism.

ScintillaBase

ScintillaBase is a subclass of Editor and adds extra windowing features including display of calltips, autocompletion lists and context menus. These features use CallTip and AutoComplete objects. This class is optional so a lightweight implementation of Scintilla may bypass it if the added functionality is not required.

Platform Events and API

Each platform uses different mechanisms for receiving events. On Windows, events are received through messages and COM. On GTK+, callback functions are used.

For each platform, a class is derived from ScintillaBase (and thus from Editor). This is ScintillaWin on Windows and ScintillaGTK on GTK+. These classes are responsible for connecting to the platforms event mechanism and also to implement some virtual methods in Editor and ScintillaBase which are different on the platforms. For example, this layer has to support this difference between the synchronous Windows clipboard and the asynchronous GTK+ clipboard.

The external API is defined in this layer as each platform has different preferred styles of API - messages on Windows and function calls on GTK+. This also allows multiple APIs to be defined on a platform. The currently available API on GTK+ is similar to the Windows API and does not follow platform conventions well. A second API could be implemented here that did follow platform conventions.

scintilla/doc/SciTEIco.png0000644000175000017500000002355312075650364014375 0ustar neilneilPNG  IHDR@@% '2IDATx^UyPSWBvb 1 B D2QAK`mQqA:BU>>˸KZ;#HKA" TEY4H{/tFc?wg޼{ιΜߙ D0(Ͽ>au0LIJQ#:-{I[ 4((4  DbEgXG8%0 BIH|#؂a)Sx)<__ߣ#<p~x, <SC( >!0AtԄ͙;\;p|oآ@E,b9f6h hPHYV>fЋ7JQLDP Y B,&Υm04ygjN3;ԫjL c2)&jȫE+ߍ v>.KHrĖ0h)p>) _ϱ #ɍsw];?qD@'M*ϖ2XmoWB>{o7VkOHEYLϺEN:9%6%e&ˆz]mUo=ik8gɗrA(smv2!! MWDƮ֞OumZ'VW^p#>,"l1@9zg2XPzB8q`(wC5FnW2~K{TAљ C#NpH25E{""̺yV$u\w:7snCUsSۺ.8O#Yn/w7c!MLCo\zMZtf=+w[,SPEIT,h#(yy5dBjXo~dӣ+_7O*\mٹ^Hs9uk>yjIarΑ]T@ЧonшU tԓFiB%`ȰjijXVM5!d1Ix@/\c"7Ur"k4£ڲUץ1h/?~ӳN܇o`;K^d!2CbZ?h) C[6&) \azURVCpfev;1!{RiĬe-M5k󏝝Lv'7c|N\/Eݱ&#:q!)m4`ʏW쟡Lp~*҃Oj1ifxw>ό͌ ,ZI,*)KE*)ډ-M*zEdƘ|G;q]l?PhN["8bii<91#!*,-1 ϢBuvõ<ٌO|Lq90gs\GGuۧ'Yw=ݛ"7>^^j̘z&.]X_Q+#&y^0Fݫ*)LH6cp>YSCD\nWIi]zq1̕DMSsXTm1.(۠+ G$%b>uM'(k⤕Ww;o C2Bk( Ŭ]i]MN2蒖Srv`lfv&|~7<|s."kvMva e$ߝ+Qʶ85DoXSDYnrD$9Y#Q(qi|z݁BBY9%u{PHɔWK*kPtF'L 8UmBHķך> {YhqY,!@7b]bD$!hlnәycFH!ziSe?#BZᬬ{,4dHGɱF}C.{ej=$ŭ^?.%Ks/4/@RR/i)=Е#hE?CIq3uhHX7՟9 rr8˰Y@FFuUHHӊ68B`@xھC"c/B`G@yO,NAEN^gcr|_؍ߓΖru +%hPͷ~csW `'mܬ])jqu*ĪpW7c/VZV$n՝@ +yB3ICLy]>٪ Q1G/q=Xa㌈쏾oɎN@2t8Qk3f+eU,rI%`ܑ,=Yտ֭>*=9=If[_.$4GE BXxYݯk2T  @qx  r8`WT&9_)qO8~!ֻ WTc*M~kw04}3촨8~`tih`X8"Zy| )!W%ȥʽU7n4:dLU"bY9%=}H!щ$p86 3rc>lo+ *Ŋv #eDn59?Y3AVSg?PVQ;v酑v% ucˁB-mK7nk.QP%P{O,Jm9GmN2P5\LrGwL2 Z "Ut˪d] .^}17QN_|+(/,uf%H_Z$= f# u3w:aAYlPԜG/rϕ̍n 5t臐ky/۲BH+\w>“WpC /qx%y?<׆d싹y?ZoJv__Vͥ#nwڿ0- ʏ_7gߙm&XaqP=5:CiZN ,J\JVA"Q2W0ظ8(Y~Q=v<+33%%DB=!!aySn9yY'tJY|)gM-\$5<]\oz~X(ASOE?=HSZkLM[kJ!_U`>TQ;D `;|a@\)^Yjr,{kc{܎NU"Aī]p&uS`a2Ikp vYpYSn~i6*j+M$*;9|vԮs7ho흭oyK¢2|ˑS FJ֠f3GeZ>;y}IZIIϯU&` rBߤܱ͌ kxhf^ EPURz}0ƒЫ!鰆k#%ghs y$ ߿/Kh:/(,s;oy[m#AU=qH ˮy% +MÓ$#5NAEr bh~6^mSMGȰӭJѶYZ2[tZ|$3p}gבY2m`ڔ}{P[J4&~1E+٠ 9wxr -( bzۮu+Cy d~lwFĜ/xuH OR6;}Ŋi FH: /{U@[9P·}c5fv,<<&TyPmCTn >2B m }"DU=L6A0C)Z&1ISZnrU"jܨl-F[݂ :VR24 <|õ[oogA(iχB.jP ]GVt66nrϽz+Ykm"mKM`-CjjDe ~E㣣c"rGlm)nχ{#>7uaDb}#Ⱥ^q]WwաQH s$4.#VVE)"؈I֋jw3{FSߣwJS17š/"V.]TҴ #l|39ƒa_~ݻoã5ooTVy%l-/"TK懧{#k,gT|k\ڍW9󨾱AaHްҢ,>b`YꊷZ?^%.93;%.*"@)EuEiF 0,-)YC3?qGse6M}1Cz!5$j~|% ш@ǾN u Z5sߵ{~""B8oD ,.7e:Z6֦zr$E̪E Eb XA螶J> ?`Het  L,;d˖Nᫎ5 r>pBp75Օ~hdKŧi Y d4~QQBO/w͞?|[Fdlb_lĵ6V @S(,NC`C3ӟ#.jFq;1rfz_4eˈаaV }њj*h ûE݇EDԉc9YBbRV e*/%ɱIG:~*sz>I~i}v+7>$Zz_>/#ӌυܸyj T>%-}zjjje$]KԿd"4BIjUMG5tM s 2_z}//a;xC:ѶM_NH;1ӣĚϡگ.ݳGVvaٵ'ٙSRJx?;3J=]ax"&Q&)>-E5"$?IZVab]BBW k\#PiRZG$ !$, ]~A_ +#Pj.` ʵ&  /h4 >D[˛>#?{N[ԿJ,2sg)jnedCS-ZveSnmQs3KL"g4elNld ^!搀]{)7D܉\/kDz95s17A!xu LVhͿ}/ZTXktmV`*A~ZGk[qJ$ l%!M\5+%j Y#c| ߣe99D!A] s=6)MX_m%$a{/wLpS7P 7+@[׼F,MWËlo*?[4mq뙤ر8UKĒ!!jSZ!8\ um=81zVxEe,4{F/l1){u,ugJenvZwh1̸(V]Gu~o˖Tdbt^26]di7=?zNk||rcV[(I JH][ $ Gbm= m3{s?_,axͷ14~ᔉ;*Fml&Y(J+%*xA'9,Bn2ok64i:8xGaWttq׾.08Dݽ{%LA$ܾPGPRIS]&I$3clvkLW\Jbe=XQz@Vg`#iq 3OG.~(XGߞod,:óhUlc26HMFgel.ήNrler9[*dc" <Cbs`^:0 Փh եbQx`!nrך-=7o-T>sL_ホ_4dn q!??ѝ5[B8FVlv3egwϵtpȕ3YCQD;&$A"2Ćq $Yf9)w0d &o{Ǯɉ/ EQL?r55wՉ UVDo0bjA@֐mz:z_qrrt8ɩ7i.S%edYK ].$`fq ֔2+oC BTazP>$<hr:QUUx"Qx8ZOa%>[*΋R}۔-b~I,(> `@5W<i]D)HGl,p` lw+t:Ȩg;;wؕ\6heCC^lX %#eֿv~wq2 ܲ6%iշXj =/.Nդ\$I Jj;U)Uݰ(lhGYu7.$Hpv]:&K9VgɁÿ>}(N&3MR6QR+-d%:.gf/ŒābBjL# pruTR͍Mklh$j5tj1`KFri8Gθ?M l'ri1Y,"[ӗJrEbUA"Ú#! uNqoD<]:Orl>~Й0rTyP=.D12(wHɴOt*em0j33a )6ښ(ZC4k z8%;`&*4vтBȚ[{$ev6AB9'I`%KuS|) CKM |֣bI$ -QhNUI/r=d5KpPGdO/MU5ZOPgqP3 ոie0$(opϳLR. 0@V*-+|=gmZeppLv[m &n \-Јhw6( pKOSP;L|*"(GC{gA=)yI(fpw^x,**h*d-=CC$Qԍ6=ޤC 6`2T;$>@LjNG%mA]_36Y]edmWV?_EzQ**f6OWT~=]tE!*`Ȋ(4`˷IENDB`scintilla/doc/Markers.png0000644000175000017500000005076312270355633014400 0ustar neilneilPNG  IHDR$sRGBgAMA a pHYsodQIDATx^KmuK풭rzvdK@I"bI0N0$u ؖ H#FPApH#vC!DQۅq% p=C:;?3sZq:`־{1=^zx//B.[z%K!B6#$Bf`D !!d34#??z}1}9{})kEz|%by5-bB|}zE7nf8֋'Wdy9~qKSڪI%uˇh]яo<'H ?`7Lߔ"JB,uu @΄__' թ S)yAZ#FdD[z1of>$r%#$Mؙd ?t+ޭ"\J@ Ѩh$RY#F A8mgL}BZGHL&>YxAnM H} #<|\ -sO m!~kX&>Y;|ͻ~#^DxǵP-@:l:|[1:*/Gi Rc odOL}BZJۑ~}}C_qZχP+ҾM$]kjoB"6^)~SkZn%JE!W 4v|:OlMK"[_2[%~@$gɵ"5r +!\ !}+_9~sK&Hg?{M!*BBd1JbB!GH(,!R׷۠x8;3{{Ywdv}nFSLZoN\~JLj~[١8xHʧ؟哟h&V_s_R?ⓥosI7nj8s~RvQ)dؼyAv{A`PQ|W567^BmrON!<ϋ^pHM?*<[fPCN/2BKo9SJp*\;P)mQKRG^&F $kmϋy Iy-H\k>m󱷩ׇlGH@6+lhls7uJqm?I;utzw:?$WD߱ m 퍍GH9aeSZYwJXQП۷#yHOE=/I YA|%ٶ{ xCu&B<'!<ԎG unwbϐ9^Zgk[z.L'쟵9W]zLsZk޾|.b$?'}C/wCN/#$ٰqc<\8뎩x."aOL✐}iZ'!͌cR^y#A VEsC򉾔$65څ#_dS;8J)S#RoSaٵ\d8g燂oHř:8붟Tl?KɾYeYֆxs8:} ƎΊOqV:!H_䙿֞ W`ATc7jt5ʷ/cI*%ZGN[N5dYrm45 S`60T>>Fs  2Қt bW\o[朷<Zm}p󟇤Zgb_Hutmf.&l_FIJPq*}%d@| }:i?]KHnG ؤ_w XH<>!GH0vBȥFHovW!R #$w>IQ"\aA(@*JG;M<[q>K{Ϸdv7ks~7܁k񺞑I$_]8}ivچ||id 'EHzfCPۭb3/ycLiw/23}ཟoM̓-c0LH#$H麌Ofy)DOyHU;ײ/@&dP R̫J֠+YéLi ק!et[QMsl.lֲQ.6c(v3כv$LFHq_oAM>#։b(=q5K]&>"$Mk?{|S/u J }ClR{1w95q>(8RN,}x#S6֩D"*"q?(q*|RSsPG.^؛sއIي}\ K\GeoYKnCʱh9o_JKRщmՎ#Φuؾ[c2́36N?!|/KxfE/^_bGnæY<QS?2]̳Sj~$]1jAޮ,H]O|#-Y7FMe9[9@f"+3Qj!)`÷yHY:x= F!ʜ#mغ*deLQ\-BڋcIOj2FH{[6|O:mm՟1SH3zbr B.0By%K!B6[㭷Kw~oMFϙMOw❗h[w6}j|*?^/OL?g'8Bܰ|/_!TH=ufE(|9;Z.,jALȴ ^@1#\^:2|ݶy۬~7'$JaI~uy}3%H-1Uls7bhX u jAG*eJ5b2AB[-X_Ȅg-]l2lbye]6`(H?׿~_vbȆ'yx#`B6$@*vƊK&lfߖ-k;~66A6ao@#}q>u(@ `t&ߖ8LCj I黈N(lJ Lח/kd]dn&Cʱ? x|([:SlKlNO_plLؒ MzPu6$[69Tr~?/^l꼶ؼ-+0wV.6Q@-J>4l2Imܬ R픅@>8CR1m\&=g7ט#&He( Rѷl&OߌM"o6l+)sH,m!B6[,4Bȥ B6(HͰA 31;*Bw|NW6򼁘1:zlJ!$0+FJ!!d30B"lDHx&;ײwdv}FŻ=\R~I;ӾK'w1|欔O~nt^bzΊ#$ٸQ(T|ROm ;Z -rfRwYi%f]D33FGO]'}ҶMY!B6[zكۘ (zfbbbZ!111m&1BbbbLAݦ/r_i%/TO߷k.|:?_uC?v|ehղކmGʵ:>?5ډv?uʯݨ66il(X6{ܤLq$S~=~$J6 3EoL(Zm@8O6%3QE^Ɨ9281K۾oy?1o^N}3n}xjzn6!IƦ]t3k㗒Qdעs<K)|'8AR󐕛/}WOuOkAmkLMz'QT6'U6uKRg!eټ8z\udbsjrq=kܲ;ݗ׺/mNC*R7f _~KGG{okBd\~[ZtsHv8(/c;^ݖ:uqdz=sVj9WK/Hq/muDJR&f w$LmAji6VV6W0M%w h2Y[jGʼHEjQB>~aUɯXI[6qdvk: I_Ril)}: XR6Zm;?u;׷\>iV ch96ε2gb۱b=[ҷ[&Rͬ ' Vi!-IYd>ZOIt[&Dyti3"!\DHr !B6#$BfA$x) +B/2-tfd17csij{,Wr@SoQ$ܴn۠co2dGHqs!V+nv/?׾/Nmǻ3DۤZJZYkiD=CgcSAujqL=A엍GH#Go>=ln:i^NT5@1 R1K s-s8Эr>o >Eȗؐ?uFHLrRY#F` |(gږuj;o:oHeccCZAXuqOt>:85:G c 2OmWq!{q jH]eM(PxgX;Rq !oK u;A:V;t޿-"^|=sH!G} g*:-:^[z`0У2#!$ۂ'ɓh?\$B#!=ć-]$BfbbbZvy4oH!B6" RSzeZh ϱ9<֛Y~JܖTMks[:/fsc%M\ܓ^l!K=6!7%N#yHɹAf{lb:kD]g>i/"B Nk/8􇍋vᄵ2N-Pʔ:kK&$-mv|K@A ; lFl汛X6{7|ュdz%ظ59Ǘ==r`E"2!hוi6_.DHN7Bz|Q8eRRUYgo{29b$jZءD{2QS0?^K[m #$Mk?{Ի:C J*oj )$QxmC"fR6:Oif%(:V*ۊQ P!l7+s<߾8*$cǶVx!^,hgu\f"%uuMy!ˆM!ՠ,}8Y^Y<$!sgd( sƬF(b; Gl%A <$`E'ɣa χ4BzJ&lG$E#VI>'ž8ȥI#Y1WBiB.E!-}%K!B6"rΦx8ʴк79ѻw.m}+V8|Xipps+fyejG Ʊ-?ʇMɗ6(\9 zmd( Y%^opMDB୶>8dc]k|85' QjA}d6( Ar} c M%q\yK@  j1ыF@Kt$:P 5Uj%\#EEPR85X(DA3[s Ϲ l8C8m$/VGȹt#W2:"!ͼnL}I3-ѯTڑ@D;S!d3<!B6#$Bf`D ;ࣿo9ggoCB̮ݻ\R~I\čs'Q~S,g,!dGH٣P)<$n}"eTKif}gRDP>xsx}IArA!K"zgv$lk(!.DR& I)uֈ∶Z$1%4^BPEH}Qp\_Vpq==I2ARw tׇ%l8嵟dIZD%Rye󞕙!?Dc!-!ik-UҾX+$$|D!!d3)5OD$.B<NYIiu;nr>Sœ̙.S~IܺW׭Ζvz2ng}sWu sgzDsF rU^wqXu(@:mtXV 垇sDH^,l-kޘCoH9!`T}qf?&uV(^#%H6N) U r뾔ܵۘ/.BZJ!`!SBȥFHuB!EHq%B%9, R Uu;nr(;w7dvAy&7csN\]wRVDaw Wx΀M~]b; =k[eβ?ѱg6#;&cYQ}M8}QEHdy$ !u޾:/`}x kh_m@| nl<ۉyҎ[=ZNG϶׭7n_<;JƖMϮ3Zyd{d7:tsyHK[Zsj0k[&HKi)G\l9ҳp'H2_Qt|d1wz߶mߐrbMea16:tٜ~u#Zcgcckzs׺ztQO\YF_+x82uXʎ}}<_[f&CimF?/"~yvA2#;yHk@̫Z.ha$H._ϭsH|4MnV.nsmTE6V[b6d*` ٗQOS/S%F.Hnߺ֨"n%Ju@8!eQ|OSXOFM#D{?o!epuBiJ!b!ͼB%`D F ?w "ٹX֭9\޽w02;֛ٔy J6wS+K_9}Iy=?ωO>$^"LbB9p}Q | qfo_ QfY̙eԭۗǼD< ~/)~B>_7Vx}>iD;^ gROp8Mv 2#Ղ$Tʔ:kdJ]̱yHUM~^[Lo/FHxm%~ FvMqVDQoqQۚ;>$]&HR^.$ dl76!ayH5-'"l!ͺ i9xBdL: >AqV[b)= RKĦ̟E|̝5'[8_(33dTl%B@2:3.B^׭}ڴOVSVKW8A:!\'!B#$Bf`D .BM(B.Njgi9x%+BwM}ܽ3;<֛u';s)'F~k4sH">)^>mk۟cH mmgk90M%sH:mޭ"LbB9p}QŌB| qfo_}8KӾ<$囼yq?-sswj[A#pyv> dek}l6! `{`|Rmy΋v:8}_ྭ Uf{Һ>3_fROpYKY0 vj+eV/lRY#F Hh[U6ZW2)bcg}yx}4Bk+DH@7, 6ȹjL6H7L|ュyH6^s~^8`έτmgfI˶=&?sHnܣcR&Q7 k V6oؖl A<߲' vgϋ5F#볞>|ݾ޷1]-hNoA}!0tQc[bD~%":b8٘Y,KX.HO ǁUG:!1.+H3uk6!&7,x-JSey`YM[;l路yH >]n]6[F.岹ѵw{fB {9=K6!&)nuނmQZm}ؤ|R)1w8lWl[E[sSu_Y6Xϯv-"n%Jk#pR'nEi&"%)*w1=.B^r)B.0By%KЌO/x(FkFH_k}᧏_~+#P!נ~?;{?sۉQ~#Z2-n}M}hݻ3!le ;cP$ɝ^~׮7huw[M\3uoޙ.BBѱB!V1RǦ{Cur"{ԺsI(X"x( t]򓩖F]n}?&ڒՋy3y {K:={[c'9yHc^M9L'ʴ5۾' қxֹfHHH)!M#^6g9fZDE$:?btT`?):aYKly#{zeuE,zYfF=BnCʱQԾ}֡4"`$%u/Z}zk buf>{ӻk ͕! Nl=.6(9]uo\D߷$kySx(6֛<.sHH !V>lgf|Nz$jK샳<$}1k}?-׾ӖzvM]3T-XG<<'[~oKx#[!hT7"pek}bkZ܂v̀ЊFHK_ !4#$}ŧ2h]'K1 Hr)!A!d?tyH[8! z%,wy9?C6!vDۭߒ9$ouN `YƘiײn'{#׶Z{ݾnI6?L}I48"$D@||R}q+kQ;f>3}H>E0jgM mΓvzׂi^m۫xM|yױ6Kih>{ed~$;Z 07Y~OПSϥidۥy<$% G{okd<|x3oښ²1J~=<~ O I}i6KJcr3$u`<7$G#$> M8nD-ٜ~usyHH=,T#k 6O õ >AN==Aj}}dۥoH9vZu MmBPt1sQ_|,5$[fϞqꭝbˌg"$wfGde x.KrCƿrL֖\ W/le9~bq|^uwlͳ,.v vնyAzA}}D R[kw '<$B"yT7"p īf71j}bkZ܂:! ڻ}BȥhFHr)+!\oH{6!d?tyH[8! zթwZPl9Zo=?d/ߺkכOݺ-IʗaGLPn_="&9퟇$<Tӻ0jNm=AkEn!eC*:F-q[^GyH:%Jbݑ )"Qc޴9o_6~TEҍSFcc$HjK_jrz#HA02$wbrL֖\W!7Q\.:y{<{+yP|(\-QMt\9$>I)Ns(>lv>)CiWcq:[e|.ݓ|y@ [IC!+~#f71j}bkZ*p5@4ƹ5id_r)B@:!\ FHC"]6>rK<$AgQ]LM\R~G-͜C[wz[w'}%Iqt,nߞCmry>m!бVknݙHe0g&c9S}.BB!eE>Dߵ ksTStX p!DgC桯Nq`ľkۏݣǏ!/lX2=fy(&\G9MQo"yHsyH^]+c|ekqȞzڍ~}[UʎVxfx5$NQdPoql7tѦTbl3a ޏW_]lQ'bz54rL[k -Ad0ڨݻ޷mCMR}\ "JY޶::\u Z\پk~;~U“Yf3Uڞ!?#ݞ aHTo%oߺnݓ|!d %J!+~#P?oF{#| D5iͤ]':b$;C!W8A:!\f$кN!!d30B"lFHͰIkMCv>u%u;nz>wZgblۜV3*ZFϻd[$BHd8ovx9?ޮ丂ҲAƔ[Akia֡λ!I:Wk .zsH-NvᰵYǯqRY#FBo$uܒTOVJ}t|F<$<ضuO_DxD(3ACHK)ΧNq yY:2)Qo+FG@v"ڏIîL(>ZHk9l[{1^8c?WL|f\MGHpV>I T 0!l>Bh)u9APՖQTXaGiU̼W[3A*{AiR !!}v*"`Zv$2?Ց|=+Of: b{!d3<!B6#$Bf`D ;,۔iu;nzsw-.'?ϤflYmPcIq|:ٱ σc5<6!Ǝ|C ^bCf͛˻S97G~u;q?买i eCyHH 칂4C&zsH/!.R&:I\<ljc)y(lC iXY9RVX/q )13ںt,C 1<`~sm<td}#g#$q.d_7rwN2SJdjK샃<$8^+ʰ#^m9g i~. ߐ4C.CZ|֟Κf"[Ҏ~4ٯ1DqFHͰڄ0B Bȥ`D !aR9hgSuMu;nz2>wi&?ϤF6Vcω$?ܗ~M޹5&OGHQP`?!ʁLxNTH2q)yZF2w/\h8Wq?ypKU Dl׭"|ǹ瑧."s7E0?88څ3]dNS F)S'F 񜴅 I=h-k﹂tܐ=2!m.qVDB¦Rr>'HEZm}pTh9#>VkR_͔2^lAA+hcߐs詳ߐdִOuS"lE|D!!d30B"lDHrFvϬ~Ztr.w37Zo0bD5ǧch] {痲vq?J}nJצ5']glq4 #~}x^q9F$S_?\ݩ#?ƺϸZ%d'5C2 #$>(]'7:tyH=A=^28WX+H1/oG2 FHbHuzF %6Ge]8@-xvs֎R;lY׈A{xE<ٵ-cԶKsFH5~g A|~sͳoQLYsFov8 Sώ ԭc;H:o~ d,$ۏBC mhZ3!^oldqo@q&u(@,ۊ!)s2K{j!KCxdӨx%k~th#(B^`0OXM-[N׭9hwDK0_/^!HsDZ 8% ԏ<<)eEz"9BaܾR$7 'wRc/H_2#$,D͐s9R6z-vTx(Îx=,^?w,قm+QCM޶LJ~V_ ~3d) -?Ȉ]֧䖴M'6¸FkaD  ʠuB.0B Bȥ`D !aR})Vκzպ79)ѻwLKf?cgz#O+1DWRvh^Gm~$mI[ctk,vvyYT!e&xmv q :8[A9QĥնjSޟܽtsV\TTs'Tll;9C թlo|~s"6dBiތ\AjӞ526ZLGH|R迭#՛Y6o)S'F w;g=h-kotM~2k% ٶ2hOA~C¿m Y}ea3ٍaeSoyH $sm?%Q7$ߎ$/9d@)sY64ŵ ˘zܲ:Jq*79Ϸ%׋:!ڂo32Qe. Q4kμ yvuȯm9]C ':SlKl;^5K92umGpWC$0O5 iߵmena_ ҵt!h9xN>V`vҎrPg >FN >e How to use the Scintilla Edit Control in windows?

How to use the Scintilla Edit Control in windows?

This should be a little step by step explanation how to use Scintilla in the windows environment.

How to create Scintilla Edit Control?

First of all, load the Scintilla DLL with something like:


	hmod = LoadLibrary("SciLexer.DLL");
		if (hmod==NULL)
		{
			MessageBox(hwndParent,
			"The Scintilla DLL could not be loaded.",
			"Error loading Scintilla",
			MB_OK | MB_ICONERROR);
		}
		

If the DLL was loaded successfully, then the DLL has registered (yes, by itself) a new window class. The new class called "Scintilla" is the new scintilla edit control.

Now you can use this new control just like any other windows control.


	hwndScintilla = CreateWindowEx(0,
		"Scintilla","", WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_CLIPCHILDREN,
		10,10,500,400,hwndParent,(HMENU)GuiID, hInstance,NULL);
		

Note the new window class name: "Scintilla". By reaching this point you actually included a Scintilla Edit Control to your windows program.

How to control the Scintilla Edit Control?

You can control Scintilla by sending commands to the Edit Control. There a 2 ways of doing this. A simple and fast way.

The simple way to control Scintilla

The simple way is just like with any other windows control. You can send messages to the Scintilla Edit Control and receive notifications from the control. (Note that the notifications are sent to the parent window of the Scintilla Edit Control.)

The Scintilla Edit Control knows a special message for each command. To send commands to the Scintilla Edit Control you can use the SendMessage function.


	SendMessage(hwndScintilla,sci_command,wparam,lparam);
			

like:


	SendMessage(hwndScintilla,SCI_CREATEDOCUMENT, 0, 0);
			

Some of the commands will return a value and unused parameters should be set to NULL.

The fast way to control Scintilla

The fast way of controlling the Scintilla Edit Control is to call message handling function by yourself. You can retrieve a pointer to the message handling function of the Scintilla Edit Control and call it directly to execute a command. This way is much more faster than the SendMessage() way.

1st you have to use the SCI_GETDIRECTFUNCTION and SCI_GETDIRECTPOINTER commands to retrieve the pointer to the function and a pointer which must be the first parameter when calling the retrieved function pointer. You have to do this with the SendMessage way :)

The whole thing has to look like this:


	int (*fn)(void*,int,int,int);
	void * ptr;
	int canundo;

	fn = (int (__cdecl *)(void *,int,int,int))SendMessage(
		hwndScintilla,SCI_GETDIRECTFUNCTION,0,0);
	ptr = (void *)SendMessage(hwndScintilla,SCI_GETDIRECTPOINTER,0,0);

	canundo = fn(ptr,SCI_CANUNDO,0,0);
			

with "fn" as the function pointer to the message handling function of the Scintilla Control and "ptr" as the pointer that must be used as 1st parameter. The next parameters are the Scintilla Command with its two (optional) parameters.

How will I receive notifications?

Whenever an event occurs where Scintilla wants to inform you about something, the Scintilla Edit Control will send notification to the parent window. This is done by a WM_NOTITY message. When receiving that message, you have to look in the xxx struct for the actual message.

So in Scintillas parent window message handling function you have to include some code like this:

	NMHDR *lpnmhdr;

	[...]

	case WM_NOTIFY:
		lpnmhdr = (LPNMHDR) lParam;

		if(lpnmhdr->hwndFrom==hwndScintilla)
		{
			switch(lpnmhdr->code)
			{
				case SCN_CHARADDED:
					/* Hey, Scintilla just told me that a new */
					/* character was added to the Edit Control.*/
					/* Now i do something cool with that char. */
				break;
			}
		}
	break;
			

Page contributed by Holger Schmidt.

scintilla/gtk/0000755000175000017500000000000012557523047012277 5ustar neilneilscintilla/gtk/makefile.orig0000644000175000017500000000576012337270165014742 0ustar neilneil# Make file for Scintilla on Linux or compatible OS # Copyright 1998-2010 by Neil Hodgson # The License.txt file describes the conditions under which this software may be distributed. # This makefile assumes GCC 4.3 is used and changes will be needed to use other compilers. # GNU make does not like \r\n line endings so should be saved to CVS in binary form. # Builds for GTK+ 2 and no longer supports GTK+ 1. # Also works with ming32-make on Windows. .SUFFIXES: .cxx .c .o .h .a ifdef CLANG CC = clang++ CCOMP = clang # Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for # thread also need to create Position Independent Executable -> search online documentation SANITIZE = address #SANITIZE = undefined else CC = g++ -mrecip CCOMP = gcc -mrecip endif AR = ar RANLIB = touch ifdef GTK3 GTKVERSION=gtk+-3.0 else GTKVERSION=gtk+-2.0 endif # Environment variable windir always defined on Win32 ifndef windir ifeq ($(shell uname),Darwin) RANLIB = ranlib endif endif ifdef windir DEL = del /q COMPLIB=..\bin\scintilla.a else DEL = rm -f COMPLIB=../bin/scintilla.a endif vpath %.h ../src ../include ../lexlib vpath %.cxx ../src ../lexlib ../lexers INCLUDEDIRS=-I ../include -I ../src -I ../lexlib ifdef CHECK_DEPRECATED DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT endif CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED) ifdef NOTHREADS THREADFLAGS=-DG_THREADS_IMPL_NONE else THREADFLAGS= endif ifdef DEBUG ifdef CLANG CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS) else CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS) endif else CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS) endif CFLAGS:=$(CTFLAGS) CXXTFLAGS:=--std=c++0x $(CTFLAGS) CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION)) MARSHALLER=scintilla-marshal.o .cxx.o: $(CC) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $< .c.o: $(CCOMP) $(CONFIGFLAGS) $(CFLAGS) -w -c $< LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx)))) all: $(COMPLIB) clean: $(DEL) *.o $(COMPLIB) *.plist analyze: clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx deps: $(CC) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak $(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \ CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \ ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSetSimple.o PlatGTK.o \ KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \ RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \ $(MARSHALLER) $(LEXOBJS) $(AR) rc $@ $^ $(RANLIB) $@ # Automatically generate header dependencies with "make deps" include deps.mak scintilla/gtk/makefile0000644000175000017500000000606512435706734014007 0ustar neilneil# Make file for Scintilla on Linux or compatible OS # Copyright 1998-2010 by Neil Hodgson # The License.txt file describes the conditions under which this software may be distributed. # This makefile assumes GCC 4.3 is used and changes will be needed to use other compilers. # GNU make does not like \r\n line endings so should be saved to CVS in binary form. # Builds for GTK+ 2 and no longer supports GTK+ 1. # Also works with ming32-make on Windows. .SUFFIXES: .cxx .c .o .h .a ifdef CLANG CXX = clang++ -Wno-deprecated-register CC = clang # Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for # thread also need to create Position Independent Executable -> search online documentation SANITIZE = address #SANITIZE = undefined endif RANLIB = touch ifdef GTK3 GTKVERSION=gtk+-3.0 else GTKVERSION=gtk+-2.0 endif # Environment variable windir always defined on Win32 ifndef windir ifeq ($(shell uname),Darwin) RANLIB = ranlib endif endif ifdef windir DEL = del /q COMPLIB=..\bin\scintilla.a else DEL = rm -f COMPLIB=../bin/scintilla.a endif vpath %.h ../src ../include ../lexlib vpath %.cxx ../src ../lexlib ../lexers INCLUDEDIRS=-I ../include -I ../src -I ../lexlib ifdef CHECK_DEPRECATED DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT endif CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED) ifdef NOTHREADS THREADFLAGS=-DG_THREADS_IMPL_NONE else THREADFLAGS= endif ifdef CXX11_REGEX REFLAGS=-DCXX11_REGEX endif ifdef DEBUG ifdef CLANG CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS) else CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS) endif else CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS) endif CFLAGS:=$(CTFLAGS) CXXTFLAGS:=--std=c++0x $(CTFLAGS) $(REFLAGS) CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION)) MARSHALLER=scintilla-marshal.o .cxx.o: $(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $< .c.o: $(CC) $(CONFIGFLAGS) $(CFLAGS) -w -c $< LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx)))) all: $(COMPLIB) clean: $(DEL) *.o $(COMPLIB) *.plist analyze: clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx deps: $(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak $(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \ CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \ ScintillaBase.o ContractionState.o EditModel.o Editor.o EditView.o ExternalLexer.o MarginView.o \ PropSetSimple.o PlatGTK.o \ KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \ RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \ $(MARSHALLER) $(LEXOBJS) $(AR) rc $@ $^ $(RANLIB) $@ # Automatically generate header dependencies with "make deps" include deps.mak scintilla/gtk/ScintillaGTK.cxx0000644000175000017500000031373412557522743015330 0ustar neilneil// Scintilla source code edit control // ScintillaGTK.cxx - GTK+ specific subclass of ScintillaBase // Copyright 1998-2004 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__WIN32__) || defined(_MSC_VER) #include #endif #include "Platform.h" #include "ILexer.h" #include "Scintilla.h" #include "ScintillaWidget.h" #ifdef SCI_LEXER #include "SciLexer.h" #endif #include "StringCopy.h" #ifdef SCI_LEXER #include "LexerModule.h" #endif #include "Position.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "ContractionState.h" #include "CellBuffer.h" #include "CallTip.h" #include "KeyMap.h" #include "Indicator.h" #include "XPM.h" #include "LineMarker.h" #include "Style.h" #include "ViewStyle.h" #include "CharClassify.h" #include "Decoration.h" #include "CaseFolder.h" #include "Document.h" #include "CaseConvert.h" #include "UniConversion.h" #include "UnicodeFromUTF8.h" #include "Selection.h" #include "PositionCache.h" #include "EditModel.h" #include "MarginView.h" #include "EditView.h" #include "Editor.h" #include "AutoComplete.h" #include "ScintillaBase.h" #ifdef SCI_LEXER #include "ExternalLexer.h" #endif #include "scintilla-marshal.h" #include "Converter.h" #if defined(__clang__) // Clang 3.0 incorrectly displays sentinel warnings. Fixed by clang 3.1. #pragma GCC diagnostic ignored "-Wsentinel" #endif #if GTK_CHECK_VERSION(2,20,0) #define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w))) #define IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w))) #define IS_WIDGET_VISIBLE(w) (gtk_widget_get_visible(GTK_WIDGET(w))) #else #define IS_WIDGET_REALIZED(w) (GTK_WIDGET_REALIZED(w)) #define IS_WIDGET_MAPPED(w) (GTK_WIDGET_MAPPED(w)) #define IS_WIDGET_VISIBLE(w) (GTK_WIDGET_VISIBLE(w)) #endif #define SC_INDICATOR_INPUT INDIC_IME #define SC_INDICATOR_TARGET INDIC_IME+1 #define SC_INDICATOR_CONVERTED INDIC_IME+2 #define SC_INDICATOR_UNKNOWN INDIC_IME_MAX static GdkWindow *WindowFromWidget(GtkWidget *w) { #if GTK_CHECK_VERSION(3,0,0) return gtk_widget_get_window(w); #else return w->window; #endif } #ifdef _MSC_VER // Constant conditional expressions are because of GTK+ headers #pragma warning(disable: 4127) // Ignore unreferenced local functions in GTK+ headers #pragma warning(disable: 4505) #endif #define OBJECT_CLASS GObjectClass #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static GdkWindow *PWindow(const Window &w) { GtkWidget *widget = reinterpret_cast(w.GetID()); #if GTK_CHECK_VERSION(3,0,0) return gtk_widget_get_window(widget); #else return widget->window; #endif } extern std::string UTF8FromLatin1(const char *s, int len); class ScintillaGTK : public ScintillaBase { _ScintillaObject *sci; Window wText; Window scrollbarv; Window scrollbarh; GtkAdjustment *adjustmentv; GtkAdjustment *adjustmenth; int verticalScrollBarWidth; int horizontalScrollBarHeight; SelectionText primary; GdkEventButton *evbtn; bool capturedMouse; bool dragWasDropped; int lastKey; int rectangularSelectionModifier; GtkWidgetClass *parentClass; static GdkAtom atomClipboard; static GdkAtom atomUTF8; static GdkAtom atomString; static GdkAtom atomUriList; static GdkAtom atomDROPFILES_DND; GdkAtom atomSought; #if PLAT_GTK_WIN32 CLIPFORMAT cfColumnSelect; #endif Window wPreedit; Window wPreeditDraw; GtkIMContext *im_context; PangoScript lastNonCommonScript; // Wheel mouse support unsigned int linesPerScroll; GTimeVal lastWheelMouseTime; gint lastWheelMouseDirection; gint wheelMouseIntensity; #if GTK_CHECK_VERSION(3,0,0) cairo_rectangle_list_t *rgnUpdate; #else GdkRegion *rgnUpdate; #endif bool repaintFullWindow; // Private so ScintillaGTK objects can not be copied ScintillaGTK(const ScintillaGTK &); ScintillaGTK &operator=(const ScintillaGTK &); public: explicit ScintillaGTK(_ScintillaObject *sci_); virtual ~ScintillaGTK(); static void ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class); private: virtual void Initialise(); virtual void Finalise(); virtual bool AbandonPaint(); virtual void DisplayCursor(Window::Cursor c); virtual bool DragThreshold(Point ptStart, Point ptNow); virtual void StartDrag(); int TargetAsUTF8(char *text); int EncodedFromUTF8(char *utf8, char *encoded) const; virtual bool ValidCodePage(int codePage) const; public: // Public for scintilla_send_message virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); private: virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam); struct TimeThunk { TickReason reason; ScintillaGTK *scintilla; guint timer; TimeThunk() : reason(tickCaret), scintilla(NULL), timer(0) {} }; TimeThunk timers[tickDwell+1]; virtual bool FineTickerAvailable(); virtual bool FineTickerRunning(TickReason reason); virtual void FineTickerStart(TickReason reason, int millis, int tolerance); virtual void FineTickerCancel(TickReason reason); virtual bool SetIdle(bool on); virtual void SetMouseCapture(bool on); virtual bool HaveMouseCapture(); virtual bool PaintContains(PRectangle rc); void FullPaint(); virtual PRectangle GetClientRectangle() const; virtual void ScrollText(int linesToMove); virtual void SetVerticalScrollPos(); virtual void SetHorizontalScrollPos(); virtual bool ModifyScrollBars(int nMax, int nPage); void ReconfigureScrollBars(); virtual void NotifyChange(); virtual void NotifyFocus(bool focus); virtual void NotifyParent(SCNotification scn); void NotifyKey(int key, int modifiers); void NotifyURIDropped(const char *list); const char *CharacterSetID() const; virtual CaseFolder *CaseFolderForEncoding(); virtual std::string CaseMapString(const std::string &s, int caseMapping); virtual int KeyDefault(int key, int modifiers); virtual void CopyToClipboard(const SelectionText &selectedText); virtual void Copy(); virtual void Paste(); virtual void CreateCallTipWindow(PRectangle rc); virtual void AddToPopUp(const char *label, int cmd = 0, bool enabled = true); bool OwnPrimarySelection(); virtual void ClaimSelection(); void GetGtkSelectionText(GtkSelectionData *selectionData, SelectionText &selText); void ReceivedSelection(GtkSelectionData *selection_data); void ReceivedDrop(GtkSelectionData *selection_data); static void GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *selected); void StoreOnClipboard(SelectionText *clipText); static void ClipboardGetSelection(GtkClipboard* clip, GtkSelectionData *selection_data, guint info, void *data); static void ClipboardClearSelection(GtkClipboard* clip, void *data); void UnclaimSelection(GdkEventSelection *selection_event); void Resize(int width, int height); // Callback functions void RealizeThis(GtkWidget *widget); static void Realize(GtkWidget *widget); void UnRealizeThis(GtkWidget *widget); static void UnRealize(GtkWidget *widget); void MapThis(); static void Map(GtkWidget *widget); void UnMapThis(); static void UnMap(GtkWidget *widget); gint FocusInThis(GtkWidget *widget); static gint FocusIn(GtkWidget *widget, GdkEventFocus *event); gint FocusOutThis(GtkWidget *widget); static gint FocusOut(GtkWidget *widget, GdkEventFocus *event); static void SizeRequest(GtkWidget *widget, GtkRequisition *requisition); #if GTK_CHECK_VERSION(3,0,0) static void GetPreferredWidth(GtkWidget *widget, gint *minimalWidth, gint *naturalWidth); static void GetPreferredHeight(GtkWidget *widget, gint *minimalHeight, gint *naturalHeight); #endif static void SizeAllocate(GtkWidget *widget, GtkAllocation *allocation); #if GTK_CHECK_VERSION(3,0,0) gboolean DrawTextThis(cairo_t *cr); static gboolean DrawText(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis); gboolean DrawThis(cairo_t *cr); static gboolean DrawMain(GtkWidget *widget, cairo_t *cr); #else gboolean ExposeTextThis(GtkWidget *widget, GdkEventExpose *ose); static gboolean ExposeText(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis); gboolean Expose(GtkWidget *widget, GdkEventExpose *ose); static gboolean ExposeMain(GtkWidget *widget, GdkEventExpose *ose); #endif void ForAll(GtkCallback callback, gpointer callback_data); static void MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static void ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis); static void ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis); gint PressThis(GdkEventButton *event); static gint Press(GtkWidget *widget, GdkEventButton *event); static gint MouseRelease(GtkWidget *widget, GdkEventButton *event); static gint ScrollEvent(GtkWidget *widget, GdkEventScroll *event); static gint Motion(GtkWidget *widget, GdkEventMotion *event); gboolean KeyThis(GdkEventKey *event); static gboolean KeyPress(GtkWidget *widget, GdkEventKey *event); static gboolean KeyRelease(GtkWidget *widget, GdkEventKey *event); #if GTK_CHECK_VERSION(3,0,0) gboolean DrawPreeditThis(GtkWidget *widget, cairo_t *cr); static gboolean DrawPreedit(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis); #else gboolean ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose); static gboolean ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis); #endif bool KoreanIME(); void CommitThis(char *str); static void Commit(GtkIMContext *context, char *str, ScintillaGTK *sciThis); void PreeditChangedInlineThis(); void PreeditChangedWindowedThis(); static void PreeditChanged(GtkIMContext *context, ScintillaGTK *sciThis); void MoveImeCarets(int pos); void DrawImeIndicator(int indicator, int len); static void GetImeUnderlines(PangoAttrList *attrs, bool *normalInput); static void GetImeBackgrounds(PangoAttrList *attrs, bool *targetInput); void SetCandidateWindowPos(); static void StyleSetText(GtkWidget *widget, GtkStyle *previous, void*); static void RealizeText(GtkWidget *widget, void*); static void Destroy(GObject *object); static void SelectionReceived(GtkWidget *widget, GtkSelectionData *selection_data, guint time); static void ClipboardReceived(GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data); static void SelectionGet(GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint time); static gint SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event); gboolean DragMotionThis(GdkDragContext *context, gint x, gint y, guint dragtime); static gboolean DragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint dragtime); static void DragLeave(GtkWidget *widget, GdkDragContext *context, guint time); static void DragEnd(GtkWidget *widget, GdkDragContext *context); static gboolean Drop(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time); static void DragDataReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *selection_data, guint info, guint time); static void DragDataGet(GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint time); static gboolean TimeOut(TimeThunk *tt); static gboolean IdleCallback(ScintillaGTK *sciThis); static gboolean StyleIdle(ScintillaGTK *sciThis); virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo); static void PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis); #if GTK_CHECK_VERSION(3,0,0) static gboolean DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip); #else static gboolean ExposeCT(GtkWidget *widget, GdkEventExpose *ose, CallTip *ct); #endif static gboolean PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis); static sptr_t DirectFunction(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); }; enum { COMMAND_SIGNAL, NOTIFY_SIGNAL, LAST_SIGNAL }; static gint scintilla_signals[LAST_SIGNAL] = { 0 }; enum { TARGET_STRING, TARGET_TEXT, TARGET_COMPOUND_TEXT, TARGET_UTF8_STRING, TARGET_URI }; GdkAtom ScintillaGTK::atomClipboard = 0; GdkAtom ScintillaGTK::atomUTF8 = 0; GdkAtom ScintillaGTK::atomString = 0; GdkAtom ScintillaGTK::atomUriList = 0; GdkAtom ScintillaGTK::atomDROPFILES_DND = 0; static const GtkTargetEntry clipboardCopyTargets[] = { { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING }, { (gchar *) "STRING", 0, TARGET_STRING }, }; static const gint nClipboardCopyTargets = ELEMENTS(clipboardCopyTargets); static const GtkTargetEntry clipboardPasteTargets[] = { { (gchar *) "text/uri-list", 0, TARGET_URI }, { (gchar *) "UTF8_STRING", 0, TARGET_UTF8_STRING }, { (gchar *) "STRING", 0, TARGET_STRING }, }; static const gint nClipboardPasteTargets = ELEMENTS(clipboardPasteTargets); static GtkWidget *PWidget(Window &w) { return reinterpret_cast(w.GetID()); } static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) { ScintillaObject *scio = reinterpret_cast(widget); return reinterpret_cast(scio->pscin); } ScintillaGTK::ScintillaGTK(_ScintillaObject *sci_) : adjustmentv(0), adjustmenth(0), verticalScrollBarWidth(30), horizontalScrollBarHeight(30), evbtn(0), capturedMouse(false), dragWasDropped(false), lastKey(0), rectangularSelectionModifier(SCMOD_CTRL), parentClass(0), im_context(NULL), lastNonCommonScript(PANGO_SCRIPT_INVALID_CODE), lastWheelMouseDirection(0), wheelMouseIntensity(0), rgnUpdate(0), repaintFullWindow(false) { sci = sci_; wMain = GTK_WIDGET(sci); #if PLAT_GTK_WIN32 rectangularSelectionModifier = SCMOD_ALT; #else rectangularSelectionModifier = SCMOD_CTRL; #endif #if PLAT_GTK_WIN32 // There does not seem to be a real standard for indicating that the clipboard // contains a rectangular selection, so copy Developer Studio. cfColumnSelect = static_cast( ::RegisterClipboardFormat("MSDEVColumnSelect")); // Get intellimouse parameters when running on win32; otherwise use // reasonable default #ifndef SPI_GETWHEELSCROLLLINES #define SPI_GETWHEELSCROLLLINES 104 #endif ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0); #else linesPerScroll = 4; #endif lastWheelMouseTime.tv_sec = 0; lastWheelMouseTime.tv_usec = 0; Initialise(); } ScintillaGTK::~ScintillaGTK() { g_idle_remove_by_data(this); if (evbtn) { gdk_event_free(reinterpret_cast(evbtn)); evbtn = 0; } wPreedit.Destroy(); } static void UnRefCursor(GdkCursor *cursor) { #if GTK_CHECK_VERSION(3,0,0) g_object_unref(cursor); #else gdk_cursor_unref(cursor); #endif } void ScintillaGTK::RealizeThis(GtkWidget *widget) { //Platform::DebugPrintf("ScintillaGTK::realize this\n"); #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_realized(widget, TRUE); #else GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); #endif GdkWindowAttr attrs; attrs.window_type = GDK_WINDOW_CHILD; GtkAllocation allocation; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_allocation(widget, &allocation); #else allocation = widget->allocation; #endif attrs.x = allocation.x; attrs.y = allocation.y; attrs.width = allocation.width; attrs.height = allocation.height; attrs.wclass = GDK_INPUT_OUTPUT; attrs.visual = gtk_widget_get_visual(widget); #if !GTK_CHECK_VERSION(3,0,0) attrs.colormap = gtk_widget_get_colormap(widget); #endif attrs.event_mask = gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK; GdkDisplay *pdisplay = gtk_widget_get_display(widget); GdkCursor *cursor = gdk_cursor_new_for_display(pdisplay, GDK_XTERM); attrs.cursor = cursor; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_set_window(widget, gdk_window_new(gtk_widget_get_parent_window(widget), &attrs, GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_CURSOR)); #if GTK_CHECK_VERSION(3,8,0) gtk_widget_register_window(widget, gtk_widget_get_window(widget)); #else gdk_window_set_user_data(gtk_widget_get_window(widget), widget); #endif gtk_style_context_set_background(gtk_widget_get_style_context(widget), gtk_widget_get_window(widget)); gdk_window_show(gtk_widget_get_window(widget)); UnRefCursor(cursor); #else widget->window = gdk_window_new(gtk_widget_get_parent_window(widget), &attrs, GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP | GDK_WA_CURSOR); gdk_window_set_user_data(widget->window, widget); widget->style = gtk_style_attach(widget->style, widget->window); gdk_window_set_background(widget->window, &widget->style->bg[GTK_STATE_NORMAL]); gdk_window_show(widget->window); UnRefCursor(cursor); #endif gtk_widget_realize(PWidget(wPreedit)); gtk_widget_realize(PWidget(wPreeditDraw)); im_context = gtk_im_multicontext_new(); g_signal_connect(G_OBJECT(im_context), "commit", G_CALLBACK(Commit), this); g_signal_connect(G_OBJECT(im_context), "preedit_changed", G_CALLBACK(PreeditChanged), this); gtk_im_context_set_client_window(im_context, WindowFromWidget(widget)); GtkWidget *widtxt = PWidget(wText); // // No code inside the G_OBJECT macro g_signal_connect_after(G_OBJECT(widtxt), "style_set", G_CALLBACK(ScintillaGTK::StyleSetText), NULL); g_signal_connect_after(G_OBJECT(widtxt), "realize", G_CALLBACK(ScintillaGTK::RealizeText), NULL); gtk_widget_realize(widtxt); gtk_widget_realize(PWidget(scrollbarv)); gtk_widget_realize(PWidget(scrollbarh)); cursor = gdk_cursor_new_for_display(pdisplay, GDK_XTERM); gdk_window_set_cursor(PWindow(wText), cursor); UnRefCursor(cursor); cursor = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR); gdk_window_set_cursor(PWindow(scrollbarv), cursor); UnRefCursor(cursor); cursor = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR); gdk_window_set_cursor(PWindow(scrollbarh), cursor); UnRefCursor(cursor); gtk_selection_add_targets(widget, GDK_SELECTION_PRIMARY, clipboardCopyTargets, nClipboardCopyTargets); } void ScintillaGTK::Realize(GtkWidget *widget) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); sciThis->RealizeThis(widget); } void ScintillaGTK::UnRealizeThis(GtkWidget *widget) { try { gtk_selection_clear_targets(widget, GDK_SELECTION_PRIMARY); if (IS_WIDGET_MAPPED(widget)) { gtk_widget_unmap(widget); } #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_realized(widget, FALSE); #else GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); #endif gtk_widget_unrealize(PWidget(wText)); gtk_widget_unrealize(PWidget(scrollbarv)); gtk_widget_unrealize(PWidget(scrollbarh)); gtk_widget_unrealize(PWidget(wPreedit)); gtk_widget_unrealize(PWidget(wPreeditDraw)); g_object_unref(im_context); im_context = NULL; if (GTK_WIDGET_CLASS(parentClass)->unrealize) GTK_WIDGET_CLASS(parentClass)->unrealize(widget); Finalise(); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::UnRealize(GtkWidget *widget) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); sciThis->UnRealizeThis(widget); } static void MapWidget(GtkWidget *widget) { if (widget && IS_WIDGET_VISIBLE(widget) && !IS_WIDGET_MAPPED(widget)) { gtk_widget_map(widget); } } void ScintillaGTK::MapThis() { try { //Platform::DebugPrintf("ScintillaGTK::map this\n"); #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_mapped(PWidget(wMain), TRUE); #else GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_MAPPED); #endif MapWidget(PWidget(wText)); MapWidget(PWidget(scrollbarh)); MapWidget(PWidget(scrollbarv)); wMain.SetCursor(Window::cursorArrow); scrollbarv.SetCursor(Window::cursorArrow); scrollbarh.SetCursor(Window::cursorArrow); ChangeSize(); gdk_window_show(PWindow(wMain)); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::Map(GtkWidget *widget) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); sciThis->MapThis(); } void ScintillaGTK::UnMapThis() { try { //Platform::DebugPrintf("ScintillaGTK::unmap this\n"); #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_mapped(PWidget(wMain), FALSE); #else GTK_WIDGET_UNSET_FLAGS(PWidget(wMain), GTK_MAPPED); #endif DropGraphics(false); gdk_window_hide(PWindow(wMain)); gtk_widget_unmap(PWidget(wText)); gtk_widget_unmap(PWidget(scrollbarh)); gtk_widget_unmap(PWidget(scrollbarv)); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::UnMap(GtkWidget *widget) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); sciThis->UnMapThis(); } void ScintillaGTK::ForAll(GtkCallback callback, gpointer callback_data) { try { (*callback) (PWidget(wText), callback_data); (*callback) (PWidget(scrollbarv), callback_data); (*callback) (PWidget(scrollbarh), callback_data); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::MainForAll(GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { ScintillaGTK *sciThis = ScintillaFromWidget((GtkWidget *)container); if (callback != NULL && include_internals) { sciThis->ForAll(callback, callback_data); } } namespace { class PreEditString { public: gchar *str; gint cursor_pos; PangoAttrList *attrs; gboolean validUTF8; glong uniStrLen; gunichar *uniStr; PangoScript pscript; explicit PreEditString(GtkIMContext *im_context) { gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor_pos); validUTF8 = g_utf8_validate(str, strlen(str), NULL); uniStr = g_utf8_to_ucs4_fast(str, strlen(str), &uniStrLen); pscript = pango_script_for_unichar(uniStr[0]); } ~PreEditString() { g_free(str); g_free(uniStr); pango_attr_list_unref(attrs); } }; } gint ScintillaGTK::FocusInThis(GtkWidget *widget) { try { SetFocusState(true); if (im_context != NULL) { PreEditString pes(im_context); if (PWidget(wPreedit) != NULL) { if (strlen(pes.str) > 0) { gtk_widget_show(PWidget(wPreedit)); } else { gtk_widget_hide(PWidget(wPreedit)); } } gtk_im_context_focus_in(im_context); } } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gint ScintillaGTK::FocusIn(GtkWidget *widget, GdkEventFocus * /*event*/) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->FocusInThis(widget); } gint ScintillaGTK::FocusOutThis(GtkWidget *widget) { try { SetFocusState(false); if (PWidget(wPreedit) != NULL) gtk_widget_hide(PWidget(wPreedit)); if (im_context != NULL) gtk_im_context_focus_out(im_context); } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gint ScintillaGTK::FocusOut(GtkWidget *widget, GdkEventFocus * /*event*/) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->FocusOutThis(widget); } void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); requisition->width = 1; requisition->height = 1; GtkRequisition child_requisition; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_preferred_size(PWidget(sciThis->scrollbarh), NULL, &child_requisition); gtk_widget_get_preferred_size(PWidget(sciThis->scrollbarv), NULL, &child_requisition); #else gtk_widget_size_request(PWidget(sciThis->scrollbarh), &child_requisition); gtk_widget_size_request(PWidget(sciThis->scrollbarv), &child_requisition); #endif } #if GTK_CHECK_VERSION(3,0,0) void ScintillaGTK::GetPreferredWidth(GtkWidget *widget, gint *minimalWidth, gint *naturalWidth) { GtkRequisition requisition; SizeRequest(widget, &requisition); *minimalWidth = *naturalWidth = requisition.width; } void ScintillaGTK::GetPreferredHeight(GtkWidget *widget, gint *minimalHeight, gint *naturalHeight) { GtkRequisition requisition; SizeRequest(widget, &requisition); *minimalHeight = *naturalHeight = requisition.height; } #endif void ScintillaGTK::SizeAllocate(GtkWidget *widget, GtkAllocation *allocation) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_allocation(widget, allocation); #else widget->allocation = *allocation; #endif if (IS_WIDGET_REALIZED(widget)) gdk_window_move_resize(WindowFromWidget(widget), allocation->x, allocation->y, allocation->width, allocation->height); sciThis->Resize(allocation->width, allocation->height); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::Initialise() { //Platform::DebugPrintf("ScintillaGTK::Initialise\n"); parentClass = reinterpret_cast( g_type_class_ref(gtk_container_get_type())); #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_can_focus(PWidget(wMain), TRUE); gtk_widget_set_sensitive(PWidget(wMain), TRUE); #else GTK_WIDGET_SET_FLAGS(PWidget(wMain), GTK_CAN_FOCUS); GTK_WIDGET_SET_FLAGS(GTK_WIDGET(PWidget(wMain)), GTK_SENSITIVE); #endif gtk_widget_set_events(PWidget(wMain), GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | GDK_STRUCTURE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK); wText = gtk_drawing_area_new(); gtk_widget_set_parent(PWidget(wText), PWidget(wMain)); GtkWidget *widtxt = PWidget(wText); // No code inside the G_OBJECT macro gtk_widget_show(widtxt); #if GTK_CHECK_VERSION(3,0,0) g_signal_connect(G_OBJECT(widtxt), "draw", G_CALLBACK(ScintillaGTK::DrawText), this); #else g_signal_connect(G_OBJECT(widtxt), "expose_event", G_CALLBACK(ScintillaGTK::ExposeText), this); #endif #if GTK_CHECK_VERSION(3,0,0) // we need a runtime check because we don't want double buffering when // running on >= 3.9.2 if (gtk_check_version(3,9,2) != NULL /* on < 3.9.2 */) #endif { #if !GTK_CHECK_VERSION(3,14,0) // Avoid background drawing flash/missing redraws gtk_widget_set_double_buffered(widtxt, FALSE); #endif } gtk_widget_set_events(widtxt, GDK_EXPOSURE_MASK); gtk_widget_set_size_request(widtxt, 100, 100); adjustmentv = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 201.0, 1.0, 20.0, 20.0)); #if GTK_CHECK_VERSION(3,0,0) scrollbarv = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(adjustmentv)); #else scrollbarv = gtk_vscrollbar_new(GTK_ADJUSTMENT(adjustmentv)); #endif #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_can_focus(PWidget(scrollbarv), FALSE); #else GTK_WIDGET_UNSET_FLAGS(PWidget(scrollbarv), GTK_CAN_FOCUS); #endif g_signal_connect(G_OBJECT(adjustmentv), "value_changed", G_CALLBACK(ScrollSignal), this); gtk_widget_set_parent(PWidget(scrollbarv), PWidget(wMain)); gtk_widget_show(PWidget(scrollbarv)); adjustmenth = GTK_ADJUSTMENT(gtk_adjustment_new(0.0, 0.0, 101.0, 1.0, 20.0, 20.0)); #if GTK_CHECK_VERSION(3,0,0) scrollbarh = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT(adjustmenth)); #else scrollbarh = gtk_hscrollbar_new(GTK_ADJUSTMENT(adjustmenth)); #endif #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_can_focus(PWidget(scrollbarh), FALSE); #else GTK_WIDGET_UNSET_FLAGS(PWidget(scrollbarh), GTK_CAN_FOCUS); #endif g_signal_connect(G_OBJECT(adjustmenth), "value_changed", G_CALLBACK(ScrollHSignal), this); gtk_widget_set_parent(PWidget(scrollbarh), PWidget(wMain)); gtk_widget_show(PWidget(scrollbarh)); gtk_widget_grab_focus(PWidget(wMain)); gtk_drag_dest_set(GTK_WIDGET(PWidget(wMain)), GTK_DEST_DEFAULT_ALL, clipboardPasteTargets, nClipboardPasteTargets, static_cast(GDK_ACTION_COPY | GDK_ACTION_MOVE)); /* create pre-edit window */ wPreedit = gtk_window_new(GTK_WINDOW_POPUP); wPreeditDraw = gtk_drawing_area_new(); GtkWidget *predrw = PWidget(wPreeditDraw); // No code inside the G_OBJECT macro #if GTK_CHECK_VERSION(3,0,0) g_signal_connect(G_OBJECT(predrw), "draw", G_CALLBACK(DrawPreedit), this); #else g_signal_connect(G_OBJECT(predrw), "expose_event", G_CALLBACK(ExposePreedit), this); #endif gtk_container_add(GTK_CONTAINER(PWidget(wPreedit)), predrw); gtk_widget_show(predrw); // Set caret period based on GTK settings gboolean blinkOn = false; if (g_object_class_find_property(G_OBJECT_GET_CLASS( G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink")) { g_object_get(G_OBJECT( gtk_settings_get_default()), "gtk-cursor-blink", &blinkOn, NULL); } if (blinkOn && g_object_class_find_property(G_OBJECT_GET_CLASS( G_OBJECT(gtk_settings_get_default())), "gtk-cursor-blink-time")) { gint value; g_object_get(G_OBJECT( gtk_settings_get_default()), "gtk-cursor-blink-time", &value, NULL); caret.period = gint(value / 1.75); } else { caret.period = 0; } for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast(tr + 1)) { timers[tr].reason = tr; timers[tr].scintilla = this; } vs.indicators[SC_INDICATOR_UNKNOWN] = Indicator(INDIC_HIDDEN, ColourDesired(0, 0, 0xff)); vs.indicators[SC_INDICATOR_INPUT] = Indicator(INDIC_DOTS, ColourDesired(0, 0, 0xff)); vs.indicators[SC_INDICATOR_CONVERTED] = Indicator(INDIC_COMPOSITIONTHICK, ColourDesired(0, 0, 0xff)); vs.indicators[SC_INDICATOR_TARGET] = Indicator(INDIC_STRAIGHTBOX, ColourDesired(0, 0, 0xff)); } void ScintillaGTK::Finalise() { for (TickReason tr = tickCaret; tr <= tickDwell; tr = static_cast(tr + 1)) { FineTickerCancel(tr); } ScintillaBase::Finalise(); } bool ScintillaGTK::AbandonPaint() { if ((paintState == painting) && !paintingAllText) { repaintFullWindow = true; } return false; } void ScintillaGTK::DisplayCursor(Window::Cursor c) { if (cursorMode == SC_CURSORNORMAL) wText.SetCursor(c); else wText.SetCursor(static_cast(cursorMode)); } bool ScintillaGTK::DragThreshold(Point ptStart, Point ptNow) { return gtk_drag_check_threshold(GTK_WIDGET(PWidget(wMain)), ptStart.x, ptStart.y, ptNow.x, ptNow.y); } void ScintillaGTK::StartDrag() { PLATFORM_ASSERT(evbtn != 0); dragWasDropped = false; inDragDrop = ddDragging; GtkTargetList *tl = gtk_target_list_new(clipboardCopyTargets, nClipboardCopyTargets); #if GTK_CHECK_VERSION(3,10,0) gtk_drag_begin_with_coordinates(GTK_WIDGET(PWidget(wMain)), tl, static_cast(GDK_ACTION_COPY | GDK_ACTION_MOVE), evbtn->button, reinterpret_cast(evbtn), -1, -1); #else gtk_drag_begin(GTK_WIDGET(PWidget(wMain)), tl, static_cast(GDK_ACTION_COPY | GDK_ACTION_MOVE), evbtn->button, reinterpret_cast(evbtn)); #endif } static std::string ConvertText(const char *s, size_t len, const char *charSetDest, const char *charSetSource, bool transliterations, bool silent=false) { // s is not const because of different versions of iconv disagreeing about const std::string destForm; Converter conv(charSetDest, charSetSource, transliterations); if (conv) { size_t outLeft = len*3+1; destForm = std::string(outLeft, '\0'); // g_iconv does not actually write to its input argument so safe to cast away const char *pin = const_cast(s); size_t inLeft = len; char *putf = &destForm[0]; char *pout = putf; size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); if (conversions == ((size_t)(-1))) { if (!silent) { if (len == 1) fprintf(stderr, "iconv %s->%s failed for %0x '%s'\n", charSetSource, charSetDest, (unsigned char)(*s), s); else fprintf(stderr, "iconv %s->%s failed for %s\n", charSetSource, charSetDest, s); } destForm = std::string(); } else { destForm.resize(pout - putf); } } else { fprintf(stderr, "Can not iconv %s %s\n", charSetDest, charSetSource); } return destForm; } // Returns the target converted to UTF8. // Return the length in bytes. int ScintillaGTK::TargetAsUTF8(char *text) { int targetLength = targetEnd - targetStart; if (IsUnicodeMode()) { if (text) { pdoc->GetCharRange(text, targetStart, targetLength); } } else { // Need to convert const char *charSetBuffer = CharacterSetID(); if (*charSetBuffer) { std::string s = RangeText(targetStart, targetEnd); std::string tmputf = ConvertText(&s[0], targetLength, "UTF-8", charSetBuffer, false); if (text) { memcpy(text, tmputf.c_str(), tmputf.length()); } return tmputf.length(); } else { if (text) { pdoc->GetCharRange(text, targetStart, targetLength); } } } return targetLength; } // Translates a nul terminated UTF8 string into the document encoding. // Return the length of the result in bytes. int ScintillaGTK::EncodedFromUTF8(char *utf8, char *encoded) const { int inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8); if (IsUnicodeMode()) { if (encoded) { memcpy(encoded, utf8, inputLength); } return inputLength; } else { // Need to convert const char *charSetBuffer = CharacterSetID(); if (*charSetBuffer) { std::string tmpEncoded = ConvertText(utf8, inputLength, charSetBuffer, "UTF-8", true); if (encoded) { memcpy(encoded, tmpEncoded.c_str(), tmpEncoded.length()); } return tmpEncoded.length(); } else { if (encoded) { memcpy(encoded, utf8, inputLength); } return inputLength; } } // Fail return 0; } bool ScintillaGTK::ValidCodePage(int codePage) const { return codePage == 0 || codePage == SC_CP_UTF8 || codePage == 932 || codePage == 936 || codePage == 949 || codePage == 950 || codePage == 1361; } sptr_t ScintillaGTK::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { try { switch (iMessage) { case SCI_GRABFOCUS: gtk_widget_grab_focus(PWidget(wMain)); break; case SCI_GETDIRECTFUNCTION: return reinterpret_cast(DirectFunction); case SCI_GETDIRECTPOINTER: return reinterpret_cast(this); #ifdef SCI_LEXER case SCI_LOADLEXERLIBRARY: LexerManager::GetInstance()->Load(reinterpret_cast(lParam)); break; #endif case SCI_TARGETASUTF8: return TargetAsUTF8(reinterpret_cast(lParam)); case SCI_ENCODEDFROMUTF8: return EncodedFromUTF8(reinterpret_cast(wParam), reinterpret_cast(lParam)); case SCI_SETRECTANGULARSELECTIONMODIFIER: rectangularSelectionModifier = wParam; break; case SCI_GETRECTANGULARSELECTIONMODIFIER: return rectangularSelectionModifier; default: return ScintillaBase::WndProc(iMessage, wParam, lParam); } } catch (std::bad_alloc&) { errorStatus = SC_STATUS_BADALLOC; } catch (...) { errorStatus = SC_STATUS_FAILURE; } return 0l; } sptr_t ScintillaGTK::DefWndProc(unsigned int, uptr_t, sptr_t) { return 0; } /** * Report that this Editor subclass has a working implementation of FineTickerStart. */ bool ScintillaGTK::FineTickerAvailable() { return true; } bool ScintillaGTK::FineTickerRunning(TickReason reason) { return timers[reason].timer != 0; } void ScintillaGTK::FineTickerStart(TickReason reason, int millis, int /* tolerance */) { FineTickerCancel(reason); timers[reason].timer = g_timeout_add(millis, reinterpret_cast(TimeOut), &timers[reason]); } void ScintillaGTK::FineTickerCancel(TickReason reason) { if (timers[reason].timer) { g_source_remove(timers[reason].timer); timers[reason].timer = 0; } } bool ScintillaGTK::SetIdle(bool on) { if (on) { // Start idler, if it's not running. if (!idler.state) { idler.state = true; idler.idlerID = reinterpret_cast( g_idle_add_full(G_PRIORITY_DEFAULT_IDLE, reinterpret_cast(IdleCallback), this, NULL)); } } else { // Stop idler, if it's running if (idler.state) { idler.state = false; g_source_remove(GPOINTER_TO_UINT(idler.idlerID)); } } return true; } void ScintillaGTK::SetMouseCapture(bool on) { if (mouseDownCaptures) { if (on) { gtk_grab_add(GTK_WIDGET(PWidget(wMain))); } else { gtk_grab_remove(GTK_WIDGET(PWidget(wMain))); } } capturedMouse = on; } bool ScintillaGTK::HaveMouseCapture() { return capturedMouse; } #if GTK_CHECK_VERSION(3,0,0) // Is crcTest completely in crcContainer? static bool CRectContains(const cairo_rectangle_t &crcContainer, const cairo_rectangle_t &crcTest) { return (crcTest.x >= crcContainer.x) && ((crcTest.x + crcTest.width) <= (crcContainer.x + crcContainer.width)) && (crcTest.y >= crcContainer.y) && ((crcTest.y + crcTest.height) <= (crcContainer.y + crcContainer.height)); } // Is crcTest completely in crcListContainer? // May incorrectly return false if complex shape static bool CRectListContains(const cairo_rectangle_list_t *crcListContainer, const cairo_rectangle_t &crcTest) { for (int r=0; rnum_rectangles; r++) { if (CRectContains(crcListContainer->rectangles[r], crcTest)) return true; } return false; } #endif bool ScintillaGTK::PaintContains(PRectangle rc) { // This allows optimization when a rectangle is completely in the update region. // It is OK to return false when too difficult to determine as that just performs extra drawing bool contains = true; if (paintState == painting) { if (!rcPaint.Contains(rc)) { contains = false; } else if (rgnUpdate) { #if GTK_CHECK_VERSION(3,0,0) cairo_rectangle_t grc = {rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top}; contains = CRectListContains(rgnUpdate, grc); #else GdkRectangle grc = {static_cast(rc.left), static_cast(rc.top), static_cast(rc.right - rc.left), static_cast(rc.bottom - rc.top)}; if (gdk_region_rect_in(rgnUpdate, &grc) != GDK_OVERLAP_RECTANGLE_IN) { contains = false; } #endif } } return contains; } // Redraw all of text area. This paint will not be abandoned. void ScintillaGTK::FullPaint() { wText.InvalidateAll(); } PRectangle ScintillaGTK::GetClientRectangle() const { Window &win = const_cast(wMain); PRectangle rc = win.GetClientPosition(); if (verticalScrollBarVisible) rc.right -= verticalScrollBarWidth; if (horizontalScrollBarVisible && !Wrapping()) rc.bottom -= horizontalScrollBarHeight; // Move to origin rc.right -= rc.left; rc.bottom -= rc.top; rc.left = 0; rc.top = 0; return rc; } void ScintillaGTK::ScrollText(int linesToMove) { int diff = vs.lineHeight * -linesToMove; //Platform::DebugPrintf("ScintillaGTK::ScrollText %d %d %0d,%0d %0d,%0d\n", linesToMove, diff, // rc.left, rc.top, rc.right, rc.bottom); GtkWidget *wi = PWidget(wText); NotifyUpdateUI(); if (IS_WIDGET_REALIZED(wi)) { gdk_window_scroll(WindowFromWidget(wi), 0, -diff); gdk_window_process_updates(WindowFromWidget(wi), FALSE); } } void ScintillaGTK::SetVerticalScrollPos() { DwellEnd(true); gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmentv), topLine); } void ScintillaGTK::SetHorizontalScrollPos() { DwellEnd(true); gtk_adjustment_set_value(GTK_ADJUSTMENT(adjustmenth), xOffset); } bool ScintillaGTK::ModifyScrollBars(int nMax, int nPage) { bool modified = false; int pageScroll = LinesToScroll(); #if GTK_CHECK_VERSION(3,0,0) if (gtk_adjustment_get_upper(adjustmentv) != (nMax + 1) || gtk_adjustment_get_page_size(adjustmentv) != nPage || gtk_adjustment_get_page_increment(adjustmentv) != pageScroll) { gtk_adjustment_set_upper(adjustmentv, nMax + 1); gtk_adjustment_set_page_size(adjustmentv, nPage); gtk_adjustment_set_page_increment(adjustmentv, pageScroll); gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmentv)); modified = true; } #else if (GTK_ADJUSTMENT(adjustmentv)->upper != (nMax + 1) || GTK_ADJUSTMENT(adjustmentv)->page_size != nPage || GTK_ADJUSTMENT(adjustmentv)->page_increment != pageScroll) { GTK_ADJUSTMENT(adjustmentv)->upper = nMax + 1; GTK_ADJUSTMENT(adjustmentv)->page_size = nPage; GTK_ADJUSTMENT(adjustmentv)->page_increment = pageScroll; gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmentv)); modified = true; } #endif PRectangle rcText = GetTextRectangle(); int horizEndPreferred = scrollWidth; if (horizEndPreferred < 0) horizEndPreferred = 0; unsigned int pageWidth = rcText.Width(); unsigned int pageIncrement = pageWidth / 3; unsigned int charWidth = vs.styles[STYLE_DEFAULT].aveCharWidth; #if GTK_CHECK_VERSION(3,0,0) if (gtk_adjustment_get_upper(adjustmenth) != horizEndPreferred || gtk_adjustment_get_page_size(adjustmenth) != pageWidth || gtk_adjustment_get_page_increment(adjustmenth) != pageIncrement || gtk_adjustment_get_step_increment(adjustmenth) != charWidth) { gtk_adjustment_set_upper(adjustmenth, horizEndPreferred); gtk_adjustment_set_page_size(adjustmenth, pageWidth); gtk_adjustment_set_page_increment(adjustmenth, pageIncrement); gtk_adjustment_set_step_increment(adjustmenth, charWidth); gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth)); modified = true; } #else if (GTK_ADJUSTMENT(adjustmenth)->upper != horizEndPreferred || GTK_ADJUSTMENT(adjustmenth)->page_size != pageWidth || GTK_ADJUSTMENT(adjustmenth)->page_increment != pageIncrement || GTK_ADJUSTMENT(adjustmenth)->step_increment != charWidth) { GTK_ADJUSTMENT(adjustmenth)->upper = horizEndPreferred; GTK_ADJUSTMENT(adjustmenth)->step_increment = charWidth; GTK_ADJUSTMENT(adjustmenth)->page_size = pageWidth; GTK_ADJUSTMENT(adjustmenth)->page_increment = pageIncrement; gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth)); modified = true; } #endif if (modified && (paintState == painting)) { repaintFullWindow = true; } return modified; } void ScintillaGTK::ReconfigureScrollBars() { PRectangle rc = wMain.GetClientPosition(); Resize(rc.Width(), rc.Height()); } void ScintillaGTK::NotifyChange() { g_signal_emit(G_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], 0, Platform::LongFromTwoShorts(GetCtrlID(), SCEN_CHANGE), PWidget(wMain)); } void ScintillaGTK::NotifyFocus(bool focus) { g_signal_emit(G_OBJECT(sci), scintilla_signals[COMMAND_SIGNAL], 0, Platform::LongFromTwoShorts (GetCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS), PWidget(wMain)); Editor::NotifyFocus(focus); } void ScintillaGTK::NotifyParent(SCNotification scn) { scn.nmhdr.hwndFrom = PWidget(wMain); scn.nmhdr.idFrom = GetCtrlID(); g_signal_emit(G_OBJECT(sci), scintilla_signals[NOTIFY_SIGNAL], 0, GetCtrlID(), &scn); } void ScintillaGTK::NotifyKey(int key, int modifiers) { SCNotification scn = {}; scn.nmhdr.code = SCN_KEY; scn.ch = key; scn.modifiers = modifiers; NotifyParent(scn); } void ScintillaGTK::NotifyURIDropped(const char *list) { SCNotification scn = {}; scn.nmhdr.code = SCN_URIDROPPED; scn.text = list; NotifyParent(scn); } const char *CharacterSetID(int characterSet); const char *ScintillaGTK::CharacterSetID() const { return ::CharacterSetID(vs.styles[STYLE_DEFAULT].characterSet); } class CaseFolderDBCS : public CaseFolderTable { const char *charSet; public: explicit CaseFolderDBCS(const char *charSet_) : charSet(charSet_) { StandardASCII(); } virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) { if ((lenMixed == 1) && (sizeFolded > 0)) { folded[0] = mapping[static_cast(mixed[0])]; return 1; } else if (*charSet) { std::string sUTF8 = ConvertText(mixed, lenMixed, "UTF-8", charSet, false); if (!sUTF8.empty()) { gchar *mapped = g_utf8_casefold(sUTF8.c_str(), sUTF8.length()); size_t lenMapped = strlen(mapped); if (lenMapped < sizeFolded) { memcpy(folded, mapped, lenMapped); } else { folded[0] = '\0'; lenMapped = 1; } g_free(mapped); return lenMapped; } } // Something failed so return a single NUL byte folded[0] = '\0'; return 1; } }; CaseFolder *ScintillaGTK::CaseFolderForEncoding() { if (pdoc->dbcsCodePage == SC_CP_UTF8) { return new CaseFolderUnicode(); } else { const char *charSetBuffer = CharacterSetID(); if (charSetBuffer) { if (pdoc->dbcsCodePage == 0) { CaseFolderTable *pcf = new CaseFolderTable(); pcf->StandardASCII(); // Only for single byte encodings for (int i=0x80; i<0x100; i++) { char sCharacter[2] = "A"; sCharacter[0] = i; // Silent as some bytes have no assigned character std::string sUTF8 = ConvertText(sCharacter, 1, "UTF-8", charSetBuffer, false, true); if (!sUTF8.empty()) { gchar *mapped = g_utf8_casefold(sUTF8.c_str(), sUTF8.length()); if (mapped) { std::string mappedBack = ConvertText(mapped, strlen(mapped), charSetBuffer, "UTF-8", false, true); if ((mappedBack.length() == 1) && (mappedBack[0] != sCharacter[0])) { pcf->SetTranslation(sCharacter[0], mappedBack[0]); } g_free(mapped); } } } return pcf; } else { return new CaseFolderDBCS(charSetBuffer); } } return 0; } } namespace { struct CaseMapper { gchar *mapped; // Must be freed with g_free CaseMapper(const std::string &sUTF8, bool toUpperCase) { if (toUpperCase) { mapped = g_utf8_strup(sUTF8.c_str(), sUTF8.length()); } else { mapped = g_utf8_strdown(sUTF8.c_str(), sUTF8.length()); } } ~CaseMapper() { g_free(mapped); } }; } std::string ScintillaGTK::CaseMapString(const std::string &s, int caseMapping) { if ((s.size() == 0) || (caseMapping == cmSame)) return s; if (IsUnicodeMode()) { std::string retMapped(s.length() * maxExpansionCaseConversion, 0); size_t lenMapped = CaseConvertString(&retMapped[0], retMapped.length(), s.c_str(), s.length(), (caseMapping == cmUpper) ? CaseConversionUpper : CaseConversionLower); retMapped.resize(lenMapped); return retMapped; } const char *charSetBuffer = CharacterSetID(); if (!*charSetBuffer) { CaseMapper mapper(s, caseMapping == cmUpper); return std::string(mapper.mapped, strlen(mapper.mapped)); } else { // Change text to UTF-8 std::string sUTF8 = ConvertText(s.c_str(), s.length(), "UTF-8", charSetBuffer, false); CaseMapper mapper(sUTF8, caseMapping == cmUpper); return ConvertText(mapper.mapped, strlen(mapper.mapped), charSetBuffer, "UTF-8", false); } } int ScintillaGTK::KeyDefault(int key, int modifiers) { // Pass up to container in case it is an accelerator NotifyKey(key, modifiers); return 0; } void ScintillaGTK::CopyToClipboard(const SelectionText &selectedText) { SelectionText *clipText = new SelectionText(); clipText->Copy(selectedText); StoreOnClipboard(clipText); } void ScintillaGTK::Copy() { if (!sel.Empty()) { SelectionText *clipText = new SelectionText(); CopySelectionRange(clipText); StoreOnClipboard(clipText); #if PLAT_GTK_WIN32 if (sel.IsRectangular()) { ::OpenClipboard(NULL); ::SetClipboardData(cfColumnSelect, 0); ::CloseClipboard(); } #endif } } void ScintillaGTK::ClipboardReceived(GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) { ScintillaGTK *sciThis = static_cast(data); sciThis->ReceivedSelection(selection_data); } void ScintillaGTK::Paste() { atomSought = atomUTF8; GtkClipboard *clipBoard = gtk_widget_get_clipboard(GTK_WIDGET(PWidget(wMain)), atomClipboard); if (clipBoard == NULL) return; gtk_clipboard_request_contents(clipBoard, atomSought, ClipboardReceived, this); } void ScintillaGTK::CreateCallTipWindow(PRectangle rc) { if (!ct.wCallTip.Created()) { ct.wCallTip = gtk_window_new(GTK_WINDOW_POPUP); ct.wDraw = gtk_drawing_area_new(); GtkWidget *widcdrw = PWidget(ct.wDraw); // // No code inside the G_OBJECT macro gtk_container_add(GTK_CONTAINER(PWidget(ct.wCallTip)), widcdrw); #if GTK_CHECK_VERSION(3,0,0) g_signal_connect(G_OBJECT(widcdrw), "draw", G_CALLBACK(ScintillaGTK::DrawCT), &ct); #else g_signal_connect(G_OBJECT(widcdrw), "expose_event", G_CALLBACK(ScintillaGTK::ExposeCT), &ct); #endif g_signal_connect(G_OBJECT(widcdrw), "button_press_event", G_CALLBACK(ScintillaGTK::PressCT), static_cast(this)); gtk_widget_set_events(widcdrw, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK); } gtk_widget_set_size_request(PWidget(ct.wDraw), rc.Width(), rc.Height()); ct.wDraw.Show(); if (PWindow(ct.wCallTip)) { gdk_window_resize(PWindow(ct.wCallTip), rc.Width(), rc.Height()); } } void ScintillaGTK::AddToPopUp(const char *label, int cmd, bool enabled) { GtkWidget *menuItem; if (label[0]) menuItem = gtk_menu_item_new_with_label(label); else menuItem = gtk_separator_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(popup.GetID()), menuItem); g_object_set_data(G_OBJECT(menuItem), "CmdNum", reinterpret_cast(cmd)); g_signal_connect(G_OBJECT(menuItem),"activate", G_CALLBACK(PopUpCB), this); if (cmd) { if (menuItem) gtk_widget_set_sensitive(menuItem, enabled); } } bool ScintillaGTK::OwnPrimarySelection() { return ((gdk_selection_owner_get(GDK_SELECTION_PRIMARY) == PWindow(wMain)) && (PWindow(wMain) != NULL)); } void ScintillaGTK::ClaimSelection() { // X Windows has a 'primary selection' as well as the clipboard. // Whenever the user selects some text, we become the primary selection if (!sel.Empty() && IS_WIDGET_REALIZED(GTK_WIDGET(PWidget(wMain)))) { primarySelection = true; gtk_selection_owner_set(GTK_WIDGET(PWidget(wMain)), GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); primary.Clear(); } else if (OwnPrimarySelection()) { primarySelection = true; if (primary.Empty()) gtk_selection_owner_set(NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); } else { primarySelection = false; primary.Clear(); } } #if GTK_CHECK_VERSION(3,0,0) static const guchar *DataOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_data(sd); } static gint LengthOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_length(sd); } static GdkAtom TypeOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_data_type(sd); } static GdkAtom SelectionOfGSD(GtkSelectionData *sd) { return gtk_selection_data_get_selection(sd); } #else static const guchar *DataOfGSD(GtkSelectionData *sd) { return sd->data; } static gint LengthOfGSD(GtkSelectionData *sd) { return sd->length; } static GdkAtom TypeOfGSD(GtkSelectionData *sd) { return sd->type; } static GdkAtom SelectionOfGSD(GtkSelectionData *sd) { return sd->selection; } #endif // Detect rectangular text, convert line ends to current mode, convert from or to UTF-8 void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, SelectionText &selText) { const char *data = reinterpret_cast(DataOfGSD(selectionData)); int len = LengthOfGSD(selectionData); GdkAtom selectionTypeData = TypeOfGSD(selectionData); // Return empty string if selection is not a string if ((selectionTypeData != GDK_TARGET_STRING) && (selectionTypeData != atomUTF8)) { selText.Clear(); return; } // Check for "\n\0" ending to string indicating that selection is rectangular bool isRectangular; #if PLAT_GTK_WIN32 isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; #else isRectangular = ((len > 2) && (data[len - 1] == 0 && data[len - 2] == '\n')); if (isRectangular) len--; // Forget the extra '\0' #endif #if PLAT_GTK_WIN32 // Win32 includes an ending '\0' byte in 'len' for clipboard text from // external applications; ignore it. if ((len > 0) && (data[len - 1] == '\0')) len--; #endif std::string dest(data, len); if (selectionTypeData == GDK_TARGET_STRING) { if (IsUnicodeMode()) { // Unknown encoding so assume in Latin1 dest = UTF8FromLatin1(dest.c_str(), dest.length()); selText.Copy(dest, SC_CP_UTF8, 0, isRectangular, false); } else { // Assume buffer is in same encoding as selection selText.Copy(dest, pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false); } } else { // UTF-8 const char *charSetBuffer = CharacterSetID(); if (!IsUnicodeMode() && *charSetBuffer) { // Convert to locale dest = ConvertText(dest.c_str(), dest.length(), charSetBuffer, "UTF-8", true); selText.Copy(dest, pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, isRectangular, false); } else { selText.Copy(dest, SC_CP_UTF8, 0, isRectangular, false); } } } void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) { try { if ((SelectionOfGSD(selection_data) == atomClipboard) || (SelectionOfGSD(selection_data) == GDK_SELECTION_PRIMARY)) { if ((atomSought == atomUTF8) && (LengthOfGSD(selection_data) <= 0)) { atomSought = atomString; gtk_selection_convert(GTK_WIDGET(PWidget(wMain)), SelectionOfGSD(selection_data), atomSought, GDK_CURRENT_TIME); } else if ((LengthOfGSD(selection_data) > 0) && ((TypeOfGSD(selection_data) == GDK_TARGET_STRING) || (TypeOfGSD(selection_data) == atomUTF8))) { SelectionText selText; GetGtkSelectionText(selection_data, selText); UndoGroup ug(pdoc); if (SelectionOfGSD(selection_data) != GDK_SELECTION_PRIMARY) { ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH); } InsertPasteShape(selText.Data(), selText.Length(), selText.rectangular ? pasteRectangular : pasteStream); EnsureCaretVisible(); } } // else fprintf(stderr, "Target non string %d %d\n", (int)(selection_data->type), // (int)(atomUTF8)); Redraw(); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) { dragWasDropped = true; if (TypeOfGSD(selection_data) == atomUriList || TypeOfGSD(selection_data) == atomDROPFILES_DND) { const char *data = reinterpret_cast(DataOfGSD(selection_data)); std::vector drop(data, data + LengthOfGSD(selection_data)); drop.push_back('\0'); NotifyURIDropped(&drop[0]); } else if ((TypeOfGSD(selection_data) == GDK_TARGET_STRING) || (TypeOfGSD(selection_data) == atomUTF8)) { if (LengthOfGSD(selection_data) > 0) { SelectionText selText; GetGtkSelectionText(selection_data, selText); DropAt(posDrop, selText.Data(), selText.Length(), false, selText.rectangular); } } else if (LengthOfGSD(selection_data) > 0) { //~ fprintf(stderr, "ReceivedDrop other %p\n", static_cast(selection_data->type)); } Redraw(); } void ScintillaGTK::GetSelection(GtkSelectionData *selection_data, guint info, SelectionText *text) { #if PLAT_GTK_WIN32 // GDK on Win32 expands any \n into \r\n, so make a copy of // the clip text now with newlines converted to \n. Use { } to hide symbols // from code below SelectionText *newline_normalized = NULL; { std::string tmpstr = Document::TransformLineEnds(text->Data(), text->Length(), SC_EOL_LF); newline_normalized = new SelectionText(); newline_normalized->Copy(tmpstr, SC_CP_UTF8, 0, text->rectangular, false); text = newline_normalized; } #endif // Convert text to utf8 if it isn't already SelectionText *converted = 0; if ((text->codePage != SC_CP_UTF8) && (info == TARGET_UTF8_STRING)) { const char *charSet = ::CharacterSetID(text->characterSet); if (*charSet) { std::string tmputf = ConvertText(text->Data(), text->Length(), "UTF-8", charSet, false); converted = new SelectionText(); converted->Copy(tmputf, SC_CP_UTF8, 0, text->rectangular, false); text = converted; } } // Here is a somewhat evil kludge. // As I can not work out how to store data on the clipboard in multiple formats // and need some way to mark the clipping as being stream or rectangular, // the terminating \0 is included in the length for rectangular clippings. // All other tested aplications behave benignly by ignoring the \0. // The #if is here because on Windows cfColumnSelect clip entry is used // instead as standard indicator of rectangularness (so no need to kludge) const char *textData = text->Data(); int len = text->Length(); #if PLAT_GTK_WIN32 == 0 if (text->rectangular) len++; #endif if (info == TARGET_UTF8_STRING) { gtk_selection_data_set_text(selection_data, textData, len); } else { gtk_selection_data_set(selection_data, static_cast(GDK_SELECTION_TYPE_STRING), 8, reinterpret_cast(textData), len); } delete converted; #if PLAT_GTK_WIN32 delete newline_normalized; #endif } void ScintillaGTK::StoreOnClipboard(SelectionText *clipText) { GtkClipboard *clipBoard = gtk_widget_get_clipboard(GTK_WIDGET(PWidget(wMain)), atomClipboard); if (clipBoard == NULL) // Occurs if widget isn't in a toplevel return; if (gtk_clipboard_set_with_data(clipBoard, clipboardCopyTargets, nClipboardCopyTargets, ClipboardGetSelection, ClipboardClearSelection, clipText)) { gtk_clipboard_set_can_store(clipBoard, clipboardCopyTargets, nClipboardCopyTargets); } } void ScintillaGTK::ClipboardGetSelection(GtkClipboard *, GtkSelectionData *selection_data, guint info, void *data) { GetSelection(selection_data, info, static_cast(data)); } void ScintillaGTK::ClipboardClearSelection(GtkClipboard *, void *data) { SelectionText *obj = static_cast(data); delete obj; } void ScintillaGTK::UnclaimSelection(GdkEventSelection *selection_event) { try { //Platform::DebugPrintf("UnclaimSelection\n"); if (selection_event->selection == GDK_SELECTION_PRIMARY) { //Platform::DebugPrintf("UnclaimPrimarySelection\n"); if (!OwnPrimarySelection()) { primary.Clear(); primarySelection = false; FullPaint(); } } } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::Resize(int width, int height) { //Platform::DebugPrintf("Resize %d %d\n", width, height); //printf("Resize %d %d\n", width, height); // Not always needed, but some themes can have different sizes of scrollbars #if GTK_CHECK_VERSION(3,0,0) GtkRequisition requisition; gtk_widget_get_preferred_size(PWidget(scrollbarv), NULL, &requisition); verticalScrollBarWidth = requisition.width; gtk_widget_get_preferred_size(PWidget(scrollbarh), NULL, &requisition); horizontalScrollBarHeight = requisition.height; #else verticalScrollBarWidth = GTK_WIDGET(PWidget(scrollbarv))->requisition.width; horizontalScrollBarHeight = GTK_WIDGET(PWidget(scrollbarh))->requisition.height; #endif // These allocations should never produce negative sizes as they would wrap around to huge // unsigned numbers inside GTK+ causing warnings. bool showSBHorizontal = horizontalScrollBarVisible && !Wrapping(); GtkAllocation alloc; if (showSBHorizontal) { gtk_widget_show(GTK_WIDGET(PWidget(scrollbarh))); alloc.x = 0; alloc.y = height - horizontalScrollBarHeight; alloc.width = Platform::Maximum(1, width - verticalScrollBarWidth); alloc.height = horizontalScrollBarHeight; gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarh)), &alloc); } else { gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarh))); horizontalScrollBarHeight = 0; // in case horizontalScrollBarVisible is true. } if (verticalScrollBarVisible) { gtk_widget_show(GTK_WIDGET(PWidget(scrollbarv))); alloc.x = width - verticalScrollBarWidth; alloc.y = 0; alloc.width = verticalScrollBarWidth; alloc.height = Platform::Maximum(1, height - horizontalScrollBarHeight); gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarv)), &alloc); } else { gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarv))); verticalScrollBarWidth = 0; } if (IS_WIDGET_MAPPED(PWidget(wMain))) { ChangeSize(); } alloc.x = 0; alloc.y = 0; alloc.width = Platform::Maximum(1, width - verticalScrollBarWidth); alloc.height = Platform::Maximum(1, height - horizontalScrollBarHeight); gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc); } static void SetAdjustmentValue(GtkAdjustment *object, int value) { GtkAdjustment *adjustment = GTK_ADJUSTMENT(object); #if GTK_CHECK_VERSION(3,0,0) int maxValue = static_cast( gtk_adjustment_get_upper(adjustment) - gtk_adjustment_get_page_size(adjustment)); #else int maxValue = static_cast( adjustment->upper - adjustment->page_size); #endif if (value > maxValue) value = maxValue; if (value < 0) value = 0; gtk_adjustment_set_value(adjustment, value); } static int modifierTranslated(int sciModifier) { switch (sciModifier) { case SCMOD_SHIFT: return GDK_SHIFT_MASK; case SCMOD_CTRL: return GDK_CONTROL_MASK; case SCMOD_ALT: return GDK_MOD1_MASK; case SCMOD_SUPER: return GDK_MOD4_MASK; default: return 0; } } gint ScintillaGTK::PressThis(GdkEventButton *event) { try { //Platform::DebugPrintf("Press %x time=%d state = %x button = %x\n",this,event->time, event->state, event->button); // Do not use GTK+ double click events as Scintilla has its own double click detection if (event->type != GDK_BUTTON_PRESS) return FALSE; if (evbtn) { gdk_event_free(reinterpret_cast(evbtn)); evbtn = 0; } evbtn = reinterpret_cast(gdk_event_copy(reinterpret_cast(event))); Point pt; pt.x = int(event->x); pt.y = int(event->y); PRectangle rcClient = GetClientRectangle(); //Platform::DebugPrintf("Press %0d,%0d in %0d,%0d %0d,%0d\n", // pt.x, pt.y, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom); if ((pt.x > rcClient.right) || (pt.y > rcClient.bottom)) { Platform::DebugPrintf("Bad location\n"); return FALSE; } bool shift = (event->state & GDK_SHIFT_MASK) != 0; bool ctrl = (event->state & GDK_CONTROL_MASK) != 0; // On X, instead of sending literal modifiers use the user specified // modifier, defaulting to control instead of alt. // This is because most X window managers grab alt + click for moving bool alt = (event->state & modifierTranslated(rectangularSelectionModifier)) != 0; gtk_widget_grab_focus(PWidget(wMain)); if (event->button == 1) { #if PLAT_GTK_MACOSX bool meta = ctrl; // GDK reports the Command modifer key as GDK_MOD2_MASK for button events, // not GDK_META_MASK like in key events. ctrl = (event->state & GDK_MOD2_MASK) != 0; #else bool meta = false; #endif ButtonDownWithModifiers(pt, event->time, ModifierFlags(shift, ctrl, alt, meta)); } else if (event->button == 2) { // Grab the primary selection if it exists SelectionPosition pos = SPositionFromLocation(pt, false, false, UserVirtualSpace()); if (OwnPrimarySelection() && primary.Empty()) CopySelectionRange(&primary); sel.Clear(); SetSelection(pos, pos); atomSought = atomUTF8; gtk_selection_convert(GTK_WIDGET(PWidget(wMain)), GDK_SELECTION_PRIMARY, atomSought, event->time); } else if (event->button == 3) { if (!PointInSelection(pt)) SetEmptySelection(PositionFromLocation(pt)); if (displayPopupMenu) { // PopUp menu // Convert to screen int ox = 0; int oy = 0; gdk_window_get_origin(PWindow(wMain), &ox, &oy); ContextMenu(Point(pt.x + ox, pt.y + oy)); } else { return FALSE; } } else if (event->button == 4) { // Wheel scrolling up (only GTK 1.x does it this way) if (ctrl) SetAdjustmentValue(adjustmenth, xOffset - 6); else SetAdjustmentValue(adjustmentv, topLine - 3); } else if (event->button == 5) { // Wheel scrolling down (only GTK 1.x does it this way) if (ctrl) SetAdjustmentValue(adjustmenth, xOffset + 6); else SetAdjustmentValue(adjustmentv, topLine + 3); } } catch (...) { errorStatus = SC_STATUS_FAILURE; } return TRUE; } gint ScintillaGTK::Press(GtkWidget *widget, GdkEventButton *event) { if (event->window != WindowFromWidget(widget)) return FALSE; ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->PressThis(event); } gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { //Platform::DebugPrintf("Release %x %d %d\n",sciThis,event->time,event->state); if (!sciThis->HaveMouseCapture()) return FALSE; if (event->button == 1) { Point pt; pt.x = int(event->x); pt.y = int(event->y); //Platform::DebugPrintf("Up %x %x %d %d %d\n", // sciThis,event->window,event->time, pt.x, pt.y); if (event->window != PWindow(sciThis->wMain)) // If mouse released on scroll bar then the position is relative to the // scrollbar, not the drawing window so just repeat the most recent point. pt = sciThis->ptMouseLast; sciThis->ButtonUp(pt, event->time, (event->state & GDK_CONTROL_MASK) != 0); } } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } return FALSE; } // win32gtk and GTK >= 2 use SCROLL_* events instead of passing the // button4/5/6/7 events to the GTK app gint ScintillaGTK::ScrollEvent(GtkWidget *widget, GdkEventScroll *event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { if (widget == NULL || event == NULL) return FALSE; // Compute amount and direction to scroll (even tho on win32 there is // intensity of scrolling info in the native message, gtk doesn't // support this so we simulate similarly adaptive scrolling) // Note that this is disabled on OS X (Darwin) with the X11 backend // where the X11 server already has an adaptive scrolling algorithm // that fights with this one int cLineScroll; #if defined(__APPLE__) && !defined(GDK_WINDOWING_QUARTZ) cLineScroll = sciThis->linesPerScroll; if (cLineScroll == 0) cLineScroll = 4; sciThis->wheelMouseIntensity = cLineScroll; #else int timeDelta = 1000000; GTimeVal curTime; g_get_current_time(&curTime); if (curTime.tv_sec == sciThis->lastWheelMouseTime.tv_sec) timeDelta = curTime.tv_usec - sciThis->lastWheelMouseTime.tv_usec; else if (curTime.tv_sec == sciThis->lastWheelMouseTime.tv_sec + 1) timeDelta = 1000000 + (curTime.tv_usec - sciThis->lastWheelMouseTime.tv_usec); if ((event->direction == sciThis->lastWheelMouseDirection) && (timeDelta < 250000)) { if (sciThis->wheelMouseIntensity < 12) sciThis->wheelMouseIntensity++; cLineScroll = sciThis->wheelMouseIntensity; } else { cLineScroll = sciThis->linesPerScroll; if (cLineScroll == 0) cLineScroll = 4; sciThis->wheelMouseIntensity = cLineScroll; } #endif if (event->direction == GDK_SCROLL_UP || event->direction == GDK_SCROLL_LEFT) { cLineScroll *= -1; } g_get_current_time(&sciThis->lastWheelMouseTime); sciThis->lastWheelMouseDirection = event->direction; // Note: Unpatched versions of win32gtk don't set the 'state' value so // only regular scrolling is supported there. Also, unpatched win32gtk // issues spurious button 2 mouse events during wheeling, which can cause // problems (a patch for both was submitted by archaeopteryx.com on 13Jun2001) // Data zoom not supported if (event->state & GDK_SHIFT_MASK) { return FALSE; } #if GTK_CHECK_VERSION(3,4,0) // Smooth scrolling not supported if (event->direction == GDK_SCROLL_SMOOTH) { return FALSE; } #endif // Horizontal scrolling if (event->direction == GDK_SCROLL_LEFT || event->direction == GDK_SCROLL_RIGHT) { sciThis->HorizontalScrollTo(sciThis->xOffset + cLineScroll); // Text font size zoom } else if (event->state & GDK_CONTROL_MASK) { if (cLineScroll < 0) { sciThis->KeyCommand(SCI_ZOOMIN); } else { sciThis->KeyCommand(SCI_ZOOMOUT); } // Regular scrolling } else { sciThis->ScrollTo(sciThis->topLine + cLineScroll); } return TRUE; } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } return FALSE; } gint ScintillaGTK::Motion(GtkWidget *widget, GdkEventMotion *event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { //Platform::DebugPrintf("Motion %x %d\n",sciThis,event->time); if (event->window != WindowFromWidget(widget)) return FALSE; int x = 0; int y = 0; GdkModifierType state; if (event->is_hint) { #if GTK_CHECK_VERSION(3,0,0) gdk_window_get_device_position(event->window, event->device, &x, &y, &state); #else gdk_window_get_pointer(event->window, &x, &y, &state); #endif } else { x = static_cast(event->x); y = static_cast(event->y); state = static_cast(event->state); } //Platform::DebugPrintf("Move %x %x %d %c %d %d\n", // sciThis,event->window,event->time,event->is_hint? 'h' :'.', x, y); Point pt(x, y); int modifiers = ((event->state & GDK_SHIFT_MASK) != 0 ? SCI_SHIFT : 0) | ((event->state & GDK_CONTROL_MASK) != 0 ? SCI_CTRL : 0) | ((event->state & modifierTranslated(sciThis->rectangularSelectionModifier)) != 0 ? SCI_ALT : 0); sciThis->ButtonMoveWithModifiers(pt, modifiers); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } return FALSE; } // Map the keypad keys to their equivalent functions static int KeyTranslate(int keyIn) { switch (keyIn) { #if GTK_CHECK_VERSION(3,0,0) case GDK_KEY_ISO_Left_Tab: return SCK_TAB; case GDK_KEY_KP_Down: return SCK_DOWN; case GDK_KEY_KP_Up: return SCK_UP; case GDK_KEY_KP_Left: return SCK_LEFT; case GDK_KEY_KP_Right: return SCK_RIGHT; case GDK_KEY_KP_Home: return SCK_HOME; case GDK_KEY_KP_End: return SCK_END; case GDK_KEY_KP_Page_Up: return SCK_PRIOR; case GDK_KEY_KP_Page_Down: return SCK_NEXT; case GDK_KEY_KP_Delete: return SCK_DELETE; case GDK_KEY_KP_Insert: return SCK_INSERT; case GDK_KEY_KP_Enter: return SCK_RETURN; case GDK_KEY_Down: return SCK_DOWN; case GDK_KEY_Up: return SCK_UP; case GDK_KEY_Left: return SCK_LEFT; case GDK_KEY_Right: return SCK_RIGHT; case GDK_KEY_Home: return SCK_HOME; case GDK_KEY_End: return SCK_END; case GDK_KEY_Page_Up: return SCK_PRIOR; case GDK_KEY_Page_Down: return SCK_NEXT; case GDK_KEY_Delete: return SCK_DELETE; case GDK_KEY_Insert: return SCK_INSERT; case GDK_KEY_Escape: return SCK_ESCAPE; case GDK_KEY_BackSpace: return SCK_BACK; case GDK_KEY_Tab: return SCK_TAB; case GDK_KEY_Return: return SCK_RETURN; case GDK_KEY_KP_Add: return SCK_ADD; case GDK_KEY_KP_Subtract: return SCK_SUBTRACT; case GDK_KEY_KP_Divide: return SCK_DIVIDE; case GDK_KEY_Super_L: return SCK_WIN; case GDK_KEY_Super_R: return SCK_RWIN; case GDK_KEY_Menu: return SCK_MENU; #else case GDK_ISO_Left_Tab: return SCK_TAB; case GDK_KP_Down: return SCK_DOWN; case GDK_KP_Up: return SCK_UP; case GDK_KP_Left: return SCK_LEFT; case GDK_KP_Right: return SCK_RIGHT; case GDK_KP_Home: return SCK_HOME; case GDK_KP_End: return SCK_END; case GDK_KP_Page_Up: return SCK_PRIOR; case GDK_KP_Page_Down: return SCK_NEXT; case GDK_KP_Delete: return SCK_DELETE; case GDK_KP_Insert: return SCK_INSERT; case GDK_KP_Enter: return SCK_RETURN; case GDK_Down: return SCK_DOWN; case GDK_Up: return SCK_UP; case GDK_Left: return SCK_LEFT; case GDK_Right: return SCK_RIGHT; case GDK_Home: return SCK_HOME; case GDK_End: return SCK_END; case GDK_Page_Up: return SCK_PRIOR; case GDK_Page_Down: return SCK_NEXT; case GDK_Delete: return SCK_DELETE; case GDK_Insert: return SCK_INSERT; case GDK_Escape: return SCK_ESCAPE; case GDK_BackSpace: return SCK_BACK; case GDK_Tab: return SCK_TAB; case GDK_Return: return SCK_RETURN; case GDK_KP_Add: return SCK_ADD; case GDK_KP_Subtract: return SCK_SUBTRACT; case GDK_KP_Divide: return SCK_DIVIDE; case GDK_Super_L: return SCK_WIN; case GDK_Super_R: return SCK_RWIN; case GDK_Menu: return SCK_MENU; #endif default: return keyIn; } } gboolean ScintillaGTK::KeyThis(GdkEventKey *event) { try { //fprintf(stderr, "SC-key: %d %x [%s]\n", // event->keyval, event->state, (event->length > 0) ? event->string : "empty"); if (gtk_im_context_filter_keypress(im_context, event)) { return 1; } if (!event->keyval) { return true; } bool shift = (event->state & GDK_SHIFT_MASK) != 0; bool ctrl = (event->state & GDK_CONTROL_MASK) != 0; bool alt = (event->state & GDK_MOD1_MASK) != 0; guint key = event->keyval; if ((ctrl || alt) && (key < 128)) key = toupper(key); #if GTK_CHECK_VERSION(3,0,0) else if (!ctrl && (key >= GDK_KEY_KP_Multiply && key <= GDK_KEY_KP_9)) #else else if (!ctrl && (key >= GDK_KP_Multiply && key <= GDK_KP_9)) #endif key &= 0x7F; // Hack for keys over 256 and below command keys but makes Hungarian work. // This will have to change for Unicode else if (key >= 0xFE00) key = KeyTranslate(key); bool consumed = false; #if !(PLAT_GTK_MACOSX) bool added = KeyDown(key, shift, ctrl, alt, &consumed) != 0; #else bool meta = ctrl; ctrl = (event->state & GDK_META_MASK) != 0; bool added = KeyDownWithModifiers(key, (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) | (alt ? SCI_ALT : 0) | (meta ? SCI_META : 0), &consumed) != 0; #endif if (!consumed) consumed = added; //fprintf(stderr, "SK-key: %d %x %x\n",event->keyval, event->state, consumed); if (event->keyval == 0xffffff && event->length > 0) { ClearSelection(); const int lengthInserted = pdoc->InsertString(CurrentPosition(), event->string, strlen(event->string)); if (lengthInserted > 0) { MovePositionTo(CurrentPosition() + lengthInserted); } } return consumed; } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gboolean ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->KeyThis(event); } gboolean ScintillaGTK::KeyRelease(GtkWidget *widget, GdkEventKey *event) { //Platform::DebugPrintf("SC-keyrel: %d %x %3s\n",event->keyval, event->state, event->string); ScintillaGTK *sciThis = ScintillaFromWidget(widget); if (gtk_im_context_filter_keypress(sciThis->im_context, event)) { return TRUE; } return FALSE; } #if GTK_CHECK_VERSION(3,0,0) gboolean ScintillaGTK::DrawPreeditThis(GtkWidget *widget, cairo_t *cr) { try { PreEditString pes(im_context); PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str); pango_layout_set_attributes(layout, pes.attrs); cairo_move_to(cr, 0, 0); pango_cairo_show_layout(cr, layout); g_object_unref(layout); } catch (...) { errorStatus = SC_STATUS_FAILURE; } return TRUE; } gboolean ScintillaGTK::DrawPreedit(GtkWidget *widget, cairo_t *cr, ScintillaGTK *sciThis) { return sciThis->DrawPreeditThis(widget, cr); } #else gboolean ScintillaGTK::ExposePreeditThis(GtkWidget *widget, GdkEventExpose *ose) { try { PreEditString pes(im_context); PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str); pango_layout_set_attributes(layout, pes.attrs); cairo_t *context = gdk_cairo_create(reinterpret_cast(WindowFromWidget(widget))); cairo_move_to(context, 0, 0); pango_cairo_show_layout(context, layout); cairo_destroy(context); g_object_unref(layout); } catch (...) { errorStatus = SC_STATUS_FAILURE; } return TRUE; } gboolean ScintillaGTK::ExposePreedit(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) { return sciThis->ExposePreeditThis(widget, ose); } #endif bool ScintillaGTK::KoreanIME() { PreEditString pes(im_context); if (pes.pscript != PANGO_SCRIPT_COMMON) lastNonCommonScript = pes.pscript; return lastNonCommonScript == PANGO_SCRIPT_HANGUL; } void ScintillaGTK::MoveImeCarets(int pos) { // Move carets relatively by bytes for (size_t r=0; r INDIC_MAX) { return; } pdoc->decorations.SetCurrentIndicator(indicator); for (size_t r=0; rDecorationFillRange(positionInsert - len, 1, len); } } void ScintillaGTK::GetImeUnderlines(PangoAttrList *attrs, bool *normalInput) { // Whether single underlines attribute is or not // attr position is counted by the number of UTF-8 bytes PangoAttrIterator *iterunderline = pango_attr_list_get_iterator(attrs); if (iterunderline) { do { PangoAttribute *attrunderline = pango_attr_iterator_get(iterunderline, PANGO_ATTR_UNDERLINE); if (attrunderline) { glong start = attrunderline->start_index; glong end = attrunderline->end_index; PangoUnderline uline = (PangoUnderline)((PangoAttrInt *)attrunderline)->value; for (glong i=start; i < end; ++i) { switch (uline) { case PANGO_UNDERLINE_NONE: normalInput[i] = false; break; case PANGO_UNDERLINE_SINGLE: // normal input normalInput[i] = true; break; case PANGO_UNDERLINE_DOUBLE: case PANGO_UNDERLINE_LOW: case PANGO_UNDERLINE_ERROR: break; } } } } while (pango_attr_iterator_next(iterunderline)); pango_attr_iterator_destroy(iterunderline); } } void ScintillaGTK::GetImeBackgrounds(PangoAttrList *attrs, bool *targetInput) { // Whether background color attribue is or not // attr position is measured in UTF-8 bytes PangoAttrIterator *itercolor = pango_attr_list_get_iterator(attrs); if (itercolor) { do { PangoAttribute *backcolor = pango_attr_iterator_get(itercolor, PANGO_ATTR_BACKGROUND); if (backcolor) { glong start = backcolor->start_index; glong end = backcolor->end_index; for (glong i=start; i < end; ++i) { targetInput[i] = true; // target converted } } } while (pango_attr_iterator_next(itercolor)); pango_attr_iterator_destroy(itercolor); } } void ScintillaGTK::SetCandidateWindowPos() { // Composition box accompanies candidate box. Point pt = PointMainCaret(); GdkRectangle imeBox = {0}; // No need to set width imeBox.x = pt.x; // Only need positiion imeBox.y = pt.y + vs.lineHeight; // underneath the first charater gtk_im_context_set_cursor_location(im_context, &imeBox); } void ScintillaGTK::CommitThis(char *commitStr) { try { //~ fprintf(stderr, "Commit '%s'\n", commitStr); view.imeCaretBlockOverride = false; if (pdoc->TentativeActive()) { pdoc->TentativeUndo(); } const char *charSetSource = CharacterSetID(); glong uniStrLen = 0; gunichar *uniStr = g_utf8_to_ucs4_fast(commitStr, strlen(commitStr), &uniStrLen); for (glong i = 0; i < uniStrLen; i++) { gunichar uniChar[1] = {0}; uniChar[0] = uniStr[i]; glong oneCharLen = 0; gchar *oneChar = g_ucs4_to_utf8(uniChar, 1, NULL, &oneCharLen, NULL); if (IsUnicodeMode()) { // Do nothing ; } else { std::string oneCharSTD = ConvertText(oneChar, oneCharLen, charSetSource, "UTF-8", true); oneCharLen = oneCharSTD.copy(oneChar,oneCharSTD.length(), 0); oneChar[oneCharLen] = '\0'; } AddCharUTF(oneChar, oneCharLen); g_free(oneChar); } g_free(uniStr); ShowCaretAtCurrentPosition(); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::Commit(GtkIMContext *, char *str, ScintillaGTK *sciThis) { sciThis->CommitThis(str); } void ScintillaGTK::PreeditChangedInlineThis() { // Copy & paste by johnsonj with a lot of helps of Neil // Great thanks for my foreruners, jiniya and BLUEnLIVE try { view.imeCaretBlockOverride = false; // If backspace. if (pdoc->TentativeActive()) { pdoc->TentativeUndo(); } else { // No tentative undo means start of this composition so // fill in any virtual spaces. FillVirtualSpace(); } PreEditString preeditStr(im_context); const char *charSetSource = CharacterSetID(); if (!preeditStr.validUTF8 || (charSetSource == NULL)) { ShowCaretAtCurrentPosition(); return; } if (preeditStr.uniStrLen == 0 || preeditStr.uniStrLen > maxLenInputIME) { //fprintf(stderr, "Do not allow over 200 chars: %i\n", preeditStr.uniStrLen); ShowCaretAtCurrentPosition(); return; } pdoc->TentativeStart(); // TentativeActive() from now on // Get preedit string attribues bool normalInput[maxLenInputIME*3+1] = {false}; bool targetInput[maxLenInputIME*3+1] = {false}; GetImeUnderlines(preeditStr.attrs, normalInput); GetImeBackgrounds(preeditStr.attrs, targetInput); // Display preedit characters, one by one glong imeCharPos[maxLenInputIME+1] = { 0 }; glong attrPos = -1; // Start at -1 to designate the last byte of one character. glong charWidth = 0; bool tmpRecordingMacro = recordingMacro; recordingMacro = false; for (glong i = 0; i < preeditStr.uniStrLen; i++) { gunichar uniChar[1] = {0}; uniChar[0] = preeditStr.uniStr[i]; glong oneCharLen = 0; gchar *oneChar = g_ucs4_to_utf8(uniChar, 1, NULL, &oneCharLen, NULL); // Record attribute positions in UTF-8 bytes attrPos += oneCharLen; if (IsUnicodeMode()) { // Do nothing } else { std::string oneCharSTD = ConvertText(oneChar, oneCharLen, charSetSource, "UTF-8", true); oneCharLen = oneCharSTD.copy(oneChar,oneCharSTD.length(), 0); oneChar[oneCharLen] = '\0'; } // Record character positions in UTF-8 or DBCS bytes charWidth += oneCharLen; imeCharPos[i+1] = charWidth; // Display one character AddCharUTF(oneChar, oneCharLen); // Draw an indicator on the character, // Overlapping allowed if (normalInput[attrPos]) { DrawImeIndicator(SC_INDICATOR_INPUT, oneCharLen); } if (targetInput[attrPos]) { DrawImeIndicator(SC_INDICATOR_TARGET, oneCharLen); } g_free(oneChar); } recordingMacro = tmpRecordingMacro; // Move caret to ime cursor position. if (KoreanIME()) { view.imeCaretBlockOverride = true; MoveImeCarets( - (imeCharPos[preeditStr.uniStrLen])); } else { MoveImeCarets( - (imeCharPos[preeditStr.uniStrLen]) + imeCharPos[preeditStr.cursor_pos]); } EnsureCaretVisible(); SetCandidateWindowPos(); ShowCaretAtCurrentPosition(); } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::PreeditChangedWindowedThis() { try { PreEditString pes(im_context); if (strlen(pes.str) > 0) { PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str); pango_layout_set_attributes(layout, pes.attrs); gint w, h; pango_layout_get_pixel_size(layout, &w, &h); g_object_unref(layout); gint x, y; gdk_window_get_origin(PWindow(wText), &x, &y); Point pt = PointMainCaret(); if (pt.x < 0) pt.x = 0; if (pt.y < 0) pt.y = 0; gtk_window_move(GTK_WINDOW(PWidget(wPreedit)), x + pt.x, y + pt.y); gtk_window_resize(GTK_WINDOW(PWidget(wPreedit)), w, h); gtk_widget_show(PWidget(wPreedit)); gtk_widget_queue_draw_area(PWidget(wPreeditDraw), 0, 0, w, h); } else { gtk_widget_hide(PWidget(wPreedit)); } } catch (...) { errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::PreeditChanged(GtkIMContext *, ScintillaGTK *sciThis) { if ((sciThis->imeInteraction == imeInline) || (sciThis->KoreanIME())) { sciThis->PreeditChangedInlineThis(); } else { sciThis->PreeditChangedWindowedThis(); } } void ScintillaGTK::StyleSetText(GtkWidget *widget, GtkStyle *, void*) { RealizeText(widget, NULL); } void ScintillaGTK::RealizeText(GtkWidget *widget, void*) { // Set NULL background to avoid automatic clearing so Scintilla responsible for all drawing if (WindowFromWidget(widget)) { #if GTK_CHECK_VERSION(3,0,0) gdk_window_set_background_pattern(WindowFromWidget(widget), NULL); #else gdk_window_set_back_pixmap(WindowFromWidget(widget), NULL, FALSE); #endif } } static GObjectClass *scintilla_class_parent_class; void ScintillaGTK::Destroy(GObject *object) { try { ScintillaObject *scio = reinterpret_cast(object); // This avoids a double destruction if (!scio->pscin) return; ScintillaGTK *sciThis = reinterpret_cast(scio->pscin); //Platform::DebugPrintf("Destroying %x %x\n", sciThis, object); sciThis->Finalise(); gtk_widget_unparent(PWidget(sciThis->scrollbarv)); gtk_widget_unparent(PWidget(sciThis->scrollbarh)); delete sciThis; scio->pscin = 0; scintilla_class_parent_class->finalize(object); } catch (...) { // Its dead so nowhere to save the status } } #if GTK_CHECK_VERSION(3,0,0) gboolean ScintillaGTK::DrawTextThis(cairo_t *cr) { try { paintState = painting; repaintFullWindow = false; rcPaint = GetClientRectangle(); PLATFORM_ASSERT(rgnUpdate == NULL); rgnUpdate = cairo_copy_clip_rectangle_list(cr); if (rgnUpdate && rgnUpdate->status != CAIRO_STATUS_SUCCESS) { // If not successful then ignore fprintf(stderr, "DrawTextThis failed to copy update region %d [%d]\n", rgnUpdate->status, rgnUpdate->num_rectangles); cairo_rectangle_list_destroy(rgnUpdate); rgnUpdate = 0; } double x1, y1, x2, y2; cairo_clip_extents(cr, &x1, &y1, &x2, &y2); rcPaint.left = x1; rcPaint.top = y1; rcPaint.right = x2; rcPaint.bottom = y2; PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceWindow) { surfaceWindow->Init(cr, PWidget(wText)); Paint(surfaceWindow, rcPaint); surfaceWindow->Release(); delete surfaceWindow; } if ((paintState == paintAbandoned) || repaintFullWindow) { // Painting area was insufficient to cover new styling or brace highlight positions FullPaint(); } paintState = notPainting; repaintFullWindow = false; if (rgnUpdate) { cairo_rectangle_list_destroy(rgnUpdate); } rgnUpdate = 0; paintState = notPainting; } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gboolean ScintillaGTK::DrawText(GtkWidget *, cairo_t *cr, ScintillaGTK *sciThis) { return sciThis->DrawTextThis(cr); } gboolean ScintillaGTK::DrawThis(cairo_t *cr) { try { #ifdef GTK_STYLE_CLASS_SCROLLBARS_JUNCTION /* GTK >= 3.4 */ // if both scrollbars are visible, paint the little square on the bottom right corner if (verticalScrollBarVisible && horizontalScrollBarVisible && !Wrapping()) { GtkStyleContext *styleContext = gtk_widget_get_style_context(PWidget(wMain)); PRectangle rc = GetClientRectangle(); gtk_style_context_save(styleContext); gtk_style_context_add_class(styleContext, GTK_STYLE_CLASS_SCROLLBARS_JUNCTION); gtk_render_background(styleContext, cr, rc.right, rc.bottom, verticalScrollBarWidth, horizontalScrollBarHeight); gtk_render_frame(styleContext, cr, rc.right, rc.bottom, verticalScrollBarWidth, horizontalScrollBarHeight); gtk_style_context_restore(styleContext); } #endif gtk_container_propagate_draw( GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarh), cr); gtk_container_propagate_draw( GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), cr); // Starting from the following version, the expose event are not propagated // for double buffered non native windows, so we need to call it ourselves // or keep the default handler #if GTK_CHECK_VERSION(3,0,0) // we want to forward on any >= 3.9.2 runtime if (gtk_check_version(3,9,2) == NULL) { gtk_container_propagate_draw( GTK_CONTAINER(PWidget(wMain)), PWidget(wText), cr); } #endif } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gboolean ScintillaGTK::DrawMain(GtkWidget *widget, cairo_t *cr) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->DrawThis(cr); } #else gboolean ScintillaGTK::ExposeTextThis(GtkWidget * /*widget*/, GdkEventExpose *ose) { try { paintState = painting; rcPaint.left = ose->area.x; rcPaint.top = ose->area.y; rcPaint.right = ose->area.x + ose->area.width; rcPaint.bottom = ose->area.y + ose->area.height; PLATFORM_ASSERT(rgnUpdate == NULL); rgnUpdate = gdk_region_copy(ose->region); PRectangle rcClient = GetClientRectangle(); paintingAllText = rcPaint.Contains(rcClient); Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceWindow) { cairo_t *cr = gdk_cairo_create(PWindow(wText)); surfaceWindow->Init(cr, PWidget(wText)); Paint(surfaceWindow, rcPaint); surfaceWindow->Release(); delete surfaceWindow; cairo_destroy(cr); } if (paintState == paintAbandoned) { // Painting area was insufficient to cover new styling or brace highlight positions FullPaint(); } paintState = notPainting; if (rgnUpdate) { gdk_region_destroy(rgnUpdate); } rgnUpdate = 0; } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gboolean ScintillaGTK::ExposeText(GtkWidget *widget, GdkEventExpose *ose, ScintillaGTK *sciThis) { return sciThis->ExposeTextThis(widget, ose); } gboolean ScintillaGTK::ExposeMain(GtkWidget *widget, GdkEventExpose *ose) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); //Platform::DebugPrintf("Expose Main %0d,%0d %0d,%0d\n", //ose->area.x, ose->area.y, ose->area.width, ose->area.height); return sciThis->Expose(widget, ose); } gboolean ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) { try { //fprintf(stderr, "Expose %0d,%0d %0d,%0d\n", //ose->area.x, ose->area.y, ose->area.width, ose->area.height); // The text is painted in ExposeText gtk_container_propagate_expose( GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarh), ose); gtk_container_propagate_expose( GTK_CONTAINER(PWidget(wMain)), PWidget(scrollbarv), ose); } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } #endif void ScintillaGTK::ScrollSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) { try { #if GTK_CHECK_VERSION(3,0,0) sciThis->ScrollTo(static_cast(gtk_adjustment_get_value(adj)), false); #else sciThis->ScrollTo(static_cast(adj->value), false); #endif } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) { try { #if GTK_CHECK_VERSION(3,0,0) sciThis->HorizontalScrollTo(static_cast(gtk_adjustment_get_value(adj))); #else sciThis->HorizontalScrollTo(static_cast(adj->value)); #endif } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::SelectionReceived(GtkWidget *widget, GtkSelectionData *selection_data, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); //Platform::DebugPrintf("Selection received\n"); sciThis->ReceivedSelection(selection_data); } void ScintillaGTK::SelectionGet(GtkWidget *widget, GtkSelectionData *selection_data, guint info, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { //Platform::DebugPrintf("Selection get\n"); if (SelectionOfGSD(selection_data) == GDK_SELECTION_PRIMARY) { if (sciThis->primary.Empty()) { sciThis->CopySelectionRange(&sciThis->primary); } sciThis->GetSelection(selection_data, info, &sciThis->primary); } } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } gint ScintillaGTK::SelectionClear(GtkWidget *widget, GdkEventSelection *selection_event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); //Platform::DebugPrintf("Selection clear\n"); sciThis->UnclaimSelection(selection_event); if (GTK_WIDGET_CLASS(sciThis->parentClass)->selection_clear_event) { return GTK_WIDGET_CLASS(sciThis->parentClass)->selection_clear_event(widget, selection_event); } return TRUE; } gboolean ScintillaGTK::DragMotionThis(GdkDragContext *context, gint x, gint y, guint dragtime) { try { Point npt(x, y); SetDragPosition(SPositionFromLocation(npt, false, false, UserVirtualSpace())); #if GTK_CHECK_VERSION(3,0,0) GdkDragAction preferredAction = gdk_drag_context_get_suggested_action(context); GdkDragAction actions = gdk_drag_context_get_actions(context); #else GdkDragAction preferredAction = context->suggested_action; GdkDragAction actions = context->actions; #endif SelectionPosition pos = SPositionFromLocation(npt); if ((inDragDrop == ddDragging) && (PositionInSelection(pos.Position()))) { // Avoid dragging selection onto itself as that produces a move // with no real effect but which creates undo actions. preferredAction = static_cast(0); } else if (actions == static_cast (GDK_ACTION_COPY | GDK_ACTION_MOVE)) { preferredAction = GDK_ACTION_MOVE; } gdk_drag_status(context, preferredAction, dragtime); } catch (...) { errorStatus = SC_STATUS_FAILURE; } return FALSE; } gboolean ScintillaGTK::DragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint dragtime) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); return sciThis->DragMotionThis(context, x, y, dragtime); } void ScintillaGTK::DragLeave(GtkWidget *widget, GdkDragContext * /*context*/, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { sciThis->SetDragPosition(SelectionPosition(invalidPosition)); //Platform::DebugPrintf("DragLeave %x\n", sciThis); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::DragEnd(GtkWidget *widget, GdkDragContext * /*context*/) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { // If drag did not result in drop here or elsewhere if (!sciThis->dragWasDropped) sciThis->SetEmptySelection(sciThis->posDrag); sciThis->SetDragPosition(SelectionPosition(invalidPosition)); //Platform::DebugPrintf("DragEnd %x %d\n", sciThis, sciThis->dragWasDropped); sciThis->inDragDrop = ddNone; } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } gboolean ScintillaGTK::Drop(GtkWidget *widget, GdkDragContext * /*context*/, gint, gint, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { //Platform::DebugPrintf("Drop %x\n", sciThis); sciThis->SetDragPosition(SelectionPosition(invalidPosition)); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } return FALSE; } void ScintillaGTK::DragDataReceived(GtkWidget *widget, GdkDragContext * /*context*/, gint, gint, GtkSelectionData *selection_data, guint /*info*/, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { sciThis->ReceivedDrop(selection_data); sciThis->SetDragPosition(SelectionPosition(invalidPosition)); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } void ScintillaGTK::DragDataGet(GtkWidget *widget, GdkDragContext *context, GtkSelectionData *selection_data, guint info, guint) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); try { sciThis->dragWasDropped = true; if (!sciThis->sel.Empty()) { sciThis->GetSelection(selection_data, info, &sciThis->drag); } #if GTK_CHECK_VERSION(3,0,0) GdkDragAction action = gdk_drag_context_get_selected_action(context); #else GdkDragAction action = context->action; #endif if (action == GDK_ACTION_MOVE) { for (size_t r=0; rsel.Count(); r++) { if (sciThis->posDrop >= sciThis->sel.Range(r).Start()) { if (sciThis->posDrop > sciThis->sel.Range(r).End()) { sciThis->posDrop.Add(-sciThis->sel.Range(r).Length()); } else { sciThis->posDrop.Add(-SelectionRange(sciThis->posDrop, sciThis->sel.Range(r).Start()).Length()); } } } sciThis->ClearSelection(); } sciThis->SetDragPosition(SelectionPosition(invalidPosition)); } catch (...) { sciThis->errorStatus = SC_STATUS_FAILURE; } } int ScintillaGTK::TimeOut(TimeThunk *tt) { tt->scintilla->TickFor(tt->reason); return 1; } gboolean ScintillaGTK::IdleCallback(ScintillaGTK *sciThis) { // Idler will be automatically stopped, if there is nothing // to do while idle. #ifndef GDK_VERSION_3_6 gdk_threads_enter(); #endif bool ret = sciThis->Idle(); if (ret == false) { // FIXME: This will remove the idler from GTK, we don't want to // remove it as it is removed automatically when this function // returns false (although, it should be harmless). sciThis->SetIdle(false); } #ifndef GDK_VERSION_3_6 gdk_threads_leave(); #endif return ret; } gboolean ScintillaGTK::StyleIdle(ScintillaGTK *sciThis) { #ifndef GDK_VERSION_3_6 gdk_threads_enter(); #endif sciThis->IdleWork(); #ifndef GDK_VERSION_3_6 gdk_threads_leave(); #endif // Idler will be automatically stopped return FALSE; } void ScintillaGTK::QueueIdleWork(WorkNeeded::workItems items, int upTo) { Editor::QueueIdleWork(items, upTo); if (!workNeeded.active) { // Only allow one style needed to be queued workNeeded.active = true; g_idle_add_full(G_PRIORITY_HIGH_IDLE, reinterpret_cast(StyleIdle), this, NULL); } } void ScintillaGTK::PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis) { guint action = (sptr_t)(g_object_get_data(G_OBJECT(menuItem), "CmdNum")); if (action) { sciThis->Command(action); } } gboolean ScintillaGTK::PressCT(GtkWidget *widget, GdkEventButton *event, ScintillaGTK *sciThis) { try { if (event->window != WindowFromWidget(widget)) return FALSE; if (event->type != GDK_BUTTON_PRESS) return FALSE; Point pt; pt.x = int(event->x); pt.y = int(event->y); sciThis->ct.MouseClick(pt); sciThis->CallTipClick(); } catch (...) { } return TRUE; } #if GTK_CHECK_VERSION(3,0,0) gboolean ScintillaGTK::DrawCT(GtkWidget *widget, cairo_t *cr, CallTip *ctip) { try { Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceWindow) { surfaceWindow->Init(cr, widget); surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage); surfaceWindow->SetDBCSMode(ctip->codePage); ctip->PaintCT(surfaceWindow); surfaceWindow->Release(); delete surfaceWindow; } } catch (...) { // No pointer back to Scintilla to save status } return TRUE; } #else gboolean ScintillaGTK::ExposeCT(GtkWidget *widget, GdkEventExpose * /*ose*/, CallTip *ctip) { try { Surface *surfaceWindow = Surface::Allocate(SC_TECHNOLOGY_DEFAULT); if (surfaceWindow) { cairo_t *cr = gdk_cairo_create(WindowFromWidget(widget)); surfaceWindow->Init(cr, widget); surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == ctip->codePage); surfaceWindow->SetDBCSMode(ctip->codePage); ctip->PaintCT(surfaceWindow); surfaceWindow->Release(); delete surfaceWindow; cairo_destroy(cr); } } catch (...) { // No pointer back to Scintilla to save status } return TRUE; } #endif sptr_t ScintillaGTK::DirectFunction( sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return reinterpret_cast(ptr)->WndProc(iMessage, wParam, lParam); } sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { ScintillaGTK *psci = reinterpret_cast(sci->pscin); return psci->WndProc(iMessage, wParam, lParam); } static void scintilla_class_init(ScintillaClass *klass); static void scintilla_init(ScintillaObject *sci); extern void Platform_Initialise(); extern void Platform_Finalise(); GType scintilla_get_type() { static GType scintilla_type = 0; try { if (!scintilla_type) { scintilla_type = g_type_from_name("Scintilla"); if (!scintilla_type) { static GTypeInfo scintilla_info = { (guint16) sizeof (ScintillaClass), NULL, //(GBaseInitFunc) NULL, //(GBaseFinalizeFunc) (GClassInitFunc) scintilla_class_init, NULL, //(GClassFinalizeFunc) NULL, //gconstpointer data (guint16) sizeof (ScintillaObject), 0, //n_preallocs (GInstanceInitFunc) scintilla_init, NULL //(GTypeValueTable*) }; scintilla_type = g_type_register_static( GTK_TYPE_CONTAINER, "Scintilla", &scintilla_info, (GTypeFlags) 0); } } } catch (...) { } return scintilla_type; } void ScintillaGTK::ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_class, GtkContainerClass *container_class) { Platform_Initialise(); #ifdef SCI_LEXER Scintilla_LinkLexers(); #endif atomClipboard = gdk_atom_intern("CLIPBOARD", FALSE); atomUTF8 = gdk_atom_intern("UTF8_STRING", FALSE); atomString = GDK_SELECTION_TYPE_STRING; atomUriList = gdk_atom_intern("text/uri-list", FALSE); atomDROPFILES_DND = gdk_atom_intern("DROPFILES_DND", FALSE); // Define default signal handlers for the class: Could move more // of the signal handlers here (those that currently attached to wDraw // in Initialise() may require coordinate translation?) object_class->finalize = Destroy; #if GTK_CHECK_VERSION(3,0,0) widget_class->get_preferred_width = GetPreferredWidth; widget_class->get_preferred_height = GetPreferredHeight; #else widget_class->size_request = SizeRequest; #endif widget_class->size_allocate = SizeAllocate; #if GTK_CHECK_VERSION(3,0,0) widget_class->draw = DrawMain; #else widget_class->expose_event = ExposeMain; #endif widget_class->motion_notify_event = Motion; widget_class->button_press_event = Press; widget_class->button_release_event = MouseRelease; widget_class->scroll_event = ScrollEvent; widget_class->key_press_event = KeyPress; widget_class->key_release_event = KeyRelease; widget_class->focus_in_event = FocusIn; widget_class->focus_out_event = FocusOut; widget_class->selection_received = SelectionReceived; widget_class->selection_get = SelectionGet; widget_class->selection_clear_event = SelectionClear; widget_class->drag_data_received = DragDataReceived; widget_class->drag_motion = DragMotion; widget_class->drag_leave = DragLeave; widget_class->drag_end = DragEnd; widget_class->drag_drop = Drop; widget_class->drag_data_get = DragDataGet; widget_class->realize = Realize; widget_class->unrealize = UnRealize; widget_class->map = Map; widget_class->unmap = UnMap; container_class->forall = MainForAll; } #define SIG_MARSHAL scintilla_marshal_NONE__INT_POINTER #define MARSHAL_ARGUMENTS G_TYPE_INT, G_TYPE_POINTER static void scintilla_class_init(ScintillaClass *klass) { try { OBJECT_CLASS *object_class = (OBJECT_CLASS*) klass; GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; GtkContainerClass *container_class = (GtkContainerClass*) klass; GSignalFlags sigflags = GSignalFlags(G_SIGNAL_ACTION | G_SIGNAL_RUN_LAST); scintilla_signals[COMMAND_SIGNAL] = g_signal_new( "command", G_TYPE_FROM_CLASS(object_class), sigflags, G_STRUCT_OFFSET(ScintillaClass, command), NULL, //(GSignalAccumulator) NULL, //(gpointer) SIG_MARSHAL, G_TYPE_NONE, 2, MARSHAL_ARGUMENTS); scintilla_signals[NOTIFY_SIGNAL] = g_signal_new( SCINTILLA_NOTIFY, G_TYPE_FROM_CLASS(object_class), sigflags, G_STRUCT_OFFSET(ScintillaClass, notify), NULL, NULL, SIG_MARSHAL, G_TYPE_NONE, 2, MARSHAL_ARGUMENTS); klass->command = NULL; klass->notify = NULL; scintilla_class_parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(klass)); ScintillaGTK::ClassInit(object_class, widget_class, container_class); } catch (...) { } } static void scintilla_init(ScintillaObject *sci) { try { #if GTK_CHECK_VERSION(2,20,0) gtk_widget_set_can_focus(GTK_WIDGET(sci), TRUE); #else GTK_WIDGET_SET_FLAGS(sci, GTK_CAN_FOCUS); #endif sci->pscin = new ScintillaGTK(sci); } catch (...) { } } GtkWidget* scintilla_new() { GtkWidget *widget = GTK_WIDGET(g_object_new(scintilla_get_type(), NULL)); gtk_widget_set_direction(widget, GTK_TEXT_DIR_LTR); return widget; } void scintilla_set_id(ScintillaObject *sci, uptr_t id) { ScintillaGTK *psci = reinterpret_cast(sci->pscin); psci->ctrlID = id; } void scintilla_release_resources(void) { try { Platform_Finalise(); } catch (...) { } } scintilla/gtk/scintilla-marshal.h0000644000175000017500000000141012075650364016051 0ustar neilneil #ifndef __scintilla_marshal_MARSHAL_H__ #define __scintilla_marshal_MARSHAL_H__ #include G_BEGIN_DECLS /* NONE:INT,POINTER (scintilla-marshal.list:1) */ extern void scintilla_marshal_VOID__INT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); #define scintilla_marshal_NONE__INT_POINTER scintilla_marshal_VOID__INT_POINTER G_END_DECLS #endif /* __scintilla_marshal_MARSHAL_H__ */ scintilla/gtk/scintilla-marshal.c0000644000175000017500000000756512075650364016065 0ustar neilneil #include #ifdef G_ENABLE_DEBUG #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v) #define g_marshal_value_peek_char(v) g_value_get_char (v) #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v) #define g_marshal_value_peek_int(v) g_value_get_int (v) #define g_marshal_value_peek_uint(v) g_value_get_uint (v) #define g_marshal_value_peek_long(v) g_value_get_long (v) #define g_marshal_value_peek_ulong(v) g_value_get_ulong (v) #define g_marshal_value_peek_int64(v) g_value_get_int64 (v) #define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v) #define g_marshal_value_peek_enum(v) g_value_get_enum (v) #define g_marshal_value_peek_flags(v) g_value_get_flags (v) #define g_marshal_value_peek_float(v) g_value_get_float (v) #define g_marshal_value_peek_double(v) g_value_get_double (v) #define g_marshal_value_peek_string(v) (char*) g_value_get_string (v) #define g_marshal_value_peek_param(v) g_value_get_param (v) #define g_marshal_value_peek_boxed(v) g_value_get_boxed (v) #define g_marshal_value_peek_pointer(v) g_value_get_pointer (v) #define g_marshal_value_peek_object(v) g_value_get_object (v) #else /* !G_ENABLE_DEBUG */ /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API. * Do not access GValues directly in your code. Instead, use the * g_value_get_*() functions */ #define g_marshal_value_peek_boolean(v) (v)->data[0].v_int #define g_marshal_value_peek_char(v) (v)->data[0].v_int #define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint #define g_marshal_value_peek_int(v) (v)->data[0].v_int #define g_marshal_value_peek_uint(v) (v)->data[0].v_uint #define g_marshal_value_peek_long(v) (v)->data[0].v_long #define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong #define g_marshal_value_peek_int64(v) (v)->data[0].v_int64 #define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64 #define g_marshal_value_peek_enum(v) (v)->data[0].v_int #define g_marshal_value_peek_flags(v) (v)->data[0].v_uint #define g_marshal_value_peek_float(v) (v)->data[0].v_float #define g_marshal_value_peek_double(v) (v)->data[0].v_double #define g_marshal_value_peek_string(v) (v)->data[0].v_pointer #define g_marshal_value_peek_param(v) (v)->data[0].v_pointer #define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer #define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer #define g_marshal_value_peek_object(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ /* NONE:INT,POINTER (scintilla-marshal.list:1) */ void scintilla_marshal_VOID__INT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data) { typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer data1, gint arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_VOID__INT_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; g_return_if_fail (n_param_values == 3); if (G_CCLOSURE_SWAP_DATA (closure)) { data1 = closure->data; data2 = g_value_peek_pointer (param_values + 0); } else { data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } callback = (GMarshalFunc_VOID__INT_POINTER) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_int (param_values + 1), g_marshal_value_peek_pointer (param_values + 2), data2); } scintilla/gtk/Converter.h0000644000175000017500000000442012270355633014413 0ustar neilneil// Scintilla source code edit control // Converter.h - Encapsulation of iconv // Copyright 2004 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef CONVERTER_H #define CONVERTER_H #ifdef SCI_NAMESPACE namespace Scintilla { #endif typedef GIConv ConverterHandle; const ConverterHandle iconvhBad = (ConverterHandle)(-1); // Since various versions of iconv can not agree on whether the src argument // is char ** or const char ** provide a templatised adaptor. template size_t iconv_adaptor(size_t(*f_iconv)(ConverterHandle, T, size_t *, char **, size_t *), ConverterHandle cd, char** src, size_t *srcleft, char **dst, size_t *dstleft) { return f_iconv(cd, (T)src, srcleft, dst, dstleft); } /** * Encapsulate iconv safely and avoid iconv_adaptor complexity in client code. */ class Converter { ConverterHandle iconvh; void OpenHandle(const char *fullDestination, const char *charSetSource) { iconvh = g_iconv_open(fullDestination, charSetSource); } bool Succeeded() const { return iconvh != iconvhBad; } public: Converter() { iconvh = iconvhBad; } Converter(const char *charSetDestination, const char *charSetSource, bool transliterations) { iconvh = iconvhBad; Open(charSetDestination, charSetSource, transliterations); } ~Converter() { Close(); } operator bool() const { return Succeeded(); } void Open(const char *charSetDestination, const char *charSetSource, bool transliterations=true) { Close(); if (*charSetSource) { // Try allowing approximate transliterations if (transliterations) { char fullDest[200]; g_strlcpy(fullDest, charSetDestination, sizeof(fullDest)); g_strlcat(fullDest, "//TRANSLIT", sizeof(fullDest)); OpenHandle(fullDest, charSetSource); } if (!Succeeded()) { // Transliterations failed so try basic name OpenHandle(charSetDestination, charSetSource); } } } void Close() { if (Succeeded()) { g_iconv_close(iconvh); iconvh = iconvhBad; } } size_t Convert(char** src, size_t *srcleft, char **dst, size_t *dstleft) const { if (!Succeeded()) { return (size_t)(-1); } else { return iconv_adaptor(g_iconv, iconvh, src, srcleft, dst, dstleft); } } }; #ifdef SCI_NAMESPACE } #endif #endif scintilla/gtk/scintilla-marshal.list0000644000175000017500000000002112075650364016572 0ustar neilneilNONE:INT,POINTER scintilla/gtk/deps.mak0000644000175000017500000011452012557522743013731 0ustar neilneilPlatGTK.o: PlatGTK.cxx \ ../include/Scintilla.h ../include/Sci_Position.h \ ../include/ScintillaWidget.h ../lexlib/StringCopy.h ../src/XPM.h \ ../src/UniConversion.h Converter.h ScintillaGTK.o: ScintillaGTK.cxx \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../include/ScintillaWidget.h ../include/SciLexer.h \ ../lexlib/StringCopy.h ../lexlib/LexerModule.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \ ../src/ContractionState.h ../src/CellBuffer.h ../src/CallTip.h \ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \ ../src/CaseConvert.h ../src/UniConversion.h ../src/UnicodeFromUTF8.h \ ../src/Selection.h ../src/PositionCache.h ../src/EditModel.h \ ../src/MarginView.h ../src/EditView.h ../src/Editor.h \ ../src/AutoComplete.h ../src/ScintillaBase.h ../src/ExternalLexer.h \ scintilla-marshal.h Converter.h AutoComplete.o: ../src/AutoComplete.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h \ ../lexlib/CharacterSet.h ../src/Position.h ../src/AutoComplete.h CallTip.o: ../src/CallTip.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../lexlib/StringCopy.h \ ../src/Position.h ../src/CallTip.h CaseConvert.o: ../src/CaseConvert.cxx ../lexlib/StringCopy.h \ ../src/CaseConvert.h ../src/UniConversion.h ../src/UnicodeFromUTF8.h CaseFolder.o: ../src/CaseFolder.cxx ../src/CaseFolder.h \ ../src/CaseConvert.h ../src/UniConversion.h Catalogue.o: ../src/Catalogue.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/LexerModule.h ../src/Catalogue.h CellBuffer.o: ../src/CellBuffer.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/CellBuffer.h \ ../src/UniConversion.h CharClassify.o: ../src/CharClassify.cxx ../src/CharClassify.h ContractionState.o: ../src/ContractionState.cxx ../include/Platform.h \ ../src/Position.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/RunStyles.h ../src/ContractionState.h Decoration.o: ../src/Decoration.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \ ../src/Decoration.h Document.o: ../src/Document.cxx ../include/Platform.h ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h \ ../lexlib/CharacterSet.h ../src/Position.h ../src/SplitVector.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/CellBuffer.h \ ../src/PerLine.h ../src/CharClassify.h ../src/Decoration.h \ ../src/CaseFolder.h ../src/Document.h ../src/RESearch.h \ ../src/UniConversion.h ../src/UnicodeFromUTF8.h EditModel.o: ../src/EditModel.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../lexlib/StringCopy.h ../src/Position.h ../src/SplitVector.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \ ../src/PositionCache.h ../src/EditModel.h Editor.o: ../src/Editor.cxx ../include/Platform.h ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../lexlib/StringCopy.h \ ../src/Position.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \ ../src/PerLine.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \ ../src/EditView.h ../src/Editor.h EditView.o: ../src/EditView.cxx ../include/Platform.h ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../lexlib/StringCopy.h \ ../src/Position.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \ ../src/PerLine.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \ ../src/EditView.h ExternalLexer.o: ../src/ExternalLexer.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../include/SciLexer.h ../lexlib/LexerModule.h ../src/Catalogue.h \ ../src/ExternalLexer.h Indicator.o: ../src/Indicator.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Indicator.h \ ../src/XPM.h KeyMap.o: ../src/KeyMap.cxx ../include/Platform.h ../include/Scintilla.h \ ../include/Sci_Position.h ../src/KeyMap.h LineMarker.o: ../src/LineMarker.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../lexlib/StringCopy.h \ ../src/XPM.h ../src/LineMarker.h MarginView.o: ../src/MarginView.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../lexlib/StringCopy.h ../src/Position.h ../src/SplitVector.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \ ../src/CellBuffer.h ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h \ ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \ ../src/Document.h ../src/UniConversion.h ../src/Selection.h \ ../src/PositionCache.h ../src/EditModel.h ../src/MarginView.h \ ../src/EditView.h PerLine.o: ../src/PerLine.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/CellBuffer.h \ ../src/PerLine.h PositionCache.o: ../src/PositionCache.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../src/Position.h ../src/SplitVector.h ../src/Partitioning.h \ ../src/RunStyles.h ../src/ContractionState.h ../src/CellBuffer.h \ ../src/KeyMap.h ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h \ ../src/Style.h ../src/ViewStyle.h ../src/CharClassify.h \ ../src/Decoration.h ../src/CaseFolder.h ../src/Document.h \ ../src/UniConversion.h ../src/Selection.h ../src/PositionCache.h RESearch.o: ../src/RESearch.cxx ../src/Position.h ../src/CharClassify.h \ ../src/RESearch.h RunStyles.o: ../src/RunStyles.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h ScintillaBase.o: ../src/ScintillaBase.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../include/SciLexer.h ../lexlib/PropSetSimple.h ../lexlib/LexerModule.h \ ../src/Catalogue.h ../src/Position.h ../src/SplitVector.h \ ../src/Partitioning.h ../src/RunStyles.h ../src/ContractionState.h \ ../src/CellBuffer.h ../src/CallTip.h ../src/KeyMap.h ../src/Indicator.h \ ../src/XPM.h ../src/LineMarker.h ../src/Style.h ../src/ViewStyle.h \ ../src/CharClassify.h ../src/Decoration.h ../src/CaseFolder.h \ ../src/Document.h ../src/Selection.h ../src/PositionCache.h \ ../src/EditModel.h ../src/MarginView.h ../src/EditView.h ../src/Editor.h \ ../src/AutoComplete.h ../src/ScintillaBase.h Selection.o: ../src/Selection.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/Selection.h Style.o: ../src/Style.cxx ../include/Platform.h ../include/Scintilla.h \ ../include/Sci_Position.h ../src/Style.h UniConversion.o: ../src/UniConversion.cxx ../src/UniConversion.h ViewStyle.o: ../src/ViewStyle.cxx ../include/Platform.h \ ../include/Scintilla.h ../include/Sci_Position.h ../src/Position.h \ ../src/SplitVector.h ../src/Partitioning.h ../src/RunStyles.h \ ../src/Indicator.h ../src/XPM.h ../src/LineMarker.h ../src/Style.h \ ../src/ViewStyle.h XPM.o: ../src/XPM.cxx ../include/Platform.h ../src/XPM.h Accessor.o: ../lexlib/Accessor.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h CharacterCategory.o: ../lexlib/CharacterCategory.cxx \ ../lexlib/StringCopy.h ../lexlib/CharacterCategory.h CharacterSet.o: ../lexlib/CharacterSet.cxx ../lexlib/CharacterSet.h LexerBase.o: ../lexlib/LexerBase.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/LexerModule.h ../lexlib/LexerBase.h LexerModule.o: ../lexlib/LexerModule.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/LexerModule.h ../lexlib/LexerBase.h \ ../lexlib/LexerSimple.h LexerNoExceptions.o: ../lexlib/LexerNoExceptions.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/LexerModule.h ../lexlib/LexerBase.h \ ../lexlib/LexerNoExceptions.h LexerSimple.o: ../lexlib/LexerSimple.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/LexerModule.h ../lexlib/LexerBase.h \ ../lexlib/LexerSimple.h PropSetSimple.o: ../lexlib/PropSetSimple.cxx ../lexlib/PropSetSimple.h StyleContext.o: ../lexlib/StyleContext.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h WordList.o: ../lexlib/WordList.cxx ../lexlib/StringCopy.h \ ../lexlib/WordList.h LexA68k.o: ../lexers/LexA68k.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAbaqus.o: ../lexers/LexAbaqus.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAda.o: ../lexers/LexAda.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAPDL.o: ../lexers/LexAPDL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAsm.o: ../lexers/LexAsm.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexAsn1.o: ../lexers/LexAsn1.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexASY.o: ../lexers/LexASY.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAU3.o: ../lexers/LexAU3.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAVE.o: ../lexers/LexAVE.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexAVS.o: ../lexers/LexAVS.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexBaan.o: ../lexers/LexBaan.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexBash.o: ../lexers/LexBash.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexBasic.o: ../lexers/LexBasic.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexBatch.o: ../lexers/LexBatch.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexBibTeX.o: ../lexers/LexBibTeX.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexBullant.o: ../lexers/LexBullant.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCaml.o: ../lexers/LexCaml.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCLW.o: ../lexers/LexCLW.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCmake.o: ../lexers/LexCmake.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCOBOL.o: ../lexers/LexCOBOL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCoffeeScript.o: ../lexers/LexCoffeeScript.cxx ../include/Platform.h \ ../include/ILexer.h ../include/Sci_Position.h ../include/Scintilla.h \ ../include/SciLexer.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexConf.o: ../lexers/LexConf.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCPP.o: ../lexers/LexCPP.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h \ ../lexlib/SubStyles.h LexCrontab.o: ../lexers/LexCrontab.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCsound.o: ../lexers/LexCsound.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexCSS.o: ../lexers/LexCSS.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexD.o: ../lexers/LexD.cxx ../include/ILexer.h ../include/Sci_Position.h \ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \ ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexDiff.o: ../lexers/LexDiff.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexDMAP.o: ../lexers/LexDMAP.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexDMIS.o: ../lexers/LexDMIS.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h LexECL.o: ../lexers/LexECL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexEiffel.o: ../lexers/LexEiffel.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexErlang.o: ../lexers/LexErlang.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexErrorList.o: ../lexers/LexErrorList.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexEScript.o: ../lexers/LexEScript.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexFlagship.o: ../lexers/LexFlagship.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexForth.o: ../lexers/LexForth.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexFortran.o: ../lexers/LexFortran.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexGAP.o: ../lexers/LexGAP.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexGui4Cli.o: ../lexers/LexGui4Cli.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexHaskell.o: ../lexers/LexHaskell.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/CharacterCategory.h ../lexlib/LexerModule.h \ ../lexlib/OptionSet.h LexHex.o: ../lexers/LexHex.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexHTML.o: ../lexers/LexHTML.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/StringCopy.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexInno.o: ../lexers/LexInno.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexKix.o: ../lexers/LexKix.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexKVIrc.o: ../lexers/LexKVIrc.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexLaTeX.o: ../lexers/LexLaTeX.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/LexerBase.h LexLisp.o: ../lexers/LexLisp.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexLout.o: ../lexers/LexLout.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexLua.o: ../lexers/LexLua.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMagik.o: ../lexers/LexMagik.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMake.o: ../lexers/LexMake.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMarkdown.o: ../lexers/LexMarkdown.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMatlab.o: ../lexers/LexMatlab.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMetapost.o: ../lexers/LexMetapost.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMMIXAL.o: ../lexers/LexMMIXAL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexModula.o: ../lexers/LexModula.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMPT.o: ../lexers/LexMPT.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMSSQL.o: ../lexers/LexMSSQL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexMySQL.o: ../lexers/LexMySQL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexNimrod.o: ../lexers/LexNimrod.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexNsis.o: ../lexers/LexNsis.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexNull.o: ../lexers/LexNull.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexOpal.o: ../lexers/LexOpal.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexOScript.o: ../lexers/LexOScript.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPascal.o: ../lexers/LexPascal.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPB.o: ../lexers/LexPB.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPerl.o: ../lexers/LexPerl.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexPLM.o: ../lexers/LexPLM.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPO.o: ../lexers/LexPO.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPOV.o: ../lexers/LexPOV.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPowerPro.o: ../lexers/LexPowerPro.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPowerShell.o: ../lexers/LexPowerShell.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexProgress.o: ../lexers/LexProgress.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexProps.o: ../lexers/LexProps.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPS.o: ../lexers/LexPS.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexPython.o: ../lexers/LexPython.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SubStyles.h LexR.o: ../lexers/LexR.cxx ../include/ILexer.h ../include/Sci_Position.h \ ../include/Scintilla.h ../include/SciLexer.h ../lexlib/WordList.h \ ../lexlib/LexAccessor.h ../lexlib/Accessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h LexRebol.o: ../lexers/LexRebol.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexRegistry.o: ../lexers/LexRegistry.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/StyleContext.h \ ../lexlib/CharacterSet.h ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexRuby.o: ../lexers/LexRuby.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexRust.o: ../lexers/LexRust.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/PropSetSimple.h ../lexlib/WordList.h ../lexlib/LexAccessor.h \ ../lexlib/Accessor.h ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h LexScriptol.o: ../lexers/LexScriptol.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSmalltalk.o: ../lexers/LexSmalltalk.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSML.o: ../lexers/LexSML.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSorcus.o: ../lexers/LexSorcus.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSpecman.o: ../lexers/LexSpecman.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSpice.o: ../lexers/LexSpice.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexSQL.o: ../lexers/LexSQL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SparseState.h LexSTTXT.o: ../lexers/LexSTTXT.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTACL.o: ../lexers/LexTACL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTADS3.o: ../lexers/LexTADS3.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTAL.o: ../lexers/LexTAL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTCL.o: ../lexers/LexTCL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTCMD.o: ../lexers/LexTCMD.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTeX.o: ../lexers/LexTeX.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexTxt2tags.o: ../lexers/LexTxt2tags.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexVB.o: ../lexers/LexVB.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexVerilog.o: ../lexers/LexVerilog.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h ../lexlib/OptionSet.h ../lexlib/SubStyles.h LexVHDL.o: ../lexers/LexVHDL.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h LexVisualProlog.o: ../lexers/LexVisualProlog.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/CharacterCategory.h ../lexlib/LexerModule.h \ ../lexlib/OptionSet.h LexYAML.o: ../lexers/LexYAML.cxx ../include/ILexer.h \ ../include/Sci_Position.h ../include/Scintilla.h ../include/SciLexer.h \ ../lexlib/WordList.h ../lexlib/LexAccessor.h ../lexlib/Accessor.h \ ../lexlib/StyleContext.h ../lexlib/CharacterSet.h \ ../lexlib/LexerModule.h scintilla/gtk/PlatGTK.cxx0000644000175000017500000020131212534155227014264 0ustar neilneil// Scintilla source code edit control // PlatGTK.cxx - implementation of platform facilities on GTK+/Linux // Copyright 1998-2004 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Platform.h" #include "Scintilla.h" #include "ScintillaWidget.h" #include "StringCopy.h" #include "XPM.h" #include "UniConversion.h" #if defined(__clang__) // Clang 3.0 incorrectly displays sentinel warnings. Fixed by clang 3.1. #pragma GCC diagnostic ignored "-Wsentinel" #endif /* GLIB must be compiled with thread support, otherwise we will bail on trying to use locks, and that could lead to problems for someone. `glib-config --libs gthread` needs to be used to get the glib libraries for linking, otherwise g_thread_init will fail */ #define USE_LOCK defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) #include "Converter.h" #if GTK_CHECK_VERSION(2,20,0) #define IS_WIDGET_FOCUSSED(w) (gtk_widget_has_focus(GTK_WIDGET(w))) #else #define IS_WIDGET_FOCUSSED(w) (GTK_WIDGET_HAS_FOCUS(w)) #endif static const double kPi = 3.14159265358979323846; // The Pango version guard for pango_units_from_double and pango_units_to_double // is more complex than simply implementing these here. static int pangoUnitsFromDouble(double d) { return static_cast(d * PANGO_SCALE + 0.5); } static double doubleFromPangoUnits(int pu) { return static_cast(pu) / PANGO_SCALE; } static cairo_surface_t *CreateSimilarSurface(GdkWindow *window, cairo_content_t content, int width, int height) { #if GTK_CHECK_VERSION(2,22,0) return gdk_window_create_similar_surface(window, content, width, height); #else cairo_surface_t *window_surface, *surface; g_return_val_if_fail(GDK_IS_WINDOW(window), NULL); window_surface = GDK_DRAWABLE_GET_CLASS(window)->ref_cairo_surface(window); surface = cairo_surface_create_similar(window_surface, content, width, height); cairo_surface_destroy(window_surface); return surface; #endif } static GdkWindow *WindowFromWidget(GtkWidget *w) { #if GTK_CHECK_VERSION(3,0,0) return gtk_widget_get_window(w); #else return w->window; #endif } #ifdef _MSC_VER // Ignore unreferenced local functions in GTK+ headers #pragma warning(disable: 4505) #endif #ifdef SCI_NAMESPACE using namespace Scintilla; #endif enum encodingType { singleByte, UTF8, dbcs}; struct LOGFONT { int size; int weight; bool italic; int characterSet; char faceName[300]; }; #if USE_LOCK static GMutex *fontMutex = NULL; static void InitializeGLIBThreads() { #if !GLIB_CHECK_VERSION(2,31,0) if (!g_thread_supported()) { g_thread_init(NULL); } #endif } #endif static void FontMutexAllocate() { #if USE_LOCK if (!fontMutex) { InitializeGLIBThreads(); #if GLIB_CHECK_VERSION(2,31,0) fontMutex = g_new(GMutex, 1); g_mutex_init(fontMutex); #else fontMutex = g_mutex_new(); #endif } #endif } static void FontMutexFree() { #if USE_LOCK if (fontMutex) { #if GLIB_CHECK_VERSION(2,31,0) g_mutex_clear(fontMutex); g_free(fontMutex); #else g_mutex_free(fontMutex); #endif fontMutex = NULL; } #endif } static void FontMutexLock() { #if USE_LOCK g_mutex_lock(fontMutex); #endif } static void FontMutexUnlock() { #if USE_LOCK if (fontMutex) { g_mutex_unlock(fontMutex); } #endif } // Holds a PangoFontDescription*. class FontHandle { XYPOSITION width[128]; encodingType et; public: int ascent; PangoFontDescription *pfd; int characterSet; FontHandle() : et(singleByte), ascent(0), pfd(0), characterSet(-1) { ResetWidths(et); } FontHandle(PangoFontDescription *pfd_, int characterSet_) { et = singleByte; ascent = 0; pfd = pfd_; characterSet = characterSet_; ResetWidths(et); } ~FontHandle() { if (pfd) pango_font_description_free(pfd); pfd = 0; } void ResetWidths(encodingType et_) { et = et_; for (int i=0; i<=127; i++) { width[i] = 0; } } XYPOSITION CharWidth(unsigned char ch, encodingType et_) const { XYPOSITION w = 0; FontMutexLock(); if ((ch <= 127) && (et == et_)) { w = width[ch]; } FontMutexUnlock(); return w; } void SetCharWidth(unsigned char ch, XYPOSITION w, encodingType et_) { if (ch <= 127) { FontMutexLock(); if (et != et_) { ResetWidths(et_); } width[ch] = w; FontMutexUnlock(); } } }; // X has a 16 bit coordinate space, so stop drawing here to avoid wrapping static const int maxCoordinate = 32000; static FontHandle *PFont(Font &f) { return reinterpret_cast(f.GetID()); } static GtkWidget *PWidget(WindowID wid) { return reinterpret_cast(wid); } Point Point::FromLong(long lpoint) { return Point( Platform::LowShortFromLong(lpoint), Platform::HighShortFromLong(lpoint)); } static void SetLogFont(LOGFONT &lf, const char *faceName, int characterSet, float size, int weight, bool italic) { lf = LOGFONT(); lf.size = size; lf.weight = weight; lf.italic = italic; lf.characterSet = characterSet; StringCopy(lf.faceName, faceName); } /** * Create a hash from the parameters for a font to allow easy checking for identity. * If one font is the same as another, its hash will be the same, but if the hash is the * same then they may still be different. */ static int HashFont(const FontParameters &fp) { return static_cast(fp.size+0.5) ^ (fp.characterSet << 10) ^ ((fp.weight / 100) << 12) ^ (fp.italic ? 0x20000000 : 0) ^ fp.faceName[0]; } class FontCached : Font { FontCached *next; int usage; LOGFONT lf; int hash; explicit FontCached(const FontParameters &fp); ~FontCached() {} bool SameAs(const FontParameters &fp); virtual void Release(); static FontID CreateNewFont(const FontParameters &fp); static FontCached *first; public: static FontID FindOrCreate(const FontParameters &fp); static void ReleaseId(FontID fid_); static void ReleaseAll(); }; FontCached *FontCached::first = 0; FontCached::FontCached(const FontParameters &fp) : next(0), usage(0), hash(0) { ::SetLogFont(lf, fp.faceName, fp.characterSet, fp.size, fp.weight, fp.italic); hash = HashFont(fp); fid = CreateNewFont(fp); usage = 1; } bool FontCached::SameAs(const FontParameters &fp) { return lf.size == fp.size && lf.weight == fp.weight && lf.italic == fp.italic && lf.characterSet == fp.characterSet && 0 == strcmp(lf.faceName, fp.faceName); } void FontCached::Release() { if (fid) delete PFont(*this); fid = 0; } FontID FontCached::FindOrCreate(const FontParameters &fp) { FontID ret = 0; FontMutexLock(); int hashFind = HashFont(fp); for (FontCached *cur = first; cur; cur = cur->next) { if ((cur->hash == hashFind) && cur->SameAs(fp)) { cur->usage++; ret = cur->fid; } } if (ret == 0) { FontCached *fc = new FontCached(fp); fc->next = first; first = fc; ret = fc->fid; } FontMutexUnlock(); return ret; } void FontCached::ReleaseId(FontID fid_) { FontMutexLock(); FontCached **pcur = &first; for (FontCached *cur = first; cur; cur = cur->next) { if (cur->fid == fid_) { cur->usage--; if (cur->usage == 0) { *pcur = cur->next; cur->Release(); cur->next = 0; delete cur; } break; } pcur = &cur->next; } FontMutexUnlock(); } void FontCached::ReleaseAll() { while (first) { ReleaseId(first->GetID()); } } FontID FontCached::CreateNewFont(const FontParameters &fp) { PangoFontDescription *pfd = pango_font_description_new(); if (pfd) { pango_font_description_set_family(pfd, (fp.faceName[0] == '!') ? fp.faceName+1 : fp.faceName); pango_font_description_set_size(pfd, pangoUnitsFromDouble(fp.size)); pango_font_description_set_weight(pfd, static_cast(fp.weight)); pango_font_description_set_style(pfd, fp.italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL); return new FontHandle(pfd, fp.characterSet); } return new FontHandle(); } Font::Font() : fid(0) {} Font::~Font() {} void Font::Create(const FontParameters &fp) { Release(); fid = FontCached::FindOrCreate(fp); } void Font::Release() { if (fid) FontCached::ReleaseId(fid); fid = 0; } // Required on OS X #ifdef SCI_NAMESPACE namespace Scintilla { #endif // SurfaceID is a cairo_t* class SurfaceImpl : public Surface { encodingType et; cairo_t *context; cairo_surface_t *psurf; int x; int y; bool inited; bool createdGC; PangoContext *pcontext; PangoLayout *layout; Converter conv; int characterSet; void SetConverter(int characterSet_); public: SurfaceImpl(); virtual ~SurfaceImpl(); void Init(WindowID wid); void Init(SurfaceID sid, WindowID wid); void InitPixMap(int width, int height, Surface *surface_, WindowID wid); void Release(); bool Initialised(); void PenColour(ColourDesired fore); int LogPixelsY(); int DeviceHeightFont(int points); void MoveTo(int x_, int y_); void LineTo(int x_, int y_); void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back); void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back); void FillRectangle(PRectangle rc, ColourDesired back); void FillRectangle(PRectangle rc, Surface &surfacePattern); void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back); void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags); void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage); void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back); void Copy(PRectangle rc, Point from, Surface &surfaceSource); void DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore); void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore); void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions); XYPOSITION WidthText(Font &font_, const char *s, int len); XYPOSITION WidthChar(Font &font_, char ch); XYPOSITION Ascent(Font &font_); XYPOSITION Descent(Font &font_); XYPOSITION InternalLeading(Font &font_); XYPOSITION ExternalLeading(Font &font_); XYPOSITION Height(Font &font_); XYPOSITION AverageCharWidth(Font &font_); void SetClip(PRectangle rc); void FlushCachedState(); void SetUnicodeMode(bool unicodeMode_); void SetDBCSMode(int codePage); }; #ifdef SCI_NAMESPACE } #endif const char *CharacterSetID(int characterSet) { switch (characterSet) { case SC_CHARSET_ANSI: return ""; case SC_CHARSET_DEFAULT: return "ISO-8859-1"; case SC_CHARSET_BALTIC: return "ISO-8859-13"; case SC_CHARSET_CHINESEBIG5: return "BIG-5"; case SC_CHARSET_EASTEUROPE: return "ISO-8859-2"; case SC_CHARSET_GB2312: return "CP936"; case SC_CHARSET_GREEK: return "ISO-8859-7"; case SC_CHARSET_HANGUL: return "CP949"; case SC_CHARSET_MAC: return "MACINTOSH"; case SC_CHARSET_OEM: return "ASCII"; case SC_CHARSET_RUSSIAN: return "KOI8-R"; case SC_CHARSET_CYRILLIC: return "CP1251"; case SC_CHARSET_SHIFTJIS: return "SHIFT-JIS"; case SC_CHARSET_SYMBOL: return ""; case SC_CHARSET_TURKISH: return "ISO-8859-9"; case SC_CHARSET_JOHAB: return "CP1361"; case SC_CHARSET_HEBREW: return "ISO-8859-8"; case SC_CHARSET_ARABIC: return "ISO-8859-6"; case SC_CHARSET_VIETNAMESE: return ""; case SC_CHARSET_THAI: return "ISO-8859-11"; case SC_CHARSET_8859_15: return "ISO-8859-15"; default: return ""; } } void SurfaceImpl::SetConverter(int characterSet_) { if (characterSet != characterSet_) { characterSet = characterSet_; conv.Open("UTF-8", CharacterSetID(characterSet), false); } } SurfaceImpl::SurfaceImpl() : et(singleByte), context(0), psurf(0), x(0), y(0), inited(false), createdGC(false) , pcontext(0), layout(0), characterSet(-1) { } SurfaceImpl::~SurfaceImpl() { Release(); } void SurfaceImpl::Release() { et = singleByte; if (createdGC) { createdGC = false; cairo_destroy(context); } context = 0; if (psurf) cairo_surface_destroy(psurf); psurf = 0; if (layout) g_object_unref(layout); layout = 0; if (pcontext) g_object_unref(pcontext); pcontext = 0; conv.Close(); characterSet = -1; x = 0; y = 0; inited = false; createdGC = false; } bool SurfaceImpl::Initialised() { #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0) if (inited && context) { if (cairo_status(context) == CAIRO_STATUS_SUCCESS) { // Even when status is success, the target surface may have been // finished whch may cause an assertion to fail crashing the application. // The cairo_surface_has_show_text_glyphs call checks the finished flag // and when set, sets the status to CAIRO_STATUS_SURFACE_FINISHED // which leads to warning messages instead of crashes. // Performing the check in this method as it is called rarely and has no // other side effects. cairo_surface_t *psurfContext = cairo_get_target(context); if (psurfContext) { cairo_surface_has_show_text_glyphs(psurfContext); } } return cairo_status(context) == CAIRO_STATUS_SUCCESS; } #endif return inited; } void SurfaceImpl::Init(WindowID wid) { Release(); PLATFORM_ASSERT(wid); // if we are only created from a window ID, we can't perform drawing psurf = 0; context = 0; createdGC = false; pcontext = gtk_widget_create_pango_context(PWidget(wid)); PLATFORM_ASSERT(pcontext); layout = pango_layout_new(pcontext); PLATFORM_ASSERT(layout); inited = true; } void SurfaceImpl::Init(SurfaceID sid, WindowID wid) { PLATFORM_ASSERT(sid); Release(); PLATFORM_ASSERT(wid); context = cairo_reference(reinterpret_cast(sid)); pcontext = gtk_widget_create_pango_context(PWidget(wid)); // update the Pango context in case sid isn't the widget's surface pango_cairo_update_context(context, pcontext); layout = pango_layout_new(pcontext); cairo_set_line_width(context, 1); createdGC = true; inited = true; } void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID wid) { PLATFORM_ASSERT(surface_); Release(); SurfaceImpl *surfImpl = static_cast(surface_); PLATFORM_ASSERT(wid); context = cairo_reference(surfImpl->context); pcontext = gtk_widget_create_pango_context(PWidget(wid)); // update the Pango context in case surface_ isn't the widget's surface pango_cairo_update_context(context, pcontext); PLATFORM_ASSERT(pcontext); layout = pango_layout_new(pcontext); PLATFORM_ASSERT(layout); if (height > 0 && width > 0) psurf = CreateSimilarSurface( WindowFromWidget(PWidget(wid)), CAIRO_CONTENT_COLOR_ALPHA, width, height); cairo_destroy(context); context = cairo_create(psurf); cairo_rectangle(context, 0, 0, width, height); cairo_set_source_rgb(context, 1.0, 0, 0); cairo_fill(context); // This produces sharp drawing more similar to GDK: //cairo_set_antialias(context, CAIRO_ANTIALIAS_NONE); cairo_set_line_width(context, 1); createdGC = true; inited = true; et = surfImpl->et; } void SurfaceImpl::PenColour(ColourDesired fore) { if (context) { ColourDesired cdFore(fore.AsLong()); cairo_set_source_rgb(context, cdFore.GetRed() / 255.0, cdFore.GetGreen() / 255.0, cdFore.GetBlue() / 255.0); } } int SurfaceImpl::LogPixelsY() { return 72; } int SurfaceImpl::DeviceHeightFont(int points) { int logPix = LogPixelsY(); return (points * logPix + logPix / 2) / 72; } void SurfaceImpl::MoveTo(int x_, int y_) { x = x_; y = y_; } static int Delta(int difference) { if (difference < 0) return -1; else if (difference > 0) return 1; else return 0; } void SurfaceImpl::LineTo(int x_, int y_) { // cairo_line_to draws the end position, unlike Win32 or GDK with GDK_CAP_NOT_LAST. // For simple cases, move back one pixel from end. if (context) { int xDiff = x_ - x; int xDelta = Delta(xDiff); int yDiff = y_ - y; int yDelta = Delta(yDiff); if ((xDiff == 0) || (yDiff == 0)) { // Horizontal or vertical lines can be more precisely drawn as a filled rectangle int xEnd = x_ - xDelta; int left = Platform::Minimum(x, xEnd); int width = abs(x - xEnd) + 1; int yEnd = y_ - yDelta; int top = Platform::Minimum(y, yEnd); int height = abs(y - yEnd) + 1; cairo_rectangle(context, left, top, width, height); cairo_fill(context); } else if ((abs(xDiff) == abs(yDiff))) { // 45 degree slope cairo_move_to(context, x + 0.5, y + 0.5); cairo_line_to(context, x_ + 0.5 - xDelta, y_ + 0.5 - yDelta); } else { // Line has a different slope so difficult to avoid last pixel cairo_move_to(context, x + 0.5, y + 0.5); cairo_line_to(context, x_ + 0.5, y_ + 0.5); } cairo_stroke(context); } x = x_; y = y_; } void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) { PLATFORM_ASSERT(context); PenColour(back); cairo_move_to(context, pts[0].x + 0.5, pts[0].y + 0.5); for (int i = 1; i < npts; i++) { cairo_line_to(context, pts[i].x + 0.5, pts[i].y + 0.5); } cairo_close_path(context); cairo_fill_preserve(context); PenColour(fore); cairo_stroke(context); } void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) { if (context) { cairo_rectangle(context, rc.left + 0.5, rc.top + 0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1); PenColour(back); cairo_fill_preserve(context); PenColour(fore); cairo_stroke(context); } } void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) { PenColour(back); if (context && (rc.left < maxCoordinate)) { // Protect against out of range rc.left = lround(rc.left); rc.right = lround(rc.right); cairo_rectangle(context, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); cairo_fill(context); } } void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { SurfaceImpl &surfi = static_cast(surfacePattern); bool canDraw = surfi.psurf != NULL; if (canDraw) { PLATFORM_ASSERT(context); // Tile pattern over rectangle // Currently assumes 8x8 pattern int widthPat = 8; int heightPat = 8; for (int xTile = rc.left; xTile < rc.right; xTile += widthPat) { int widthx = (xTile + widthPat > rc.right) ? rc.right - xTile : widthPat; for (int yTile = rc.top; yTile < rc.bottom; yTile += heightPat) { int heighty = (yTile + heightPat > rc.bottom) ? rc.bottom - yTile : heightPat; cairo_set_source_surface(context, surfi.psurf, xTile, yTile); cairo_rectangle(context, xTile, yTile, widthx, heighty); cairo_fill(context); } } } else { // Something is wrong so try to show anyway // Shows up black because colour not allocated FillRectangle(rc, ColourDesired(0)); } } void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) { if (((rc.right - rc.left) > 4) && ((rc.bottom - rc.top) > 4)) { // Approximate a round rect with some cut off corners Point pts[] = { Point(rc.left + 2, rc.top), Point(rc.right - 2, rc.top), Point(rc.right, rc.top + 2), Point(rc.right, rc.bottom - 2), Point(rc.right - 2, rc.bottom), Point(rc.left + 2, rc.bottom), Point(rc.left, rc.bottom - 2), Point(rc.left, rc.top + 2), }; Polygon(pts, ELEMENTS(pts), fore, back); } else { RectangleDraw(rc, fore, back); } } static void PathRoundRectangle(cairo_t *context, double left, double top, double width, double height, int radius) { double degrees = kPi / 180.0; #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0) cairo_new_sub_path(context); #else // First arc is in the top-right corner and starts from a point on the top line cairo_move_to(context, left + width - radius, top); #endif cairo_arc(context, left + width - radius, top + radius, radius, -90 * degrees, 0 * degrees); cairo_arc(context, left + width - radius, top + height - radius, radius, 0 * degrees, 90 * degrees); cairo_arc(context, left + radius, top + height - radius, radius, 90 * degrees, 180 * degrees); cairo_arc(context, left + radius, top + radius, radius, 180 * degrees, 270 * degrees); cairo_close_path(context); } void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags) { if (context && rc.Width() > 0) { ColourDesired cdFill(fill.AsLong()); cairo_set_source_rgba(context, cdFill.GetRed() / 255.0, cdFill.GetGreen() / 255.0, cdFill.GetBlue() / 255.0, alphaFill / 255.0); if (cornerSize > 0) PathRoundRectangle(context, rc.left + 1.0, rc.top + 1.0, rc.right - rc.left - 2.0, rc.bottom - rc.top - 2.0, cornerSize); else cairo_rectangle(context, rc.left + 1.0, rc.top + 1.0, rc.right - rc.left - 2.0, rc.bottom - rc.top - 2.0); cairo_fill(context); ColourDesired cdOutline(outline.AsLong()); cairo_set_source_rgba(context, cdOutline.GetRed() / 255.0, cdOutline.GetGreen() / 255.0, cdOutline.GetBlue() / 255.0, alphaOutline / 255.0); if (cornerSize > 0) PathRoundRectangle(context, rc.left + 0.5, rc.top + 0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1, cornerSize); else cairo_rectangle(context, rc.left + 0.5, rc.top + 0.5, rc.right - rc.left - 1, rc.bottom - rc.top - 1); cairo_stroke(context); } } void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) { PLATFORM_ASSERT(context); if (rc.Width() > width) rc.left += (rc.Width() - width) / 2; rc.right = rc.left + width; if (rc.Height() > height) rc.top += (rc.Height() - height) / 2; rc.bottom = rc.top + height; #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0) int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); #else int stride = width * 4; #endif int ucs = stride * height; std::vector image(ucs); for (int iy=0; iy(surfaceSource); bool canDraw = surfi.psurf != NULL; if (canDraw) { PLATFORM_ASSERT(context); cairo_set_source_surface(context, surfi.psurf, rc.left - from.x, rc.top - from.y); cairo_rectangle(context, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top); cairo_fill(context); } } std::string UTF8FromLatin1(const char *s, int len) { std::string utfForm(len*2 + 1, '\0'); size_t lenU = 0; for (int i=0; i(s[i]); if (uch < 0x80) { utfForm[lenU++] = uch; } else { utfForm[lenU++] = static_cast(0xC0 | (uch >> 6)); utfForm[lenU++] = static_cast(0x80 | (uch & 0x3f)); } } utfForm.resize(lenU); return utfForm; } static std::string UTF8FromIconv(const Converter &conv, const char *s, int len) { if (conv) { std::string utfForm(len*3+1, '\0'); char *pin = const_cast(s); size_t inLeft = len; char *putf = &utfForm[0]; char *pout = putf; size_t outLeft = len*3+1; size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); if (conversions != ((size_t)(-1))) { *pout = '\0'; utfForm.resize(pout - putf); return utfForm; } } return std::string(); } // Work out how many bytes are in a character by trying to convert using iconv, // returning the first length that succeeds. static size_t MultiByteLenFromIconv(const Converter &conv, const char *s, size_t len) { for (size_t lenMB=1; (lenMB<4) && (lenMB <= len); lenMB++) { char wcForm[2]; char *pin = const_cast(s); size_t inLeft = lenMB; char *pout = wcForm; size_t outLeft = 2; size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); if (conversions != ((size_t)(-1))) { return lenMB; } } return 1; } void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore) { PenColour(fore); if (context) { XYPOSITION xText = rc.left; if (PFont(font_)->pfd) { std::string utfForm; if (et == UTF8) { pango_layout_set_text(layout, s, len); } else { SetConverter(PFont(font_)->characterSet); utfForm = UTF8FromIconv(conv, s, len); if (utfForm.empty()) { // iconv failed so treat as Latin1 utfForm = UTF8FromLatin1(s, len); } pango_layout_set_text(layout, utfForm.c_str(), utfForm.length()); } pango_layout_set_font_description(layout, PFont(font_)->pfd); pango_cairo_update_layout(context, layout); #ifdef PANGO_VERSION PangoLayoutLine *pll = pango_layout_get_line_readonly(layout,0); #else PangoLayoutLine *pll = pango_layout_get_line(layout,0); #endif cairo_move_to(context, xText, ybase); pango_cairo_show_layout_line(context, pll); } } } void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { FillRectangle(rc, back); DrawTextBase(rc, font_, ybase, s, len, fore); } // On GTK+, exactly same as DrawTextNoClip void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) { FillRectangle(rc, back); DrawTextBase(rc, font_, ybase, s, len, fore); } void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore) { // Avoid drawing spaces in transparent mode for (int i=0; ipfd) { if (len == 1) { int width = PFont(font_)->CharWidth(*s, et); if (width) { positions[0] = width; return; } } pango_layout_set_font_description(layout, PFont(font_)->pfd); if (et == UTF8) { // Simple and direct as UTF-8 is native Pango encoding int i = 0; pango_layout_set_text(layout, s, len); ClusterIterator iti(layout, lenPositions); while (!iti.finished) { iti.Next(); int places = iti.curIndex - i; while (i < iti.curIndex) { // Evenly distribute space among bytes of this cluster. // Would be better to find number of characters and then // divide evenly between characters with each byte of a character // being at the same position. positions[i] = iti.position - (iti.curIndex - 1 - i) * iti.distance / places; i++; } } PLATFORM_ASSERT(i == lenPositions); } else { int positionsCalculated = 0; if (et == dbcs) { SetConverter(PFont(font_)->characterSet); std::string utfForm = UTF8FromIconv(conv, s, len); if (!utfForm.empty()) { // Convert to UTF-8 so can ask Pango for widths, then // Loop through UTF-8 and DBCS forms, taking account of different // character byte lengths. Converter convMeasure("UCS-2", CharacterSetID(characterSet), false); pango_layout_set_text(layout, utfForm.c_str(), strlen(utfForm.c_str())); int i = 0; int clusterStart = 0; ClusterIterator iti(layout, strlen(utfForm.c_str())); while (!iti.finished) { iti.Next(); int clusterEnd = iti.curIndex; int places = g_utf8_strlen(utfForm.c_str() + clusterStart, clusterEnd - clusterStart); int place = 1; while (clusterStart < clusterEnd) { size_t lenChar = MultiByteLenFromIconv(convMeasure, s+i, len-i); while (lenChar--) { positions[i++] = iti.position - (places - place) * iti.distance / places; positionsCalculated++; } clusterStart += UTF8CharLength(static_cast(utfForm.c_str()[clusterStart])); place++; } } PLATFORM_ASSERT(i == lenPositions); } } if (positionsCalculated < 1 ) { // Either 8-bit or DBCS conversion failed so treat as 8-bit. SetConverter(PFont(font_)->characterSet); const bool rtlCheck = PFont(font_)->characterSet == SC_CHARSET_HEBREW || PFont(font_)->characterSet == SC_CHARSET_ARABIC; std::string utfForm = UTF8FromIconv(conv, s, len); if (utfForm.empty()) { utfForm = UTF8FromLatin1(s, len); } pango_layout_set_text(layout, utfForm.c_str(), utfForm.length()); int i = 0; int clusterStart = 0; // Each 8-bit input character may take 1 or 2 bytes in UTF-8 // and groups of up to 3 may be represented as ligatures. ClusterIterator iti(layout, utfForm.length()); while (!iti.finished) { iti.Next(); int clusterEnd = iti.curIndex; int ligatureLength = g_utf8_strlen(utfForm.c_str() + clusterStart, clusterEnd - clusterStart); if (rtlCheck && ((clusterEnd <= clusterStart) || (ligatureLength == 0) || (ligatureLength > 3))) { // Something has gone wrong: exit quickly but pretend all the characters are equally spaced: int widthLayout = 0; pango_layout_get_size(layout, &widthLayout, NULL); XYPOSITION widthTotal = doubleFromPangoUnits(widthLayout); for (int bytePos=0; bytePos 0 && ligatureLength <= 3); for (int charInLig=0; charInLigSetCharWidth(*s, positions[0], et); } return; } } else { // No font so return an ascending range of values for (int i = 0; i < len; i++) { positions[i] = i + 1; } } } XYPOSITION SurfaceImpl::WidthText(Font &font_, const char *s, int len) { if (font_.GetID()) { if (PFont(font_)->pfd) { std::string utfForm; pango_layout_set_font_description(layout, PFont(font_)->pfd); PangoRectangle pos; if (et == UTF8) { pango_layout_set_text(layout, s, len); } else { SetConverter(PFont(font_)->characterSet); utfForm = UTF8FromIconv(conv, s, len); if (utfForm.empty()) { // iconv failed so treat as Latin1 utfForm = UTF8FromLatin1(s, len); } pango_layout_set_text(layout, utfForm.c_str(), utfForm.length()); } #ifdef PANGO_VERSION PangoLayoutLine *pangoLine = pango_layout_get_line_readonly(layout,0); #else PangoLayoutLine *pangoLine = pango_layout_get_line(layout,0); #endif pango_layout_line_get_extents(pangoLine, NULL, &pos); return doubleFromPangoUnits(pos.width); } return 1; } else { return 1; } } XYPOSITION SurfaceImpl::WidthChar(Font &font_, char ch) { if (font_.GetID()) { if (PFont(font_)->pfd) { return WidthText(font_, &ch, 1); } return 1; } else { return 1; } } // Ascent and descent determined by Pango font metrics. XYPOSITION SurfaceImpl::Ascent(Font &font_) { if (!(font_.GetID())) return 1; FontMutexLock(); int ascent = PFont(font_)->ascent; if ((ascent == 0) && (PFont(font_)->pfd)) { PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, PFont(font_)->pfd, pango_context_get_language(pcontext)); PFont(font_)->ascent = doubleFromPangoUnits(pango_font_metrics_get_ascent(metrics)); pango_font_metrics_unref(metrics); ascent = PFont(font_)->ascent; } if (ascent == 0) { ascent = 1; } FontMutexUnlock(); return ascent; } XYPOSITION SurfaceImpl::Descent(Font &font_) { if (!(font_.GetID())) return 1; if (PFont(font_)->pfd) { PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, PFont(font_)->pfd, pango_context_get_language(pcontext)); int descent = doubleFromPangoUnits(pango_font_metrics_get_descent(metrics)); pango_font_metrics_unref(metrics); return descent; } return 0; } XYPOSITION SurfaceImpl::InternalLeading(Font &) { return 0; } XYPOSITION SurfaceImpl::ExternalLeading(Font &) { return 0; } XYPOSITION SurfaceImpl::Height(Font &font_) { return Ascent(font_) + Descent(font_); } XYPOSITION SurfaceImpl::AverageCharWidth(Font &font_) { return WidthChar(font_, 'n'); } void SurfaceImpl::SetClip(PRectangle rc) { PLATFORM_ASSERT(context); cairo_rectangle(context, rc.left, rc.top, rc.right, rc.bottom); cairo_clip(context); } void SurfaceImpl::FlushCachedState() {} void SurfaceImpl::SetUnicodeMode(bool unicodeMode_) { if (unicodeMode_) et = UTF8; } void SurfaceImpl::SetDBCSMode(int codePage) { if (codePage && (codePage != SC_CP_UTF8)) et = dbcs; } Surface *Surface::Allocate(int) { return new SurfaceImpl(); } Window::~Window() {} void Window::Destroy() { if (wid) { ListBox *listbox = dynamic_cast(this); if (listbox) { gtk_widget_hide(GTK_WIDGET(wid)); // clear up window content listbox->Clear(); // resize the window to the smallest possible size for it to adapt // to future content gtk_window_resize(GTK_WINDOW(wid), 1, 1); } else { gtk_widget_destroy(GTK_WIDGET(wid)); } wid = 0; } } bool Window::HasFocus() { return IS_WIDGET_FOCUSSED(wid); } PRectangle Window::GetPosition() { // Before any size allocated pretend its 1000 wide so not scrolled PRectangle rc(0, 0, 1000, 1000); if (wid) { GtkAllocation allocation; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_allocation(PWidget(wid), &allocation); #else allocation = PWidget(wid)->allocation; #endif rc.left = allocation.x; rc.top = allocation.y; if (allocation.width > 20) { rc.right = rc.left + allocation.width; rc.bottom = rc.top + allocation.height; } } return rc; } void Window::SetPosition(PRectangle rc) { GtkAllocation alloc; alloc.x = rc.left; alloc.y = rc.top; alloc.width = rc.Width(); alloc.height = rc.Height(); gtk_widget_size_allocate(PWidget(wid), &alloc); } void Window::SetPositionRelative(PRectangle rc, Window relativeTo) { int ox = 0; int oy = 0; gdk_window_get_origin(WindowFromWidget(PWidget(relativeTo.wid)), &ox, &oy); ox += rc.left; if (ox < 0) ox = 0; oy += rc.top; if (oy < 0) oy = 0; /* do some corrections to fit into screen */ int sizex = rc.right - rc.left; int sizey = rc.bottom - rc.top; int screenWidth = gdk_screen_width(); int screenHeight = gdk_screen_height(); if (sizex > screenWidth) ox = 0; /* the best we can do */ else if (ox + sizex > screenWidth) ox = screenWidth - sizex; if (oy + sizey > screenHeight) oy = screenHeight - sizey; gtk_window_move(GTK_WINDOW(PWidget(wid)), ox, oy); gtk_window_resize(GTK_WINDOW(wid), sizex, sizey); } PRectangle Window::GetClientPosition() { // On GTK+, the client position is the window position return GetPosition(); } void Window::Show(bool show) { if (show) gtk_widget_show(PWidget(wid)); } void Window::InvalidateAll() { if (wid) { gtk_widget_queue_draw(PWidget(wid)); } } void Window::InvalidateRectangle(PRectangle rc) { if (wid) { gtk_widget_queue_draw_area(PWidget(wid), rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); } } void Window::SetFont(Font &) { // Can not be done generically but only needed for ListBox } void Window::SetCursor(Cursor curs) { // We don't set the cursor to same value numerous times under gtk because // it stores the cursor in the window once it's set if (curs == cursorLast) return; cursorLast = curs; GdkDisplay *pdisplay = gtk_widget_get_display(PWidget(wid)); GdkCursor *gdkCurs; switch (curs) { case cursorText: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_XTERM); break; case cursorArrow: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR); break; case cursorUp: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_CENTER_PTR); break; case cursorWait: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_WATCH); break; case cursorHand: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_HAND2); break; case cursorReverseArrow: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_RIGHT_PTR); break; default: gdkCurs = gdk_cursor_new_for_display(pdisplay, GDK_LEFT_PTR); cursorLast = cursorArrow; break; } if (WindowFromWidget(PWidget(wid))) gdk_window_set_cursor(WindowFromWidget(PWidget(wid)), gdkCurs); #if GTK_CHECK_VERSION(3,0,0) g_object_unref(gdkCurs); #else gdk_cursor_unref(gdkCurs); #endif } void Window::SetTitle(const char *s) { gtk_window_set_title(GTK_WINDOW(wid), s); } /* Returns rectangle of monitor pt is on, both rect and pt are in Window's gdk window coordinates */ PRectangle Window::GetMonitorRect(Point pt) { gint x_offset, y_offset; gdk_window_get_origin(WindowFromWidget(PWidget(wid)), &x_offset, &y_offset); GdkScreen* screen; gint monitor_num; GdkRectangle rect; screen = gtk_widget_get_screen(PWidget(wid)); monitor_num = gdk_screen_get_monitor_at_point(screen, pt.x + x_offset, pt.y + y_offset); gdk_screen_get_monitor_geometry(screen, monitor_num, &rect); rect.x -= x_offset; rect.y -= y_offset; return PRectangle(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); } typedef std::map ImageMap; struct ListImage { const RGBAImage *rgba_data; GdkPixbuf *pixbuf; }; static void list_image_free(gpointer, gpointer value, gpointer) { ListImage *list_image = static_cast(value); if (list_image->pixbuf) g_object_unref(list_image->pixbuf); g_free(list_image); } ListBox::ListBox() { } ListBox::~ListBox() { } enum { PIXBUF_COLUMN, TEXT_COLUMN, N_COLUMNS }; class ListBoxX : public ListBox { WindowID widCached; WindowID frame; WindowID list; WindowID scroller; void *pixhash; GtkCellRenderer* pixbuf_renderer; RGBAImageSet images; int desiredVisibleRows; unsigned int maxItemCharacters; unsigned int aveCharWidth; public: CallBackAction doubleClickAction; void *doubleClickActionData; ListBoxX() : widCached(0), frame(0), list(0), scroller(0), pixhash(NULL), pixbuf_renderer(0), desiredVisibleRows(5), maxItemCharacters(0), aveCharWidth(1), doubleClickAction(NULL), doubleClickActionData(NULL) { } virtual ~ListBoxX() { if (pixhash) { g_hash_table_foreach((GHashTable *) pixhash, list_image_free, NULL); g_hash_table_destroy((GHashTable *) pixhash); } if (widCached) { gtk_widget_destroy(GTK_WIDGET(widCached)); wid = widCached = 0; } } virtual void SetFont(Font &font); virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int technology_); virtual void SetAverageCharWidth(int width); virtual void SetVisibleRows(int rows); virtual int GetVisibleRows() const; int GetRowHeight(); virtual PRectangle GetDesiredRect(); virtual int CaretFromEdge(); virtual void Clear(); virtual void Append(char *s, int type = -1); virtual int Length(); virtual void Select(int n); virtual int GetSelection(); virtual int Find(const char *prefix); virtual void GetValue(int n, char *value, int len); void RegisterRGBA(int type, RGBAImage *image); virtual void RegisterImage(int type, const char *xpm_data); virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage); virtual void ClearRegisteredImages(); virtual void SetDoubleClickAction(CallBackAction action, void *data) { doubleClickAction = action; doubleClickActionData = data; } virtual void SetList(const char *listText, char separator, char typesep); }; ListBox *ListBox::Allocate() { ListBoxX *lb = new ListBoxX(); return lb; } // SmallScroller, a GtkScrolledWindow that can shrink very small, as // gtk_widget_set_size_request() cannot shrink widgets on GTK3 typedef struct { GtkScrolledWindow parent; /* Workaround ABI issue with Windows GTK2 bundle and GCC > 3. See http://lists.geany.org/pipermail/devel/2015-April/thread.html#9379 GtkScrolledWindow contains a bitfield, and GCC 3.4 and 4.8 don't agree on the size of the structure (regardless of -mms-bitfields): - GCC 3.4 has sizeof(GtkScrolledWindow)=88 - GCC 4.8 has sizeof(GtkScrolledWindow)=84 As Windows GTK2 bundle is built with GCC 3, it requires types derived from GtkScrolledWindow to be at least 88 bytes, which means we need to add some fake padding to fill in the extra 4 bytes. There is however no other issue with the layout difference as we never access any GtkScrolledWindow fields ourselves. */ int padding; } SmallScroller; typedef GtkScrolledWindowClass SmallScrollerClass; G_DEFINE_TYPE(SmallScroller, small_scroller, GTK_TYPE_SCROLLED_WINDOW) #if GTK_CHECK_VERSION(3,0,0) static void small_scroller_get_preferred_height(GtkWidget *widget, gint *min, gint *nat) { GTK_WIDGET_CLASS(small_scroller_parent_class)->get_preferred_height(widget, min, nat); if (*min > 1) *min = 1; } #else static void small_scroller_size_request(GtkWidget *widget, GtkRequisition *req) { GTK_WIDGET_CLASS(small_scroller_parent_class)->size_request(widget, req); req->height = 1; } #endif static void small_scroller_class_init(SmallScrollerClass *klass) { #if GTK_CHECK_VERSION(3,0,0) GTK_WIDGET_CLASS(klass)->get_preferred_height = small_scroller_get_preferred_height; #else GTK_WIDGET_CLASS(klass)->size_request = small_scroller_size_request; #endif } static void small_scroller_init(SmallScroller *){} static gboolean ButtonPress(GtkWidget *, GdkEventButton* ev, gpointer p) { try { ListBoxX* lb = reinterpret_cast(p); if (ev->type == GDK_2BUTTON_PRESS && lb->doubleClickAction != NULL) { lb->doubleClickAction(lb->doubleClickActionData); return TRUE; } } catch (...) { // No pointer back to Scintilla to save status } return FALSE; } /* Change the active color to the selected color so the listbox uses the color scheme that it would use if it had the focus. */ static void StyleSet(GtkWidget *w, GtkStyle*, void*) { g_return_if_fail(w != NULL); /* Copy the selected color to active. Note that the modify calls will cause recursive calls to this function after the value is updated and w->style to be set to a new object */ #if GTK_CHECK_VERSION(3,0,0) GtkStyleContext *styleContext = gtk_widget_get_style_context(w); if (styleContext == NULL) return; GdkRGBA colourForeSelected; gtk_style_context_get_color(styleContext, GTK_STATE_FLAG_SELECTED, &colourForeSelected); GdkRGBA colourForeActive; gtk_style_context_get_color(styleContext, GTK_STATE_FLAG_ACTIVE, &colourForeActive); if (!gdk_rgba_equal(&colourForeSelected, &colourForeActive)) gtk_widget_override_color(w, GTK_STATE_FLAG_ACTIVE, &colourForeSelected); styleContext = gtk_widget_get_style_context(w); if (styleContext == NULL) return; GdkRGBA colourBaseSelected; gtk_style_context_get_background_color(styleContext, GTK_STATE_FLAG_SELECTED, &colourBaseSelected); GdkRGBA colourBaseActive; gtk_style_context_get_background_color(styleContext, GTK_STATE_FLAG_ACTIVE, &colourBaseActive); if (!gdk_rgba_equal(&colourBaseSelected, &colourBaseActive)) gtk_widget_override_background_color(w, GTK_STATE_FLAG_ACTIVE, &colourBaseSelected); #else GtkStyle *style = gtk_widget_get_style(w); if (style == NULL) return; if (!gdk_color_equal(&style->base[GTK_STATE_SELECTED], &style->base[GTK_STATE_ACTIVE])) gtk_widget_modify_base(w, GTK_STATE_ACTIVE, &style->base[GTK_STATE_SELECTED]); style = gtk_widget_get_style(w); if (style == NULL) return; if (!gdk_color_equal(&style->text[GTK_STATE_SELECTED], &style->text[GTK_STATE_ACTIVE])) gtk_widget_modify_text(w, GTK_STATE_ACTIVE, &style->text[GTK_STATE_SELECTED]); #endif } void ListBoxX::Create(Window &, int, Point, int, bool, int) { if (widCached != 0) { wid = widCached; return; } wid = widCached = gtk_window_new(GTK_WINDOW_POPUP); frame = gtk_frame_new(NULL); gtk_widget_show(PWidget(frame)); gtk_container_add(GTK_CONTAINER(GetID()), PWidget(frame)); gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); gtk_container_set_border_width(GTK_CONTAINER(frame), 0); scroller = g_object_new(small_scroller_get_type(), NULL); gtk_container_set_border_width(GTK_CONTAINER(scroller), 0); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(frame), PWidget(scroller)); gtk_widget_show(PWidget(scroller)); /* Tree and its model */ GtkListStore *store = gtk_list_store_new(N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING); list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); g_signal_connect(G_OBJECT(list), "style-set", G_CALLBACK(StyleSet), NULL); GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(list), FALSE); gtk_tree_view_set_reorderable(GTK_TREE_VIEW(list), FALSE); /* Columns */ GtkTreeViewColumn *column = gtk_tree_view_column_new(); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_title(column, "Autocomplete"); pixbuf_renderer = gtk_cell_renderer_pixbuf_new(); gtk_cell_renderer_set_fixed_size(pixbuf_renderer, 0, -1); gtk_tree_view_column_pack_start(column, pixbuf_renderer, FALSE); gtk_tree_view_column_add_attribute(column, pixbuf_renderer, "pixbuf", PIXBUF_COLUMN); GtkCellRenderer* renderer = gtk_cell_renderer_text_new(); gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1); gtk_tree_view_column_pack_start(column, renderer, TRUE); gtk_tree_view_column_add_attribute(column, renderer, "text", TEXT_COLUMN); gtk_tree_view_append_column(GTK_TREE_VIEW(list), column); if (g_object_class_find_property(G_OBJECT_GET_CLASS(list), "fixed-height-mode")) g_object_set(G_OBJECT(list), "fixed-height-mode", TRUE, NULL); GtkWidget *widget = PWidget(list); // No code inside the G_OBJECT macro gtk_container_add(GTK_CONTAINER(PWidget(scroller)), widget); gtk_widget_show(widget); g_signal_connect(G_OBJECT(widget), "button_press_event", G_CALLBACK(ButtonPress), this); } void ListBoxX::SetFont(Font &scint_font) { // Only do for Pango font as there have been crashes for GDK fonts if (Created() && PFont(scint_font)->pfd) { // Current font is Pango font #if GTK_CHECK_VERSION(3,0,0) gtk_widget_override_font(PWidget(list), PFont(scint_font)->pfd); #else gtk_widget_modify_font(PWidget(list), PFont(scint_font)->pfd); #endif } } void ListBoxX::SetAverageCharWidth(int width) { aveCharWidth = width; } void ListBoxX::SetVisibleRows(int rows) { desiredVisibleRows = rows; } int ListBoxX::GetVisibleRows() const { return desiredVisibleRows; } int ListBoxX::GetRowHeight() { #if GTK_CHECK_VERSION(3,0,0) // This version sometimes reports erroneous results on GTK2, but the GTK2 // version is inaccurate for GTK 3.14. GdkRectangle rect; GtkTreePath *path = gtk_tree_path_new_first(); gtk_tree_view_get_background_area(GTK_TREE_VIEW(list), path, NULL, &rect); return rect.height; #else int row_height=0; int vertical_separator=0; int expander_size=0; GtkTreeViewColumn *column = gtk_tree_view_get_column(GTK_TREE_VIEW(list), 0); gtk_tree_view_column_cell_get_size(column, NULL, NULL, NULL, NULL, &row_height); gtk_widget_style_get(PWidget(list), "vertical-separator", &vertical_separator, "expander-size", &expander_size, NULL); row_height += vertical_separator; row_height = Platform::Maximum(row_height, expander_size); return row_height; #endif } PRectangle ListBoxX::GetDesiredRect() { // Before any size allocated pretend its 100 wide so not scrolled PRectangle rc(0, 0, 100, 100); if (wid) { int rows = Length(); if ((rows == 0) || (rows > desiredVisibleRows)) rows = desiredVisibleRows; GtkRequisition req; // This, apparently unnecessary call, ensures gtk_tree_view_column_cell_get_size // returns reasonable values. #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_preferred_size(GTK_WIDGET(frame), NULL, &req); #else gtk_widget_size_request(GTK_WIDGET(frame), &req); #endif int height; // First calculate height of the clist for our desired visible // row count otherwise it tries to expand to the total # of rows // Get cell height int row_height = GetRowHeight(); #if GTK_CHECK_VERSION(3,0,0) GtkStyleContext *styleContextFrame = gtk_widget_get_style_context(PWidget(frame)); GtkBorder padding, border; gtk_style_context_get_padding(styleContextFrame, GTK_STATE_FLAG_NORMAL, &padding); gtk_style_context_get_border(styleContextFrame, GTK_STATE_FLAG_NORMAL, &border); height = (rows * row_height + padding.top + padding.bottom + border.top + border.bottom + 2 * gtk_container_get_border_width(GTK_CONTAINER(PWidget(list)))); #else height = (rows * row_height + 2 * (PWidget(frame)->style->ythickness + GTK_CONTAINER(PWidget(list))->border_width)); #endif rc.bottom = height; int width = maxItemCharacters; if (width < 12) width = 12; rc.right = width * (aveCharWidth + aveCharWidth / 3); // Add horizontal padding and borders int horizontal_separator=0; gtk_widget_style_get(PWidget(list), "horizontal-separator", &horizontal_separator, NULL); rc.right += horizontal_separator; #if GTK_CHECK_VERSION(3,0,0) rc.right += (padding.left + padding.right + border.left + border.right + 2 * gtk_container_get_border_width(GTK_CONTAINER(PWidget(list)))); #else rc.right += 2 * (PWidget(frame)->style->xthickness + GTK_CONTAINER(PWidget(list))->border_width); #endif if (Length() > rows) { // Add the width of the scrollbar GtkWidget *vscrollbar = gtk_scrolled_window_get_vscrollbar(GTK_SCROLLED_WINDOW(scroller)); #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_preferred_size(vscrollbar, NULL, &req); #else gtk_widget_size_request(vscrollbar, &req); #endif rc.right += req.width; } } return rc; } int ListBoxX::CaretFromEdge() { gint renderer_width, renderer_height; gtk_cell_renderer_get_fixed_size(pixbuf_renderer, &renderer_width, &renderer_height); return 4 + renderer_width; } void ListBoxX::Clear() { GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); gtk_list_store_clear(GTK_LIST_STORE(model)); maxItemCharacters = 0; } static void init_pixmap(ListImage *list_image) { if (list_image->rgba_data) { // Drop any existing pixmap/bitmap as data may have changed if (list_image->pixbuf) g_object_unref(list_image->pixbuf); list_image->pixbuf = gdk_pixbuf_new_from_data(list_image->rgba_data->Pixels(), GDK_COLORSPACE_RGB, TRUE, 8, list_image->rgba_data->GetWidth(), list_image->rgba_data->GetHeight(), list_image->rgba_data->GetWidth() * 4, NULL, NULL); } } #define SPACING 5 void ListBoxX::Append(char *s, int type) { ListImage *list_image = NULL; if ((type >= 0) && pixhash) { list_image = static_cast(g_hash_table_lookup((GHashTable *) pixhash , (gconstpointer) GINT_TO_POINTER(type))); } GtkTreeIter iter; GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(list))); gtk_list_store_append(GTK_LIST_STORE(store), &iter); if (list_image) { if (NULL == list_image->pixbuf) init_pixmap(list_image); if (list_image->pixbuf) { gtk_list_store_set(GTK_LIST_STORE(store), &iter, PIXBUF_COLUMN, list_image->pixbuf, TEXT_COLUMN, s, -1); gint pixbuf_width = gdk_pixbuf_get_width(list_image->pixbuf); gint renderer_height, renderer_width; gtk_cell_renderer_get_fixed_size(pixbuf_renderer, &renderer_width, &renderer_height); if (pixbuf_width > renderer_width) gtk_cell_renderer_set_fixed_size(pixbuf_renderer, pixbuf_width, -1); } else { gtk_list_store_set(GTK_LIST_STORE(store), &iter, TEXT_COLUMN, s, -1); } } else { gtk_list_store_set(GTK_LIST_STORE(store), &iter, TEXT_COLUMN, s, -1); } size_t len = strlen(s); if (maxItemCharacters < len) maxItemCharacters = len; } int ListBoxX::Length() { if (wid) return gtk_tree_model_iter_n_children(gtk_tree_view_get_model (GTK_TREE_VIEW(list)), NULL); return 0; } void ListBoxX::Select(int n) { GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list)); if (n < 0) { gtk_tree_selection_unselect_all(selection); return; } bool valid = gtk_tree_model_iter_nth_child(model, &iter, NULL, n) != FALSE; if (valid) { gtk_tree_selection_select_iter(selection, &iter); // Move the scrollbar to show the selection. int total = Length(); #if GTK_CHECK_VERSION(3,0,0) GtkAdjustment *adj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(list)); gfloat value = ((gfloat)n / total) * (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_lower(adj)) + gtk_adjustment_get_lower(adj) - gtk_adjustment_get_page_size(adj) / 2; #else GtkAdjustment *adj = gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list)); gfloat value = ((gfloat)n / total) * (adj->upper - adj->lower) + adj->lower - adj->page_size / 2; #endif // Get cell height int row_height = GetRowHeight(); int rows = Length(); if ((rows == 0) || (rows > desiredVisibleRows)) rows = desiredVisibleRows; if (rows & 0x1) { // Odd rows to display -- We are now in the middle. // Align it so that we don't chop off rows. value += (gfloat)row_height / 2.0; } // Clamp it. value = (value < 0)? 0 : value; #if GTK_CHECK_VERSION(3,0,0) value = (value > (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj)))? (gtk_adjustment_get_upper(adj) - gtk_adjustment_get_page_size(adj)) : value; #else value = (value > (adj->upper - adj->page_size))? (adj->upper - adj->page_size) : value; #endif // Set it. gtk_adjustment_set_value(adj, value); } else { gtk_tree_selection_unselect_all(selection); } } int ListBoxX::GetSelection() { int index = -1; GtkTreeIter iter; GtkTreeModel *model; GtkTreeSelection *selection; selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list)); if (gtk_tree_selection_get_selected(selection, &model, &iter)) { GtkTreePath *path = gtk_tree_model_get_path(model, &iter); int *indices = gtk_tree_path_get_indices(path); // Don't free indices. if (indices) index = indices[0]; gtk_tree_path_free(path); } return index; } int ListBoxX::Find(const char *prefix) { GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); bool valid = gtk_tree_model_get_iter_first(model, &iter) != FALSE; int i = 0; while(valid) { gchar *s; gtk_tree_model_get(model, &iter, TEXT_COLUMN, &s, -1); if (s && (0 == strncmp(prefix, s, strlen(prefix)))) { g_free(s); return i; } g_free(s); valid = gtk_tree_model_iter_next(model, &iter) != FALSE; i++; } return -1; } void ListBoxX::GetValue(int n, char *value, int len) { char *text = NULL; GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); bool valid = gtk_tree_model_iter_nth_child(model, &iter, NULL, n) != FALSE; if (valid) { gtk_tree_model_get(model, &iter, TEXT_COLUMN, &text, -1); } if (text && len > 0) { g_strlcpy(value, text, len); } else { value[0] = '\0'; } g_free(text); } // g_return_if_fail causes unnecessary compiler warning in release compile. #ifdef _MSC_VER #pragma warning(disable: 4127) #endif void ListBoxX::RegisterRGBA(int type, RGBAImage *image) { images.Add(type, image); if (!pixhash) { pixhash = g_hash_table_new(g_direct_hash, g_direct_equal); } ListImage *list_image = static_cast(g_hash_table_lookup((GHashTable *) pixhash, (gconstpointer) GINT_TO_POINTER(type))); if (list_image) { // Drop icon already registered if (list_image->pixbuf) g_object_unref(list_image->pixbuf); list_image->pixbuf = NULL; list_image->rgba_data = image; } else { list_image = g_new0(ListImage, 1); list_image->rgba_data = image; g_hash_table_insert((GHashTable *) pixhash, GINT_TO_POINTER(type), (gpointer) list_image); } } void ListBoxX::RegisterImage(int type, const char *xpm_data) { g_return_if_fail(xpm_data); XPM xpmImage(xpm_data); RegisterRGBA(type, new RGBAImage(xpmImage)); } void ListBoxX::RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) { RegisterRGBA(type, new RGBAImage(width, height, 1.0, pixelsImage)); } void ListBoxX::ClearRegisteredImages() { images.Clear(); } void ListBoxX::SetList(const char *listText, char separator, char typesep) { Clear(); int count = strlen(listText) + 1; std::vector words(listText, listText+count); char *startword = &words[0]; char *numword = NULL; int i = 0; for (; words[i]; i++) { if (words[i] == separator) { words[i] = '\0'; if (numword) *numword = '\0'; Append(startword, numword?atoi(numword + 1):-1); startword = &words[0] + i + 1; numword = NULL; } else if (words[i] == typesep) { numword = &words[0] + i; } } if (startword) { if (numword) *numword = '\0'; Append(startword, numword?atoi(numword + 1):-1); } } Menu::Menu() : mid(0) {} void Menu::CreatePopUp() { Destroy(); mid = gtk_menu_new(); #if GLIB_CHECK_VERSION(2,10,0) g_object_ref_sink(G_OBJECT(mid)); #else g_object_ref(G_OBJECT(mid)); gtk_object_sink(GTK_OBJECT(G_OBJECT(mid))); #endif } void Menu::Destroy() { if (mid) g_object_unref(G_OBJECT(mid)); mid = 0; } static void MenuPositionFunc(GtkMenu *, gint *x, gint *y, gboolean *, gpointer userData) { sptr_t intFromPointer = reinterpret_cast(userData); *x = intFromPointer & 0xffff; *y = intFromPointer >> 16; } void Menu::Show(Point pt, Window &) { int screenHeight = gdk_screen_height(); int screenWidth = gdk_screen_width(); GtkMenu *widget = reinterpret_cast(mid); gtk_widget_show_all(GTK_WIDGET(widget)); GtkRequisition requisition; #if GTK_CHECK_VERSION(3,0,0) gtk_widget_get_preferred_size(GTK_WIDGET(widget), NULL, &requisition); #else gtk_widget_size_request(GTK_WIDGET(widget), &requisition); #endif if ((pt.x + requisition.width) > screenWidth) { pt.x = screenWidth - requisition.width; } if ((pt.y + requisition.height) > screenHeight) { pt.y = screenHeight - requisition.height; } gtk_menu_popup(widget, NULL, NULL, MenuPositionFunc, reinterpret_cast((static_cast(pt.y) << 16) | static_cast(pt.x)), 0, gtk_get_current_event_time()); } ElapsedTime::ElapsedTime() { GTimeVal curTime; g_get_current_time(&curTime); bigBit = curTime.tv_sec; littleBit = curTime.tv_usec; } class DynamicLibraryImpl : public DynamicLibrary { protected: GModule* m; public: explicit DynamicLibraryImpl(const char *modulePath) { m = g_module_open(modulePath, G_MODULE_BIND_LAZY); } virtual ~DynamicLibraryImpl() { if (m != NULL) g_module_close(m); } // Use g_module_symbol to get a pointer to the relevant function. virtual Function FindFunction(const char *name) { if (m != NULL) { gpointer fn_address = NULL; gboolean status = g_module_symbol(m, name, &fn_address); if (status) return static_cast(fn_address); else return NULL; } else { return NULL; } } virtual bool IsValid() { return m != NULL; } }; DynamicLibrary *DynamicLibrary::Load(const char *modulePath) { return static_cast( new DynamicLibraryImpl(modulePath) ); } double ElapsedTime::Duration(bool reset) { GTimeVal curTime; g_get_current_time(&curTime); long endBigBit = curTime.tv_sec; long endLittleBit = curTime.tv_usec; double result = 1000000.0 * (endBigBit - bigBit); result += endLittleBit - littleBit; result /= 1000000.0; if (reset) { bigBit = endBigBit; littleBit = endLittleBit; } return result; } ColourDesired Platform::Chrome() { return ColourDesired(0xe0, 0xe0, 0xe0); } ColourDesired Platform::ChromeHighlight() { return ColourDesired(0xff, 0xff, 0xff); } const char *Platform::DefaultFont() { #ifdef G_OS_WIN32 return "Lucida Console"; #else return "!Sans"; #endif } int Platform::DefaultFontSize() { #ifdef G_OS_WIN32 return 10; #else return 12; #endif } unsigned int Platform::DoubleClickTime() { return 500; // Half a second } bool Platform::MouseButtonBounce() { return true; } void Platform::DebugDisplay(const char *s) { fprintf(stderr, "%s", s); } bool Platform::IsKeyDown(int) { // TODO: discover state of keys in GTK+/X return false; } long Platform::SendScintilla( WindowID w, unsigned int msg, unsigned long wParam, long lParam) { return scintilla_send_message(SCINTILLA(w), msg, wParam, lParam); } long Platform::SendScintillaPointer( WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { return scintilla_send_message(SCINTILLA(w), msg, wParam, reinterpret_cast(lParam)); } bool Platform::IsDBCSLeadByte(int codePage, char ch) { // Byte ranges found in Wikipedia articles with relevant search strings in each case unsigned char uch = static_cast(ch); switch (codePage) { case 932: // Shift_jis return ((uch >= 0x81) && (uch <= 0x9F)) || ((uch >= 0xE0) && (uch <= 0xFC)); // Lead bytes F0 to FC may be a Microsoft addition. case 936: // GBK return (uch >= 0x81) && (uch <= 0xFE); case 950: // Big5 return (uch >= 0x81) && (uch <= 0xFE); // Korean EUC-KR may be code page 949. } return false; } int Platform::DBCSCharLength(int codePage, const char *s) { if (codePage == 932 || codePage == 936 || codePage == 950) { return IsDBCSLeadByte(codePage, s[0]) ? 2 : 1; } else { int bytes = mblen(s, MB_CUR_MAX); if (bytes >= 1) return bytes; else return 1; } } int Platform::DBCSCharMaxLength() { return MB_CUR_MAX; //return 2; } // These are utility functions not really tied to a platform int Platform::Minimum(int a, int b) { if (a < b) return a; else return b; } int Platform::Maximum(int a, int b) { if (a > b) return a; else return b; } //#define TRACE #ifdef TRACE void Platform::DebugPrintf(const char *format, ...) { char buffer[2000]; va_list pArguments; va_start(pArguments, format); vsprintf(buffer, format, pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); } #else void Platform::DebugPrintf(const char *, ...) {} #endif // Not supported for GTK+ static bool assertionPopUps = true; bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { bool ret = assertionPopUps; assertionPopUps = assertionPopUps_; return ret; } void Platform::Assert(const char *c, const char *file, int line) { char buffer[2000]; g_snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d\r\n", c, file, line); Platform::DebugDisplay(buffer); abort(); } int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; if (val < minVal) val = minVal; return val; } void Platform_Initialise() { FontMutexAllocate(); } void Platform_Finalise() { FontCached::ReleaseAll(); FontMutexFree(); } scintilla/include/0000755000175000017500000000000012557522743013137 5ustar neilneilscintilla/include/Scintilla.iface0000644000175000017500000042527712557522743016073 0ustar neilneil## First line may be used for shbang ## This file defines the interface to Scintilla ## Copyright 2000-2003 by Neil Hodgson ## The License.txt file describes the conditions under which this software may be distributed. ## A line starting with ## is a pure comment and should be stripped by readers. ## A line starting with #! is for future shbang use ## A line starting with # followed by a space is a documentation comment and refers ## to the next feature definition. ## Each feature is defined by a line starting with fun, get, set, val or evt. ## cat -> start a category ## fun -> a function ## get -> a property get function ## set -> a property set function ## val -> definition of a constant ## evt -> an event ## enu -> associate an enumeration with a set of vals with a prefix ## lex -> associate a lexer with the lexical classes it produces ## ## All other feature names should be ignored. They may be defined in the future. ## A property may have a set function, a get function or both. Each will have ## "Get" or "Set" in their names and the corresponding name will have the obvious switch. ## A property may be subscripted, in which case the first parameter is the subscript. ## fun, get, and set features have a strict syntax: ## [=,) ## where stands for white space. ## param may be empty (null value) or is [=] ## Additional white space is allowed between elements. ## The syntax for evt is [=[,]*]) ## Feature names that contain an underscore are defined by Windows, so in these ## cases, using the Windows definition is preferred where available. ## The feature numbers are stable so features will not be renumbered. ## Features may be removed but they will go through a period of deprecation ## before removal which is signalled by moving them into the Deprecated category. ## ## enu has the syntax enu=[]* where all the val ## features in this file starting with a given are considered part of the ## enumeration. ## ## lex has the syntax lex=[]* ## where name is a reasonably capitalised (Python, XML) identifier or UI name, ## lexerVal is the val used to specify the lexer, and the list of prefixes is similar ## to enu. The name may not be the same as that used within the lexer so the lexerVal ## should be used to tie these entities together. ## Types: ## void ## int ## bool -> integer, 1=true, 0=false ## position -> integer position in a document ## colour -> colour integer containing red, green and blue bytes. ## string -> pointer to const character ## stringresult -> pointer to character, NULL-> return size of result ## cells -> pointer to array of cells, each cell containing a style byte and character byte ## textrange -> range of a min and a max position with an output string ## findtext -> searchrange, text -> foundposition ## keymod -> integer containing key in low half and modifiers in high half ## formatrange ## Types no longer used: ## findtextex -> searchrange ## charrange -> range of a min and a max position ## charrangeresult -> like charrange, but output param ## countedstring ## point -> x,y ## pointresult -> like point, but output param ## rectangle -> left,top,right,bottom ## Client code should ignore definitions containing types it does not understand, except ## for possibly #defining the constants ## Line numbers and positions start at 0. ## String arguments may contain NUL ('\0') characters where the calls provide a length ## argument and retrieve NUL characters. APIs marked as NUL-terminated also have a ## NUL appended but client code should calculate the size that will be returned rather ## than relying upon the NUL whenever possible. Allow for the extra NUL character when ## allocating buffers. The size to allocate for a stringresult (not including NUL) can be ## determined by calling with a NULL (0) pointer. cat Basics ################################################ ## For Scintilla.h val INVALID_POSITION=-1 # Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages # as many EM_ messages can be used although that use is deprecated. val SCI_START=2000 val SCI_OPTIONAL_START=3000 val SCI_LEXER_START=4000 # Add text to the document at current position. fun void AddText=2001(int length, string text) # Add array of cells to document. fun void AddStyledText=2002(int length, cells c) # Insert string at a position. fun void InsertText=2003(position pos, string text) # Change the text that is being inserted in response to SC_MOD_INSERTCHECK fun void ChangeInsertion=2672(int length, string text) # Delete all text in the document. fun void ClearAll=2004(,) # Delete a range of text in the document. fun void DeleteRange=2645(position pos, int deleteLength) # Set all style bytes to 0, remove all folding information. fun void ClearDocumentStyle=2005(,) # Returns the number of bytes in the document. get int GetLength=2006(,) # Returns the character byte at the position. get int GetCharAt=2007(position pos,) # Returns the position of the caret. get position GetCurrentPos=2008(,) # Returns the position of the opposite end of the selection to the caret. get position GetAnchor=2009(,) # Returns the style byte at the position. get int GetStyleAt=2010(position pos,) # Redoes the next action on the undo history. fun void Redo=2011(,) # Choose between collecting actions into the undo # history and discarding them. set void SetUndoCollection=2012(bool collectUndo,) # Select all the text in the document. fun void SelectAll=2013(,) # Remember the current position in the undo history as the position # at which the document was saved. fun void SetSavePoint=2014(,) # Retrieve a buffer of cells. # Returns the number of bytes in the buffer not including terminating NULs. fun int GetStyledText=2015(, textrange tr) # Are there any redoable actions in the undo history? fun bool CanRedo=2016(,) # Retrieve the line number at which a particular marker is located. fun int MarkerLineFromHandle=2017(int handle,) # Delete a marker. fun void MarkerDeleteHandle=2018(int handle,) # Is undo history being collected? get bool GetUndoCollection=2019(,) enu WhiteSpace=SCWS_ val SCWS_INVISIBLE=0 val SCWS_VISIBLEALWAYS=1 val SCWS_VISIBLEAFTERINDENT=2 # Are white space characters currently visible? # Returns one of SCWS_* constants. get int GetViewWS=2020(,) # Make white space characters invisible, always visible or visible outside indentation. set void SetViewWS=2021(int viewWS,) # Find the position from a point within the window. fun position PositionFromPoint=2022(int x, int y) # Find the position from a point within the window but return # INVALID_POSITION if not close to text. fun position PositionFromPointClose=2023(int x, int y) # Set caret to start of a line and ensure it is visible. fun void GotoLine=2024(int line,) # Set caret to a position and ensure it is visible. fun void GotoPos=2025(position pos,) # Set the selection anchor to a position. The anchor is the opposite # end of the selection from the caret. set void SetAnchor=2026(position posAnchor,) # Retrieve the text of the line containing the caret. # Returns the index of the caret on the line. # Result is NUL-terminated. fun int GetCurLine=2027(int length, stringresult text) # Retrieve the position of the last correctly styled character. get position GetEndStyled=2028(,) enu EndOfLine=SC_EOL_ val SC_EOL_CRLF=0 val SC_EOL_CR=1 val SC_EOL_LF=2 # Convert all line endings in the document to one mode. fun void ConvertEOLs=2029(int eolMode,) # Retrieve the current end of line mode - one of CRLF, CR, or LF. get int GetEOLMode=2030(,) # Set the current end of line mode. set void SetEOLMode=2031(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. fun void StartStyling=2032(position 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. fun void SetStyling=2033(int length, int style) # Is drawing done first into a buffer or direct to the screen? get bool GetBufferedDraw=2034(,) # If drawing is buffered then each line of text is drawn into a bitmap buffer # before drawing it to the screen to avoid flicker. set void SetBufferedDraw=2035(bool buffered,) # Change the visible size of a tab to be a multiple of the width of a space character. set void SetTabWidth=2036(int tabWidth,) # Retrieve the visible size of a tab. get int GetTabWidth=2121(,) # Clear explicit tabstops on a line. fun void ClearTabStops=2675(int line,) # Add an explicit tab stop for a line. fun void AddTabStop=2676(int line, int x) # Find the next explicit tab stop position on a line after a position. fun int GetNextTabStop=2677(int line, int x) # The SC_CP_UTF8 value can be used to enter Unicode mode. # This is the same value as CP_UTF8 in Windows val SC_CP_UTF8=65001 # 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. set void SetCodePage=2037(int codePage,) enu IMEInteraction=SC_IME_ val SC_IME_WINDOWED=0 val SC_IME_INLINE=1 # Is the IME displayed in a winow or inline? get int GetIMEInteraction=2678(,) # Choose to display the the IME in a winow or inline. set void SetIMEInteraction=2679(int imeInteraction,) enu MarkerSymbol=SC_MARK_ val MARKER_MAX=31 val SC_MARK_CIRCLE=0 val SC_MARK_ROUNDRECT=1 val SC_MARK_ARROW=2 val SC_MARK_SMALLRECT=3 val SC_MARK_SHORTARROW=4 val SC_MARK_EMPTY=5 val SC_MARK_ARROWDOWN=6 val SC_MARK_MINUS=7 val SC_MARK_PLUS=8 # Shapes used for outlining column. val SC_MARK_VLINE=9 val SC_MARK_LCORNER=10 val SC_MARK_TCORNER=11 val SC_MARK_BOXPLUS=12 val SC_MARK_BOXPLUSCONNECTED=13 val SC_MARK_BOXMINUS=14 val SC_MARK_BOXMINUSCONNECTED=15 val SC_MARK_LCORNERCURVE=16 val SC_MARK_TCORNERCURVE=17 val SC_MARK_CIRCLEPLUS=18 val SC_MARK_CIRCLEPLUSCONNECTED=19 val SC_MARK_CIRCLEMINUS=20 val SC_MARK_CIRCLEMINUSCONNECTED=21 # Invisible mark that only sets the line background colour. val SC_MARK_BACKGROUND=22 val SC_MARK_DOTDOTDOT=23 val SC_MARK_ARROWS=24 val SC_MARK_PIXMAP=25 val SC_MARK_FULLRECT=26 val SC_MARK_LEFTRECT=27 val SC_MARK_AVAILABLE=28 val SC_MARK_UNDERLINE=29 val SC_MARK_RGBAIMAGE=30 val SC_MARK_BOOKMARK=31 val SC_MARK_CHARACTER=10000 enu MarkerOutline=SC_MARKNUM_ # Markers used for outlining column. val SC_MARKNUM_FOLDEREND=25 val SC_MARKNUM_FOLDEROPENMID=26 val SC_MARKNUM_FOLDERMIDTAIL=27 val SC_MARKNUM_FOLDERTAIL=28 val SC_MARKNUM_FOLDERSUB=29 val SC_MARKNUM_FOLDER=30 val SC_MARKNUM_FOLDEROPEN=31 val SC_MASK_FOLDERS=0xFE000000 # Set the symbol used for a particular marker number. fun void MarkerDefine=2040(int markerNumber, int markerSymbol) # Set the foreground colour used for a particular marker number. set void MarkerSetFore=2041(int markerNumber, colour fore) # Set the background colour used for a particular marker number. set void MarkerSetBack=2042(int markerNumber, colour back) # Set the background colour used for a particular marker number when its folding block is selected. set void MarkerSetBackSelected=2292(int markerNumber, colour back) # Enable/disable highlight for current folding bloc (smallest one that contains the caret) fun void MarkerEnableHighlight=2293(bool enabled,) # Add a marker to a line, returning an ID which can be used to find or delete the marker. fun int MarkerAdd=2043(int line, int markerNumber) # Delete a marker from a line. fun void MarkerDelete=2044(int line, int markerNumber) # Delete all markers with a particular number from all lines. fun void MarkerDeleteAll=2045(int markerNumber,) # Get a bit mask of all the markers set on a line. fun int MarkerGet=2046(int line,) # Find the next line at or after lineStart that includes a marker in mask. # Return -1 when no more lines. fun int MarkerNext=2047(int lineStart, int markerMask) # Find the previous line before lineStart that includes a marker in mask. fun int MarkerPrevious=2048(int lineStart, int markerMask) # Define a marker from a pixmap. fun void MarkerDefinePixmap=2049(int markerNumber, string pixmap) # Add a set of markers to a line. fun void MarkerAddSet=2466(int line, int set) # Set the alpha used for a marker that is drawn in the text area, not the margin. set void MarkerSetAlpha=2476(int markerNumber, int alpha) val SC_MAX_MARGIN=4 enu MarginType=SC_MARGIN_ val SC_MARGIN_SYMBOL=0 val SC_MARGIN_NUMBER=1 val SC_MARGIN_BACK=2 val SC_MARGIN_FORE=3 val SC_MARGIN_TEXT=4 val SC_MARGIN_RTEXT=5 # Set a margin to be either numeric or symbolic. set void SetMarginTypeN=2240(int margin, int marginType) # Retrieve the type of a margin. get int GetMarginTypeN=2241(int margin,) # Set the width of a margin to a width expressed in pixels. set void SetMarginWidthN=2242(int margin, int pixelWidth) # Retrieve the width of a margin in pixels. get int GetMarginWidthN=2243(int margin,) # Set a mask that determines which markers are displayed in a margin. set void SetMarginMaskN=2244(int margin, int mask) # Retrieve the marker mask of a margin. get int GetMarginMaskN=2245(int margin,) # Make a margin sensitive or insensitive to mouse clicks. set void SetMarginSensitiveN=2246(int margin, bool sensitive) # Retrieve the mouse click sensitivity of a margin. get bool GetMarginSensitiveN=2247(int margin,) # Set the cursor shown when the mouse is inside a margin. set void SetMarginCursorN=2248(int margin, int cursor) # Retrieve the cursor shown in a margin. get int GetMarginCursorN=2249(int margin,) # Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles. # Style 39 is for future use. enu StylesCommon=STYLE_ val STYLE_DEFAULT=32 val STYLE_LINENUMBER=33 val STYLE_BRACELIGHT=34 val STYLE_BRACEBAD=35 val STYLE_CONTROLCHAR=36 val STYLE_INDENTGUIDE=37 val STYLE_CALLTIP=38 val STYLE_LASTPREDEFINED=39 val STYLE_MAX=255 # Character set identifiers are used in StyleSetCharacterSet. # The values are the same as the Windows *_CHARSET values. enu CharacterSet=SC_CHARSET_ val SC_CHARSET_ANSI=0 val SC_CHARSET_DEFAULT=1 val SC_CHARSET_BALTIC=186 val SC_CHARSET_CHINESEBIG5=136 val SC_CHARSET_EASTEUROPE=238 val SC_CHARSET_GB2312=134 val SC_CHARSET_GREEK=161 val SC_CHARSET_HANGUL=129 val SC_CHARSET_MAC=77 val SC_CHARSET_OEM=255 val SC_CHARSET_RUSSIAN=204 val SC_CHARSET_CYRILLIC=1251 val SC_CHARSET_SHIFTJIS=128 val SC_CHARSET_SYMBOL=2 val SC_CHARSET_TURKISH=162 val SC_CHARSET_JOHAB=130 val SC_CHARSET_HEBREW=177 val SC_CHARSET_ARABIC=178 val SC_CHARSET_VIETNAMESE=163 val SC_CHARSET_THAI=222 val SC_CHARSET_8859_15=1000 # Clear all the styles and make equivalent to the global default style. fun void StyleClearAll=2050(,) # Set the foreground colour of a style. set void StyleSetFore=2051(int style, colour fore) # Set the background colour of a style. set void StyleSetBack=2052(int style, colour back) # Set a style to be bold or not. set void StyleSetBold=2053(int style, bool bold) # Set a style to be italic or not. set void StyleSetItalic=2054(int style, bool italic) # Set the size of characters of a style. set void StyleSetSize=2055(int style, int sizePoints) # Set the font of a style. set void StyleSetFont=2056(int style, string fontName) # Set a style to have its end of line filled or not. set void StyleSetEOLFilled=2057(int style, bool filled) # Reset the default style to its state at startup fun void StyleResetDefault=2058(,) # Set a style to be underlined or not. set void StyleSetUnderline=2059(int style, bool underline) enu CaseVisible=SC_CASE_ val SC_CASE_MIXED=0 val SC_CASE_UPPER=1 val SC_CASE_LOWER=2 val SC_CASE_CAMEL=3 # Get the foreground colour of a style. get colour StyleGetFore=2481(int style,) # Get the background colour of a style. get colour StyleGetBack=2482(int style,) # Get is a style bold or not. get bool StyleGetBold=2483(int style,) # Get is a style italic or not. get bool StyleGetItalic=2484(int style,) # Get the size of characters of a style. get int StyleGetSize=2485(int style,) # Get the font of a style. # Returns the length of the fontName # Result is NUL-terminated. get int StyleGetFont=2486(int style, stringresult fontName) # Get is a style to have its end of line filled or not. get bool StyleGetEOLFilled=2487(int style,) # Get is a style underlined or not. get bool StyleGetUnderline=2488(int style,) # Get is a style mixed case, or to force upper or lower case. get int StyleGetCase=2489(int style,) # Get the character get of the font in a style. get int StyleGetCharacterSet=2490(int style,) # Get is a style visible or not. get bool StyleGetVisible=2491(int style,) # Get is a style changeable or not (read only). # Experimental feature, currently buggy. get bool StyleGetChangeable=2492(int style,) # Get is a style a hotspot or not. get bool StyleGetHotSpot=2493(int style,) # Set a style to be mixed case, or to force upper or lower case. set void StyleSetCase=2060(int style, int caseForce) val SC_FONT_SIZE_MULTIPLIER=100 # Set the size of characters of a style. Size is in points multiplied by 100. set void StyleSetSizeFractional=2061(int style, int caseForce) # Get the size of characters of a style in points multiplied by 100 get int StyleGetSizeFractional=2062(int style,) enu FontWeight=SC_WEIGHT_ val SC_WEIGHT_NORMAL=400 val SC_WEIGHT_SEMIBOLD=600 val SC_WEIGHT_BOLD=700 # Set the weight of characters of a style. set void StyleSetWeight=2063(int style, int weight) # Get the weight of characters of a style. get int StyleGetWeight=2064(int style,) # Set the character set of the font in a style. set void StyleSetCharacterSet=2066(int style, int characterSet) # Set a style to be a hotspot or not. set void StyleSetHotSpot=2409(int style, bool hotspot) # Set the foreground colour of the main and additional selections and whether to use this setting. fun void SetSelFore=2067(bool useSetting, colour fore) # Set the background colour of the main and additional selections and whether to use this setting. fun void SetSelBack=2068(bool useSetting, colour back) # Get the alpha of the selection. get int GetSelAlpha=2477(,) # Set the alpha of the selection. set void SetSelAlpha=2478(int alpha,) # Is the selection end of line filled? get bool GetSelEOLFilled=2479(,) # Set the selection to have its end of line filled or not. set void SetSelEOLFilled=2480(bool filled,) # Set the foreground colour of the caret. set void SetCaretFore=2069(colour fore,) # When key+modifier combination km is pressed perform msg. fun void AssignCmdKey=2070(keymod km, int msg) # When key+modifier combination km is pressed do nothing. fun void ClearCmdKey=2071(keymod km,) # Drop all key mappings. fun void ClearAllCmdKeys=2072(,) # Set the styles for a segment of the document. fun void SetStylingEx=2073(int length, string styles) # Set a style to be visible or not. set void StyleSetVisible=2074(int style, bool visible) # Get the time in milliseconds that the caret is on and off. get int GetCaretPeriod=2075(,) # Get the time in milliseconds that the caret is on and off. 0 = steady on. set void SetCaretPeriod=2076(int periodMilliseconds,) # Set the set of characters making up words for when moving or selecting by word. # First sets defaults like SetCharsDefault. set void SetWordChars=2077(, string characters) # Get the set of characters making up words for when moving or selecting by word. # Returns the number of characters get int GetWordChars=2646(, stringresult characters) # Start a sequence of actions that is undone and redone as a unit. # May be nested. fun void BeginUndoAction=2078(,) # End a sequence of actions that is undone and redone as a unit. fun void EndUndoAction=2079(,) # Indicator style enumeration and some constants enu IndicatorStyle=INDIC_ val INDIC_PLAIN=0 val INDIC_SQUIGGLE=1 val INDIC_TT=2 val INDIC_DIAGONAL=3 val INDIC_STRIKE=4 val INDIC_HIDDEN=5 val INDIC_BOX=6 val INDIC_ROUNDBOX=7 val INDIC_STRAIGHTBOX=8 val INDIC_DASH=9 val INDIC_DOTS=10 val INDIC_SQUIGGLELOW=11 val INDIC_DOTBOX=12 val INDIC_SQUIGGLEPIXMAP=13 val INDIC_COMPOSITIONTHICK=14 val INDIC_COMPOSITIONTHIN=15 val INDIC_FULLBOX=16 val INDIC_TEXTFORE=17 val INDIC_IME=32 val INDIC_IME_MAX=35 val INDIC_MAX=35 val INDIC_CONTAINER=8 val INDIC0_MASK=0x20 val INDIC1_MASK=0x40 val INDIC2_MASK=0x80 val INDICS_MASK=0xE0 # Set an indicator to plain, squiggle or TT. set void IndicSetStyle=2080(int indic, int style) # Retrieve the style of an indicator. get int IndicGetStyle=2081(int indic,) # Set the foreground colour of an indicator. set void IndicSetFore=2082(int indic, colour fore) # Retrieve the foreground colour of an indicator. get colour IndicGetFore=2083(int indic,) # Set an indicator to draw under text or over(default). set void IndicSetUnder=2510(int indic, bool under) # Retrieve whether indicator drawn under or over text. get bool IndicGetUnder=2511(int indic,) # Set a hover indicator to plain, squiggle or TT. set void IndicSetHoverStyle=2680(int indic, int style) # Retrieve the hover style of an indicator. get int IndicGetHoverStyle=2681(int indic,) # Set the foreground hover colour of an indicator. set void IndicSetHoverFore=2682(int indic, colour fore) # Retrieve the foreground hover colour of an indicator. get colour IndicGetHoverFore=2683(int indic,) val SC_INDICVALUEBIT=0x1000000 val SC_INDICVALUEMASK=0xFFFFFF enu IndicFlag=SC_INDICFLAG_ val SC_INDICFLAG_VALUEFORE=1 # Set the attributes of an indicator. set void IndicSetFlags=2684(int indic, int flags) # Retrieve the attributes of an indicator. get int IndicGetFlags=2685(int indic,) # Set the foreground colour of all whitespace and whether to use this setting. fun void SetWhitespaceFore=2084(bool useSetting, colour fore) # Set the background colour of all whitespace and whether to use this setting. fun void SetWhitespaceBack=2085(bool useSetting, colour back) # Set the size of the dots used to mark space characters. set void SetWhitespaceSize=2086(int size,) # Get the size of the dots used to mark space characters. get int GetWhitespaceSize=2087(,) # 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. set void SetStyleBits=2090(int bits,) # Retrieve number of bits in style bytes used to hold the lexical state. get int GetStyleBits=2091(,) # Used to hold extra styling information for each line. set void SetLineState=2092(int line, int state) # Retrieve the extra styling information for a line. get int GetLineState=2093(int line,) # Retrieve the last line number that has line state. get int GetMaxLineState=2094(,) # Is the background of the line containing the caret in a different colour? get bool GetCaretLineVisible=2095(,) # Display the background of the line containing the caret in a different colour. set void SetCaretLineVisible=2096(bool show,) # Get the colour of the background of the line containing the caret. get colour GetCaretLineBack=2097(,) # Set the colour of the background of the line containing the caret. set void SetCaretLineBack=2098(colour back,) # Set a style to be changeable or not (read only). # Experimental feature, currently buggy. set void StyleSetChangeable=2099(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. fun void AutoCShow=2100(int lenEntered, string itemList) # Remove the auto-completion list from the screen. fun void AutoCCancel=2101(,) # Is there an auto-completion list visible? fun bool AutoCActive=2102(,) # Retrieve the position of the caret when the auto-completion list was displayed. fun position AutoCPosStart=2103(,) # User has selected an item so remove the list and insert the selection. fun void AutoCComplete=2104(,) # Define a set of character that when typed cancel the auto-completion list. fun void AutoCStops=2105(, string 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. set void AutoCSetSeparator=2106(int separatorCharacter,) # Retrieve the auto-completion list separator character. get int AutoCGetSeparator=2107(,) # Select the item in the auto-completion list that starts with a string. fun void AutoCSelect=2108(, string text) # Should the auto-completion list be cancelled if the user backspaces to a # position before where the box was created. set void AutoCSetCancelAtStart=2110(bool cancel,) # Retrieve whether auto-completion cancelled by backspacing before start. get bool AutoCGetCancelAtStart=2111(,) # Define a set of characters that when typed will cause the autocompletion to # choose the selected item. set void AutoCSetFillUps=2112(, string characterSet) # Should a single item auto-completion list automatically choose the item. set void AutoCSetChooseSingle=2113(bool chooseSingle,) # Retrieve whether a single item auto-completion list automatically choose the item. get bool AutoCGetChooseSingle=2114(,) # Set whether case is significant when performing auto-completion searches. set void AutoCSetIgnoreCase=2115(bool ignoreCase,) # Retrieve state of ignore case flag. get bool AutoCGetIgnoreCase=2116(,) # Display a list of strings and send notification when user chooses one. fun void UserListShow=2117(int listType, string itemList) # Set whether or not autocompletion is hidden automatically when nothing matches. set void AutoCSetAutoHide=2118(bool autoHide,) # Retrieve whether or not autocompletion is hidden automatically when nothing matches. get bool AutoCGetAutoHide=2119(,) # Set whether or not autocompletion deletes any word characters # after the inserted text upon completion. set void AutoCSetDropRestOfWord=2270(bool dropRestOfWord,) # Retrieve whether or not autocompletion deletes any word characters # after the inserted text upon completion. get bool AutoCGetDropRestOfWord=2271(,) # Register an XPM image for use in autocompletion lists. fun void RegisterImage=2405(int type, string xpmData) # Clear all the registered XPM images. fun void ClearRegisteredImages=2408(,) # Retrieve the auto-completion list type-separator character. get int AutoCGetTypeSeparator=2285(,) # Change the type-separator character in the string setting up an auto-completion list. # Default is '?' but can be changed if items contain '?'. set void AutoCSetTypeSeparator=2286(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. set void AutoCSetMaxWidth=2208(int characterCount,) # Get the maximum width, in characters, of auto-completion and user lists. get int AutoCGetMaxWidth=2209(,) # Set the maximum height, in rows, of auto-completion and user lists. # The default is 5 rows. set void AutoCSetMaxHeight=2210(int rowCount,) # Set the maximum height, in rows, of auto-completion and user lists. get int AutoCGetMaxHeight=2211(,) # Set the number of spaces used for one level of indentation. set void SetIndent=2122(int indentSize,) # Retrieve indentation size. get int GetIndent=2123(,) # Indentation will only use space characters if useTabs is false, otherwise # it will use a combination of tabs and spaces. set void SetUseTabs=2124(bool useTabs,) # Retrieve whether tabs will be used in indentation. get bool GetUseTabs=2125(,) # Change the indentation of a line to a number of columns. set void SetLineIndentation=2126(int line, int indentSize) # Retrieve the number of columns that a line is indented. get int GetLineIndentation=2127(int line,) # Retrieve the position before the first non indentation character on a line. get position GetLineIndentPosition=2128(int line,) # Retrieve the column number of a position, taking tab width into account. get int GetColumn=2129(position pos,) # Count characters between two positions. fun int CountCharacters=2633(int startPos, int endPos) # Show or hide the horizontal scroll bar. set void SetHScrollBar=2130(bool show,) # Is the horizontal scroll bar visible? get bool GetHScrollBar=2131(,) enu IndentView=SC_IV_ val SC_IV_NONE=0 val SC_IV_REAL=1 val SC_IV_LOOKFORWARD=2 val SC_IV_LOOKBOTH=3 # Show or hide indentation guides. set void SetIndentationGuides=2132(int indentView,) # Are the indentation guides visible? get int GetIndentationGuides=2133(,) # Set the highlighted indentation guide column. # 0 = no highlighted guide. set void SetHighlightGuide=2134(int column,) # Get the highlighted indentation guide column. get int GetHighlightGuide=2135(,) # Get the position after the last visible characters on a line. get position GetLineEndPosition=2136(int line,) # Get the code page used to interpret the bytes of the document as characters. get int GetCodePage=2137(,) # Get the foreground colour of the caret. get colour GetCaretFore=2138(,) # In read-only mode? get bool GetReadOnly=2140(,) # Sets the position of the caret. set void SetCurrentPos=2141(position pos,) # Sets the position that starts the selection - this becomes the anchor. set void SetSelectionStart=2142(position pos,) # Returns the position at the start of the selection. get position GetSelectionStart=2143(,) # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionEnd=2144(position pos,) # Returns the position at the end of the selection. get position GetSelectionEnd=2145(,) # Set caret to a position, while removing any existing selection. fun void SetEmptySelection=2556(position pos,) # Sets the print magnification added to the point size of each style for printing. set void SetPrintMagnification=2146(int magnification,) # Returns the print magnification. get int GetPrintMagnification=2147(,) enu PrintOption=SC_PRINT_ # PrintColourMode - use same colours as screen. val SC_PRINT_NORMAL=0 # PrintColourMode - invert the light value of each style for printing. val SC_PRINT_INVERTLIGHT=1 # PrintColourMode - force black text on white background for printing. val SC_PRINT_BLACKONWHITE=2 # PrintColourMode - text stays coloured, but all background is forced to be white for printing. val SC_PRINT_COLOURONWHITE=3 # PrintColourMode - only the default-background is forced to be white for printing. val SC_PRINT_COLOURONWHITEDEFAULTBG=4 # Modify colours when printing for clearer printed text. set void SetPrintColourMode=2148(int mode,) # Returns the print colour mode. get int GetPrintColourMode=2149(,) enu FindOption=SCFIND_ val SCFIND_WHOLEWORD=0x2 val SCFIND_MATCHCASE=0x4 val SCFIND_WORDSTART=0x00100000 val SCFIND_REGEXP=0x00200000 val SCFIND_POSIX=0x00400000 val SCFIND_CXX11REGEX=0x00800000 # Find some text in the document. fun position FindText=2150(int flags, findtext ft) # On Windows, will draw the document into a display context such as a printer. fun position FormatRange=2151(bool draw, formatrange fr) # Retrieve the display line at the top of the display. get int GetFirstVisibleLine=2152(,) # Retrieve the contents of a line. # Returns the length of the line. fun int GetLine=2153(int line, stringresult text) # Returns the number of lines in the document. There is always at least one. get int GetLineCount=2154(,) # Sets the size in pixels of the left margin. set void SetMarginLeft=2155(, int pixelWidth) # Returns the size in pixels of the left margin. get int GetMarginLeft=2156(,) # Sets the size in pixels of the right margin. set void SetMarginRight=2157(, int pixelWidth) # Returns the size in pixels of the right margin. get int GetMarginRight=2158(,) # Is the document different from when it was last saved? get bool GetModify=2159(,) # Select a range of text. fun void SetSel=2160(position start, position end) # Retrieve the selected text. # Return the length of the text. # Result is NUL-terminated. fun int GetSelText=2161(, stringresult text) # Retrieve a range of text. # Return the length of the text. fun int GetTextRange=2162(, textrange tr) # Draw the selection in normal style or with selection highlighted. fun void HideSelection=2163(bool normal,) # Retrieve the x value of the point in the window where a position is displayed. fun int PointXFromPosition=2164(, position pos) # Retrieve the y value of the point in the window where a position is displayed. fun int PointYFromPosition=2165(, position pos) # Retrieve the line containing a position. fun int LineFromPosition=2166(position pos,) # Retrieve the position at the start of a line. fun position PositionFromLine=2167(int line,) # Scroll horizontally and vertically. fun void LineScroll=2168(int columns, int lines) # Ensure the caret is visible. fun void ScrollCaret=2169(,) # Scroll the argument positions and the range between them into view giving # priority to the primary position then the secondary position. # This may be used to make a search match visible. fun void ScrollRange=2569(position secondary, position primary) # Replace the selected text with the argument text. fun void ReplaceSel=2170(, string text) # Set to read only or read write. set void SetReadOnly=2171(bool readOnly,) # Null operation. fun void Null=2172(,) # Will a paste succeed? fun bool CanPaste=2173(,) # Are there any undoable actions in the undo history? fun bool CanUndo=2174(,) # Delete the undo history. fun void EmptyUndoBuffer=2175(,) # Undo one action in the undo history. fun void Undo=2176(,) # Cut the selection to the clipboard. fun void Cut=2177(,) # Copy the selection to the clipboard. fun void Copy=2178(,) # Paste the contents of the clipboard into the document replacing the selection. fun void Paste=2179(,) # Clear the selection. fun void Clear=2180(,) # Replace the contents of the document with the argument text. fun void SetText=2181(, string text) # Retrieve all the text in the document. # Returns number of characters retrieved. # Result is NUL-terminated. fun int GetText=2182(int length, stringresult text) # Retrieve the number of characters in the document. get int GetTextLength=2183(,) # Retrieve a pointer to a function that processes messages for this Scintilla. get int GetDirectFunction=2184(,) # Retrieve a pointer value to use as the first argument when calling # the function returned by GetDirectFunction. get int GetDirectPointer=2185(,) # Set to overtype (true) or insert mode. set void SetOvertype=2186(bool overtype,) # Returns true if overtype mode is active otherwise false is returned. get bool GetOvertype=2187(,) # Set the width of the insert mode caret. set void SetCaretWidth=2188(int pixelWidth,) # Returns the width of the insert mode caret. get int GetCaretWidth=2189(,) # Sets the position that starts the target which is used for updating the # document without affecting the scroll position. set void SetTargetStart=2190(position pos,) # Get the position that starts the target. get position GetTargetStart=2191(,) # Sets the position that ends the target which is used for updating the # document without affecting the scroll position. set void SetTargetEnd=2192(position pos,) # Get the position that ends the target. get position GetTargetEnd=2193(,) # Sets both the start and end of the target in one call. fun void SetTargetRange=2686(position start, position end) # Retrieve the text in the target. get int GetTargetText=2687(, stringresult characters) # Make the target range start and end be the same as the selection range start and end. fun void TargetFromSelection=2287(,) # Sets the target to the whole document. fun void TargetWholeDocument=2690(,) # Replace the target text with the argument text. # Text is counted so it can contain NULs. # Returns the length of the replacement text. fun int ReplaceTarget=2194(int length, string text) # Replace the target text with the argument text after \d processing. # Text is counted so it can contain NULs. # Looks for \d where d is between 1 and 9 and replaces these with the strings # matched in the last search operation which were surrounded by \( and \). # Returns the length of the replacement text including any change # caused by processing the \d patterns. fun int ReplaceTargetRE=2195(int length, string text) # Search for a counted string in the target and set the target to the found # range. Text is counted so it can contain NULs. # Returns length of range or -1 for failure in which case target is not moved. fun int SearchInTarget=2197(int length, string text) # Set the search flags used by SearchInTarget. set void SetSearchFlags=2198(int flags,) # Get the search flags used by SearchInTarget. get int GetSearchFlags=2199(,) # Show a call tip containing a definition near position pos. fun void CallTipShow=2200(position pos, string definition) # Remove the call tip from the screen. fun void CallTipCancel=2201(,) # Is there an active call tip? fun bool CallTipActive=2202(,) # Retrieve the position where the caret was before displaying the call tip. fun position CallTipPosStart=2203(,) # Set the start position in order to change when backspacing removes the calltip. set void CallTipSetPosStart=2214(int posStart,) # Highlight a segment of the definition. fun void CallTipSetHlt=2204(int start, int end) # Set the background colour for the call tip. set void CallTipSetBack=2205(colour back,) # Set the foreground colour for the call tip. set void CallTipSetFore=2206(colour fore,) # Set the foreground colour for the highlighted part of the call tip. set void CallTipSetForeHlt=2207(colour fore,) # Enable use of STYLE_CALLTIP and set call tip tab size in pixels. set void CallTipUseStyle=2212(int tabSize,) # Set position of calltip, above or below text. set void CallTipSetPosition=2213(bool above,) # Find the display line of a document line taking hidden lines into account. fun int VisibleFromDocLine=2220(int line,) # Find the document line of a display line taking hidden lines into account. fun int DocLineFromVisible=2221(int lineDisplay,) # The number of display lines needed to wrap a document line fun int WrapCount=2235(int line,) enu FoldLevel=SC_FOLDLEVEL val SC_FOLDLEVELBASE=0x400 val SC_FOLDLEVELWHITEFLAG=0x1000 val SC_FOLDLEVELHEADERFLAG=0x2000 val SC_FOLDLEVELNUMBERMASK=0x0FFF # Set the fold level of a line. # This encodes an integer level along with flags indicating whether the # line is a header and whether it is effectively white space. set void SetFoldLevel=2222(int line, int level) # Retrieve the fold level of a line. get int GetFoldLevel=2223(int line,) # Find the last child line of a header line. get int GetLastChild=2224(int line, int level) # Find the parent line of a child line. get int GetFoldParent=2225(int line,) # Make a range of lines visible. fun void ShowLines=2226(int lineStart, int lineEnd) # Make a range of lines invisible. fun void HideLines=2227(int lineStart, int lineEnd) # Is a line visible? get bool GetLineVisible=2228(int line,) # Are all lines visible? get bool GetAllLinesVisible=2236(,) # Show the children of a header line. set void SetFoldExpanded=2229(int line, bool expanded) # Is a header line expanded? get bool GetFoldExpanded=2230(int line,) # Switch a header line between expanded and contracted. fun void ToggleFold=2231(int line,) enu FoldAction=SC_FOLDACTION val SC_FOLDACTION_CONTRACT=0 val SC_FOLDACTION_EXPAND=1 val SC_FOLDACTION_TOGGLE=2 # Expand or contract a fold header. fun void FoldLine=2237(int line, int action) # Expand or contract a fold header and its children. fun void FoldChildren=2238(int line, int action) # Expand a fold header and all children. Use the level argument instead of the line's current level. fun void ExpandChildren=2239(int line, int level) # Expand or contract all fold headers. fun void FoldAll=2662(int action,) # Ensure a particular line is visible by expanding any header line hiding it. fun void EnsureVisible=2232(int line,) enu AutomaticFold=SC_AUTOMATICFOLD_ val SC_AUTOMATICFOLD_SHOW=0x0001 val SC_AUTOMATICFOLD_CLICK=0x0002 val SC_AUTOMATICFOLD_CHANGE=0x0004 # Set automatic folding behaviours. set void SetAutomaticFold=2663(int automaticFold,) # Get automatic folding behaviours. get int GetAutomaticFold=2664(,) enu FoldFlag=SC_FOLDFLAG_ val SC_FOLDFLAG_LINEBEFORE_EXPANDED=0x0002 val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010 val SC_FOLDFLAG_LEVELNUMBERS=0x0040 val SC_FOLDFLAG_LINESTATE=0x0080 # Set some style options for folding. set void SetFoldFlags=2233(int flags,) # Ensure a particular line is visible by expanding any header line hiding it. # Use the currently set visibility policy to determine which range to display. fun void EnsureVisibleEnforcePolicy=2234(int line,) # Sets whether a tab pressed when caret is within indentation indents. set void SetTabIndents=2260(bool tabIndents,) # Does a tab pressed when caret is within indentation indent? get bool GetTabIndents=2261(,) # Sets whether a backspace pressed when caret is within indentation unindents. set void SetBackSpaceUnIndents=2262(bool bsUnIndents,) # Does a backspace pressed when caret is within indentation unindent? get bool GetBackSpaceUnIndents=2263(,) val SC_TIME_FOREVER=10000000 # Sets the time the mouse must sit still to generate a mouse dwell event. set void SetMouseDwellTime=2264(int periodMilliseconds,) # Retrieve the time the mouse must sit still to generate a mouse dwell event. get int GetMouseDwellTime=2265(,) # Get position of start of word. fun int WordStartPosition=2266(position pos, bool onlyWordCharacters) # Get position of end of word. fun int WordEndPosition=2267(position pos, bool onlyWordCharacters) # Is the range start..end considered a word? fun bool IsRangeWord=2691(position start, position end) enu Wrap=SC_WRAP_ val SC_WRAP_NONE=0 val SC_WRAP_WORD=1 val SC_WRAP_CHAR=2 val SC_WRAP_WHITESPACE=3 # Sets whether text is word wrapped. set void SetWrapMode=2268(int mode,) # Retrieve whether text is word wrapped. get int GetWrapMode=2269(,) enu WrapVisualFlag=SC_WRAPVISUALFLAG_ val SC_WRAPVISUALFLAG_NONE=0x0000 val SC_WRAPVISUALFLAG_END=0x0001 val SC_WRAPVISUALFLAG_START=0x0002 val SC_WRAPVISUALFLAG_MARGIN=0x0004 # Set the display mode of visual flags for wrapped lines. set void SetWrapVisualFlags=2460(int wrapVisualFlags,) # Retrive the display mode of visual flags for wrapped lines. get int GetWrapVisualFlags=2461(,) enu WrapVisualLocation=SC_WRAPVISUALFLAGLOC_ val SC_WRAPVISUALFLAGLOC_DEFAULT=0x0000 val SC_WRAPVISUALFLAGLOC_END_BY_TEXT=0x0001 val SC_WRAPVISUALFLAGLOC_START_BY_TEXT=0x0002 # Set the location of visual flags for wrapped lines. set void SetWrapVisualFlagsLocation=2462(int wrapVisualFlagsLocation,) # Retrive the location of visual flags for wrapped lines. get int GetWrapVisualFlagsLocation=2463(,) # Set the start indent for wrapped lines. set void SetWrapStartIndent=2464(int indent,) # Retrive the start indent for wrapped lines. get int GetWrapStartIndent=2465(,) enu WrapIndentMode=SC_WRAPINDENT_ val SC_WRAPINDENT_FIXED=0 val SC_WRAPINDENT_SAME=1 val SC_WRAPINDENT_INDENT=2 # Sets how wrapped sublines are placed. Default is fixed. set void SetWrapIndentMode=2472(int mode,) # Retrieve how wrapped sublines are placed. Default is fixed. get int GetWrapIndentMode=2473(,) enu LineCache=SC_CACHE_ val SC_CACHE_NONE=0 val SC_CACHE_CARET=1 val SC_CACHE_PAGE=2 val SC_CACHE_DOCUMENT=3 # Sets the degree of caching of layout information. set void SetLayoutCache=2272(int mode,) # Retrieve the degree of caching of layout information. get int GetLayoutCache=2273(,) # Sets the document width assumed for scrolling. set void SetScrollWidth=2274(int pixelWidth,) # Retrieve the document width assumed for scrolling. get int GetScrollWidth=2275(,) # Sets whether the maximum width line displayed is used to set scroll width. set void SetScrollWidthTracking=2516(bool tracking,) # Retrieve whether the scroll width tracks wide lines. get bool GetScrollWidthTracking=2517(,) # Measure the pixel width of some text in a particular style. # NUL terminated text argument. # Does not handle tab or control characters. fun int TextWidth=2276(int style, string text) # Sets the scroll range so that maximum scroll position has # the last line at the bottom of the view (default). # Setting this to false allows scrolling one page below the last line. set void SetEndAtLastLine=2277(bool endAtLastLine,) # Retrieve whether the maximum scroll position has the last # line at the bottom of the view. get bool GetEndAtLastLine=2278(,) # Retrieve the height of a particular line of text in pixels. fun int TextHeight=2279(int line,) # Show or hide the vertical scroll bar. set void SetVScrollBar=2280(bool show,) # Is the vertical scroll bar visible? get bool GetVScrollBar=2281(,) # Append a string to the end of the document without changing the selection. fun void AppendText=2282(int length, string text) # Is drawing done in two phases with backgrounds drawn before foregrounds? get bool GetTwoPhaseDraw=2283(,) # In twoPhaseDraw mode, drawing is performed in two phases, first the background # and then the foreground. This avoids chopping off characters that overlap the next run. set void SetTwoPhaseDraw=2284(bool twoPhase,) enu FontQuality=SC_PHASES_ val SC_PHASES_ONE=0 val SC_PHASES_TWO=1 val SC_PHASES_MULTIPLE=2 # How many phases is drawing done in? get int GetPhasesDraw=2673(,) # In one phase draw, text is drawn in a series of rectangular blocks with no overlap. # In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. # In multiple phase draw, each element is drawn over the whole drawing area, allowing text # to overlap from one line to the next. set void SetPhasesDraw=2674(int phases,) # Control font anti-aliasing. enu FontQuality=SC_EFF_ val SC_EFF_QUALITY_MASK=0xF val SC_EFF_QUALITY_DEFAULT=0 val SC_EFF_QUALITY_NON_ANTIALIASED=1 val SC_EFF_QUALITY_ANTIALIASED=2 val SC_EFF_QUALITY_LCD_OPTIMIZED=3 # Choose the quality level for text from the FontQuality enumeration. set void SetFontQuality=2611(int fontQuality,) # Retrieve the quality level for text. get int GetFontQuality=2612(,) # Scroll so that a display line is at the top of the display. set void SetFirstVisibleLine=2613(int lineDisplay,) enu MultiPaste=SC_MULTIPASTE_ val SC_MULTIPASTE_ONCE=0 val SC_MULTIPASTE_EACH=1 # Change the effect of pasting when there are multiple selections. set void SetMultiPaste=2614(int multiPaste,) # Retrieve the effect of pasting when there are multiple selections.. get int GetMultiPaste=2615(,) # Retrieve the value of a tag from a regular expression search. # Result is NUL-terminated. get int GetTag=2616(int tagNumber, stringresult tagValue) # Join the lines in the target. fun void LinesJoin=2288(,) # Split the lines in the target into lines that are less wide than pixelWidth # where possible. fun void LinesSplit=2289(int pixelWidth,) # Set the colours used as a chequerboard pattern in the fold margin fun void SetFoldMarginColour=2290(bool useSetting, colour back) fun void SetFoldMarginHiColour=2291(bool useSetting, colour fore) ## New messages go here ## Start of key messages # Move caret down one line. fun void LineDown=2300(,) # Move caret down one line extending selection to new caret position. fun void LineDownExtend=2301(,) # Move caret up one line. fun void LineUp=2302(,) # Move caret up one line extending selection to new caret position. fun void LineUpExtend=2303(,) # Move caret left one character. fun void CharLeft=2304(,) # Move caret left one character extending selection to new caret position. fun void CharLeftExtend=2305(,) # Move caret right one character. fun void CharRight=2306(,) # Move caret right one character extending selection to new caret position. fun void CharRightExtend=2307(,) # Move caret left one word. fun void WordLeft=2308(,) # Move caret left one word extending selection to new caret position. fun void WordLeftExtend=2309(,) # Move caret right one word. fun void WordRight=2310(,) # Move caret right one word extending selection to new caret position. fun void WordRightExtend=2311(,) # Move caret to first position on line. fun void Home=2312(,) # Move caret to first position on line extending selection to new caret position. fun void HomeExtend=2313(,) # Move caret to last position on line. fun void LineEnd=2314(,) # Move caret to last position on line extending selection to new caret position. fun void LineEndExtend=2315(,) # Move caret to first position in document. fun void DocumentStart=2316(,) # Move caret to first position in document extending selection to new caret position. fun void DocumentStartExtend=2317(,) # Move caret to last position in document. fun void DocumentEnd=2318(,) # Move caret to last position in document extending selection to new caret position. fun void DocumentEndExtend=2319(,) # Move caret one page up. fun void PageUp=2320(,) # Move caret one page up extending selection to new caret position. fun void PageUpExtend=2321(,) # Move caret one page down. fun void PageDown=2322(,) # Move caret one page down extending selection to new caret position. fun void PageDownExtend=2323(,) # Switch from insert to overtype mode or the reverse. fun void EditToggleOvertype=2324(,) # Cancel any modes such as call tip or auto-completion list display. fun void Cancel=2325(,) # Delete the selection or if no selection, the character before the caret. fun void DeleteBack=2326(,) # If selection is empty or all on one line replace the selection with a tab character. # If more than one line selected, indent the lines. fun void Tab=2327(,) # Dedent the selected lines. fun void BackTab=2328(,) # Insert a new line, may use a CRLF, CR or LF depending on EOL mode. fun void NewLine=2329(,) # Insert a Form Feed character. fun void FormFeed=2330(,) # Move caret to before first visible character on line. # If already there move to first character on line. fun void VCHome=2331(,) # Like VCHome but extending selection to new caret position. fun void VCHomeExtend=2332(,) # Magnify the displayed text by increasing the sizes by 1 point. fun void ZoomIn=2333(,) # Make the displayed text smaller by decreasing the sizes by 1 point. fun void ZoomOut=2334(,) # Delete the word to the left of the caret. fun void DelWordLeft=2335(,) # Delete the word to the right of the caret. fun void DelWordRight=2336(,) # Delete the word to the right of the caret, but not the trailing non-word characters. fun void DelWordRightEnd=2518(,) # Cut the line containing the caret. fun void LineCut=2337(,) # Delete the line containing the caret. fun void LineDelete=2338(,) # Switch the current line with the previous. fun void LineTranspose=2339(,) # Duplicate the current line. fun void LineDuplicate=2404(,) # Transform the selection to lower case. fun void LowerCase=2340(,) # Transform the selection to upper case. fun void UpperCase=2341(,) # Scroll the document down, keeping the caret visible. fun void LineScrollDown=2342(,) # Scroll the document up, keeping the caret visible. fun void LineScrollUp=2343(,) # Delete the selection or if no selection, the character before the caret. # Will not delete the character before at the start of a line. fun void DeleteBackNotLine=2344(,) # Move caret to first position on display line. fun void HomeDisplay=2345(,) # Move caret to first position on display line extending selection to # new caret position. fun void HomeDisplayExtend=2346(,) # Move caret to last position on display line. fun void LineEndDisplay=2347(,) # Move caret to last position on display line extending selection to new # caret position. fun void LineEndDisplayExtend=2348(,) # These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)? # except they behave differently when word-wrap is enabled: # They go first to the start / end of the display line, like (Home|LineEnd)Display # The difference is that, the cursor is already at the point, it goes on to the start # or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?. fun void HomeWrap=2349(,) fun void HomeWrapExtend=2450(,) fun void LineEndWrap=2451(,) fun void LineEndWrapExtend=2452(,) fun void VCHomeWrap=2453(,) fun void VCHomeWrapExtend=2454(,) # Copy the line containing the caret. fun void LineCopy=2455(,) # Move the caret inside current view if it's not there already. fun void MoveCaretInsideView=2401(,) # How many characters are on a line, including end of line characters? fun int LineLength=2350(int line,) # Highlight the characters at two positions. fun void BraceHighlight=2351(position pos1, position pos2) # Use specified indicator to highlight matching braces instead of changing their style. fun void BraceHighlightIndicator=2498(bool useBraceHighlightIndicator, int indicator) # Highlight the character at a position indicating there is no matching brace. fun void BraceBadLight=2352(position pos,) # Use specified indicator to highlight non matching brace instead of changing its style. fun void BraceBadLightIndicator=2499(bool useBraceBadLightIndicator, int indicator) # Find the position of a matching brace or INVALID_POSITION if no match. fun position BraceMatch=2353(position pos,) # Are the end of line characters visible? get bool GetViewEOL=2355(,) # Make the end of line characters visible or invisible. set void SetViewEOL=2356(bool visible,) # Retrieve a pointer to the document object. get int GetDocPointer=2357(,) # Change the document object used. set void SetDocPointer=2358(, int pointer) # Set which document modification events are sent to the container. set void SetModEventMask=2359(int mask,) enu EdgeVisualStyle=EDGE_ val EDGE_NONE=0 val EDGE_LINE=1 val EDGE_BACKGROUND=2 # Retrieve the column number which text should be kept within. get int GetEdgeColumn=2360(,) # Set the column number of the edge. # If text goes past the edge then it is highlighted. set void SetEdgeColumn=2361(int column,) # Retrieve the edge highlight mode. get int GetEdgeMode=2362(,) # The edge may be displayed by a line (EDGE_LINE) or by highlighting text that # goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). set void SetEdgeMode=2363(int mode,) # Retrieve the colour used in edge indication. get colour GetEdgeColour=2364(,) # Change the colour used in edge indication. set void SetEdgeColour=2365(colour edgeColour,) # Sets the current caret position to be the search anchor. fun void SearchAnchor=2366(,) # Find some text starting at the search anchor. # Does not ensure the selection is visible. fun int SearchNext=2367(int flags, string text) # Find some text starting at the search anchor and moving backwards. # Does not ensure the selection is visible. fun int SearchPrev=2368(int flags, string text) # Retrieves the number of lines completely visible. get int LinesOnScreen=2370(,) # Set whether a pop up menu is displayed automatically when the user presses # the wrong mouse button. fun void UsePopUp=2371(bool allowPopUp,) # Is the selection rectangular? The alternative is the more common stream selection. get bool SelectionIsRectangle=2372(,) # Set the zoom level. This number of points is added to the size of all fonts. # It may be positive to magnify or negative to reduce. set void SetZoom=2373(int zoom,) # Retrieve the zoom level. get int GetZoom=2374(,) # Create a new document object. # Starts with reference count of 1 and not selected into editor. fun int CreateDocument=2375(,) # Extend life of document. fun void AddRefDocument=2376(, int doc) # Release a reference to the document, deleting document if it fades to black. fun void ReleaseDocument=2377(, int doc) # Get which document modification events are sent to the container. get int GetModEventMask=2378(,) # Change internal focus flag. set void SetFocus=2380(bool focus,) # Get internal focus flag. get bool GetFocus=2381(,) enu Status=SC_STATUS_ val SC_STATUS_OK=0 val SC_STATUS_FAILURE=1 val SC_STATUS_BADALLOC=2 val SC_STATUS_WARN_START=1000 val SC_STATUS_WARN_REGEX=1001 # Change error status - 0 = OK. set void SetStatus=2382(int statusCode,) # Get error status. get int GetStatus=2383(,) # Set whether the mouse is captured when its button is pressed. set void SetMouseDownCaptures=2384(bool captures,) # Get whether mouse gets captured. get bool GetMouseDownCaptures=2385(,) enu CursorShape=SC_CURSOR val SC_CURSORNORMAL=-1 val SC_CURSORARROW=2 val SC_CURSORWAIT=4 val SC_CURSORREVERSEARROW=7 # Sets the cursor to one of the SC_CURSOR* values. set void SetCursor=2386(int cursorType,) # Get cursor type. get int GetCursor=2387(,) # Change the way control characters are displayed: # If symbol is < 32, keep the drawn way, else, use the given character. set void SetControlCharSymbol=2388(int symbol,) # Get the way control characters are displayed. get int GetControlCharSymbol=2389(,) # Move to the previous change in capitalisation. fun void WordPartLeft=2390(,) # Move to the previous change in capitalisation extending selection # to new caret position. fun void WordPartLeftExtend=2391(,) # Move to the change next in capitalisation. fun void WordPartRight=2392(,) # Move to the next change in capitalisation extending selection # to new caret position. fun void WordPartRightExtend=2393(,) # Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. val VISIBLE_SLOP=0x01 val VISIBLE_STRICT=0x04 # Set the way the display area is determined when a particular line # is to be moved to by Find, FindNext, GotoLine, etc. fun void SetVisiblePolicy=2394(int visiblePolicy, int visibleSlop) # Delete back from the current position to the start of the line. fun void DelLineLeft=2395(,) # Delete forwards from the current position to the end of the line. fun void DelLineRight=2396(,) # Get and Set the xOffset (ie, horizontal scroll position). set void SetXOffset=2397(int newOffset,) get int GetXOffset=2398(,) # Set the last x chosen value to be the caret x position. fun void ChooseCaretX=2399(,) # Set the focus to this Scintilla widget. fun void GrabFocus=2400(,) enu CaretPolicy=CARET_ # Caret policy, used by SetXCaretPolicy and SetYCaretPolicy. # If CARET_SLOP is set, we can define a slop value: caretSlop. # This value defines an unwanted zone (UZ) where the caret is... unwanted. # This zone is defined as a number of pixels near the vertical margins, # and as a number of lines near the horizontal margins. # By keeping the caret away from the edges, it is seen within its context, # so it is likely that the identifier that the caret is on can be completely seen, # and that the current line is seen with some of the lines following it which are # often dependent on that line. val CARET_SLOP=0x01 # If CARET_STRICT is set, the policy is enforced... strictly. # The caret is centred on the display if slop is not set, # and cannot go in the UZ if slop is set. val CARET_STRICT=0x04 # If CARET_JUMPS is set, the display is moved more energetically # so the caret can move in the same direction longer before the policy is applied again. val CARET_JUMPS=0x10 # If CARET_EVEN is not set, instead of having symmetrical UZs, # the left and bottom UZs are extended up to right and top UZs respectively. # This way, we favour the displaying of useful information: the beginning of lines, # where most code reside, and the lines after the caret, eg. the body of a function. val CARET_EVEN=0x08 # Set the way the caret is kept visible when going sideways. # The exclusion zone is given in pixels. fun void SetXCaretPolicy=2402(int caretPolicy, int caretSlop) # Set the way the line the caret is on is kept visible. # The exclusion zone is given in lines. fun void SetYCaretPolicy=2403(int caretPolicy, int caretSlop) # Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). set void SetPrintWrapMode=2406(int mode,) # Is printing line wrapped? get int GetPrintWrapMode=2407(,) # Set a fore colour for active hotspots. set void SetHotspotActiveFore=2410(bool useSetting, colour fore) # Get the fore colour for active hotspots. get colour GetHotspotActiveFore=2494(,) # Set a back colour for active hotspots. set void SetHotspotActiveBack=2411(bool useSetting, colour back) # Get the back colour for active hotspots. get colour GetHotspotActiveBack=2495(,) # Enable / Disable underlining active hotspots. set void SetHotspotActiveUnderline=2412(bool underline,) # Get whether underlining for active hotspots. get bool GetHotspotActiveUnderline=2496(,) # Limit hotspots to single line so hotspots on two lines don't merge. set void SetHotspotSingleLine=2421(bool singleLine,) # Get the HotspotSingleLine property get bool GetHotspotSingleLine=2497(,) # Move caret between paragraphs (delimited by empty lines). fun void ParaDown=2413(,) fun void ParaDownExtend=2414(,) fun void ParaUp=2415(,) fun void ParaUpExtend=2416(,) # Given a valid document position, return the previous position taking code # page into account. Returns 0 if passed 0. fun position PositionBefore=2417(position pos,) # Given a valid document position, return the next position taking code # page into account. Maximum value returned is the last position in the document. fun position PositionAfter=2418(position pos,) # Given a valid document position, return a position that differs in a number # of characters. Returned value is always between 0 and last position in document. fun position PositionRelative=2670(position pos, int relative) # Copy a range of text to the clipboard. Positions are clipped into the document. fun void CopyRange=2419(position start, position end) # Copy argument text to the clipboard. fun void CopyText=2420(int length, string text) enu SelectionMode=SC_SEL_ val SC_SEL_STREAM=0 val SC_SEL_RECTANGLE=1 val SC_SEL_LINES=2 val SC_SEL_THIN=3 # Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or # by lines (SC_SEL_LINES). set void SetSelectionMode=2422(int mode,) # Get the mode of the current selection. get int GetSelectionMode=2423(,) # Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). fun position GetLineSelStartPosition=2424(int line,) # Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). fun position GetLineSelEndPosition=2425(int line,) ## RectExtended rectangular selection moves # Move caret down one line, extending rectangular selection to new caret position. fun void LineDownRectExtend=2426(,) # Move caret up one line, extending rectangular selection to new caret position. fun void LineUpRectExtend=2427(,) # Move caret left one character, extending rectangular selection to new caret position. fun void CharLeftRectExtend=2428(,) # Move caret right one character, extending rectangular selection to new caret position. fun void CharRightRectExtend=2429(,) # Move caret to first position on line, extending rectangular selection to new caret position. fun void HomeRectExtend=2430(,) # Move caret to before first visible character on line. # If already there move to first character on line. # In either case, extend rectangular selection to new caret position. fun void VCHomeRectExtend=2431(,) # Move caret to last position on line, extending rectangular selection to new caret position. fun void LineEndRectExtend=2432(,) # Move caret one page up, extending rectangular selection to new caret position. fun void PageUpRectExtend=2433(,) # Move caret one page down, extending rectangular selection to new caret position. fun void PageDownRectExtend=2434(,) # Move caret to top of page, or one page up if already at top of page. fun void StutteredPageUp=2435(,) # Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. fun void StutteredPageUpExtend=2436(,) # Move caret to bottom of page, or one page down if already at bottom of page. fun void StutteredPageDown=2437(,) # Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. fun void StutteredPageDownExtend=2438(,) # Move caret left one word, position cursor at end of word. fun void WordLeftEnd=2439(,) # Move caret left one word, position cursor at end of word, extending selection to new caret position. fun void WordLeftEndExtend=2440(,) # Move caret right one word, position cursor at end of word. fun void WordRightEnd=2441(,) # Move caret right one word, position cursor at end of word, extending selection to new caret position. fun void WordRightEndExtend=2442(,) # Set the set of characters making up whitespace for when moving or selecting by word. # Should be called after SetWordChars. set void SetWhitespaceChars=2443(, string characters) # Get the set of characters making up whitespace for when moving or selecting by word. get int GetWhitespaceChars=2647(, stringresult characters) # Set the set of characters making up punctuation characters # Should be called after SetWordChars. set void SetPunctuationChars=2648(, string characters) # Get the set of characters making up punctuation characters get int GetPunctuationChars=2649(, stringresult characters) # Reset the set of characters for whitespace and word characters to the defaults. fun void SetCharsDefault=2444(,) # Get currently selected item position in the auto-completion list get int AutoCGetCurrent=2445(,) # Get currently selected item text in the auto-completion list # Returns the length of the item text # Result is NUL-terminated. get int AutoCGetCurrentText=2610(, stringresult s) enu CaseInsensitiveBehaviour=SC_CASEINSENSITIVEBEHAVIOUR_ val SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE=0 val SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE=1 # Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,) # Get auto-completion case insensitive behaviour. get int AutoCGetCaseInsensitiveBehaviour=2635(,) enu MultiAutoComplete=SC_MULTIAUTOC_ val SC_MULTIAUTOC_ONCE=0 val SC_MULTIAUTOC_EACH=1 # Change the effect of autocompleting when there are multiple selections. set void AutoCSetMulti=2636(int multi,) # Retrieve the effect of autocompleting when there are multiple selections.. get int AutoCGetMulti=2637(,) enu Ordering=SC_ORDER_ val SC_ORDER_PRESORTED=0 val SC_ORDER_PERFORMSORT=1 val SC_ORDER_CUSTOM=2 # Set the way autocompletion lists are ordered. set void AutoCSetOrder=2660(int order,) # Get the way autocompletion lists are ordered. get int AutoCGetOrder=2661(,) # Enlarge the document to a particular size of text bytes. fun void Allocate=2446(int bytes,) # Returns the target converted to UTF8. # Return the length in bytes. fun int TargetAsUTF8=2447(, stringresult s) # Set the length of the utf8 argument for calling EncodedFromUTF8. # Set to -1 and the string will be measured to the first nul. fun void SetLengthForEncode=2448(int bytes,) # Translates a UTF8 string into the document encoding. # Return the length of the result in bytes. # On error return 0. fun int EncodedFromUTF8=2449(string utf8, stringresult encoded) # Find the position of a column on a line taking into account tabs and # multi-byte characters. If beyond end of line, return line end position. fun int FindColumn=2456(int line, int column) # Can the caret preferred x position only be changed by explicit movement commands? get int GetCaretSticky=2457(,) # Stop the caret preferred x position changing when the user types. set void SetCaretSticky=2458(int useCaretStickyBehaviour,) enu CaretSticky=SC_CARETSTICKY_ val SC_CARETSTICKY_OFF=0 val SC_CARETSTICKY_ON=1 val SC_CARETSTICKY_WHITESPACE=2 # Switch between sticky and non-sticky: meant to be bound to a key. fun void ToggleCaretSticky=2459(,) # Enable/Disable convert-on-paste for line endings set void SetPasteConvertEndings=2467(bool convert,) # Get convert-on-paste setting get bool GetPasteConvertEndings=2468(,) # Duplicate the selection. If selection empty duplicate the line containing the caret. fun void SelectionDuplicate=2469(,) val SC_ALPHA_TRANSPARENT=0 val SC_ALPHA_OPAQUE=255 val SC_ALPHA_NOALPHA=256 # Set background alpha of the caret line. set void SetCaretLineBackAlpha=2470(int alpha,) # Get the background alpha of the caret line. get int GetCaretLineBackAlpha=2471(,) enu CaretStyle=CARETSTYLE_ val CARETSTYLE_INVISIBLE=0 val CARETSTYLE_LINE=1 val CARETSTYLE_BLOCK=2 # Set the style of the caret to be drawn. set void SetCaretStyle=2512(int caretStyle,) # Returns the current style of the caret. get int GetCaretStyle=2513(,) # Set the indicator used for IndicatorFillRange and IndicatorClearRange set void SetIndicatorCurrent=2500(int indicator,) # Get the current indicator get int GetIndicatorCurrent=2501(,) # Set the value used for IndicatorFillRange set void SetIndicatorValue=2502(int value,) # Get the current indicator value get int GetIndicatorValue=2503(,) # Turn a indicator on over a range. fun void IndicatorFillRange=2504(int position, int fillLength) # Turn a indicator off over a range. fun void IndicatorClearRange=2505(int position, int clearLength) # Are any indicators present at position? fun int IndicatorAllOnFor=2506(int position,) # What value does a particular indicator have at at a position? fun int IndicatorValueAt=2507(int indicator, int position) # Where does a particular indicator start? fun int IndicatorStart=2508(int indicator, int position) # Where does a particular indicator end? fun int IndicatorEnd=2509(int indicator, int position) # Set number of entries in position cache set void SetPositionCache=2514(int size,) # How many entries are allocated to the position cache? get int GetPositionCache=2515(,) # Copy the selection, if selection empty copy the line with the caret fun void CopyAllowLine=2519(,) # Compact the document buffer and return a read-only pointer to the # characters in the document. get int GetCharacterPointer=2520(,) # Return a read-only pointer to a range of characters in the document. # May move the gap so that the range is contiguous, but will only move up # to rangeLength bytes. get int GetRangePointer=2643(int position, int rangeLength) # Return a position which, to avoid performance costs, should not be within # the range of a call to GetRangePointer. get position GetGapPosition=2644(,) # Set the alpha fill colour of the given indicator. set void IndicSetAlpha=2523(int indicator, int alpha) # Get the alpha fill colour of the given indicator. get int IndicGetAlpha=2524(int indicator,) # Set the alpha outline colour of the given indicator. set void IndicSetOutlineAlpha=2558(int indicator, int alpha) # Get the alpha outline colour of the given indicator. get int IndicGetOutlineAlpha=2559(int indicator,) # Set extra ascent for each line set void SetExtraAscent=2525(int extraAscent,) # Get extra ascent for each line get int GetExtraAscent=2526(,) # Set extra descent for each line set void SetExtraDescent=2527(int extraDescent,) # Get extra descent for each line get int GetExtraDescent=2528(,) # Which symbol was defined for markerNumber with MarkerDefine fun int MarkerSymbolDefined=2529(int markerNumber,) # Set the text in the text margin for a line set void MarginSetText=2530(int line, string text) # Get the text in the text margin for a line get int MarginGetText=2531(int line, stringresult text) # Set the style number for the text margin for a line set void MarginSetStyle=2532(int line, int style) # Get the style number for the text margin for a line get int MarginGetStyle=2533(int line,) # Set the style in the text margin for a line set void MarginSetStyles=2534(int line, string styles) # Get the styles in the text margin for a line get int MarginGetStyles=2535(int line, stringresult styles) # Clear the margin text on all lines fun void MarginTextClearAll=2536(,) # Get the start of the range of style numbers used for margin text set void MarginSetStyleOffset=2537(int style,) # Get the start of the range of style numbers used for margin text get int MarginGetStyleOffset=2538(,) enu MarginOption=SC_MARGINOPTION_ val SC_MARGINOPTION_NONE=0 val SC_MARGINOPTION_SUBLINESELECT=1 # Set the margin options. set void SetMarginOptions=2539(int marginOptions,) # Get the margin options. get int GetMarginOptions=2557(,) # Set the annotation text for a line set void AnnotationSetText=2540(int line, string text) # Get the annotation text for a line get int AnnotationGetText=2541(int line, stringresult text) # Set the style number for the annotations for a line set void AnnotationSetStyle=2542(int line, int style) # Get the style number for the annotations for a line get int AnnotationGetStyle=2543(int line,) # Set the annotation styles for a line set void AnnotationSetStyles=2544(int line, string styles) # Get the annotation styles for a line get int AnnotationGetStyles=2545(int line, stringresult styles) # Get the number of annotation lines for a line get int AnnotationGetLines=2546(int line,) # Clear the annotations from all lines fun void AnnotationClearAll=2547(,) enu AnnotationVisible=ANNOTATION_ val ANNOTATION_HIDDEN=0 val ANNOTATION_STANDARD=1 val ANNOTATION_BOXED=2 val ANNOTATION_INDENTED=3 # Set the visibility for the annotations for a view set void AnnotationSetVisible=2548(int visible,) # Get the visibility for the annotations for a view get int AnnotationGetVisible=2549(,) # Get the start of the range of style numbers used for annotations set void AnnotationSetStyleOffset=2550(int style,) # Get the start of the range of style numbers used for annotations get int AnnotationGetStyleOffset=2551(,) # Release all extended (>255) style numbers fun void ReleaseAllExtendedStyles=2552(,) # Allocate some extended (>255) style numbers and return the start of the range fun int AllocateExtendedStyles=2553(int numberStyles,) val UNDO_MAY_COALESCE=1 # Add a container action to the undo stack fun void AddUndoAction=2560(int token, int flags) # Find the position of a character from a point within the window. fun position CharPositionFromPoint=2561(int x, int y) # Find the position of a character from a point within the window. # Return INVALID_POSITION if not close to text. fun position CharPositionFromPointClose=2562(int x, int y) # Set whether switching to rectangular mode while selecting with the mouse is allowed. set void SetMouseSelectionRectangularSwitch=2668(bool mouseSelectionRectangularSwitch,) # Whether switching to rectangular mode while selecting with the mouse is allowed. get bool GetMouseSelectionRectangularSwitch=2669(,) # Set whether multiple selections can be made set void SetMultipleSelection=2563(bool multipleSelection,) # Whether multiple selections can be made get bool GetMultipleSelection=2564(,) # Set whether typing can be performed into multiple selections set void SetAdditionalSelectionTyping=2565(bool additionalSelectionTyping,) # Whether typing can be performed into multiple selections get bool GetAdditionalSelectionTyping=2566(,) # Set whether additional carets will blink set void SetAdditionalCaretsBlink=2567(bool additionalCaretsBlink,) # Whether additional carets will blink get bool GetAdditionalCaretsBlink=2568(,) # Set whether additional carets are visible set void SetAdditionalCaretsVisible=2608(bool additionalCaretsBlink,) # Whether additional carets are visible get bool GetAdditionalCaretsVisible=2609(,) # How many selections are there? get int GetSelections=2570(,) # Is every selected range empty? get bool GetSelectionEmpty=2650(,) # Clear selections to a single empty stream selection fun void ClearSelections=2571(,) # Set a simple selection fun int SetSelection=2572(int caret, int anchor) # Add a selection fun int AddSelection=2573(int caret, int anchor) # Drop one selection fun void DropSelectionN=2671(int selection,) # Set the main selection set void SetMainSelection=2574(int selection,) # Which selection is the main selection get int GetMainSelection=2575(,) set void SetSelectionNCaret=2576(int selection, position pos) get position GetSelectionNCaret=2577(int selection,) set void SetSelectionNAnchor=2578(int selection, position posAnchor) get position GetSelectionNAnchor=2579(int selection,) set void SetSelectionNCaretVirtualSpace=2580(int selection, int space) get int GetSelectionNCaretVirtualSpace=2581(int selection,) set void SetSelectionNAnchorVirtualSpace=2582(int selection, int space) get int GetSelectionNAnchorVirtualSpace=2583(int selection,) # Sets the position that starts the selection - this becomes the anchor. set void SetSelectionNStart=2584(int selection, position pos) # Returns the position at the start of the selection. get position GetSelectionNStart=2585(int selection,) # Sets the position that ends the selection - this becomes the currentPosition. set void SetSelectionNEnd=2586(int selection, position pos) # Returns the position at the end of the selection. get position GetSelectionNEnd=2587(int selection,) set void SetRectangularSelectionCaret=2588(position pos,) get position GetRectangularSelectionCaret=2589(,) set void SetRectangularSelectionAnchor=2590(position posAnchor,) get position GetRectangularSelectionAnchor=2591(,) set void SetRectangularSelectionCaretVirtualSpace=2592(int space,) get int GetRectangularSelectionCaretVirtualSpace=2593(,) set void SetRectangularSelectionAnchorVirtualSpace=2594(int space,) get int GetRectangularSelectionAnchorVirtualSpace=2595(,) enu VirtualSpace=SCVS_ val SCVS_NONE=0 val SCVS_RECTANGULARSELECTION=1 val SCVS_USERACCESSIBLE=2 set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,) get int GetVirtualSpaceOptions=2597(,) # On GTK+, allow selecting the modifier key to use for mouse-based # rectangular selection. Often the window manager requires Alt+Mouse Drag # for moving windows. # Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. set void SetRectangularSelectionModifier=2598(int modifier,) # Get the modifier key used for rectangular selection. get int GetRectangularSelectionModifier=2599(,) # Set the foreground colour of additional selections. # Must have previously called SetSelFore with non-zero first argument for this to have an effect. set void SetAdditionalSelFore=2600(colour fore,) # Set the background colour of additional selections. # Must have previously called SetSelBack with non-zero first argument for this to have an effect. set void SetAdditionalSelBack=2601(colour back,) # Set the alpha of the selection. set void SetAdditionalSelAlpha=2602(int alpha,) # Get the alpha of the selection. get int GetAdditionalSelAlpha=2603(,) # Set the foreground colour of additional carets. set void SetAdditionalCaretFore=2604(colour fore,) # Get the foreground colour of additional carets. get colour GetAdditionalCaretFore=2605(,) # Set the main selection to the next selection. fun void RotateSelection=2606(,) # Swap that caret and anchor of the main selection. fun void SwapMainAnchorCaret=2607(,) # Add the next occurrence of the main selection to the set of selections as main. # If the current selection is empty then select word around caret. fun void MultipleSelectAddNext=2688(,) # Add each occurrence of the main selection in the target to the set of selections. # If the current selection is empty then select word around caret. fun void MultipleSelectAddEach=2689(,) # Indicate that the internal state of a lexer has changed over a range and therefore # there may be a need to redraw. fun int ChangeLexerState=2617(position start, position end) # Find the next line at or after lineStart that is a contracted fold header line. # Return -1 when no more lines. fun int ContractedFoldNext=2618(int lineStart,) # Centre current line in window. fun void VerticalCentreCaret=2619(,) # Move the selected lines up one line, shifting the line above after the selection fun void MoveSelectedLinesUp=2620(,) # Move the selected lines down one line, shifting the line below before the selection fun void MoveSelectedLinesDown=2621(,) # Set the identifier reported as idFrom in notification messages. set void SetIdentifier=2622(int identifier,) # Get the identifier. get int GetIdentifier=2623(,) # Set the width for future RGBA image data. set void RGBAImageSetWidth=2624(int width,) # Set the height for future RGBA image data. set void RGBAImageSetHeight=2625(int height,) # Set the scale factor in percent for future RGBA image data. set void RGBAImageSetScale=2651(int scalePercent,) # Define a marker from RGBA data. # It has the width and height from RGBAImageSetWidth/Height fun void MarkerDefineRGBAImage=2626(int markerNumber, string pixels) # Register an RGBA image for use in autocompletion lists. # It has the width and height from RGBAImageSetWidth/Height fun void RegisterRGBAImage=2627(int type, string pixels) # Scroll to start of document. fun void ScrollToStart=2628(,) # Scroll to end of document. fun void ScrollToEnd=2629(,) val SC_TECHNOLOGY_DEFAULT=0 val SC_TECHNOLOGY_DIRECTWRITE=1 val SC_TECHNOLOGY_DIRECTWRITERETAIN=2 val SC_TECHNOLOGY_DIRECTWRITEDC=3 # Set the technology used. set void SetTechnology=2630(int technology,) # Get the tech. get int GetTechnology=2631(,) # Create an ILoader*. fun int CreateLoader=2632(int bytes,) # On OS X, show a find indicator. fun void FindIndicatorShow=2640(position start, position end) # On OS X, flash a find indicator, then fade out. fun void FindIndicatorFlash=2641(position start, position end) # On OS X, hide the find indicator. fun void FindIndicatorHide=2642(,) # Move caret to before first visible character on display line. # If already there move to first character on display line. fun void VCHomeDisplay=2652(,) # Like VCHomeDisplay but extending selection to new caret position. fun void VCHomeDisplayExtend=2653(,) # Is the caret line always visible? get bool GetCaretLineVisibleAlways=2654(,) # Sets the caret line to always visible. set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,) # Line end types which may be used in addition to LF, CR, and CRLF # SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator, # U+2029 Paragraph Separator, and U+0085 Next Line enu LineEndType=SC_LINE_END_TYPE_ val SC_LINE_END_TYPE_DEFAULT=0 val SC_LINE_END_TYPE_UNICODE=1 # Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. set void SetLineEndTypesAllowed=2656(int lineEndBitSet,) # Get the line end types currently allowed. get int GetLineEndTypesAllowed=2657(,) # Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. get int GetLineEndTypesActive=2658(,) # Set the way a character is drawn. set void SetRepresentation=2665(string encodedCharacter, string representation) # Set the way a character is drawn. # Result is NUL-terminated. get int GetRepresentation=2666(string encodedCharacter, stringresult representation) # Remove a character representation. fun void ClearRepresentation=2667(string encodedCharacter,) # Start notifying the container of all key presses and commands. fun void StartRecord=3001(,) # Stop notifying the container of all key presses and commands. fun void StopRecord=3002(,) # Set the lexing language of the document. set void SetLexer=4001(int lexer,) # Retrieve the lexing language of the document. get int GetLexer=4002(,) # Colourise a segment of the document using the current lexing language. fun void Colourise=4003(position start, position end) # Set up a value that may be used by a lexer for some optional feature. set void SetProperty=4004(string key, string value) # Maximum value of keywordSet parameter of SetKeyWords. val KEYWORDSET_MAX=8 # Set up the key words used by the lexer. set void SetKeyWords=4005(int keywordSet, string keyWords) # Set the lexing language of the document based on string name. set void SetLexerLanguage=4006(, string language) # Load a lexer library (dll / so). fun void LoadLexerLibrary=4007(, string path) # Retrieve a "property" value previously set with SetProperty. # Result is NUL-terminated. get int GetProperty=4008(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, # with "$()" variable replacement on returned buffer. # Result is NUL-terminated. get int GetPropertyExpanded=4009(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, # interpreted as an int AFTER any "$()" variable replacement. get int GetPropertyInt=4010(string key,) # Retrieve the number of bits the current lexer needs for styling. get int GetStyleBitsNeeded=4011(,) # Retrieve the name of the lexer. # Return the length of the text. # Result is NUL-terminated. get int GetLexerLanguage=4012(, stringresult text) # For private communication between an application and a known lexer. fun int PrivateLexerCall=4013(int operation, int pointer) # Retrieve a '\n' separated list of properties understood by the current lexer. # Result is NUL-terminated. fun int PropertyNames=4014(, stringresult names) enu TypeProperty=SC_TYPE_ val SC_TYPE_BOOLEAN=0 val SC_TYPE_INTEGER=1 val SC_TYPE_STRING=2 # Retrieve the type of a property. fun int PropertyType=4015(string name,) # Describe a property. # Result is NUL-terminated. fun int DescribeProperty=4016(string name, stringresult description) # Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. # Result is NUL-terminated. fun int DescribeKeyWordSets=4017(, stringresult descriptions) # Bit set of LineEndType enumertion for which line ends beyond the standard # LF, CR, and CRLF are supported by the lexer. get int GetLineEndTypesSupported=4018(,) # Allocate a set of sub styles for a particular base style, returning start of range fun int AllocateSubStyles=4020(int styleBase, int numberStyles) # The starting style number for the sub styles associated with a base style get int GetSubStylesStart=4021(int styleBase,) # The number of sub styles associated with a base style get int GetSubStylesLength=4022(int styleBase,) # For a sub style, return the base style, else return the argument. get int GetStyleFromSubStyle=4027(int subStyle,) # For a secondary style, return the primary style, else return the argument. get int GetPrimaryStyleFromStyle=4028(int style,) # Free allocated sub styles fun void FreeSubStyles=4023(,) # Set the identifiers that are shown in a particular style set void SetIdentifiers=4024(int style, string identifiers) # Where styles are duplicated by a feature such as active/inactive code # return the distance between the two types. get int DistanceToSecondaryStyles=4025(,) # Get the set of base styles that can be extended with sub styles # Result is NUL-terminated. get int GetSubStyleBases=4026(, stringresult styles) # Notifications # Type of modification and the action which caused the modification. # These are defined as a bit mask to make it easy to specify which notifications are wanted. # One bit is set from each of SC_MOD_* and SC_PERFORMED_*. enu ModificationFlags=SC_MOD_ SC_PERFORMED_ SC_MULTISTEPUNDOREDO SC_LASTSTEPINUNDOREDO SC_MULTILINEUNDOREDO SC_STARTACTION SC_MODEVENTMASKALL val SC_MOD_INSERTTEXT=0x1 val SC_MOD_DELETETEXT=0x2 val SC_MOD_CHANGESTYLE=0x4 val SC_MOD_CHANGEFOLD=0x8 val SC_PERFORMED_USER=0x10 val SC_PERFORMED_UNDO=0x20 val SC_PERFORMED_REDO=0x40 val SC_MULTISTEPUNDOREDO=0x80 val SC_LASTSTEPINUNDOREDO=0x100 val SC_MOD_CHANGEMARKER=0x200 val SC_MOD_BEFOREINSERT=0x400 val SC_MOD_BEFOREDELETE=0x800 val SC_MULTILINEUNDOREDO=0x1000 val SC_STARTACTION=0x2000 val SC_MOD_CHANGEINDICATOR=0x4000 val SC_MOD_CHANGELINESTATE=0x8000 val SC_MOD_CHANGEMARGIN=0x10000 val SC_MOD_CHANGEANNOTATION=0x20000 val SC_MOD_CONTAINER=0x40000 val SC_MOD_LEXERSTATE=0x80000 val SC_MOD_INSERTCHECK=0x100000 val SC_MOD_CHANGETABSTOPS=0x200000 val SC_MODEVENTMASKALL=0x3FFFFF enu Update=SC_UPDATE_ val SC_UPDATE_CONTENT=0x1 val SC_UPDATE_SELECTION=0x2 val SC_UPDATE_V_SCROLL=0x4 val SC_UPDATE_H_SCROLL=0x8 # For compatibility, these go through the COMMAND notification rather than NOTIFY # and should have had exactly the same values as the EN_* constants. # Unfortunately the SETFOCUS and KILLFOCUS are flipped over from EN_* # As clients depend on these constants, this will not be changed. val SCEN_CHANGE=768 val SCEN_SETFOCUS=512 val SCEN_KILLFOCUS=256 # Symbolic key codes and modifier flags. # ASCII and other printable characters below 256. # Extended keys above 300. enu Keys=SCK_ val SCK_DOWN=300 val SCK_UP=301 val SCK_LEFT=302 val SCK_RIGHT=303 val SCK_HOME=304 val SCK_END=305 val SCK_PRIOR=306 val SCK_NEXT=307 val SCK_DELETE=308 val SCK_INSERT=309 val SCK_ESCAPE=7 val SCK_BACK=8 val SCK_TAB=9 val SCK_RETURN=13 val SCK_ADD=310 val SCK_SUBTRACT=311 val SCK_DIVIDE=312 val SCK_WIN=313 val SCK_RWIN=314 val SCK_MENU=315 enu KeyMod=SCMOD_ val SCMOD_NORM=0 val SCMOD_SHIFT=1 val SCMOD_CTRL=2 val SCMOD_ALT=4 val SCMOD_SUPER=8 val SCMOD_META=16 enu CompletionMethods=SC_AC_ val SC_AC_FILLUP=1 val SC_AC_DOUBLECLICK=2 val SC_AC_TAB=3 val SC_AC_NEWLINE=4 val SC_AC_COMMAND=5 ################################################ # For SciLexer.h enu Lexer=SCLEX_ val SCLEX_CONTAINER=0 val SCLEX_NULL=1 val SCLEX_PYTHON=2 val SCLEX_CPP=3 val SCLEX_HTML=4 val SCLEX_XML=5 val SCLEX_PERL=6 val SCLEX_SQL=7 val SCLEX_VB=8 val SCLEX_PROPERTIES=9 val SCLEX_ERRORLIST=10 val SCLEX_MAKEFILE=11 val SCLEX_BATCH=12 val SCLEX_XCODE=13 val SCLEX_LATEX=14 val SCLEX_LUA=15 val SCLEX_DIFF=16 val SCLEX_CONF=17 val SCLEX_PASCAL=18 val SCLEX_AVE=19 val SCLEX_ADA=20 val SCLEX_LISP=21 val SCLEX_RUBY=22 val SCLEX_EIFFEL=23 val SCLEX_EIFFELKW=24 val SCLEX_TCL=25 val SCLEX_NNCRONTAB=26 val SCLEX_BULLANT=27 val SCLEX_VBSCRIPT=28 val SCLEX_BAAN=31 val SCLEX_MATLAB=32 val SCLEX_SCRIPTOL=33 val SCLEX_ASM=34 val SCLEX_CPPNOCASE=35 val SCLEX_FORTRAN=36 val SCLEX_F77=37 val SCLEX_CSS=38 val SCLEX_POV=39 val SCLEX_LOUT=40 val SCLEX_ESCRIPT=41 val SCLEX_PS=42 val SCLEX_NSIS=43 val SCLEX_MMIXAL=44 val SCLEX_CLW=45 val SCLEX_CLWNOCASE=46 val SCLEX_LOT=47 val SCLEX_YAML=48 val SCLEX_TEX=49 val SCLEX_METAPOST=50 val SCLEX_POWERBASIC=51 val SCLEX_FORTH=52 val SCLEX_ERLANG=53 val SCLEX_OCTAVE=54 val SCLEX_MSSQL=55 val SCLEX_VERILOG=56 val SCLEX_KIX=57 val SCLEX_GUI4CLI=58 val SCLEX_SPECMAN=59 val SCLEX_AU3=60 val SCLEX_APDL=61 val SCLEX_BASH=62 val SCLEX_ASN1=63 val SCLEX_VHDL=64 val SCLEX_CAML=65 val SCLEX_BLITZBASIC=66 val SCLEX_PUREBASIC=67 val SCLEX_HASKELL=68 val SCLEX_PHPSCRIPT=69 val SCLEX_TADS3=70 val SCLEX_REBOL=71 val SCLEX_SMALLTALK=72 val SCLEX_FLAGSHIP=73 val SCLEX_CSOUND=74 val SCLEX_FREEBASIC=75 val SCLEX_INNOSETUP=76 val SCLEX_OPAL=77 val SCLEX_SPICE=78 val SCLEX_D=79 val SCLEX_CMAKE=80 val SCLEX_GAP=81 val SCLEX_PLM=82 val SCLEX_PROGRESS=83 val SCLEX_ABAQUS=84 val SCLEX_ASYMPTOTE=85 val SCLEX_R=86 val SCLEX_MAGIK=87 val SCLEX_POWERSHELL=88 val SCLEX_MYSQL=89 val SCLEX_PO=90 val SCLEX_TAL=91 val SCLEX_COBOL=92 val SCLEX_TACL=93 val SCLEX_SORCUS=94 val SCLEX_POWERPRO=95 val SCLEX_NIMROD=96 val SCLEX_SML=97 val SCLEX_MARKDOWN=98 val SCLEX_TXT2TAGS=99 val SCLEX_A68K=100 val SCLEX_MODULA=101 val SCLEX_COFFEESCRIPT=102 val SCLEX_TCMD=103 val SCLEX_AVS=104 val SCLEX_ECL=105 val SCLEX_OSCRIPT=106 val SCLEX_VISUALPROLOG=107 val SCLEX_LITERATEHASKELL=108 val SCLEX_STTXT=109 val SCLEX_KVIRC=110 val SCLEX_RUST=111 val SCLEX_DMAP=112 val SCLEX_AS=113 val SCLEX_DMIS=114 val SCLEX_REGISTRY=115 val SCLEX_BIBTEX=116 val SCLEX_SREC=117 val SCLEX_IHEX=118 val SCLEX_TEHEX=119 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. val SCLEX_AUTOMATIC=1000 # Lexical states for SCLEX_PYTHON lex Python=SCLEX_PYTHON SCE_P_ lex Nimrod=SCLEX_NIMROD SCE_P_ val SCE_P_DEFAULT=0 val SCE_P_COMMENTLINE=1 val SCE_P_NUMBER=2 val SCE_P_STRING=3 val SCE_P_CHARACTER=4 val SCE_P_WORD=5 val SCE_P_TRIPLE=6 val SCE_P_TRIPLEDOUBLE=7 val SCE_P_CLASSNAME=8 val SCE_P_DEFNAME=9 val SCE_P_OPERATOR=10 val SCE_P_IDENTIFIER=11 val SCE_P_COMMENTBLOCK=12 val SCE_P_STRINGEOL=13 val SCE_P_WORD2=14 val SCE_P_DECORATOR=15 # Lexical states for SCLEX_CPP lex Cpp=SCLEX_CPP SCE_C_ lex BullAnt=SCLEX_BULLANT SCE_C_ val SCE_C_DEFAULT=0 val SCE_C_COMMENT=1 val SCE_C_COMMENTLINE=2 val SCE_C_COMMENTDOC=3 val SCE_C_NUMBER=4 val SCE_C_WORD=5 val SCE_C_STRING=6 val SCE_C_CHARACTER=7 val SCE_C_UUID=8 val SCE_C_PREPROCESSOR=9 val SCE_C_OPERATOR=10 val SCE_C_IDENTIFIER=11 val SCE_C_STRINGEOL=12 val SCE_C_VERBATIM=13 val SCE_C_REGEX=14 val SCE_C_COMMENTLINEDOC=15 val SCE_C_WORD2=16 val SCE_C_COMMENTDOCKEYWORD=17 val SCE_C_COMMENTDOCKEYWORDERROR=18 val SCE_C_GLOBALCLASS=19 val SCE_C_STRINGRAW=20 val SCE_C_TRIPLEVERBATIM=21 val SCE_C_HASHQUOTEDSTRING=22 val SCE_C_PREPROCESSORCOMMENT=23 val SCE_C_PREPROCESSORCOMMENTDOC=24 val SCE_C_USERLITERAL=25 val SCE_C_TASKMARKER=26 val SCE_C_ESCAPESEQUENCE=27 # Lexical states for SCLEX_D lex D=SCLEX_D SCE_D_ val SCE_D_DEFAULT=0 val SCE_D_COMMENT=1 val SCE_D_COMMENTLINE=2 val SCE_D_COMMENTDOC=3 val SCE_D_COMMENTNESTED=4 val SCE_D_NUMBER=5 val SCE_D_WORD=6 val SCE_D_WORD2=7 val SCE_D_WORD3=8 val SCE_D_TYPEDEF=9 val SCE_D_STRING=10 val SCE_D_STRINGEOL=11 val SCE_D_CHARACTER=12 val SCE_D_OPERATOR=13 val SCE_D_IDENTIFIER=14 val SCE_D_COMMENTLINEDOC=15 val SCE_D_COMMENTDOCKEYWORD=16 val SCE_D_COMMENTDOCKEYWORDERROR=17 val SCE_D_STRINGB=18 val SCE_D_STRINGR=19 val SCE_D_WORD5=20 val SCE_D_WORD6=21 val SCE_D_WORD7=22 # Lexical states for SCLEX_TCL lex TCL=SCLEX_TCL SCE_TCL_ val SCE_TCL_DEFAULT=0 val SCE_TCL_COMMENT=1 val SCE_TCL_COMMENTLINE=2 val SCE_TCL_NUMBER=3 val SCE_TCL_WORD_IN_QUOTE=4 val SCE_TCL_IN_QUOTE=5 val SCE_TCL_OPERATOR=6 val SCE_TCL_IDENTIFIER=7 val SCE_TCL_SUBSTITUTION=8 val SCE_TCL_SUB_BRACE=9 val SCE_TCL_MODIFIER=10 val SCE_TCL_EXPAND=11 val SCE_TCL_WORD=12 val SCE_TCL_WORD2=13 val SCE_TCL_WORD3=14 val SCE_TCL_WORD4=15 val SCE_TCL_WORD5=16 val SCE_TCL_WORD6=17 val SCE_TCL_WORD7=18 val SCE_TCL_WORD8=19 val SCE_TCL_COMMENT_BOX=20 val SCE_TCL_BLOCK_COMMENT=21 # Lexical states for SCLEX_HTML, SCLEX_XML lex HTML=SCLEX_HTML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ lex XML=SCLEX_XML SCE_H_ SCE_HJ_ SCE_HJA_ SCE_HB_ SCE_HBA_ SCE_HP_ SCE_HPHP_ SCE_HPA_ val SCE_H_DEFAULT=0 val SCE_H_TAG=1 val SCE_H_TAGUNKNOWN=2 val SCE_H_ATTRIBUTE=3 val SCE_H_ATTRIBUTEUNKNOWN=4 val SCE_H_NUMBER=5 val SCE_H_DOUBLESTRING=6 val SCE_H_SINGLESTRING=7 val SCE_H_OTHER=8 val SCE_H_COMMENT=9 val SCE_H_ENTITY=10 # XML and ASP val SCE_H_TAGEND=11 val SCE_H_XMLSTART=12 val SCE_H_XMLEND=13 val SCE_H_SCRIPT=14 val SCE_H_ASP=15 val SCE_H_ASPAT=16 val SCE_H_CDATA=17 val SCE_H_QUESTION=18 # More HTML val SCE_H_VALUE=19 # X-Code val SCE_H_XCCOMMENT=20 # SGML val SCE_H_SGML_DEFAULT=21 val SCE_H_SGML_COMMAND=22 val SCE_H_SGML_1ST_PARAM=23 val SCE_H_SGML_DOUBLESTRING=24 val SCE_H_SGML_SIMPLESTRING=25 val SCE_H_SGML_ERROR=26 val SCE_H_SGML_SPECIAL=27 val SCE_H_SGML_ENTITY=28 val SCE_H_SGML_COMMENT=29 val SCE_H_SGML_1ST_PARAM_COMMENT=30 val SCE_H_SGML_BLOCK_DEFAULT=31 # Embedded Javascript val SCE_HJ_START=40 val SCE_HJ_DEFAULT=41 val SCE_HJ_COMMENT=42 val SCE_HJ_COMMENTLINE=43 val SCE_HJ_COMMENTDOC=44 val SCE_HJ_NUMBER=45 val SCE_HJ_WORD=46 val SCE_HJ_KEYWORD=47 val SCE_HJ_DOUBLESTRING=48 val SCE_HJ_SINGLESTRING=49 val SCE_HJ_SYMBOLS=50 val SCE_HJ_STRINGEOL=51 val SCE_HJ_REGEX=52 # ASP Javascript val SCE_HJA_START=55 val SCE_HJA_DEFAULT=56 val SCE_HJA_COMMENT=57 val SCE_HJA_COMMENTLINE=58 val SCE_HJA_COMMENTDOC=59 val SCE_HJA_NUMBER=60 val SCE_HJA_WORD=61 val SCE_HJA_KEYWORD=62 val SCE_HJA_DOUBLESTRING=63 val SCE_HJA_SINGLESTRING=64 val SCE_HJA_SYMBOLS=65 val SCE_HJA_STRINGEOL=66 val SCE_HJA_REGEX=67 # Embedded VBScript val SCE_HB_START=70 val SCE_HB_DEFAULT=71 val SCE_HB_COMMENTLINE=72 val SCE_HB_NUMBER=73 val SCE_HB_WORD=74 val SCE_HB_STRING=75 val SCE_HB_IDENTIFIER=76 val SCE_HB_STRINGEOL=77 # ASP VBScript val SCE_HBA_START=80 val SCE_HBA_DEFAULT=81 val SCE_HBA_COMMENTLINE=82 val SCE_HBA_NUMBER=83 val SCE_HBA_WORD=84 val SCE_HBA_STRING=85 val SCE_HBA_IDENTIFIER=86 val SCE_HBA_STRINGEOL=87 # Embedded Python val SCE_HP_START=90 val SCE_HP_DEFAULT=91 val SCE_HP_COMMENTLINE=92 val SCE_HP_NUMBER=93 val SCE_HP_STRING=94 val SCE_HP_CHARACTER=95 val SCE_HP_WORD=96 val SCE_HP_TRIPLE=97 val SCE_HP_TRIPLEDOUBLE=98 val SCE_HP_CLASSNAME=99 val SCE_HP_DEFNAME=100 val SCE_HP_OPERATOR=101 val SCE_HP_IDENTIFIER=102 # PHP val SCE_HPHP_COMPLEX_VARIABLE=104 # ASP Python val SCE_HPA_START=105 val SCE_HPA_DEFAULT=106 val SCE_HPA_COMMENTLINE=107 val SCE_HPA_NUMBER=108 val SCE_HPA_STRING=109 val SCE_HPA_CHARACTER=110 val SCE_HPA_WORD=111 val SCE_HPA_TRIPLE=112 val SCE_HPA_TRIPLEDOUBLE=113 val SCE_HPA_CLASSNAME=114 val SCE_HPA_DEFNAME=115 val SCE_HPA_OPERATOR=116 val SCE_HPA_IDENTIFIER=117 # PHP val SCE_HPHP_DEFAULT=118 val SCE_HPHP_HSTRING=119 val SCE_HPHP_SIMPLESTRING=120 val SCE_HPHP_WORD=121 val SCE_HPHP_NUMBER=122 val SCE_HPHP_VARIABLE=123 val SCE_HPHP_COMMENT=124 val SCE_HPHP_COMMENTLINE=125 val SCE_HPHP_HSTRING_VARIABLE=126 val SCE_HPHP_OPERATOR=127 # Lexical states for SCLEX_PERL lex Perl=SCLEX_PERL SCE_PL_ val SCE_PL_DEFAULT=0 val SCE_PL_ERROR=1 val SCE_PL_COMMENTLINE=2 val SCE_PL_POD=3 val SCE_PL_NUMBER=4 val SCE_PL_WORD=5 val SCE_PL_STRING=6 val SCE_PL_CHARACTER=7 val SCE_PL_PUNCTUATION=8 val SCE_PL_PREPROCESSOR=9 val SCE_PL_OPERATOR=10 val SCE_PL_IDENTIFIER=11 val SCE_PL_SCALAR=12 val SCE_PL_ARRAY=13 val SCE_PL_HASH=14 val SCE_PL_SYMBOLTABLE=15 val SCE_PL_VARIABLE_INDEXER=16 val SCE_PL_REGEX=17 val SCE_PL_REGSUBST=18 val SCE_PL_LONGQUOTE=19 val SCE_PL_BACKTICKS=20 val SCE_PL_DATASECTION=21 val SCE_PL_HERE_DELIM=22 val SCE_PL_HERE_Q=23 val SCE_PL_HERE_QQ=24 val SCE_PL_HERE_QX=25 val SCE_PL_STRING_Q=26 val SCE_PL_STRING_QQ=27 val SCE_PL_STRING_QX=28 val SCE_PL_STRING_QR=29 val SCE_PL_STRING_QW=30 val SCE_PL_POD_VERB=31 val SCE_PL_SUB_PROTOTYPE=40 val SCE_PL_FORMAT_IDENT=41 val SCE_PL_FORMAT=42 val SCE_PL_STRING_VAR=43 val SCE_PL_XLAT=44 val SCE_PL_REGEX_VAR=54 val SCE_PL_REGSUBST_VAR=55 val SCE_PL_BACKTICKS_VAR=57 val SCE_PL_HERE_QQ_VAR=61 val SCE_PL_HERE_QX_VAR=62 val SCE_PL_STRING_QQ_VAR=64 val SCE_PL_STRING_QX_VAR=65 val SCE_PL_STRING_QR_VAR=66 # Lexical states for SCLEX_RUBY lex Ruby=SCLEX_RUBY SCE_RB_ val SCE_RB_DEFAULT=0 val SCE_RB_ERROR=1 val SCE_RB_COMMENTLINE=2 val SCE_RB_POD=3 val SCE_RB_NUMBER=4 val SCE_RB_WORD=5 val SCE_RB_STRING=6 val SCE_RB_CHARACTER=7 val SCE_RB_CLASSNAME=8 val SCE_RB_DEFNAME=9 val SCE_RB_OPERATOR=10 val SCE_RB_IDENTIFIER=11 val SCE_RB_REGEX=12 val SCE_RB_GLOBAL=13 val SCE_RB_SYMBOL=14 val SCE_RB_MODULE_NAME=15 val SCE_RB_INSTANCE_VAR=16 val SCE_RB_CLASS_VAR=17 val SCE_RB_BACKTICKS=18 val SCE_RB_DATASECTION=19 val SCE_RB_HERE_DELIM=20 val SCE_RB_HERE_Q=21 val SCE_RB_HERE_QQ=22 val SCE_RB_HERE_QX=23 val SCE_RB_STRING_Q=24 val SCE_RB_STRING_QQ=25 val SCE_RB_STRING_QX=26 val SCE_RB_STRING_QR=27 val SCE_RB_STRING_QW=28 val SCE_RB_WORD_DEMOTED=29 val SCE_RB_STDIN=30 val SCE_RB_STDOUT=31 val SCE_RB_STDERR=40 val SCE_RB_UPPER_BOUND=41 # Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC lex VB=SCLEX_VB SCE_B_ lex VBScript=SCLEX_VBSCRIPT SCE_B_ lex PowerBasic=SCLEX_POWERBASIC SCE_B_ val SCE_B_DEFAULT=0 val SCE_B_COMMENT=1 val SCE_B_NUMBER=2 val SCE_B_KEYWORD=3 val SCE_B_STRING=4 val SCE_B_PREPROCESSOR=5 val SCE_B_OPERATOR=6 val SCE_B_IDENTIFIER=7 val SCE_B_DATE=8 val SCE_B_STRINGEOL=9 val SCE_B_KEYWORD2=10 val SCE_B_KEYWORD3=11 val SCE_B_KEYWORD4=12 val SCE_B_CONSTANT=13 val SCE_B_ASM=14 val SCE_B_LABEL=15 val SCE_B_ERROR=16 val SCE_B_HEXNUMBER=17 val SCE_B_BINNUMBER=18 val SCE_B_COMMENTBLOCK=19 val SCE_B_DOCLINE=20 val SCE_B_DOCBLOCK=21 val SCE_B_DOCKEYWORD=22 # Lexical states for SCLEX_PROPERTIES lex Properties=SCLEX_PROPERTIES SCE_PROPS_ val SCE_PROPS_DEFAULT=0 val SCE_PROPS_COMMENT=1 val SCE_PROPS_SECTION=2 val SCE_PROPS_ASSIGNMENT=3 val SCE_PROPS_DEFVAL=4 val SCE_PROPS_KEY=5 # Lexical states for SCLEX_LATEX lex LaTeX=SCLEX_LATEX SCE_L_ val SCE_L_DEFAULT=0 val SCE_L_COMMAND=1 val SCE_L_TAG=2 val SCE_L_MATH=3 val SCE_L_COMMENT=4 val SCE_L_TAG2=5 val SCE_L_MATH2=6 val SCE_L_COMMENT2=7 val SCE_L_VERBATIM=8 val SCE_L_SHORTCMD=9 val SCE_L_SPECIAL=10 val SCE_L_CMDOPT=11 val SCE_L_ERROR=12 # Lexical states for SCLEX_LUA lex Lua=SCLEX_LUA SCE_LUA_ val SCE_LUA_DEFAULT=0 val SCE_LUA_COMMENT=1 val SCE_LUA_COMMENTLINE=2 val SCE_LUA_COMMENTDOC=3 val SCE_LUA_NUMBER=4 val SCE_LUA_WORD=5 val SCE_LUA_STRING=6 val SCE_LUA_CHARACTER=7 val SCE_LUA_LITERALSTRING=8 val SCE_LUA_PREPROCESSOR=9 val SCE_LUA_OPERATOR=10 val SCE_LUA_IDENTIFIER=11 val SCE_LUA_STRINGEOL=12 val SCE_LUA_WORD2=13 val SCE_LUA_WORD3=14 val SCE_LUA_WORD4=15 val SCE_LUA_WORD5=16 val SCE_LUA_WORD6=17 val SCE_LUA_WORD7=18 val SCE_LUA_WORD8=19 val SCE_LUA_LABEL=20 # Lexical states for SCLEX_ERRORLIST lex ErrorList=SCLEX_ERRORLIST SCE_ERR_ val SCE_ERR_DEFAULT=0 val SCE_ERR_PYTHON=1 val SCE_ERR_GCC=2 val SCE_ERR_MS=3 val SCE_ERR_CMD=4 val SCE_ERR_BORLAND=5 val SCE_ERR_PERL=6 val SCE_ERR_NET=7 val SCE_ERR_LUA=8 val SCE_ERR_CTAG=9 val SCE_ERR_DIFF_CHANGED=10 val SCE_ERR_DIFF_ADDITION=11 val SCE_ERR_DIFF_DELETION=12 val SCE_ERR_DIFF_MESSAGE=13 val SCE_ERR_PHP=14 val SCE_ERR_ELF=15 val SCE_ERR_IFC=16 val SCE_ERR_IFORT=17 val SCE_ERR_ABSF=18 val SCE_ERR_TIDY=19 val SCE_ERR_JAVA_STACK=20 val SCE_ERR_VALUE=21 val SCE_ERR_GCC_INCLUDED_FROM=22 # Lexical states for SCLEX_BATCH lex Batch=SCLEX_BATCH SCE_BAT_ val SCE_BAT_DEFAULT=0 val SCE_BAT_COMMENT=1 val SCE_BAT_WORD=2 val SCE_BAT_LABEL=3 val SCE_BAT_HIDE=4 val SCE_BAT_COMMAND=5 val SCE_BAT_IDENTIFIER=6 val SCE_BAT_OPERATOR=7 # Lexical states for SCLEX_TCMD lex TCMD=SCLEX_TCMD SCE_TCMD_ val SCE_TCMD_DEFAULT=0 val SCE_TCMD_COMMENT=1 val SCE_TCMD_WORD=2 val SCE_TCMD_LABEL=3 val SCE_TCMD_HIDE=4 val SCE_TCMD_COMMAND=5 val SCE_TCMD_IDENTIFIER=6 val SCE_TCMD_OPERATOR=7 val SCE_TCMD_ENVIRONMENT=8 val SCE_TCMD_EXPANSION=9 val SCE_TCMD_CLABEL=10 # Lexical states for SCLEX_MAKEFILE lex MakeFile=SCLEX_MAKEFILE SCE_MAKE_ val SCE_MAKE_DEFAULT=0 val SCE_MAKE_COMMENT=1 val SCE_MAKE_PREPROCESSOR=2 val SCE_MAKE_IDENTIFIER=3 val SCE_MAKE_OPERATOR=4 val SCE_MAKE_TARGET=5 val SCE_MAKE_IDEOL=9 # Lexical states for SCLEX_DIFF lex Diff=SCLEX_DIFF SCE_DIFF_ val SCE_DIFF_DEFAULT=0 val SCE_DIFF_COMMENT=1 val SCE_DIFF_COMMAND=2 val SCE_DIFF_HEADER=3 val SCE_DIFF_POSITION=4 val SCE_DIFF_DELETED=5 val SCE_DIFF_ADDED=6 val SCE_DIFF_CHANGED=7 # Lexical states for SCLEX_CONF (Apache Configuration Files Lexer) lex Conf=SCLEX_CONF SCE_CONF_ val SCE_CONF_DEFAULT=0 val SCE_CONF_COMMENT=1 val SCE_CONF_NUMBER=2 val SCE_CONF_IDENTIFIER=3 val SCE_CONF_EXTENSION=4 val SCE_CONF_PARAMETER=5 val SCE_CONF_STRING=6 val SCE_CONF_OPERATOR=7 val SCE_CONF_IP=8 val SCE_CONF_DIRECTIVE=9 # Lexical states for SCLEX_AVE, Avenue lex Avenue=SCLEX_AVE SCE_AVE_ val SCE_AVE_DEFAULT=0 val SCE_AVE_COMMENT=1 val SCE_AVE_NUMBER=2 val SCE_AVE_WORD=3 val SCE_AVE_STRING=6 val SCE_AVE_ENUM=7 val SCE_AVE_STRINGEOL=8 val SCE_AVE_IDENTIFIER=9 val SCE_AVE_OPERATOR=10 val SCE_AVE_WORD1=11 val SCE_AVE_WORD2=12 val SCE_AVE_WORD3=13 val SCE_AVE_WORD4=14 val SCE_AVE_WORD5=15 val SCE_AVE_WORD6=16 # Lexical states for SCLEX_ADA lex Ada=SCLEX_ADA SCE_ADA_ val SCE_ADA_DEFAULT=0 val SCE_ADA_WORD=1 val SCE_ADA_IDENTIFIER=2 val SCE_ADA_NUMBER=3 val SCE_ADA_DELIMITER=4 val SCE_ADA_CHARACTER=5 val SCE_ADA_CHARACTEREOL=6 val SCE_ADA_STRING=7 val SCE_ADA_STRINGEOL=8 val SCE_ADA_LABEL=9 val SCE_ADA_COMMENTLINE=10 val SCE_ADA_ILLEGAL=11 # Lexical states for SCLEX_BAAN lex Baan=SCLEX_BAAN SCE_BAAN_ val SCE_BAAN_DEFAULT=0 val SCE_BAAN_COMMENT=1 val SCE_BAAN_COMMENTDOC=2 val SCE_BAAN_NUMBER=3 val SCE_BAAN_WORD=4 val SCE_BAAN_STRING=5 val SCE_BAAN_PREPROCESSOR=6 val SCE_BAAN_OPERATOR=7 val SCE_BAAN_IDENTIFIER=8 val SCE_BAAN_STRINGEOL=9 val SCE_BAAN_WORD2=10 # Lexical states for SCLEX_LISP lex Lisp=SCLEX_LISP SCE_LISP_ val SCE_LISP_DEFAULT=0 val SCE_LISP_COMMENT=1 val SCE_LISP_NUMBER=2 val SCE_LISP_KEYWORD=3 val SCE_LISP_KEYWORD_KW=4 val SCE_LISP_SYMBOL=5 val SCE_LISP_STRING=6 val SCE_LISP_STRINGEOL=8 val SCE_LISP_IDENTIFIER=9 val SCE_LISP_OPERATOR=10 val SCE_LISP_SPECIAL=11 val SCE_LISP_MULTI_COMMENT=12 # Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW lex Eiffel=SCLEX_EIFFEL SCE_EIFFEL_ lex EiffelKW=SCLEX_EIFFELKW SCE_EIFFEL_ val SCE_EIFFEL_DEFAULT=0 val SCE_EIFFEL_COMMENTLINE=1 val SCE_EIFFEL_NUMBER=2 val SCE_EIFFEL_WORD=3 val SCE_EIFFEL_STRING=4 val SCE_EIFFEL_CHARACTER=5 val SCE_EIFFEL_OPERATOR=6 val SCE_EIFFEL_IDENTIFIER=7 val SCE_EIFFEL_STRINGEOL=8 # Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer) lex NNCronTab=SCLEX_NNCRONTAB SCE_NNCRONTAB_ val SCE_NNCRONTAB_DEFAULT=0 val SCE_NNCRONTAB_COMMENT=1 val SCE_NNCRONTAB_TASK=2 val SCE_NNCRONTAB_SECTION=3 val SCE_NNCRONTAB_KEYWORD=4 val SCE_NNCRONTAB_MODIFIER=5 val SCE_NNCRONTAB_ASTERISK=6 val SCE_NNCRONTAB_NUMBER=7 val SCE_NNCRONTAB_STRING=8 val SCE_NNCRONTAB_ENVIRONMENT=9 val SCE_NNCRONTAB_IDENTIFIER=10 # Lexical states for SCLEX_FORTH (Forth Lexer) lex Forth=SCLEX_FORTH SCE_FORTH_ val SCE_FORTH_DEFAULT=0 val SCE_FORTH_COMMENT=1 val SCE_FORTH_COMMENT_ML=2 val SCE_FORTH_IDENTIFIER=3 val SCE_FORTH_CONTROL=4 val SCE_FORTH_KEYWORD=5 val SCE_FORTH_DEFWORD=6 val SCE_FORTH_PREWORD1=7 val SCE_FORTH_PREWORD2=8 val SCE_FORTH_NUMBER=9 val SCE_FORTH_STRING=10 val SCE_FORTH_LOCALE=11 # Lexical states for SCLEX_MATLAB lex MatLab=SCLEX_MATLAB SCE_MATLAB_ val SCE_MATLAB_DEFAULT=0 val SCE_MATLAB_COMMENT=1 val SCE_MATLAB_COMMAND=2 val SCE_MATLAB_NUMBER=3 val SCE_MATLAB_KEYWORD=4 # single quoted string val SCE_MATLAB_STRING=5 val SCE_MATLAB_OPERATOR=6 val SCE_MATLAB_IDENTIFIER=7 val SCE_MATLAB_DOUBLEQUOTESTRING=8 # Lexical states for SCLEX_SCRIPTOL lex Sol=SCLEX_SCRIPTOL SCE_SCRIPTOL_ val SCE_SCRIPTOL_DEFAULT=0 val SCE_SCRIPTOL_WHITE=1 val SCE_SCRIPTOL_COMMENTLINE=2 val SCE_SCRIPTOL_PERSISTENT=3 val SCE_SCRIPTOL_CSTYLE=4 val SCE_SCRIPTOL_COMMENTBLOCK=5 val SCE_SCRIPTOL_NUMBER=6 val SCE_SCRIPTOL_STRING=7 val SCE_SCRIPTOL_CHARACTER=8 val SCE_SCRIPTOL_STRINGEOL=9 val SCE_SCRIPTOL_KEYWORD=10 val SCE_SCRIPTOL_OPERATOR=11 val SCE_SCRIPTOL_IDENTIFIER=12 val SCE_SCRIPTOL_TRIPLE=13 val SCE_SCRIPTOL_CLASSNAME=14 val SCE_SCRIPTOL_PREPROCESSOR=15 # Lexical states for SCLEX_ASM, SCLEX_AS lex Asm=SCLEX_ASM SCE_ASM_ lex As=SCLEX_AS SCE_ASM_ val SCE_ASM_DEFAULT=0 val SCE_ASM_COMMENT=1 val SCE_ASM_NUMBER=2 val SCE_ASM_STRING=3 val SCE_ASM_OPERATOR=4 val SCE_ASM_IDENTIFIER=5 val SCE_ASM_CPUINSTRUCTION=6 val SCE_ASM_MATHINSTRUCTION=7 val SCE_ASM_REGISTER=8 val SCE_ASM_DIRECTIVE=9 val SCE_ASM_DIRECTIVEOPERAND=10 val SCE_ASM_COMMENTBLOCK=11 val SCE_ASM_CHARACTER=12 val SCE_ASM_STRINGEOL=13 val SCE_ASM_EXTINSTRUCTION=14 val SCE_ASM_COMMENTDIRECTIVE=15 # Lexical states for SCLEX_FORTRAN lex Fortran=SCLEX_FORTRAN SCE_F_ lex F77=SCLEX_F77 SCE_F_ val SCE_F_DEFAULT=0 val SCE_F_COMMENT=1 val SCE_F_NUMBER=2 val SCE_F_STRING1=3 val SCE_F_STRING2=4 val SCE_F_STRINGEOL=5 val SCE_F_OPERATOR=6 val SCE_F_IDENTIFIER=7 val SCE_F_WORD=8 val SCE_F_WORD2=9 val SCE_F_WORD3=10 val SCE_F_PREPROCESSOR=11 val SCE_F_OPERATOR2=12 val SCE_F_LABEL=13 val SCE_F_CONTINUATION=14 # Lexical states for SCLEX_CSS lex CSS=SCLEX_CSS SCE_CSS_ val SCE_CSS_DEFAULT=0 val SCE_CSS_TAG=1 val SCE_CSS_CLASS=2 val SCE_CSS_PSEUDOCLASS=3 val SCE_CSS_UNKNOWN_PSEUDOCLASS=4 val SCE_CSS_OPERATOR=5 val SCE_CSS_IDENTIFIER=6 val SCE_CSS_UNKNOWN_IDENTIFIER=7 val SCE_CSS_VALUE=8 val SCE_CSS_COMMENT=9 val SCE_CSS_ID=10 val SCE_CSS_IMPORTANT=11 val SCE_CSS_DIRECTIVE=12 val SCE_CSS_DOUBLESTRING=13 val SCE_CSS_SINGLESTRING=14 val SCE_CSS_IDENTIFIER2=15 val SCE_CSS_ATTRIBUTE=16 val SCE_CSS_IDENTIFIER3=17 val SCE_CSS_PSEUDOELEMENT=18 val SCE_CSS_EXTENDED_IDENTIFIER=19 val SCE_CSS_EXTENDED_PSEUDOCLASS=20 val SCE_CSS_EXTENDED_PSEUDOELEMENT=21 val SCE_CSS_MEDIA=22 val SCE_CSS_VARIABLE=23 # Lexical states for SCLEX_POV lex POV=SCLEX_POV SCE_POV_ val SCE_POV_DEFAULT=0 val SCE_POV_COMMENT=1 val SCE_POV_COMMENTLINE=2 val SCE_POV_NUMBER=3 val SCE_POV_OPERATOR=4 val SCE_POV_IDENTIFIER=5 val SCE_POV_STRING=6 val SCE_POV_STRINGEOL=7 val SCE_POV_DIRECTIVE=8 val SCE_POV_BADDIRECTIVE=9 val SCE_POV_WORD2=10 val SCE_POV_WORD3=11 val SCE_POV_WORD4=12 val SCE_POV_WORD5=13 val SCE_POV_WORD6=14 val SCE_POV_WORD7=15 val SCE_POV_WORD8=16 # Lexical states for SCLEX_LOUT lex LOUT=SCLEX_LOUT SCE_LOUT_ val SCE_LOUT_DEFAULT=0 val SCE_LOUT_COMMENT=1 val SCE_LOUT_NUMBER=2 val SCE_LOUT_WORD=3 val SCE_LOUT_WORD2=4 val SCE_LOUT_WORD3=5 val SCE_LOUT_WORD4=6 val SCE_LOUT_STRING=7 val SCE_LOUT_OPERATOR=8 val SCE_LOUT_IDENTIFIER=9 val SCE_LOUT_STRINGEOL=10 # Lexical states for SCLEX_ESCRIPT lex ESCRIPT=SCLEX_ESCRIPT SCE_ESCRIPT_ val SCE_ESCRIPT_DEFAULT=0 val SCE_ESCRIPT_COMMENT=1 val SCE_ESCRIPT_COMMENTLINE=2 val SCE_ESCRIPT_COMMENTDOC=3 val SCE_ESCRIPT_NUMBER=4 val SCE_ESCRIPT_WORD=5 val SCE_ESCRIPT_STRING=6 val SCE_ESCRIPT_OPERATOR=7 val SCE_ESCRIPT_IDENTIFIER=8 val SCE_ESCRIPT_BRACE=9 val SCE_ESCRIPT_WORD2=10 val SCE_ESCRIPT_WORD3=11 # Lexical states for SCLEX_PS lex PS=SCLEX_PS SCE_PS_ val SCE_PS_DEFAULT=0 val SCE_PS_COMMENT=1 val SCE_PS_DSC_COMMENT=2 val SCE_PS_DSC_VALUE=3 val SCE_PS_NUMBER=4 val SCE_PS_NAME=5 val SCE_PS_KEYWORD=6 val SCE_PS_LITERAL=7 val SCE_PS_IMMEVAL=8 val SCE_PS_PAREN_ARRAY=9 val SCE_PS_PAREN_DICT=10 val SCE_PS_PAREN_PROC=11 val SCE_PS_TEXT=12 val SCE_PS_HEXSTRING=13 val SCE_PS_BASE85STRING=14 val SCE_PS_BADSTRINGCHAR=15 # Lexical states for SCLEX_NSIS lex NSIS=SCLEX_NSIS SCE_NSIS_ val SCE_NSIS_DEFAULT=0 val SCE_NSIS_COMMENT=1 val SCE_NSIS_STRINGDQ=2 val SCE_NSIS_STRINGLQ=3 val SCE_NSIS_STRINGRQ=4 val SCE_NSIS_FUNCTION=5 val SCE_NSIS_VARIABLE=6 val SCE_NSIS_LABEL=7 val SCE_NSIS_USERDEFINED=8 val SCE_NSIS_SECTIONDEF=9 val SCE_NSIS_SUBSECTIONDEF=10 val SCE_NSIS_IFDEFINEDEF=11 val SCE_NSIS_MACRODEF=12 val SCE_NSIS_STRINGVAR=13 val SCE_NSIS_NUMBER=14 val SCE_NSIS_SECTIONGROUP=15 val SCE_NSIS_PAGEEX=16 val SCE_NSIS_FUNCTIONDEF=17 val SCE_NSIS_COMMENTBOX=18 # Lexical states for SCLEX_MMIXAL lex MMIXAL=SCLEX_MMIXAL SCE_MMIXAL_ val SCE_MMIXAL_LEADWS=0 val SCE_MMIXAL_COMMENT=1 val SCE_MMIXAL_LABEL=2 val SCE_MMIXAL_OPCODE=3 val SCE_MMIXAL_OPCODE_PRE=4 val SCE_MMIXAL_OPCODE_VALID=5 val SCE_MMIXAL_OPCODE_UNKNOWN=6 val SCE_MMIXAL_OPCODE_POST=7 val SCE_MMIXAL_OPERANDS=8 val SCE_MMIXAL_NUMBER=9 val SCE_MMIXAL_REF=10 val SCE_MMIXAL_CHAR=11 val SCE_MMIXAL_STRING=12 val SCE_MMIXAL_REGISTER=13 val SCE_MMIXAL_HEX=14 val SCE_MMIXAL_OPERATOR=15 val SCE_MMIXAL_SYMBOL=16 val SCE_MMIXAL_INCLUDE=17 # Lexical states for SCLEX_CLW lex Clarion=SCLEX_CLW SCE_CLW_ val SCE_CLW_DEFAULT=0 val SCE_CLW_LABEL=1 val SCE_CLW_COMMENT=2 val SCE_CLW_STRING=3 val SCE_CLW_USER_IDENTIFIER=4 val SCE_CLW_INTEGER_CONSTANT=5 val SCE_CLW_REAL_CONSTANT=6 val SCE_CLW_PICTURE_STRING=7 val SCE_CLW_KEYWORD=8 val SCE_CLW_COMPILER_DIRECTIVE=9 val SCE_CLW_RUNTIME_EXPRESSIONS=10 val SCE_CLW_BUILTIN_PROCEDURES_FUNCTION=11 val SCE_CLW_STRUCTURE_DATA_TYPE=12 val SCE_CLW_ATTRIBUTE=13 val SCE_CLW_STANDARD_EQUATE=14 val SCE_CLW_ERROR=15 val SCE_CLW_DEPRECATED=16 # Lexical states for SCLEX_LOT lex LOT=SCLEX_LOT SCE_LOT_ val SCE_LOT_DEFAULT=0 val SCE_LOT_HEADER=1 val SCE_LOT_BREAK=2 val SCE_LOT_SET=3 val SCE_LOT_PASS=4 val SCE_LOT_FAIL=5 val SCE_LOT_ABORT=6 # Lexical states for SCLEX_YAML lex YAML=SCLEX_YAML SCE_YAML_ val SCE_YAML_DEFAULT=0 val SCE_YAML_COMMENT=1 val SCE_YAML_IDENTIFIER=2 val SCE_YAML_KEYWORD=3 val SCE_YAML_NUMBER=4 val SCE_YAML_REFERENCE=5 val SCE_YAML_DOCUMENT=6 val SCE_YAML_TEXT=7 val SCE_YAML_ERROR=8 val SCE_YAML_OPERATOR=9 # Lexical states for SCLEX_TEX lex TeX=SCLEX_TEX SCE_TEX_ val SCE_TEX_DEFAULT=0 val SCE_TEX_SPECIAL=1 val SCE_TEX_GROUP=2 val SCE_TEX_SYMBOL=3 val SCE_TEX_COMMAND=4 val SCE_TEX_TEXT=5 lex Metapost=SCLEX_METAPOST SCE_METAPOST_ val SCE_METAPOST_DEFAULT=0 val SCE_METAPOST_SPECIAL=1 val SCE_METAPOST_GROUP=2 val SCE_METAPOST_SYMBOL=3 val SCE_METAPOST_COMMAND=4 val SCE_METAPOST_TEXT=5 val SCE_METAPOST_EXTRA=6 # Lexical states for SCLEX_ERLANG lex Erlang=SCLEX_ERLANG SCE_ERLANG_ val SCE_ERLANG_DEFAULT=0 val SCE_ERLANG_COMMENT=1 val SCE_ERLANG_VARIABLE=2 val SCE_ERLANG_NUMBER=3 val SCE_ERLANG_KEYWORD=4 val SCE_ERLANG_STRING=5 val SCE_ERLANG_OPERATOR=6 val SCE_ERLANG_ATOM=7 val SCE_ERLANG_FUNCTION_NAME=8 val SCE_ERLANG_CHARACTER=9 val SCE_ERLANG_MACRO=10 val SCE_ERLANG_RECORD=11 val SCE_ERLANG_PREPROC=12 val SCE_ERLANG_NODE_NAME=13 val SCE_ERLANG_COMMENT_FUNCTION=14 val SCE_ERLANG_COMMENT_MODULE=15 val SCE_ERLANG_COMMENT_DOC=16 val SCE_ERLANG_COMMENT_DOC_MACRO=17 val SCE_ERLANG_ATOM_QUOTED=18 val SCE_ERLANG_MACRO_QUOTED=19 val SCE_ERLANG_RECORD_QUOTED=20 val SCE_ERLANG_NODE_NAME_QUOTED=21 val SCE_ERLANG_BIFS=22 val SCE_ERLANG_MODULES=23 val SCE_ERLANG_MODULES_ATT=24 val SCE_ERLANG_UNKNOWN=31 # Lexical states for SCLEX_OCTAVE are identical to MatLab lex Octave=SCLEX_OCTAVE SCE_MATLAB_ # Lexical states for SCLEX_MSSQL lex MSSQL=SCLEX_MSSQL SCE_MSSQL_ val SCE_MSSQL_DEFAULT=0 val SCE_MSSQL_COMMENT=1 val SCE_MSSQL_LINE_COMMENT=2 val SCE_MSSQL_NUMBER=3 val SCE_MSSQL_STRING=4 val SCE_MSSQL_OPERATOR=5 val SCE_MSSQL_IDENTIFIER=6 val SCE_MSSQL_VARIABLE=7 val SCE_MSSQL_COLUMN_NAME=8 val SCE_MSSQL_STATEMENT=9 val SCE_MSSQL_DATATYPE=10 val SCE_MSSQL_SYSTABLE=11 val SCE_MSSQL_GLOBAL_VARIABLE=12 val SCE_MSSQL_FUNCTION=13 val SCE_MSSQL_STORED_PROCEDURE=14 val SCE_MSSQL_DEFAULT_PREF_DATATYPE=15 val SCE_MSSQL_COLUMN_NAME_2=16 # Lexical states for SCLEX_VERILOG lex Verilog=SCLEX_VERILOG SCE_V_ val SCE_V_DEFAULT=0 val SCE_V_COMMENT=1 val SCE_V_COMMENTLINE=2 val SCE_V_COMMENTLINEBANG=3 val SCE_V_NUMBER=4 val SCE_V_WORD=5 val SCE_V_STRING=6 val SCE_V_WORD2=7 val SCE_V_WORD3=8 val SCE_V_PREPROCESSOR=9 val SCE_V_OPERATOR=10 val SCE_V_IDENTIFIER=11 val SCE_V_STRINGEOL=12 val SCE_V_USER=19 val SCE_V_COMMENT_WORD=20 val SCE_V_INPUT=21 val SCE_V_OUTPUT=22 val SCE_V_INOUT=23 val SCE_V_PORT_CONNECT=24 # Lexical states for SCLEX_KIX lex Kix=SCLEX_KIX SCE_KIX_ val SCE_KIX_DEFAULT=0 val SCE_KIX_COMMENT=1 val SCE_KIX_STRING1=2 val SCE_KIX_STRING2=3 val SCE_KIX_NUMBER=4 val SCE_KIX_VAR=5 val SCE_KIX_MACRO=6 val SCE_KIX_KEYWORD=7 val SCE_KIX_FUNCTIONS=8 val SCE_KIX_OPERATOR=9 val SCE_KIX_COMMENTSTREAM=10 val SCE_KIX_IDENTIFIER=31 # Lexical states for SCLEX_GUI4CLI lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_ val SCE_GC_DEFAULT=0 val SCE_GC_COMMENTLINE=1 val SCE_GC_COMMENTBLOCK=2 val SCE_GC_GLOBAL=3 val SCE_GC_EVENT=4 val SCE_GC_ATTRIBUTE=5 val SCE_GC_CONTROL=6 val SCE_GC_COMMAND=7 val SCE_GC_STRING=8 val SCE_GC_OPERATOR=9 # Lexical states for SCLEX_SPECMAN lex Specman=SCLEX_SPECMAN SCE_SN_ val SCE_SN_DEFAULT=0 val SCE_SN_CODE=1 val SCE_SN_COMMENTLINE=2 val SCE_SN_COMMENTLINEBANG=3 val SCE_SN_NUMBER=4 val SCE_SN_WORD=5 val SCE_SN_STRING=6 val SCE_SN_WORD2=7 val SCE_SN_WORD3=8 val SCE_SN_PREPROCESSOR=9 val SCE_SN_OPERATOR=10 val SCE_SN_IDENTIFIER=11 val SCE_SN_STRINGEOL=12 val SCE_SN_REGEXTAG=13 val SCE_SN_SIGNAL=14 val SCE_SN_USER=19 # Lexical states for SCLEX_AU3 lex Au3=SCLEX_AU3 SCE_AU3_ val SCE_AU3_DEFAULT=0 val SCE_AU3_COMMENT=1 val SCE_AU3_COMMENTBLOCK=2 val SCE_AU3_NUMBER=3 val SCE_AU3_FUNCTION=4 val SCE_AU3_KEYWORD=5 val SCE_AU3_MACRO=6 val SCE_AU3_STRING=7 val SCE_AU3_OPERATOR=8 val SCE_AU3_VARIABLE=9 val SCE_AU3_SENT=10 val SCE_AU3_PREPROCESSOR=11 val SCE_AU3_SPECIAL=12 val SCE_AU3_EXPAND=13 val SCE_AU3_COMOBJ=14 val SCE_AU3_UDF=15 # Lexical states for SCLEX_APDL lex APDL=SCLEX_APDL SCE_APDL_ val SCE_APDL_DEFAULT=0 val SCE_APDL_COMMENT=1 val SCE_APDL_COMMENTBLOCK=2 val SCE_APDL_NUMBER=3 val SCE_APDL_STRING=4 val SCE_APDL_OPERATOR=5 val SCE_APDL_WORD=6 val SCE_APDL_PROCESSOR=7 val SCE_APDL_COMMAND=8 val SCE_APDL_SLASHCOMMAND=9 val SCE_APDL_STARCOMMAND=10 val SCE_APDL_ARGUMENT=11 val SCE_APDL_FUNCTION=12 # Lexical states for SCLEX_BASH lex Bash=SCLEX_BASH SCE_SH_ val SCE_SH_DEFAULT=0 val SCE_SH_ERROR=1 val SCE_SH_COMMENTLINE=2 val SCE_SH_NUMBER=3 val SCE_SH_WORD=4 val SCE_SH_STRING=5 val SCE_SH_CHARACTER=6 val SCE_SH_OPERATOR=7 val SCE_SH_IDENTIFIER=8 val SCE_SH_SCALAR=9 val SCE_SH_PARAM=10 val SCE_SH_BACKTICKS=11 val SCE_SH_HERE_DELIM=12 val SCE_SH_HERE_Q=13 # Lexical states for SCLEX_ASN1 lex Asn1=SCLEX_ASN1 SCE_ASN1_ val SCE_ASN1_DEFAULT=0 val SCE_ASN1_COMMENT=1 val SCE_ASN1_IDENTIFIER=2 val SCE_ASN1_STRING=3 val SCE_ASN1_OID=4 val SCE_ASN1_SCALAR=5 val SCE_ASN1_KEYWORD=6 val SCE_ASN1_ATTRIBUTE=7 val SCE_ASN1_DESCRIPTOR=8 val SCE_ASN1_TYPE=9 val SCE_ASN1_OPERATOR=10 # Lexical states for SCLEX_VHDL lex VHDL=SCLEX_VHDL SCE_VHDL_ val SCE_VHDL_DEFAULT=0 val SCE_VHDL_COMMENT=1 val SCE_VHDL_COMMENTLINEBANG=2 val SCE_VHDL_NUMBER=3 val SCE_VHDL_STRING=4 val SCE_VHDL_OPERATOR=5 val SCE_VHDL_IDENTIFIER=6 val SCE_VHDL_STRINGEOL=7 val SCE_VHDL_KEYWORD=8 val SCE_VHDL_STDOPERATOR=9 val SCE_VHDL_ATTRIBUTE=10 val SCE_VHDL_STDFUNCTION=11 val SCE_VHDL_STDPACKAGE=12 val SCE_VHDL_STDTYPE=13 val SCE_VHDL_USERWORD=14 val SCE_VHDL_BLOCK_COMMENT=15 # Lexical states for SCLEX_CAML lex Caml=SCLEX_CAML SCE_CAML_ val SCE_CAML_DEFAULT=0 val SCE_CAML_IDENTIFIER=1 val SCE_CAML_TAGNAME=2 val SCE_CAML_KEYWORD=3 val SCE_CAML_KEYWORD2=4 val SCE_CAML_KEYWORD3=5 val SCE_CAML_LINENUM=6 val SCE_CAML_OPERATOR=7 val SCE_CAML_NUMBER=8 val SCE_CAML_CHAR=9 val SCE_CAML_WHITE=10 val SCE_CAML_STRING=11 val SCE_CAML_COMMENT=12 val SCE_CAML_COMMENT1=13 val SCE_CAML_COMMENT2=14 val SCE_CAML_COMMENT3=15 # Lexical states for SCLEX_HASKELL lex Haskell=SCLEX_HASKELL SCE_HA_ val SCE_HA_DEFAULT=0 val SCE_HA_IDENTIFIER=1 val SCE_HA_KEYWORD=2 val SCE_HA_NUMBER=3 val SCE_HA_STRING=4 val SCE_HA_CHARACTER=5 val SCE_HA_CLASS=6 val SCE_HA_MODULE=7 val SCE_HA_CAPITAL=8 val SCE_HA_DATA=9 val SCE_HA_IMPORT=10 val SCE_HA_OPERATOR=11 val SCE_HA_INSTANCE=12 val SCE_HA_COMMENTLINE=13 val SCE_HA_COMMENTBLOCK=14 val SCE_HA_COMMENTBLOCK2=15 val SCE_HA_COMMENTBLOCK3=16 val SCE_HA_PRAGMA=17 val SCE_HA_PREPROCESSOR=18 val SCE_HA_STRINGEOL=19 val SCE_HA_RESERVED_OPERATOR=20 val SCE_HA_LITERATE_COMMENT=21 val SCE_HA_LITERATE_CODEDELIM=22 # Lexical states of SCLEX_TADS3 lex TADS3=SCLEX_TADS3 SCE_T3_ val SCE_T3_DEFAULT=0 val SCE_T3_X_DEFAULT=1 val SCE_T3_PREPROCESSOR=2 val SCE_T3_BLOCK_COMMENT=3 val SCE_T3_LINE_COMMENT=4 val SCE_T3_OPERATOR=5 val SCE_T3_KEYWORD=6 val SCE_T3_NUMBER=7 val SCE_T3_IDENTIFIER=8 val SCE_T3_S_STRING=9 val SCE_T3_D_STRING=10 val SCE_T3_X_STRING=11 val SCE_T3_LIB_DIRECTIVE=12 val SCE_T3_MSG_PARAM=13 val SCE_T3_HTML_TAG=14 val SCE_T3_HTML_DEFAULT=15 val SCE_T3_HTML_STRING=16 val SCE_T3_USER1=17 val SCE_T3_USER2=18 val SCE_T3_USER3=19 val SCE_T3_BRACE=20 # Lexical states for SCLEX_REBOL lex Rebol=SCLEX_REBOL SCE_REBOL_ val SCE_REBOL_DEFAULT=0 val SCE_REBOL_COMMENTLINE=1 val SCE_REBOL_COMMENTBLOCK=2 val SCE_REBOL_PREFACE=3 val SCE_REBOL_OPERATOR=4 val SCE_REBOL_CHARACTER=5 val SCE_REBOL_QUOTEDSTRING=6 val SCE_REBOL_BRACEDSTRING=7 val SCE_REBOL_NUMBER=8 val SCE_REBOL_PAIR=9 val SCE_REBOL_TUPLE=10 val SCE_REBOL_BINARY=11 val SCE_REBOL_MONEY=12 val SCE_REBOL_ISSUE=13 val SCE_REBOL_TAG=14 val SCE_REBOL_FILE=15 val SCE_REBOL_EMAIL=16 val SCE_REBOL_URL=17 val SCE_REBOL_DATE=18 val SCE_REBOL_TIME=19 val SCE_REBOL_IDENTIFIER=20 val SCE_REBOL_WORD=21 val SCE_REBOL_WORD2=22 val SCE_REBOL_WORD3=23 val SCE_REBOL_WORD4=24 val SCE_REBOL_WORD5=25 val SCE_REBOL_WORD6=26 val SCE_REBOL_WORD7=27 val SCE_REBOL_WORD8=28 # Lexical states for SCLEX_SQL lex SQL=SCLEX_SQL SCE_SQL_ val SCE_SQL_DEFAULT=0 val SCE_SQL_COMMENT=1 val SCE_SQL_COMMENTLINE=2 val SCE_SQL_COMMENTDOC=3 val SCE_SQL_NUMBER=4 val SCE_SQL_WORD=5 val SCE_SQL_STRING=6 val SCE_SQL_CHARACTER=7 val SCE_SQL_SQLPLUS=8 val SCE_SQL_SQLPLUS_PROMPT=9 val SCE_SQL_OPERATOR=10 val SCE_SQL_IDENTIFIER=11 val SCE_SQL_SQLPLUS_COMMENT=13 val SCE_SQL_COMMENTLINEDOC=15 val SCE_SQL_WORD2=16 val SCE_SQL_COMMENTDOCKEYWORD=17 val SCE_SQL_COMMENTDOCKEYWORDERROR=18 val SCE_SQL_USER1=19 val SCE_SQL_USER2=20 val SCE_SQL_USER3=21 val SCE_SQL_USER4=22 val SCE_SQL_QUOTEDIDENTIFIER=23 val SCE_SQL_QOPERATOR=24 # Lexical states for SCLEX_SMALLTALK lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ val SCE_ST_DEFAULT=0 val SCE_ST_STRING=1 val SCE_ST_NUMBER=2 val SCE_ST_COMMENT=3 val SCE_ST_SYMBOL=4 val SCE_ST_BINARY=5 val SCE_ST_BOOL=6 val SCE_ST_SELF=7 val SCE_ST_SUPER=8 val SCE_ST_NIL=9 val SCE_ST_GLOBAL=10 val SCE_ST_RETURN=11 val SCE_ST_SPECIAL=12 val SCE_ST_KWSEND=13 val SCE_ST_ASSIGN=14 val SCE_ST_CHARACTER=15 val SCE_ST_SPEC_SEL=16 # Lexical states for SCLEX_FLAGSHIP (clipper) lex FlagShip=SCLEX_FLAGSHIP SCE_FS_ val SCE_FS_DEFAULT=0 val SCE_FS_COMMENT=1 val SCE_FS_COMMENTLINE=2 val SCE_FS_COMMENTDOC=3 val SCE_FS_COMMENTLINEDOC=4 val SCE_FS_COMMENTDOCKEYWORD=5 val SCE_FS_COMMENTDOCKEYWORDERROR=6 val SCE_FS_KEYWORD=7 val SCE_FS_KEYWORD2=8 val SCE_FS_KEYWORD3=9 val SCE_FS_KEYWORD4=10 val SCE_FS_NUMBER=11 val SCE_FS_STRING=12 val SCE_FS_PREPROCESSOR=13 val SCE_FS_OPERATOR=14 val SCE_FS_IDENTIFIER=15 val SCE_FS_DATE=16 val SCE_FS_STRINGEOL=17 val SCE_FS_CONSTANT=18 val SCE_FS_WORDOPERATOR=19 val SCE_FS_DISABLEDCODE=20 val SCE_FS_DEFAULT_C=21 val SCE_FS_COMMENTDOC_C=22 val SCE_FS_COMMENTLINEDOC_C=23 val SCE_FS_KEYWORD_C=24 val SCE_FS_KEYWORD2_C=25 val SCE_FS_NUMBER_C=26 val SCE_FS_STRING_C=27 val SCE_FS_PREPROCESSOR_C=28 val SCE_FS_OPERATOR_C=29 val SCE_FS_IDENTIFIER_C=30 val SCE_FS_STRINGEOL_C=31 # Lexical states for SCLEX_CSOUND lex Csound=SCLEX_CSOUND SCE_CSOUND_ val SCE_CSOUND_DEFAULT=0 val SCE_CSOUND_COMMENT=1 val SCE_CSOUND_NUMBER=2 val SCE_CSOUND_OPERATOR=3 val SCE_CSOUND_INSTR=4 val SCE_CSOUND_IDENTIFIER=5 val SCE_CSOUND_OPCODE=6 val SCE_CSOUND_HEADERSTMT=7 val SCE_CSOUND_USERKEYWORD=8 val SCE_CSOUND_COMMENTBLOCK=9 val SCE_CSOUND_PARAM=10 val SCE_CSOUND_ARATE_VAR=11 val SCE_CSOUND_KRATE_VAR=12 val SCE_CSOUND_IRATE_VAR=13 val SCE_CSOUND_GLOBAL_VAR=14 val SCE_CSOUND_STRINGEOL=15 # Lexical states for SCLEX_INNOSETUP lex Inno=SCLEX_INNOSETUP SCE_INNO_ val SCE_INNO_DEFAULT=0 val SCE_INNO_COMMENT=1 val SCE_INNO_KEYWORD=2 val SCE_INNO_PARAMETER=3 val SCE_INNO_SECTION=4 val SCE_INNO_PREPROC=5 val SCE_INNO_INLINE_EXPANSION=6 val SCE_INNO_COMMENT_PASCAL=7 val SCE_INNO_KEYWORD_PASCAL=8 val SCE_INNO_KEYWORD_USER=9 val SCE_INNO_STRING_DOUBLE=10 val SCE_INNO_STRING_SINGLE=11 val SCE_INNO_IDENTIFIER=12 # Lexical states for SCLEX_OPAL lex Opal=SCLEX_OPAL SCE_OPAL_ val SCE_OPAL_SPACE=0 val SCE_OPAL_COMMENT_BLOCK=1 val SCE_OPAL_COMMENT_LINE=2 val SCE_OPAL_INTEGER=3 val SCE_OPAL_KEYWORD=4 val SCE_OPAL_SORT=5 val SCE_OPAL_STRING=6 val SCE_OPAL_PAR=7 val SCE_OPAL_BOOL_CONST=8 val SCE_OPAL_DEFAULT=32 # Lexical states for SCLEX_SPICE lex Spice=SCLEX_SPICE SCE_SPICE_ val SCE_SPICE_DEFAULT=0 val SCE_SPICE_IDENTIFIER=1 val SCE_SPICE_KEYWORD=2 val SCE_SPICE_KEYWORD2=3 val SCE_SPICE_KEYWORD3=4 val SCE_SPICE_NUMBER=5 val SCE_SPICE_DELIMITER=6 val SCE_SPICE_VALUE=7 val SCE_SPICE_COMMENTLINE=8 # Lexical states for SCLEX_CMAKE lex CMAKE=SCLEX_CMAKE SCE_CMAKE_ val SCE_CMAKE_DEFAULT=0 val SCE_CMAKE_COMMENT=1 val SCE_CMAKE_STRINGDQ=2 val SCE_CMAKE_STRINGLQ=3 val SCE_CMAKE_STRINGRQ=4 val SCE_CMAKE_COMMANDS=5 val SCE_CMAKE_PARAMETERS=6 val SCE_CMAKE_VARIABLE=7 val SCE_CMAKE_USERDEFINED=8 val SCE_CMAKE_WHILEDEF=9 val SCE_CMAKE_FOREACHDEF=10 val SCE_CMAKE_IFDEFINEDEF=11 val SCE_CMAKE_MACRODEF=12 val SCE_CMAKE_STRINGVAR=13 val SCE_CMAKE_NUMBER=14 # Lexical states for SCLEX_GAP lex Gap=SCLEX_GAP SCE_GAP_ val SCE_GAP_DEFAULT=0 val SCE_GAP_IDENTIFIER=1 val SCE_GAP_KEYWORD=2 val SCE_GAP_KEYWORD2=3 val SCE_GAP_KEYWORD3=4 val SCE_GAP_KEYWORD4=5 val SCE_GAP_STRING=6 val SCE_GAP_CHAR=7 val SCE_GAP_OPERATOR=8 val SCE_GAP_COMMENT=9 val SCE_GAP_NUMBER=10 val SCE_GAP_STRINGEOL=11 # Lexical state for SCLEX_PLM lex PLM=SCLEX_PLM SCE_PLM_ val SCE_PLM_DEFAULT=0 val SCE_PLM_COMMENT=1 val SCE_PLM_STRING=2 val SCE_PLM_NUMBER=3 val SCE_PLM_IDENTIFIER=4 val SCE_PLM_OPERATOR=5 val SCE_PLM_CONTROL=6 val SCE_PLM_KEYWORD=7 # Lexical state for SCLEX_PROGRESS lex Progress=SCLEX_PROGRESS SCE_4GL_ val SCE_4GL_DEFAULT=0 val SCE_4GL_NUMBER=1 val SCE_4GL_WORD=2 val SCE_4GL_STRING=3 val SCE_4GL_CHARACTER=4 val SCE_4GL_PREPROCESSOR=5 val SCE_4GL_OPERATOR=6 val SCE_4GL_IDENTIFIER=7 val SCE_4GL_BLOCK=8 val SCE_4GL_END=9 val SCE_4GL_COMMENT1=10 val SCE_4GL_COMMENT2=11 val SCE_4GL_COMMENT3=12 val SCE_4GL_COMMENT4=13 val SCE_4GL_COMMENT5=14 val SCE_4GL_COMMENT6=15 val SCE_4GL_DEFAULT_=16 val SCE_4GL_NUMBER_=17 val SCE_4GL_WORD_=18 val SCE_4GL_STRING_=19 val SCE_4GL_CHARACTER_=20 val SCE_4GL_PREPROCESSOR_=21 val SCE_4GL_OPERATOR_=22 val SCE_4GL_IDENTIFIER_=23 val SCE_4GL_BLOCK_=24 val SCE_4GL_END_=25 val SCE_4GL_COMMENT1_=26 val SCE_4GL_COMMENT2_=27 val SCE_4GL_COMMENT3_=28 val SCE_4GL_COMMENT4_=29 val SCE_4GL_COMMENT5_=30 val SCE_4GL_COMMENT6_=31 # Lexical states for SCLEX_ABAQUS lex ABAQUS=SCLEX_ABAQUS SCE_ABAQUS_ val SCE_ABAQUS_DEFAULT=0 val SCE_ABAQUS_COMMENT=1 val SCE_ABAQUS_COMMENTBLOCK=2 val SCE_ABAQUS_NUMBER=3 val SCE_ABAQUS_STRING=4 val SCE_ABAQUS_OPERATOR=5 val SCE_ABAQUS_WORD=6 val SCE_ABAQUS_PROCESSOR=7 val SCE_ABAQUS_COMMAND=8 val SCE_ABAQUS_SLASHCOMMAND=9 val SCE_ABAQUS_STARCOMMAND=10 val SCE_ABAQUS_ARGUMENT=11 val SCE_ABAQUS_FUNCTION=12 # Lexical states for SCLEX_ASYMPTOTE lex Asymptote=SCLEX_ASYMPTOTE SCE_ASY_ val SCE_ASY_DEFAULT=0 val SCE_ASY_COMMENT=1 val SCE_ASY_COMMENTLINE=2 val SCE_ASY_NUMBER=3 val SCE_ASY_WORD=4 val SCE_ASY_STRING=5 val SCE_ASY_CHARACTER=6 val SCE_ASY_OPERATOR=7 val SCE_ASY_IDENTIFIER=8 val SCE_ASY_STRINGEOL=9 val SCE_ASY_COMMENTLINEDOC=10 val SCE_ASY_WORD2=11 # Lexical states for SCLEX_R lex R=SCLEX_R SCE_R_ val SCE_R_DEFAULT=0 val SCE_R_COMMENT=1 val SCE_R_KWORD=2 val SCE_R_BASEKWORD=3 val SCE_R_OTHERKWORD=4 val SCE_R_NUMBER=5 val SCE_R_STRING=6 val SCE_R_STRING2=7 val SCE_R_OPERATOR=8 val SCE_R_IDENTIFIER=9 val SCE_R_INFIX=10 val SCE_R_INFIXEOL=11 # Lexical state for SCLEX_MAGIK lex MagikSF=SCLEX_MAGIK SCE_MAGIK_ val SCE_MAGIK_DEFAULT=0 val SCE_MAGIK_COMMENT=1 val SCE_MAGIK_HYPER_COMMENT=16 val SCE_MAGIK_STRING=2 val SCE_MAGIK_CHARACTER=3 val SCE_MAGIK_NUMBER=4 val SCE_MAGIK_IDENTIFIER=5 val SCE_MAGIK_OPERATOR=6 val SCE_MAGIK_FLOW=7 val SCE_MAGIK_CONTAINER=8 val SCE_MAGIK_BRACKET_BLOCK=9 val SCE_MAGIK_BRACE_BLOCK=10 val SCE_MAGIK_SQBRACKET_BLOCK=11 val SCE_MAGIK_UNKNOWN_KEYWORD=12 val SCE_MAGIK_KEYWORD=13 val SCE_MAGIK_PRAGMA=14 val SCE_MAGIK_SYMBOL=15 # Lexical state for SCLEX_POWERSHELL lex PowerShell=SCLEX_POWERSHELL SCE_POWERSHELL_ val SCE_POWERSHELL_DEFAULT=0 val SCE_POWERSHELL_COMMENT=1 val SCE_POWERSHELL_STRING=2 val SCE_POWERSHELL_CHARACTER=3 val SCE_POWERSHELL_NUMBER=4 val SCE_POWERSHELL_VARIABLE=5 val SCE_POWERSHELL_OPERATOR=6 val SCE_POWERSHELL_IDENTIFIER=7 val SCE_POWERSHELL_KEYWORD=8 val SCE_POWERSHELL_CMDLET=9 val SCE_POWERSHELL_ALIAS=10 val SCE_POWERSHELL_FUNCTION=11 val SCE_POWERSHELL_USER1=12 val SCE_POWERSHELL_COMMENTSTREAM=13 val SCE_POWERSHELL_HERE_STRING=14 val SCE_POWERSHELL_HERE_CHARACTER=15 val SCE_POWERSHELL_COMMENTDOCKEYWORD=16 # Lexical state for SCLEX_MYSQL lex MySQL=SCLEX_MYSQL SCE_MYSQL_ val SCE_MYSQL_DEFAULT=0 val SCE_MYSQL_COMMENT=1 val SCE_MYSQL_COMMENTLINE=2 val SCE_MYSQL_VARIABLE=3 val SCE_MYSQL_SYSTEMVARIABLE=4 val SCE_MYSQL_KNOWNSYSTEMVARIABLE=5 val SCE_MYSQL_NUMBER=6 val SCE_MYSQL_MAJORKEYWORD=7 val SCE_MYSQL_KEYWORD=8 val SCE_MYSQL_DATABASEOBJECT=9 val SCE_MYSQL_PROCEDUREKEYWORD=10 val SCE_MYSQL_STRING=11 val SCE_MYSQL_SQSTRING=12 val SCE_MYSQL_DQSTRING=13 val SCE_MYSQL_OPERATOR=14 val SCE_MYSQL_FUNCTION=15 val SCE_MYSQL_IDENTIFIER=16 val SCE_MYSQL_QUOTEDIDENTIFIER=17 val SCE_MYSQL_USER1=18 val SCE_MYSQL_USER2=19 val SCE_MYSQL_USER3=20 val SCE_MYSQL_HIDDENCOMMAND=21 val SCE_MYSQL_PLACEHOLDER=22 # Lexical state for SCLEX_PO lex Po=SCLEX_PO SCE_PO_ val SCE_PO_DEFAULT=0 val SCE_PO_COMMENT=1 val SCE_PO_MSGID=2 val SCE_PO_MSGID_TEXT=3 val SCE_PO_MSGSTR=4 val SCE_PO_MSGSTR_TEXT=5 val SCE_PO_MSGCTXT=6 val SCE_PO_MSGCTXT_TEXT=7 val SCE_PO_FUZZY=8 val SCE_PO_PROGRAMMER_COMMENT=9 val SCE_PO_REFERENCE=10 val SCE_PO_FLAGS=11 val SCE_PO_MSGID_TEXT_EOL=12 val SCE_PO_MSGSTR_TEXT_EOL=13 val SCE_PO_MSGCTXT_TEXT_EOL=14 val SCE_PO_ERROR=15 # Lexical states for SCLEX_PASCAL lex Pascal=SCLEX_PASCAL SCE_PAS_ val SCE_PAS_DEFAULT=0 val SCE_PAS_IDENTIFIER=1 val SCE_PAS_COMMENT=2 val SCE_PAS_COMMENT2=3 val SCE_PAS_COMMENTLINE=4 val SCE_PAS_PREPROCESSOR=5 val SCE_PAS_PREPROCESSOR2=6 val SCE_PAS_NUMBER=7 val SCE_PAS_HEXNUMBER=8 val SCE_PAS_WORD=9 val SCE_PAS_STRING=10 val SCE_PAS_STRINGEOL=11 val SCE_PAS_CHARACTER=12 val SCE_PAS_OPERATOR=13 val SCE_PAS_ASM=14 # Lexical state for SCLEX_SORCUS lex SORCUS=SCLEX_SORCUS SCE_SORCUS_ val SCE_SORCUS_DEFAULT=0 val SCE_SORCUS_COMMAND=1 val SCE_SORCUS_PARAMETER=2 val SCE_SORCUS_COMMENTLINE=3 val SCE_SORCUS_STRING=4 val SCE_SORCUS_STRINGEOL=5 val SCE_SORCUS_IDENTIFIER=6 val SCE_SORCUS_OPERATOR=7 val SCE_SORCUS_NUMBER=8 val SCE_SORCUS_CONSTANT=9 # Lexical state for SCLEX_POWERPRO lex PowerPro=SCLEX_POWERPRO SCE_POWERPRO_ val SCE_POWERPRO_DEFAULT=0 val SCE_POWERPRO_COMMENTBLOCK=1 val SCE_POWERPRO_COMMENTLINE=2 val SCE_POWERPRO_NUMBER=3 val SCE_POWERPRO_WORD=4 val SCE_POWERPRO_WORD2=5 val SCE_POWERPRO_WORD3=6 val SCE_POWERPRO_WORD4=7 val SCE_POWERPRO_DOUBLEQUOTEDSTRING=8 val SCE_POWERPRO_SINGLEQUOTEDSTRING=9 val SCE_POWERPRO_LINECONTINUE=10 val SCE_POWERPRO_OPERATOR=11 val SCE_POWERPRO_IDENTIFIER=12 val SCE_POWERPRO_STRINGEOL=13 val SCE_POWERPRO_VERBATIM=14 val SCE_POWERPRO_ALTQUOTE=15 val SCE_POWERPRO_FUNCTION=16 # Lexical states for SCLEX_SML lex SML=SCLEX_SML SCE_SML_ val SCE_SML_DEFAULT=0 val SCE_SML_IDENTIFIER=1 val SCE_SML_TAGNAME=2 val SCE_SML_KEYWORD=3 val SCE_SML_KEYWORD2=4 val SCE_SML_KEYWORD3=5 val SCE_SML_LINENUM=6 val SCE_SML_OPERATOR=7 val SCE_SML_NUMBER=8 val SCE_SML_CHAR=9 val SCE_SML_STRING=11 val SCE_SML_COMMENT=12 val SCE_SML_COMMENT1=13 val SCE_SML_COMMENT2=14 val SCE_SML_COMMENT3=15 # Lexical state for SCLEX_MARKDOWN lex Markdown=SCLEX_MARKDOWN SCE_MARKDOWN_ val SCE_MARKDOWN_DEFAULT=0 val SCE_MARKDOWN_LINE_BEGIN=1 val SCE_MARKDOWN_STRONG1=2 val SCE_MARKDOWN_STRONG2=3 val SCE_MARKDOWN_EM1=4 val SCE_MARKDOWN_EM2=5 val SCE_MARKDOWN_HEADER1=6 val SCE_MARKDOWN_HEADER2=7 val SCE_MARKDOWN_HEADER3=8 val SCE_MARKDOWN_HEADER4=9 val SCE_MARKDOWN_HEADER5=10 val SCE_MARKDOWN_HEADER6=11 val SCE_MARKDOWN_PRECHAR=12 val SCE_MARKDOWN_ULIST_ITEM=13 val SCE_MARKDOWN_OLIST_ITEM=14 val SCE_MARKDOWN_BLOCKQUOTE=15 val SCE_MARKDOWN_STRIKEOUT=16 val SCE_MARKDOWN_HRULE=17 val SCE_MARKDOWN_LINK=18 val SCE_MARKDOWN_CODE=19 val SCE_MARKDOWN_CODE2=20 val SCE_MARKDOWN_CODEBK=21 # Lexical state for SCLEX_TXT2TAGS lex Txt2tags=SCLEX_TXT2TAGS SCE_TXT2TAGS_ val SCE_TXT2TAGS_DEFAULT=0 val SCE_TXT2TAGS_LINE_BEGIN=1 val SCE_TXT2TAGS_STRONG1=2 val SCE_TXT2TAGS_STRONG2=3 val SCE_TXT2TAGS_EM1=4 val SCE_TXT2TAGS_EM2=5 val SCE_TXT2TAGS_HEADER1=6 val SCE_TXT2TAGS_HEADER2=7 val SCE_TXT2TAGS_HEADER3=8 val SCE_TXT2TAGS_HEADER4=9 val SCE_TXT2TAGS_HEADER5=10 val SCE_TXT2TAGS_HEADER6=11 val SCE_TXT2TAGS_PRECHAR=12 val SCE_TXT2TAGS_ULIST_ITEM=13 val SCE_TXT2TAGS_OLIST_ITEM=14 val SCE_TXT2TAGS_BLOCKQUOTE=15 val SCE_TXT2TAGS_STRIKEOUT=16 val SCE_TXT2TAGS_HRULE=17 val SCE_TXT2TAGS_LINK=18 val SCE_TXT2TAGS_CODE=19 val SCE_TXT2TAGS_CODE2=20 val SCE_TXT2TAGS_CODEBK=21 val SCE_TXT2TAGS_COMMENT=22 val SCE_TXT2TAGS_OPTION=23 val SCE_TXT2TAGS_PREPROC=24 val SCE_TXT2TAGS_POSTPROC=25 # Lexical states for SCLEX_A68K lex A68k=SCLEX_A68K SCE_A68K_ val SCE_A68K_DEFAULT=0 val SCE_A68K_COMMENT=1 val SCE_A68K_NUMBER_DEC=2 val SCE_A68K_NUMBER_BIN=3 val SCE_A68K_NUMBER_HEX=4 val SCE_A68K_STRING1=5 val SCE_A68K_OPERATOR=6 val SCE_A68K_CPUINSTRUCTION=7 val SCE_A68K_EXTINSTRUCTION=8 val SCE_A68K_REGISTER=9 val SCE_A68K_DIRECTIVE=10 val SCE_A68K_MACRO_ARG=11 val SCE_A68K_LABEL=12 val SCE_A68K_STRING2=13 val SCE_A68K_IDENTIFIER=14 val SCE_A68K_MACRO_DECLARATION=15 val SCE_A68K_COMMENT_WORD=16 val SCE_A68K_COMMENT_SPECIAL=17 val SCE_A68K_COMMENT_DOXYGEN=18 # Lexical states for SCLEX_MODULA lex Modula=SCLEX_MODULA SCE_MODULA_ val SCE_MODULA_DEFAULT=0 val SCE_MODULA_COMMENT=1 val SCE_MODULA_DOXYCOMM=2 val SCE_MODULA_DOXYKEY=3 val SCE_MODULA_KEYWORD=4 val SCE_MODULA_RESERVED=5 val SCE_MODULA_NUMBER=6 val SCE_MODULA_BASENUM=7 val SCE_MODULA_FLOAT=8 val SCE_MODULA_STRING=9 val SCE_MODULA_STRSPEC=10 val SCE_MODULA_CHAR=11 val SCE_MODULA_CHARSPEC=12 val SCE_MODULA_PROC=13 val SCE_MODULA_PRAGMA=14 val SCE_MODULA_PRGKEY=15 val SCE_MODULA_OPERATOR=16 val SCE_MODULA_BADSTR=17 # Lexical states for SCLEX_COFFEESCRIPT lex CoffeeScript=SCLEX_COFFEESCRIPT SCE_COFFEESCRIPT_ val SCE_COFFEESCRIPT_DEFAULT=0 val SCE_COFFEESCRIPT_COMMENT=1 val SCE_COFFEESCRIPT_COMMENTLINE=2 val SCE_COFFEESCRIPT_COMMENTDOC=3 val SCE_COFFEESCRIPT_NUMBER=4 val SCE_COFFEESCRIPT_WORD=5 val SCE_COFFEESCRIPT_STRING=6 val SCE_COFFEESCRIPT_CHARACTER=7 val SCE_COFFEESCRIPT_UUID=8 val SCE_COFFEESCRIPT_PREPROCESSOR=9 val SCE_COFFEESCRIPT_OPERATOR=10 val SCE_COFFEESCRIPT_IDENTIFIER=11 val SCE_COFFEESCRIPT_STRINGEOL=12 val SCE_COFFEESCRIPT_VERBATIM=13 val SCE_COFFEESCRIPT_REGEX=14 val SCE_COFFEESCRIPT_COMMENTLINEDOC=15 val SCE_COFFEESCRIPT_WORD2=16 val SCE_COFFEESCRIPT_COMMENTDOCKEYWORD=17 val SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR=18 val SCE_COFFEESCRIPT_GLOBALCLASS=19 val SCE_COFFEESCRIPT_STRINGRAW=20 val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21 val SCE_COFFEESCRIPT_COMMENTBLOCK=22 val SCE_COFFEESCRIPT_VERBOSE_REGEX=23 val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24 # Lexical states for SCLEX_AVS lex AVS=SCLEX_AVS SCE_AVS_ val SCE_AVS_DEFAULT=0 val SCE_AVS_COMMENTBLOCK=1 val SCE_AVS_COMMENTBLOCKN=2 val SCE_AVS_COMMENTLINE=3 val SCE_AVS_NUMBER=4 val SCE_AVS_OPERATOR=5 val SCE_AVS_IDENTIFIER=6 val SCE_AVS_STRING=7 val SCE_AVS_TRIPLESTRING=8 val SCE_AVS_KEYWORD=9 val SCE_AVS_FILTER=10 val SCE_AVS_PLUGIN=11 val SCE_AVS_FUNCTION=12 val SCE_AVS_CLIPPROP=13 val SCE_AVS_USERDFN=14 # Lexical states for SCLEX_ECL lex ECL=SCLEX_ECL SCE_ECL_ val SCE_ECL_DEFAULT=0 val SCE_ECL_COMMENT=1 val SCE_ECL_COMMENTLINE=2 val SCE_ECL_NUMBER=3 val SCE_ECL_STRING=4 val SCE_ECL_WORD0=5 val SCE_ECL_OPERATOR=6 val SCE_ECL_CHARACTER=7 val SCE_ECL_UUID=8 val SCE_ECL_PREPROCESSOR=9 val SCE_ECL_UNKNOWN=10 val SCE_ECL_IDENTIFIER=11 val SCE_ECL_STRINGEOL=12 val SCE_ECL_VERBATIM=13 val SCE_ECL_REGEX=14 val SCE_ECL_COMMENTLINEDOC=15 val SCE_ECL_WORD1=16 val SCE_ECL_COMMENTDOCKEYWORD=17 val SCE_ECL_COMMENTDOCKEYWORDERROR=18 val SCE_ECL_WORD2=19 val SCE_ECL_WORD3=20 val SCE_ECL_WORD4=21 val SCE_ECL_WORD5=22 val SCE_ECL_COMMENTDOC=23 val SCE_ECL_ADDED=24 val SCE_ECL_DELETED=25 val SCE_ECL_CHANGED=26 val SCE_ECL_MOVED=27 # Lexical states for SCLEX_OSCRIPT lex OScript=SCLEX_OSCRIPT SCE_OSCRIPT_ val SCE_OSCRIPT_DEFAULT=0 val SCE_OSCRIPT_LINE_COMMENT=1 val SCE_OSCRIPT_BLOCK_COMMENT=2 val SCE_OSCRIPT_DOC_COMMENT=3 val SCE_OSCRIPT_PREPROCESSOR=4 val SCE_OSCRIPT_NUMBER=5 val SCE_OSCRIPT_SINGLEQUOTE_STRING=6 val SCE_OSCRIPT_DOUBLEQUOTE_STRING=7 val SCE_OSCRIPT_CONSTANT=8 val SCE_OSCRIPT_IDENTIFIER=9 val SCE_OSCRIPT_GLOBAL=10 val SCE_OSCRIPT_KEYWORD=11 val SCE_OSCRIPT_OPERATOR=12 val SCE_OSCRIPT_LABEL=13 val SCE_OSCRIPT_TYPE=14 val SCE_OSCRIPT_FUNCTION=15 val SCE_OSCRIPT_OBJECT=16 val SCE_OSCRIPT_PROPERTY=17 val SCE_OSCRIPT_METHOD=18 # Lexical states for SCLEX_VISUALPROLOG lex VisualProlog=SCLEX_VISUALPROLOG SCE_VISUALPROLOG_ val SCE_VISUALPROLOG_DEFAULT=0 val SCE_VISUALPROLOG_KEY_MAJOR=1 val SCE_VISUALPROLOG_KEY_MINOR=2 val SCE_VISUALPROLOG_KEY_DIRECTIVE=3 val SCE_VISUALPROLOG_COMMENT_BLOCK=4 val SCE_VISUALPROLOG_COMMENT_LINE=5 val SCE_VISUALPROLOG_COMMENT_KEY=6 val SCE_VISUALPROLOG_COMMENT_KEY_ERROR=7 val SCE_VISUALPROLOG_IDENTIFIER=8 val SCE_VISUALPROLOG_VARIABLE=9 val SCE_VISUALPROLOG_ANONYMOUS=10 val SCE_VISUALPROLOG_NUMBER=11 val SCE_VISUALPROLOG_OPERATOR=12 val SCE_VISUALPROLOG_CHARACTER=13 val SCE_VISUALPROLOG_CHARACTER_TOO_MANY=14 val SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR=15 val SCE_VISUALPROLOG_STRING=16 val SCE_VISUALPROLOG_STRING_ESCAPE=17 val SCE_VISUALPROLOG_STRING_ESCAPE_ERROR=18 val SCE_VISUALPROLOG_STRING_EOL_OPEN=19 val SCE_VISUALPROLOG_STRING_VERBATIM=20 val SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL=21 val SCE_VISUALPROLOG_STRING_VERBATIM_EOL=22 # Lexical states for SCLEX_STTXT lex StructuredText=SCLEX_STTXT SCE_STTXT_ val SCE_STTXT_DEFAULT=0 val SCE_STTXT_COMMENT=1 val SCE_STTXT_COMMENTLINE=2 val SCE_STTXT_KEYWORD=3 val SCE_STTXT_TYPE=4 val SCE_STTXT_FUNCTION=5 val SCE_STTXT_FB=6 val SCE_STTXT_NUMBER=7 val SCE_STTXT_HEXNUMBER=8 val SCE_STTXT_PRAGMA=9 val SCE_STTXT_OPERATOR=10 val SCE_STTXT_CHARACTER=11 val SCE_STTXT_STRING1=12 val SCE_STTXT_STRING2=13 val SCE_STTXT_STRINGEOL=14 val SCE_STTXT_IDENTIFIER=15 val SCE_STTXT_DATETIME=16 val SCE_STTXT_VARS=17 val SCE_STTXT_PRAGMAS=18 # Lexical states for SCLEX_KVIRC lex KVIrc=SCLEX_KVIRC SCE_KVIRC_ val SCE_KVIRC_DEFAULT=0 val SCE_KVIRC_COMMENT=1 val SCE_KVIRC_COMMENTBLOCK=2 val SCE_KVIRC_STRING=3 val SCE_KVIRC_WORD=4 val SCE_KVIRC_KEYWORD=5 val SCE_KVIRC_FUNCTION_KEYWORD=6 val SCE_KVIRC_FUNCTION=7 val SCE_KVIRC_VARIABLE=8 val SCE_KVIRC_NUMBER=9 val SCE_KVIRC_OPERATOR=10 val SCE_KVIRC_STRING_FUNCTION=11 val SCE_KVIRC_STRING_VARIABLE=12 # Lexical states for SCLEX_RUST lex Rust=SCLEX_RUST SCE_RUST_ val SCE_RUST_DEFAULT=0 val SCE_RUST_COMMENTBLOCK=1 val SCE_RUST_COMMENTLINE=2 val SCE_RUST_COMMENTBLOCKDOC=3 val SCE_RUST_COMMENTLINEDOC=4 val SCE_RUST_NUMBER=5 val SCE_RUST_WORD=6 val SCE_RUST_WORD2=7 val SCE_RUST_WORD3=8 val SCE_RUST_WORD4=9 val SCE_RUST_WORD5=10 val SCE_RUST_WORD6=11 val SCE_RUST_WORD7=12 val SCE_RUST_STRING=13 val SCE_RUST_STRINGR=14 val SCE_RUST_CHARACTER=15 val SCE_RUST_OPERATOR=16 val SCE_RUST_IDENTIFIER=17 val SCE_RUST_LIFETIME=18 val SCE_RUST_MACRO=19 val SCE_RUST_LEXERROR=20 val SCE_RUST_BYTESTRING=21 val SCE_RUST_BYTESTRINGR=22 val SCE_RUST_BYTECHARACTER=23 # Lexical states for SCLEX_DMAP lex DMAP=SCLEX_DMAP SCE_DMAP_ val SCE_DMAP_DEFAULT=0 val SCE_DMAP_COMMENT=1 val SCE_DMAP_NUMBER=2 val SCE_DMAP_STRING1=3 val SCE_DMAP_STRING2=4 val SCE_DMAP_STRINGEOL=5 val SCE_DMAP_OPERATOR=6 val SCE_DMAP_IDENTIFIER=7 val SCE_DMAP_WORD=8 val SCE_DMAP_WORD2=9 val SCE_DMAP_WORD3=10 # Lexical states for SCLEX_DMIS lex DMIS=SCLEX_DMIS SCE_DMIS_ val SCE_DMIS_DEFAULT=0 val SCE_DMIS_COMMENT=1 val SCE_DMIS_STRING=2 val SCE_DMIS_NUMBER=3 val SCE_DMIS_KEYWORD=4 val SCE_DMIS_MAJORWORD=5 val SCE_DMIS_MINORWORD=6 val SCE_DMIS_UNSUPPORTED_MAJOR=7 val SCE_DMIS_UNSUPPORTED_MINOR=8 val SCE_DMIS_LABEL=9 # Lexical states for SCLEX_REGISTRY lex REG=SCLEX_REGISTRY SCE_REG_ val SCE_REG_DEFAULT=0 val SCE_REG_COMMENT=1 val SCE_REG_VALUENAME=2 val SCE_REG_STRING=3 val SCE_REG_HEXDIGIT=4 val SCE_REG_VALUETYPE=5 val SCE_REG_ADDEDKEY=6 val SCE_REG_DELETEDKEY=7 val SCE_REG_ESCAPED=8 val SCE_REG_KEYPATH_GUID=9 val SCE_REG_STRING_GUID=10 val SCE_REG_PARAMETER=11 val SCE_REG_OPERATOR=12 # Lexical state for SCLEX_BIBTEX lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_ val SCE_BIBTEX_DEFAULT=0 val SCE_BIBTEX_ENTRY=1 val SCE_BIBTEX_UNKNOWN_ENTRY=2 val SCE_BIBTEX_KEY=3 val SCE_BIBTEX_PARAMETER=4 val SCE_BIBTEX_VALUE=5 val SCE_BIBTEX_COMMENT=6 # Lexical state for SCLEX_SREC lex Srec=SCLEX_SREC SCE_HEX_ val SCE_HEX_DEFAULT=0 val SCE_HEX_RECSTART=1 val SCE_HEX_RECTYPE=2 val SCE_HEX_RECTYPE_UNKNOWN=3 val SCE_HEX_BYTECOUNT=4 val SCE_HEX_BYTECOUNT_WRONG=5 val SCE_HEX_NOADDRESS=6 val SCE_HEX_DATAADDRESS=7 val SCE_HEX_RECCOUNT=8 val SCE_HEX_STARTADDRESS=9 val SCE_HEX_ADDRESSFIELD_UNKNOWN=10 val SCE_HEX_EXTENDEDADDRESS=11 val SCE_HEX_DATA_ODD=12 val SCE_HEX_DATA_EVEN=13 val SCE_HEX_DATA_UNKNOWN=14 val SCE_HEX_DATA_EMPTY=15 val SCE_HEX_CHECKSUM=16 val SCE_HEX_CHECKSUM_WRONG=17 val SCE_HEX_GARBAGE=18 # Lexical state for SCLEX_IHEX (shared with Srec) lex IHex=SCLEX_IHEX SCE_HEX_ # Lexical state for SCLEX_TEHEX (shared with Srec) lex TEHex=SCLEX_TEHEX SCE_HEX_ # Events evt void StyleNeeded=2000(int position) evt void CharAdded=2001(int ch) evt void SavePointReached=2002(void) evt void SavePointLeft=2003(void) evt void ModifyAttemptRO=2004(void) # GTK+ Specific to work around focus and accelerator problems: evt void Key=2005(int ch, int modifiers) evt void DoubleClick=2006(int modifiers, int position, int line) evt void UpdateUI=2007(int updated) evt void Modified=2008(int position, int modificationType, string text, int length, int linesAdded, int line, int foldLevelNow, int foldLevelPrev, int token, int annotationLinesAdded) evt void MacroRecord=2009(int message, int wParam, int lParam) evt void MarginClick=2010(int modifiers, int position, int margin) evt void NeedShown=2011(int position, int length) evt void Painted=2013(void) evt void UserListSelection=2014(int listType, string text, int positionint, int ch, CompletionMethods listCompletionMethod) evt void URIDropped=2015(string text) evt void DwellStart=2016(int position, int x, int y) evt void DwellEnd=2017(int position, int x, int y) evt void Zoom=2018(void) evt void HotSpotClick=2019(int modifiers, int position) evt void HotSpotDoubleClick=2020(int modifiers, int position) evt void CallTipClick=2021(int position) evt void AutoCSelection=2022(string text, int position, int ch, CompletionMethods listCompletionMethod) evt void IndicatorClick=2023(int modifiers, int position) evt void IndicatorRelease=2024(int modifiers, int position) evt void AutoCCancelled=2025(void) evt void AutoCCharDeleted=2026(void) evt void HotSpotReleaseClick=2027(int modifiers, int position) evt void FocusIn=2028(void) evt void FocusOut=2029(void) evt void AutoCCompleted=2030(string text, int position, int ch, CompletionMethods listCompletionMethod) # There are no provisional features currently cat Provisional cat Deprecated # Deprecated in 2.21 # The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+. val SC_CP_DBCS=1 # Deprecated in 2.30 # In palette mode? get bool GetUsePalette=2139(,) # In palette mode, Scintilla uses the environment's palette calls to display # more colours. This may lead to ugly displays. set void SetUsePalette=2039(bool usePalette,) # Deprecated in 3.5.5 # Always interpret keyboard input as Unicode set void SetKeysUnicode=2521(bool keysUnicode,) # Are keys always interpreted as Unicode? get bool GetKeysUnicode=2522(,) scintilla/include/SciLexer.h0000644000175000017500000014237712457301435015034 0ustar neilneil/* Scintilla source code edit control */ /** @file SciLexer.h ** Interface to the added lexer functions in the SciLexer version of the edit control. **/ /* Copyright 1998-2002 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ /* Most of this file is automatically generated from the Scintilla.iface interface definition * file which contains any comments about the definitions. HFacer.py does the generation. */ #ifndef SCILEXER_H #define SCILEXER_H /* SciLexer features - not in standard Scintilla */ /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define SCLEX_CONTAINER 0 #define SCLEX_NULL 1 #define SCLEX_PYTHON 2 #define SCLEX_CPP 3 #define SCLEX_HTML 4 #define SCLEX_XML 5 #define SCLEX_PERL 6 #define SCLEX_SQL 7 #define SCLEX_VB 8 #define SCLEX_PROPERTIES 9 #define SCLEX_ERRORLIST 10 #define SCLEX_MAKEFILE 11 #define SCLEX_BATCH 12 #define SCLEX_XCODE 13 #define SCLEX_LATEX 14 #define SCLEX_LUA 15 #define SCLEX_DIFF 16 #define SCLEX_CONF 17 #define SCLEX_PASCAL 18 #define SCLEX_AVE 19 #define SCLEX_ADA 20 #define SCLEX_LISP 21 #define SCLEX_RUBY 22 #define SCLEX_EIFFEL 23 #define SCLEX_EIFFELKW 24 #define SCLEX_TCL 25 #define SCLEX_NNCRONTAB 26 #define SCLEX_BULLANT 27 #define SCLEX_VBSCRIPT 28 #define SCLEX_BAAN 31 #define SCLEX_MATLAB 32 #define SCLEX_SCRIPTOL 33 #define SCLEX_ASM 34 #define SCLEX_CPPNOCASE 35 #define SCLEX_FORTRAN 36 #define SCLEX_F77 37 #define SCLEX_CSS 38 #define SCLEX_POV 39 #define SCLEX_LOUT 40 #define SCLEX_ESCRIPT 41 #define SCLEX_PS 42 #define SCLEX_NSIS 43 #define SCLEX_MMIXAL 44 #define SCLEX_CLW 45 #define SCLEX_CLWNOCASE 46 #define SCLEX_LOT 47 #define SCLEX_YAML 48 #define SCLEX_TEX 49 #define SCLEX_METAPOST 50 #define SCLEX_POWERBASIC 51 #define SCLEX_FORTH 52 #define SCLEX_ERLANG 53 #define SCLEX_OCTAVE 54 #define SCLEX_MSSQL 55 #define SCLEX_VERILOG 56 #define SCLEX_KIX 57 #define SCLEX_GUI4CLI 58 #define SCLEX_SPECMAN 59 #define SCLEX_AU3 60 #define SCLEX_APDL 61 #define SCLEX_BASH 62 #define SCLEX_ASN1 63 #define SCLEX_VHDL 64 #define SCLEX_CAML 65 #define SCLEX_BLITZBASIC 66 #define SCLEX_PUREBASIC 67 #define SCLEX_HASKELL 68 #define SCLEX_PHPSCRIPT 69 #define SCLEX_TADS3 70 #define SCLEX_REBOL 71 #define SCLEX_SMALLTALK 72 #define SCLEX_FLAGSHIP 73 #define SCLEX_CSOUND 74 #define SCLEX_FREEBASIC 75 #define SCLEX_INNOSETUP 76 #define SCLEX_OPAL 77 #define SCLEX_SPICE 78 #define SCLEX_D 79 #define SCLEX_CMAKE 80 #define SCLEX_GAP 81 #define SCLEX_PLM 82 #define SCLEX_PROGRESS 83 #define SCLEX_ABAQUS 84 #define SCLEX_ASYMPTOTE 85 #define SCLEX_R 86 #define SCLEX_MAGIK 87 #define SCLEX_POWERSHELL 88 #define SCLEX_MYSQL 89 #define SCLEX_PO 90 #define SCLEX_TAL 91 #define SCLEX_COBOL 92 #define SCLEX_TACL 93 #define SCLEX_SORCUS 94 #define SCLEX_POWERPRO 95 #define SCLEX_NIMROD 96 #define SCLEX_SML 97 #define SCLEX_MARKDOWN 98 #define SCLEX_TXT2TAGS 99 #define SCLEX_A68K 100 #define SCLEX_MODULA 101 #define SCLEX_COFFEESCRIPT 102 #define SCLEX_TCMD 103 #define SCLEX_AVS 104 #define SCLEX_ECL 105 #define SCLEX_OSCRIPT 106 #define SCLEX_VISUALPROLOG 107 #define SCLEX_LITERATEHASKELL 108 #define SCLEX_STTXT 109 #define SCLEX_KVIRC 110 #define SCLEX_RUST 111 #define SCLEX_DMAP 112 #define SCLEX_AS 113 #define SCLEX_DMIS 114 #define SCLEX_REGISTRY 115 #define SCLEX_BIBTEX 116 #define SCLEX_SREC 117 #define SCLEX_IHEX 118 #define SCLEX_TEHEX 119 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 #define SCE_P_STRING 3 #define SCE_P_CHARACTER 4 #define SCE_P_WORD 5 #define SCE_P_TRIPLE 6 #define SCE_P_TRIPLEDOUBLE 7 #define SCE_P_CLASSNAME 8 #define SCE_P_DEFNAME 9 #define SCE_P_OPERATOR 10 #define SCE_P_IDENTIFIER 11 #define SCE_P_COMMENTBLOCK 12 #define SCE_P_STRINGEOL 13 #define SCE_P_WORD2 14 #define SCE_P_DECORATOR 15 #define SCE_C_DEFAULT 0 #define SCE_C_COMMENT 1 #define SCE_C_COMMENTLINE 2 #define SCE_C_COMMENTDOC 3 #define SCE_C_NUMBER 4 #define SCE_C_WORD 5 #define SCE_C_STRING 6 #define SCE_C_CHARACTER 7 #define SCE_C_UUID 8 #define SCE_C_PREPROCESSOR 9 #define SCE_C_OPERATOR 10 #define SCE_C_IDENTIFIER 11 #define SCE_C_STRINGEOL 12 #define SCE_C_VERBATIM 13 #define SCE_C_REGEX 14 #define SCE_C_COMMENTLINEDOC 15 #define SCE_C_WORD2 16 #define SCE_C_COMMENTDOCKEYWORD 17 #define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_C_GLOBALCLASS 19 #define SCE_C_STRINGRAW 20 #define SCE_C_TRIPLEVERBATIM 21 #define SCE_C_HASHQUOTEDSTRING 22 #define SCE_C_PREPROCESSORCOMMENT 23 #define SCE_C_PREPROCESSORCOMMENTDOC 24 #define SCE_C_USERLITERAL 25 #define SCE_C_TASKMARKER 26 #define SCE_C_ESCAPESEQUENCE 27 #define SCE_D_DEFAULT 0 #define SCE_D_COMMENT 1 #define SCE_D_COMMENTLINE 2 #define SCE_D_COMMENTDOC 3 #define SCE_D_COMMENTNESTED 4 #define SCE_D_NUMBER 5 #define SCE_D_WORD 6 #define SCE_D_WORD2 7 #define SCE_D_WORD3 8 #define SCE_D_TYPEDEF 9 #define SCE_D_STRING 10 #define SCE_D_STRINGEOL 11 #define SCE_D_CHARACTER 12 #define SCE_D_OPERATOR 13 #define SCE_D_IDENTIFIER 14 #define SCE_D_COMMENTLINEDOC 15 #define SCE_D_COMMENTDOCKEYWORD 16 #define SCE_D_COMMENTDOCKEYWORDERROR 17 #define SCE_D_STRINGB 18 #define SCE_D_STRINGR 19 #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 #define SCE_TCL_NUMBER 3 #define SCE_TCL_WORD_IN_QUOTE 4 #define SCE_TCL_IN_QUOTE 5 #define SCE_TCL_OPERATOR 6 #define SCE_TCL_IDENTIFIER 7 #define SCE_TCL_SUBSTITUTION 8 #define SCE_TCL_SUB_BRACE 9 #define SCE_TCL_MODIFIER 10 #define SCE_TCL_EXPAND 11 #define SCE_TCL_WORD 12 #define SCE_TCL_WORD2 13 #define SCE_TCL_WORD3 14 #define SCE_TCL_WORD4 15 #define SCE_TCL_WORD5 16 #define SCE_TCL_WORD6 17 #define SCE_TCL_WORD7 18 #define SCE_TCL_WORD8 19 #define SCE_TCL_COMMENT_BOX 20 #define SCE_TCL_BLOCK_COMMENT 21 #define SCE_H_DEFAULT 0 #define SCE_H_TAG 1 #define SCE_H_TAGUNKNOWN 2 #define SCE_H_ATTRIBUTE 3 #define SCE_H_ATTRIBUTEUNKNOWN 4 #define SCE_H_NUMBER 5 #define SCE_H_DOUBLESTRING 6 #define SCE_H_SINGLESTRING 7 #define SCE_H_OTHER 8 #define SCE_H_COMMENT 9 #define SCE_H_ENTITY 10 #define SCE_H_TAGEND 11 #define SCE_H_XMLSTART 12 #define SCE_H_XMLEND 13 #define SCE_H_SCRIPT 14 #define SCE_H_ASP 15 #define SCE_H_ASPAT 16 #define SCE_H_CDATA 17 #define SCE_H_QUESTION 18 #define SCE_H_VALUE 19 #define SCE_H_XCCOMMENT 20 #define SCE_H_SGML_DEFAULT 21 #define SCE_H_SGML_COMMAND 22 #define SCE_H_SGML_1ST_PARAM 23 #define SCE_H_SGML_DOUBLESTRING 24 #define SCE_H_SGML_SIMPLESTRING 25 #define SCE_H_SGML_ERROR 26 #define SCE_H_SGML_SPECIAL 27 #define SCE_H_SGML_ENTITY 28 #define SCE_H_SGML_COMMENT 29 #define SCE_H_SGML_1ST_PARAM_COMMENT 30 #define SCE_H_SGML_BLOCK_DEFAULT 31 #define SCE_HJ_START 40 #define SCE_HJ_DEFAULT 41 #define SCE_HJ_COMMENT 42 #define SCE_HJ_COMMENTLINE 43 #define SCE_HJ_COMMENTDOC 44 #define SCE_HJ_NUMBER 45 #define SCE_HJ_WORD 46 #define SCE_HJ_KEYWORD 47 #define SCE_HJ_DOUBLESTRING 48 #define SCE_HJ_SINGLESTRING 49 #define SCE_HJ_SYMBOLS 50 #define SCE_HJ_STRINGEOL 51 #define SCE_HJ_REGEX 52 #define SCE_HJA_START 55 #define SCE_HJA_DEFAULT 56 #define SCE_HJA_COMMENT 57 #define SCE_HJA_COMMENTLINE 58 #define SCE_HJA_COMMENTDOC 59 #define SCE_HJA_NUMBER 60 #define SCE_HJA_WORD 61 #define SCE_HJA_KEYWORD 62 #define SCE_HJA_DOUBLESTRING 63 #define SCE_HJA_SINGLESTRING 64 #define SCE_HJA_SYMBOLS 65 #define SCE_HJA_STRINGEOL 66 #define SCE_HJA_REGEX 67 #define SCE_HB_START 70 #define SCE_HB_DEFAULT 71 #define SCE_HB_COMMENTLINE 72 #define SCE_HB_NUMBER 73 #define SCE_HB_WORD 74 #define SCE_HB_STRING 75 #define SCE_HB_IDENTIFIER 76 #define SCE_HB_STRINGEOL 77 #define SCE_HBA_START 80 #define SCE_HBA_DEFAULT 81 #define SCE_HBA_COMMENTLINE 82 #define SCE_HBA_NUMBER 83 #define SCE_HBA_WORD 84 #define SCE_HBA_STRING 85 #define SCE_HBA_IDENTIFIER 86 #define SCE_HBA_STRINGEOL 87 #define SCE_HP_START 90 #define SCE_HP_DEFAULT 91 #define SCE_HP_COMMENTLINE 92 #define SCE_HP_NUMBER 93 #define SCE_HP_STRING 94 #define SCE_HP_CHARACTER 95 #define SCE_HP_WORD 96 #define SCE_HP_TRIPLE 97 #define SCE_HP_TRIPLEDOUBLE 98 #define SCE_HP_CLASSNAME 99 #define SCE_HP_DEFNAME 100 #define SCE_HP_OPERATOR 101 #define SCE_HP_IDENTIFIER 102 #define SCE_HPHP_COMPLEX_VARIABLE 104 #define SCE_HPA_START 105 #define SCE_HPA_DEFAULT 106 #define SCE_HPA_COMMENTLINE 107 #define SCE_HPA_NUMBER 108 #define SCE_HPA_STRING 109 #define SCE_HPA_CHARACTER 110 #define SCE_HPA_WORD 111 #define SCE_HPA_TRIPLE 112 #define SCE_HPA_TRIPLEDOUBLE 113 #define SCE_HPA_CLASSNAME 114 #define SCE_HPA_DEFNAME 115 #define SCE_HPA_OPERATOR 116 #define SCE_HPA_IDENTIFIER 117 #define SCE_HPHP_DEFAULT 118 #define SCE_HPHP_HSTRING 119 #define SCE_HPHP_SIMPLESTRING 120 #define SCE_HPHP_WORD 121 #define SCE_HPHP_NUMBER 122 #define SCE_HPHP_VARIABLE 123 #define SCE_HPHP_COMMENT 124 #define SCE_HPHP_COMMENTLINE 125 #define SCE_HPHP_HSTRING_VARIABLE 126 #define SCE_HPHP_OPERATOR 127 #define SCE_PL_DEFAULT 0 #define SCE_PL_ERROR 1 #define SCE_PL_COMMENTLINE 2 #define SCE_PL_POD 3 #define SCE_PL_NUMBER 4 #define SCE_PL_WORD 5 #define SCE_PL_STRING 6 #define SCE_PL_CHARACTER 7 #define SCE_PL_PUNCTUATION 8 #define SCE_PL_PREPROCESSOR 9 #define SCE_PL_OPERATOR 10 #define SCE_PL_IDENTIFIER 11 #define SCE_PL_SCALAR 12 #define SCE_PL_ARRAY 13 #define SCE_PL_HASH 14 #define SCE_PL_SYMBOLTABLE 15 #define SCE_PL_VARIABLE_INDEXER 16 #define SCE_PL_REGEX 17 #define SCE_PL_REGSUBST 18 #define SCE_PL_LONGQUOTE 19 #define SCE_PL_BACKTICKS 20 #define SCE_PL_DATASECTION 21 #define SCE_PL_HERE_DELIM 22 #define SCE_PL_HERE_Q 23 #define SCE_PL_HERE_QQ 24 #define SCE_PL_HERE_QX 25 #define SCE_PL_STRING_Q 26 #define SCE_PL_STRING_QQ 27 #define SCE_PL_STRING_QX 28 #define SCE_PL_STRING_QR 29 #define SCE_PL_STRING_QW 30 #define SCE_PL_POD_VERB 31 #define SCE_PL_SUB_PROTOTYPE 40 #define SCE_PL_FORMAT_IDENT 41 #define SCE_PL_FORMAT 42 #define SCE_PL_STRING_VAR 43 #define SCE_PL_XLAT 44 #define SCE_PL_REGEX_VAR 54 #define SCE_PL_REGSUBST_VAR 55 #define SCE_PL_BACKTICKS_VAR 57 #define SCE_PL_HERE_QQ_VAR 61 #define SCE_PL_HERE_QX_VAR 62 #define SCE_PL_STRING_QQ_VAR 64 #define SCE_PL_STRING_QX_VAR 65 #define SCE_PL_STRING_QR_VAR 66 #define SCE_RB_DEFAULT 0 #define SCE_RB_ERROR 1 #define SCE_RB_COMMENTLINE 2 #define SCE_RB_POD 3 #define SCE_RB_NUMBER 4 #define SCE_RB_WORD 5 #define SCE_RB_STRING 6 #define SCE_RB_CHARACTER 7 #define SCE_RB_CLASSNAME 8 #define SCE_RB_DEFNAME 9 #define SCE_RB_OPERATOR 10 #define SCE_RB_IDENTIFIER 11 #define SCE_RB_REGEX 12 #define SCE_RB_GLOBAL 13 #define SCE_RB_SYMBOL 14 #define SCE_RB_MODULE_NAME 15 #define SCE_RB_INSTANCE_VAR 16 #define SCE_RB_CLASS_VAR 17 #define SCE_RB_BACKTICKS 18 #define SCE_RB_DATASECTION 19 #define SCE_RB_HERE_DELIM 20 #define SCE_RB_HERE_Q 21 #define SCE_RB_HERE_QQ 22 #define SCE_RB_HERE_QX 23 #define SCE_RB_STRING_Q 24 #define SCE_RB_STRING_QQ 25 #define SCE_RB_STRING_QX 26 #define SCE_RB_STRING_QR 27 #define SCE_RB_STRING_QW 28 #define SCE_RB_WORD_DEMOTED 29 #define SCE_RB_STDIN 30 #define SCE_RB_STDOUT 31 #define SCE_RB_STDERR 40 #define SCE_RB_UPPER_BOUND 41 #define SCE_B_DEFAULT 0 #define SCE_B_COMMENT 1 #define SCE_B_NUMBER 2 #define SCE_B_KEYWORD 3 #define SCE_B_STRING 4 #define SCE_B_PREPROCESSOR 5 #define SCE_B_OPERATOR 6 #define SCE_B_IDENTIFIER 7 #define SCE_B_DATE 8 #define SCE_B_STRINGEOL 9 #define SCE_B_KEYWORD2 10 #define SCE_B_KEYWORD3 11 #define SCE_B_KEYWORD4 12 #define SCE_B_CONSTANT 13 #define SCE_B_ASM 14 #define SCE_B_LABEL 15 #define SCE_B_ERROR 16 #define SCE_B_HEXNUMBER 17 #define SCE_B_BINNUMBER 18 #define SCE_B_COMMENTBLOCK 19 #define SCE_B_DOCLINE 20 #define SCE_B_DOCBLOCK 21 #define SCE_B_DOCKEYWORD 22 #define SCE_PROPS_DEFAULT 0 #define SCE_PROPS_COMMENT 1 #define SCE_PROPS_SECTION 2 #define SCE_PROPS_ASSIGNMENT 3 #define SCE_PROPS_DEFVAL 4 #define SCE_PROPS_KEY 5 #define SCE_L_DEFAULT 0 #define SCE_L_COMMAND 1 #define SCE_L_TAG 2 #define SCE_L_MATH 3 #define SCE_L_COMMENT 4 #define SCE_L_TAG2 5 #define SCE_L_MATH2 6 #define SCE_L_COMMENT2 7 #define SCE_L_VERBATIM 8 #define SCE_L_SHORTCMD 9 #define SCE_L_SPECIAL 10 #define SCE_L_CMDOPT 11 #define SCE_L_ERROR 12 #define SCE_LUA_DEFAULT 0 #define SCE_LUA_COMMENT 1 #define SCE_LUA_COMMENTLINE 2 #define SCE_LUA_COMMENTDOC 3 #define SCE_LUA_NUMBER 4 #define SCE_LUA_WORD 5 #define SCE_LUA_STRING 6 #define SCE_LUA_CHARACTER 7 #define SCE_LUA_LITERALSTRING 8 #define SCE_LUA_PREPROCESSOR 9 #define SCE_LUA_OPERATOR 10 #define SCE_LUA_IDENTIFIER 11 #define SCE_LUA_STRINGEOL 12 #define SCE_LUA_WORD2 13 #define SCE_LUA_WORD3 14 #define SCE_LUA_WORD4 15 #define SCE_LUA_WORD5 16 #define SCE_LUA_WORD6 17 #define SCE_LUA_WORD7 18 #define SCE_LUA_WORD8 19 #define SCE_LUA_LABEL 20 #define SCE_ERR_DEFAULT 0 #define SCE_ERR_PYTHON 1 #define SCE_ERR_GCC 2 #define SCE_ERR_MS 3 #define SCE_ERR_CMD 4 #define SCE_ERR_BORLAND 5 #define SCE_ERR_PERL 6 #define SCE_ERR_NET 7 #define SCE_ERR_LUA 8 #define SCE_ERR_CTAG 9 #define SCE_ERR_DIFF_CHANGED 10 #define SCE_ERR_DIFF_ADDITION 11 #define SCE_ERR_DIFF_DELETION 12 #define SCE_ERR_DIFF_MESSAGE 13 #define SCE_ERR_PHP 14 #define SCE_ERR_ELF 15 #define SCE_ERR_IFC 16 #define SCE_ERR_IFORT 17 #define SCE_ERR_ABSF 18 #define SCE_ERR_TIDY 19 #define SCE_ERR_JAVA_STACK 20 #define SCE_ERR_VALUE 21 #define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_BAT_DEFAULT 0 #define SCE_BAT_COMMENT 1 #define SCE_BAT_WORD 2 #define SCE_BAT_LABEL 3 #define SCE_BAT_HIDE 4 #define SCE_BAT_COMMAND 5 #define SCE_BAT_IDENTIFIER 6 #define SCE_BAT_OPERATOR 7 #define SCE_TCMD_DEFAULT 0 #define SCE_TCMD_COMMENT 1 #define SCE_TCMD_WORD 2 #define SCE_TCMD_LABEL 3 #define SCE_TCMD_HIDE 4 #define SCE_TCMD_COMMAND 5 #define SCE_TCMD_IDENTIFIER 6 #define SCE_TCMD_OPERATOR 7 #define SCE_TCMD_ENVIRONMENT 8 #define SCE_TCMD_EXPANSION 9 #define SCE_TCMD_CLABEL 10 #define SCE_MAKE_DEFAULT 0 #define SCE_MAKE_COMMENT 1 #define SCE_MAKE_PREPROCESSOR 2 #define SCE_MAKE_IDENTIFIER 3 #define SCE_MAKE_OPERATOR 4 #define SCE_MAKE_TARGET 5 #define SCE_MAKE_IDEOL 9 #define SCE_DIFF_DEFAULT 0 #define SCE_DIFF_COMMENT 1 #define SCE_DIFF_COMMAND 2 #define SCE_DIFF_HEADER 3 #define SCE_DIFF_POSITION 4 #define SCE_DIFF_DELETED 5 #define SCE_DIFF_ADDED 6 #define SCE_DIFF_CHANGED 7 #define SCE_CONF_DEFAULT 0 #define SCE_CONF_COMMENT 1 #define SCE_CONF_NUMBER 2 #define SCE_CONF_IDENTIFIER 3 #define SCE_CONF_EXTENSION 4 #define SCE_CONF_PARAMETER 5 #define SCE_CONF_STRING 6 #define SCE_CONF_OPERATOR 7 #define SCE_CONF_IP 8 #define SCE_CONF_DIRECTIVE 9 #define SCE_AVE_DEFAULT 0 #define SCE_AVE_COMMENT 1 #define SCE_AVE_NUMBER 2 #define SCE_AVE_WORD 3 #define SCE_AVE_STRING 6 #define SCE_AVE_ENUM 7 #define SCE_AVE_STRINGEOL 8 #define SCE_AVE_IDENTIFIER 9 #define SCE_AVE_OPERATOR 10 #define SCE_AVE_WORD1 11 #define SCE_AVE_WORD2 12 #define SCE_AVE_WORD3 13 #define SCE_AVE_WORD4 14 #define SCE_AVE_WORD5 15 #define SCE_AVE_WORD6 16 #define SCE_ADA_DEFAULT 0 #define SCE_ADA_WORD 1 #define SCE_ADA_IDENTIFIER 2 #define SCE_ADA_NUMBER 3 #define SCE_ADA_DELIMITER 4 #define SCE_ADA_CHARACTER 5 #define SCE_ADA_CHARACTEREOL 6 #define SCE_ADA_STRING 7 #define SCE_ADA_STRINGEOL 8 #define SCE_ADA_LABEL 9 #define SCE_ADA_COMMENTLINE 10 #define SCE_ADA_ILLEGAL 11 #define SCE_BAAN_DEFAULT 0 #define SCE_BAAN_COMMENT 1 #define SCE_BAAN_COMMENTDOC 2 #define SCE_BAAN_NUMBER 3 #define SCE_BAAN_WORD 4 #define SCE_BAAN_STRING 5 #define SCE_BAAN_PREPROCESSOR 6 #define SCE_BAAN_OPERATOR 7 #define SCE_BAAN_IDENTIFIER 8 #define SCE_BAAN_STRINGEOL 9 #define SCE_BAAN_WORD2 10 #define SCE_LISP_DEFAULT 0 #define SCE_LISP_COMMENT 1 #define SCE_LISP_NUMBER 2 #define SCE_LISP_KEYWORD 3 #define SCE_LISP_KEYWORD_KW 4 #define SCE_LISP_SYMBOL 5 #define SCE_LISP_STRING 6 #define SCE_LISP_STRINGEOL 8 #define SCE_LISP_IDENTIFIER 9 #define SCE_LISP_OPERATOR 10 #define SCE_LISP_SPECIAL 11 #define SCE_LISP_MULTI_COMMENT 12 #define SCE_EIFFEL_DEFAULT 0 #define SCE_EIFFEL_COMMENTLINE 1 #define SCE_EIFFEL_NUMBER 2 #define SCE_EIFFEL_WORD 3 #define SCE_EIFFEL_STRING 4 #define SCE_EIFFEL_CHARACTER 5 #define SCE_EIFFEL_OPERATOR 6 #define SCE_EIFFEL_IDENTIFIER 7 #define SCE_EIFFEL_STRINGEOL 8 #define SCE_NNCRONTAB_DEFAULT 0 #define SCE_NNCRONTAB_COMMENT 1 #define SCE_NNCRONTAB_TASK 2 #define SCE_NNCRONTAB_SECTION 3 #define SCE_NNCRONTAB_KEYWORD 4 #define SCE_NNCRONTAB_MODIFIER 5 #define SCE_NNCRONTAB_ASTERISK 6 #define SCE_NNCRONTAB_NUMBER 7 #define SCE_NNCRONTAB_STRING 8 #define SCE_NNCRONTAB_ENVIRONMENT 9 #define SCE_NNCRONTAB_IDENTIFIER 10 #define SCE_FORTH_DEFAULT 0 #define SCE_FORTH_COMMENT 1 #define SCE_FORTH_COMMENT_ML 2 #define SCE_FORTH_IDENTIFIER 3 #define SCE_FORTH_CONTROL 4 #define SCE_FORTH_KEYWORD 5 #define SCE_FORTH_DEFWORD 6 #define SCE_FORTH_PREWORD1 7 #define SCE_FORTH_PREWORD2 8 #define SCE_FORTH_NUMBER 9 #define SCE_FORTH_STRING 10 #define SCE_FORTH_LOCALE 11 #define SCE_MATLAB_DEFAULT 0 #define SCE_MATLAB_COMMENT 1 #define SCE_MATLAB_COMMAND 2 #define SCE_MATLAB_NUMBER 3 #define SCE_MATLAB_KEYWORD 4 #define SCE_MATLAB_STRING 5 #define SCE_MATLAB_OPERATOR 6 #define SCE_MATLAB_IDENTIFIER 7 #define SCE_MATLAB_DOUBLEQUOTESTRING 8 #define SCE_SCRIPTOL_DEFAULT 0 #define SCE_SCRIPTOL_WHITE 1 #define SCE_SCRIPTOL_COMMENTLINE 2 #define SCE_SCRIPTOL_PERSISTENT 3 #define SCE_SCRIPTOL_CSTYLE 4 #define SCE_SCRIPTOL_COMMENTBLOCK 5 #define SCE_SCRIPTOL_NUMBER 6 #define SCE_SCRIPTOL_STRING 7 #define SCE_SCRIPTOL_CHARACTER 8 #define SCE_SCRIPTOL_STRINGEOL 9 #define SCE_SCRIPTOL_KEYWORD 10 #define SCE_SCRIPTOL_OPERATOR 11 #define SCE_SCRIPTOL_IDENTIFIER 12 #define SCE_SCRIPTOL_TRIPLE 13 #define SCE_SCRIPTOL_CLASSNAME 14 #define SCE_SCRIPTOL_PREPROCESSOR 15 #define SCE_ASM_DEFAULT 0 #define SCE_ASM_COMMENT 1 #define SCE_ASM_NUMBER 2 #define SCE_ASM_STRING 3 #define SCE_ASM_OPERATOR 4 #define SCE_ASM_IDENTIFIER 5 #define SCE_ASM_CPUINSTRUCTION 6 #define SCE_ASM_MATHINSTRUCTION 7 #define SCE_ASM_REGISTER 8 #define SCE_ASM_DIRECTIVE 9 #define SCE_ASM_DIRECTIVEOPERAND 10 #define SCE_ASM_COMMENTBLOCK 11 #define SCE_ASM_CHARACTER 12 #define SCE_ASM_STRINGEOL 13 #define SCE_ASM_EXTINSTRUCTION 14 #define SCE_ASM_COMMENTDIRECTIVE 15 #define SCE_F_DEFAULT 0 #define SCE_F_COMMENT 1 #define SCE_F_NUMBER 2 #define SCE_F_STRING1 3 #define SCE_F_STRING2 4 #define SCE_F_STRINGEOL 5 #define SCE_F_OPERATOR 6 #define SCE_F_IDENTIFIER 7 #define SCE_F_WORD 8 #define SCE_F_WORD2 9 #define SCE_F_WORD3 10 #define SCE_F_PREPROCESSOR 11 #define SCE_F_OPERATOR2 12 #define SCE_F_LABEL 13 #define SCE_F_CONTINUATION 14 #define SCE_CSS_DEFAULT 0 #define SCE_CSS_TAG 1 #define SCE_CSS_CLASS 2 #define SCE_CSS_PSEUDOCLASS 3 #define SCE_CSS_UNKNOWN_PSEUDOCLASS 4 #define SCE_CSS_OPERATOR 5 #define SCE_CSS_IDENTIFIER 6 #define SCE_CSS_UNKNOWN_IDENTIFIER 7 #define SCE_CSS_VALUE 8 #define SCE_CSS_COMMENT 9 #define SCE_CSS_ID 10 #define SCE_CSS_IMPORTANT 11 #define SCE_CSS_DIRECTIVE 12 #define SCE_CSS_DOUBLESTRING 13 #define SCE_CSS_SINGLESTRING 14 #define SCE_CSS_IDENTIFIER2 15 #define SCE_CSS_ATTRIBUTE 16 #define SCE_CSS_IDENTIFIER3 17 #define SCE_CSS_PSEUDOELEMENT 18 #define SCE_CSS_EXTENDED_IDENTIFIER 19 #define SCE_CSS_EXTENDED_PSEUDOCLASS 20 #define SCE_CSS_EXTENDED_PSEUDOELEMENT 21 #define SCE_CSS_MEDIA 22 #define SCE_CSS_VARIABLE 23 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 #define SCE_POV_NUMBER 3 #define SCE_POV_OPERATOR 4 #define SCE_POV_IDENTIFIER 5 #define SCE_POV_STRING 6 #define SCE_POV_STRINGEOL 7 #define SCE_POV_DIRECTIVE 8 #define SCE_POV_BADDIRECTIVE 9 #define SCE_POV_WORD2 10 #define SCE_POV_WORD3 11 #define SCE_POV_WORD4 12 #define SCE_POV_WORD5 13 #define SCE_POV_WORD6 14 #define SCE_POV_WORD7 15 #define SCE_POV_WORD8 16 #define SCE_LOUT_DEFAULT 0 #define SCE_LOUT_COMMENT 1 #define SCE_LOUT_NUMBER 2 #define SCE_LOUT_WORD 3 #define SCE_LOUT_WORD2 4 #define SCE_LOUT_WORD3 5 #define SCE_LOUT_WORD4 6 #define SCE_LOUT_STRING 7 #define SCE_LOUT_OPERATOR 8 #define SCE_LOUT_IDENTIFIER 9 #define SCE_LOUT_STRINGEOL 10 #define SCE_ESCRIPT_DEFAULT 0 #define SCE_ESCRIPT_COMMENT 1 #define SCE_ESCRIPT_COMMENTLINE 2 #define SCE_ESCRIPT_COMMENTDOC 3 #define SCE_ESCRIPT_NUMBER 4 #define SCE_ESCRIPT_WORD 5 #define SCE_ESCRIPT_STRING 6 #define SCE_ESCRIPT_OPERATOR 7 #define SCE_ESCRIPT_IDENTIFIER 8 #define SCE_ESCRIPT_BRACE 9 #define SCE_ESCRIPT_WORD2 10 #define SCE_ESCRIPT_WORD3 11 #define SCE_PS_DEFAULT 0 #define SCE_PS_COMMENT 1 #define SCE_PS_DSC_COMMENT 2 #define SCE_PS_DSC_VALUE 3 #define SCE_PS_NUMBER 4 #define SCE_PS_NAME 5 #define SCE_PS_KEYWORD 6 #define SCE_PS_LITERAL 7 #define SCE_PS_IMMEVAL 8 #define SCE_PS_PAREN_ARRAY 9 #define SCE_PS_PAREN_DICT 10 #define SCE_PS_PAREN_PROC 11 #define SCE_PS_TEXT 12 #define SCE_PS_HEXSTRING 13 #define SCE_PS_BASE85STRING 14 #define SCE_PS_BADSTRINGCHAR 15 #define SCE_NSIS_DEFAULT 0 #define SCE_NSIS_COMMENT 1 #define SCE_NSIS_STRINGDQ 2 #define SCE_NSIS_STRINGLQ 3 #define SCE_NSIS_STRINGRQ 4 #define SCE_NSIS_FUNCTION 5 #define SCE_NSIS_VARIABLE 6 #define SCE_NSIS_LABEL 7 #define SCE_NSIS_USERDEFINED 8 #define SCE_NSIS_SECTIONDEF 9 #define SCE_NSIS_SUBSECTIONDEF 10 #define SCE_NSIS_IFDEFINEDEF 11 #define SCE_NSIS_MACRODEF 12 #define SCE_NSIS_STRINGVAR 13 #define SCE_NSIS_NUMBER 14 #define SCE_NSIS_SECTIONGROUP 15 #define SCE_NSIS_PAGEEX 16 #define SCE_NSIS_FUNCTIONDEF 17 #define SCE_NSIS_COMMENTBOX 18 #define SCE_MMIXAL_LEADWS 0 #define SCE_MMIXAL_COMMENT 1 #define SCE_MMIXAL_LABEL 2 #define SCE_MMIXAL_OPCODE 3 #define SCE_MMIXAL_OPCODE_PRE 4 #define SCE_MMIXAL_OPCODE_VALID 5 #define SCE_MMIXAL_OPCODE_UNKNOWN 6 #define SCE_MMIXAL_OPCODE_POST 7 #define SCE_MMIXAL_OPERANDS 8 #define SCE_MMIXAL_NUMBER 9 #define SCE_MMIXAL_REF 10 #define SCE_MMIXAL_CHAR 11 #define SCE_MMIXAL_STRING 12 #define SCE_MMIXAL_REGISTER 13 #define SCE_MMIXAL_HEX 14 #define SCE_MMIXAL_OPERATOR 15 #define SCE_MMIXAL_SYMBOL 16 #define SCE_MMIXAL_INCLUDE 17 #define SCE_CLW_DEFAULT 0 #define SCE_CLW_LABEL 1 #define SCE_CLW_COMMENT 2 #define SCE_CLW_STRING 3 #define SCE_CLW_USER_IDENTIFIER 4 #define SCE_CLW_INTEGER_CONSTANT 5 #define SCE_CLW_REAL_CONSTANT 6 #define SCE_CLW_PICTURE_STRING 7 #define SCE_CLW_KEYWORD 8 #define SCE_CLW_COMPILER_DIRECTIVE 9 #define SCE_CLW_RUNTIME_EXPRESSIONS 10 #define SCE_CLW_BUILTIN_PROCEDURES_FUNCTION 11 #define SCE_CLW_STRUCTURE_DATA_TYPE 12 #define SCE_CLW_ATTRIBUTE 13 #define SCE_CLW_STANDARD_EQUATE 14 #define SCE_CLW_ERROR 15 #define SCE_CLW_DEPRECATED 16 #define SCE_LOT_DEFAULT 0 #define SCE_LOT_HEADER 1 #define SCE_LOT_BREAK 2 #define SCE_LOT_SET 3 #define SCE_LOT_PASS 4 #define SCE_LOT_FAIL 5 #define SCE_LOT_ABORT 6 #define SCE_YAML_DEFAULT 0 #define SCE_YAML_COMMENT 1 #define SCE_YAML_IDENTIFIER 2 #define SCE_YAML_KEYWORD 3 #define SCE_YAML_NUMBER 4 #define SCE_YAML_REFERENCE 5 #define SCE_YAML_DOCUMENT 6 #define SCE_YAML_TEXT 7 #define SCE_YAML_ERROR 8 #define SCE_YAML_OPERATOR 9 #define SCE_TEX_DEFAULT 0 #define SCE_TEX_SPECIAL 1 #define SCE_TEX_GROUP 2 #define SCE_TEX_SYMBOL 3 #define SCE_TEX_COMMAND 4 #define SCE_TEX_TEXT 5 #define SCE_METAPOST_DEFAULT 0 #define SCE_METAPOST_SPECIAL 1 #define SCE_METAPOST_GROUP 2 #define SCE_METAPOST_SYMBOL 3 #define SCE_METAPOST_COMMAND 4 #define SCE_METAPOST_TEXT 5 #define SCE_METAPOST_EXTRA 6 #define SCE_ERLANG_DEFAULT 0 #define SCE_ERLANG_COMMENT 1 #define SCE_ERLANG_VARIABLE 2 #define SCE_ERLANG_NUMBER 3 #define SCE_ERLANG_KEYWORD 4 #define SCE_ERLANG_STRING 5 #define SCE_ERLANG_OPERATOR 6 #define SCE_ERLANG_ATOM 7 #define SCE_ERLANG_FUNCTION_NAME 8 #define SCE_ERLANG_CHARACTER 9 #define SCE_ERLANG_MACRO 10 #define SCE_ERLANG_RECORD 11 #define SCE_ERLANG_PREPROC 12 #define SCE_ERLANG_NODE_NAME 13 #define SCE_ERLANG_COMMENT_FUNCTION 14 #define SCE_ERLANG_COMMENT_MODULE 15 #define SCE_ERLANG_COMMENT_DOC 16 #define SCE_ERLANG_COMMENT_DOC_MACRO 17 #define SCE_ERLANG_ATOM_QUOTED 18 #define SCE_ERLANG_MACRO_QUOTED 19 #define SCE_ERLANG_RECORD_QUOTED 20 #define SCE_ERLANG_NODE_NAME_QUOTED 21 #define SCE_ERLANG_BIFS 22 #define SCE_ERLANG_MODULES 23 #define SCE_ERLANG_MODULES_ATT 24 #define SCE_ERLANG_UNKNOWN 31 #define SCE_MSSQL_DEFAULT 0 #define SCE_MSSQL_COMMENT 1 #define SCE_MSSQL_LINE_COMMENT 2 #define SCE_MSSQL_NUMBER 3 #define SCE_MSSQL_STRING 4 #define SCE_MSSQL_OPERATOR 5 #define SCE_MSSQL_IDENTIFIER 6 #define SCE_MSSQL_VARIABLE 7 #define SCE_MSSQL_COLUMN_NAME 8 #define SCE_MSSQL_STATEMENT 9 #define SCE_MSSQL_DATATYPE 10 #define SCE_MSSQL_SYSTABLE 11 #define SCE_MSSQL_GLOBAL_VARIABLE 12 #define SCE_MSSQL_FUNCTION 13 #define SCE_MSSQL_STORED_PROCEDURE 14 #define SCE_MSSQL_DEFAULT_PREF_DATATYPE 15 #define SCE_MSSQL_COLUMN_NAME_2 16 #define SCE_V_DEFAULT 0 #define SCE_V_COMMENT 1 #define SCE_V_COMMENTLINE 2 #define SCE_V_COMMENTLINEBANG 3 #define SCE_V_NUMBER 4 #define SCE_V_WORD 5 #define SCE_V_STRING 6 #define SCE_V_WORD2 7 #define SCE_V_WORD3 8 #define SCE_V_PREPROCESSOR 9 #define SCE_V_OPERATOR 10 #define SCE_V_IDENTIFIER 11 #define SCE_V_STRINGEOL 12 #define SCE_V_USER 19 #define SCE_V_COMMENT_WORD 20 #define SCE_V_INPUT 21 #define SCE_V_OUTPUT 22 #define SCE_V_INOUT 23 #define SCE_V_PORT_CONNECT 24 #define SCE_KIX_DEFAULT 0 #define SCE_KIX_COMMENT 1 #define SCE_KIX_STRING1 2 #define SCE_KIX_STRING2 3 #define SCE_KIX_NUMBER 4 #define SCE_KIX_VAR 5 #define SCE_KIX_MACRO 6 #define SCE_KIX_KEYWORD 7 #define SCE_KIX_FUNCTIONS 8 #define SCE_KIX_OPERATOR 9 #define SCE_KIX_COMMENTSTREAM 10 #define SCE_KIX_IDENTIFIER 31 #define SCE_GC_DEFAULT 0 #define SCE_GC_COMMENTLINE 1 #define SCE_GC_COMMENTBLOCK 2 #define SCE_GC_GLOBAL 3 #define SCE_GC_EVENT 4 #define SCE_GC_ATTRIBUTE 5 #define SCE_GC_CONTROL 6 #define SCE_GC_COMMAND 7 #define SCE_GC_STRING 8 #define SCE_GC_OPERATOR 9 #define SCE_SN_DEFAULT 0 #define SCE_SN_CODE 1 #define SCE_SN_COMMENTLINE 2 #define SCE_SN_COMMENTLINEBANG 3 #define SCE_SN_NUMBER 4 #define SCE_SN_WORD 5 #define SCE_SN_STRING 6 #define SCE_SN_WORD2 7 #define SCE_SN_WORD3 8 #define SCE_SN_PREPROCESSOR 9 #define SCE_SN_OPERATOR 10 #define SCE_SN_IDENTIFIER 11 #define SCE_SN_STRINGEOL 12 #define SCE_SN_REGEXTAG 13 #define SCE_SN_SIGNAL 14 #define SCE_SN_USER 19 #define SCE_AU3_DEFAULT 0 #define SCE_AU3_COMMENT 1 #define SCE_AU3_COMMENTBLOCK 2 #define SCE_AU3_NUMBER 3 #define SCE_AU3_FUNCTION 4 #define SCE_AU3_KEYWORD 5 #define SCE_AU3_MACRO 6 #define SCE_AU3_STRING 7 #define SCE_AU3_OPERATOR 8 #define SCE_AU3_VARIABLE 9 #define SCE_AU3_SENT 10 #define SCE_AU3_PREPROCESSOR 11 #define SCE_AU3_SPECIAL 12 #define SCE_AU3_EXPAND 13 #define SCE_AU3_COMOBJ 14 #define SCE_AU3_UDF 15 #define SCE_APDL_DEFAULT 0 #define SCE_APDL_COMMENT 1 #define SCE_APDL_COMMENTBLOCK 2 #define SCE_APDL_NUMBER 3 #define SCE_APDL_STRING 4 #define SCE_APDL_OPERATOR 5 #define SCE_APDL_WORD 6 #define SCE_APDL_PROCESSOR 7 #define SCE_APDL_COMMAND 8 #define SCE_APDL_SLASHCOMMAND 9 #define SCE_APDL_STARCOMMAND 10 #define SCE_APDL_ARGUMENT 11 #define SCE_APDL_FUNCTION 12 #define SCE_SH_DEFAULT 0 #define SCE_SH_ERROR 1 #define SCE_SH_COMMENTLINE 2 #define SCE_SH_NUMBER 3 #define SCE_SH_WORD 4 #define SCE_SH_STRING 5 #define SCE_SH_CHARACTER 6 #define SCE_SH_OPERATOR 7 #define SCE_SH_IDENTIFIER 8 #define SCE_SH_SCALAR 9 #define SCE_SH_PARAM 10 #define SCE_SH_BACKTICKS 11 #define SCE_SH_HERE_DELIM 12 #define SCE_SH_HERE_Q 13 #define SCE_ASN1_DEFAULT 0 #define SCE_ASN1_COMMENT 1 #define SCE_ASN1_IDENTIFIER 2 #define SCE_ASN1_STRING 3 #define SCE_ASN1_OID 4 #define SCE_ASN1_SCALAR 5 #define SCE_ASN1_KEYWORD 6 #define SCE_ASN1_ATTRIBUTE 7 #define SCE_ASN1_DESCRIPTOR 8 #define SCE_ASN1_TYPE 9 #define SCE_ASN1_OPERATOR 10 #define SCE_VHDL_DEFAULT 0 #define SCE_VHDL_COMMENT 1 #define SCE_VHDL_COMMENTLINEBANG 2 #define SCE_VHDL_NUMBER 3 #define SCE_VHDL_STRING 4 #define SCE_VHDL_OPERATOR 5 #define SCE_VHDL_IDENTIFIER 6 #define SCE_VHDL_STRINGEOL 7 #define SCE_VHDL_KEYWORD 8 #define SCE_VHDL_STDOPERATOR 9 #define SCE_VHDL_ATTRIBUTE 10 #define SCE_VHDL_STDFUNCTION 11 #define SCE_VHDL_STDPACKAGE 12 #define SCE_VHDL_STDTYPE 13 #define SCE_VHDL_USERWORD 14 #define SCE_VHDL_BLOCK_COMMENT 15 #define SCE_CAML_DEFAULT 0 #define SCE_CAML_IDENTIFIER 1 #define SCE_CAML_TAGNAME 2 #define SCE_CAML_KEYWORD 3 #define SCE_CAML_KEYWORD2 4 #define SCE_CAML_KEYWORD3 5 #define SCE_CAML_LINENUM 6 #define SCE_CAML_OPERATOR 7 #define SCE_CAML_NUMBER 8 #define SCE_CAML_CHAR 9 #define SCE_CAML_WHITE 10 #define SCE_CAML_STRING 11 #define SCE_CAML_COMMENT 12 #define SCE_CAML_COMMENT1 13 #define SCE_CAML_COMMENT2 14 #define SCE_CAML_COMMENT3 15 #define SCE_HA_DEFAULT 0 #define SCE_HA_IDENTIFIER 1 #define SCE_HA_KEYWORD 2 #define SCE_HA_NUMBER 3 #define SCE_HA_STRING 4 #define SCE_HA_CHARACTER 5 #define SCE_HA_CLASS 6 #define SCE_HA_MODULE 7 #define SCE_HA_CAPITAL 8 #define SCE_HA_DATA 9 #define SCE_HA_IMPORT 10 #define SCE_HA_OPERATOR 11 #define SCE_HA_INSTANCE 12 #define SCE_HA_COMMENTLINE 13 #define SCE_HA_COMMENTBLOCK 14 #define SCE_HA_COMMENTBLOCK2 15 #define SCE_HA_COMMENTBLOCK3 16 #define SCE_HA_PRAGMA 17 #define SCE_HA_PREPROCESSOR 18 #define SCE_HA_STRINGEOL 19 #define SCE_HA_RESERVED_OPERATOR 20 #define SCE_HA_LITERATE_COMMENT 21 #define SCE_HA_LITERATE_CODEDELIM 22 #define SCE_T3_DEFAULT 0 #define SCE_T3_X_DEFAULT 1 #define SCE_T3_PREPROCESSOR 2 #define SCE_T3_BLOCK_COMMENT 3 #define SCE_T3_LINE_COMMENT 4 #define SCE_T3_OPERATOR 5 #define SCE_T3_KEYWORD 6 #define SCE_T3_NUMBER 7 #define SCE_T3_IDENTIFIER 8 #define SCE_T3_S_STRING 9 #define SCE_T3_D_STRING 10 #define SCE_T3_X_STRING 11 #define SCE_T3_LIB_DIRECTIVE 12 #define SCE_T3_MSG_PARAM 13 #define SCE_T3_HTML_TAG 14 #define SCE_T3_HTML_DEFAULT 15 #define SCE_T3_HTML_STRING 16 #define SCE_T3_USER1 17 #define SCE_T3_USER2 18 #define SCE_T3_USER3 19 #define SCE_T3_BRACE 20 #define SCE_REBOL_DEFAULT 0 #define SCE_REBOL_COMMENTLINE 1 #define SCE_REBOL_COMMENTBLOCK 2 #define SCE_REBOL_PREFACE 3 #define SCE_REBOL_OPERATOR 4 #define SCE_REBOL_CHARACTER 5 #define SCE_REBOL_QUOTEDSTRING 6 #define SCE_REBOL_BRACEDSTRING 7 #define SCE_REBOL_NUMBER 8 #define SCE_REBOL_PAIR 9 #define SCE_REBOL_TUPLE 10 #define SCE_REBOL_BINARY 11 #define SCE_REBOL_MONEY 12 #define SCE_REBOL_ISSUE 13 #define SCE_REBOL_TAG 14 #define SCE_REBOL_FILE 15 #define SCE_REBOL_EMAIL 16 #define SCE_REBOL_URL 17 #define SCE_REBOL_DATE 18 #define SCE_REBOL_TIME 19 #define SCE_REBOL_IDENTIFIER 20 #define SCE_REBOL_WORD 21 #define SCE_REBOL_WORD2 22 #define SCE_REBOL_WORD3 23 #define SCE_REBOL_WORD4 24 #define SCE_REBOL_WORD5 25 #define SCE_REBOL_WORD6 26 #define SCE_REBOL_WORD7 27 #define SCE_REBOL_WORD8 28 #define SCE_SQL_DEFAULT 0 #define SCE_SQL_COMMENT 1 #define SCE_SQL_COMMENTLINE 2 #define SCE_SQL_COMMENTDOC 3 #define SCE_SQL_NUMBER 4 #define SCE_SQL_WORD 5 #define SCE_SQL_STRING 6 #define SCE_SQL_CHARACTER 7 #define SCE_SQL_SQLPLUS 8 #define SCE_SQL_SQLPLUS_PROMPT 9 #define SCE_SQL_OPERATOR 10 #define SCE_SQL_IDENTIFIER 11 #define SCE_SQL_SQLPLUS_COMMENT 13 #define SCE_SQL_COMMENTLINEDOC 15 #define SCE_SQL_WORD2 16 #define SCE_SQL_COMMENTDOCKEYWORD 17 #define SCE_SQL_COMMENTDOCKEYWORDERROR 18 #define SCE_SQL_USER1 19 #define SCE_SQL_USER2 20 #define SCE_SQL_USER3 21 #define SCE_SQL_USER4 22 #define SCE_SQL_QUOTEDIDENTIFIER 23 #define SCE_SQL_QOPERATOR 24 #define SCE_ST_DEFAULT 0 #define SCE_ST_STRING 1 #define SCE_ST_NUMBER 2 #define SCE_ST_COMMENT 3 #define SCE_ST_SYMBOL 4 #define SCE_ST_BINARY 5 #define SCE_ST_BOOL 6 #define SCE_ST_SELF 7 #define SCE_ST_SUPER 8 #define SCE_ST_NIL 9 #define SCE_ST_GLOBAL 10 #define SCE_ST_RETURN 11 #define SCE_ST_SPECIAL 12 #define SCE_ST_KWSEND 13 #define SCE_ST_ASSIGN 14 #define SCE_ST_CHARACTER 15 #define SCE_ST_SPEC_SEL 16 #define SCE_FS_DEFAULT 0 #define SCE_FS_COMMENT 1 #define SCE_FS_COMMENTLINE 2 #define SCE_FS_COMMENTDOC 3 #define SCE_FS_COMMENTLINEDOC 4 #define SCE_FS_COMMENTDOCKEYWORD 5 #define SCE_FS_COMMENTDOCKEYWORDERROR 6 #define SCE_FS_KEYWORD 7 #define SCE_FS_KEYWORD2 8 #define SCE_FS_KEYWORD3 9 #define SCE_FS_KEYWORD4 10 #define SCE_FS_NUMBER 11 #define SCE_FS_STRING 12 #define SCE_FS_PREPROCESSOR 13 #define SCE_FS_OPERATOR 14 #define SCE_FS_IDENTIFIER 15 #define SCE_FS_DATE 16 #define SCE_FS_STRINGEOL 17 #define SCE_FS_CONSTANT 18 #define SCE_FS_WORDOPERATOR 19 #define SCE_FS_DISABLEDCODE 20 #define SCE_FS_DEFAULT_C 21 #define SCE_FS_COMMENTDOC_C 22 #define SCE_FS_COMMENTLINEDOC_C 23 #define SCE_FS_KEYWORD_C 24 #define SCE_FS_KEYWORD2_C 25 #define SCE_FS_NUMBER_C 26 #define SCE_FS_STRING_C 27 #define SCE_FS_PREPROCESSOR_C 28 #define SCE_FS_OPERATOR_C 29 #define SCE_FS_IDENTIFIER_C 30 #define SCE_FS_STRINGEOL_C 31 #define SCE_CSOUND_DEFAULT 0 #define SCE_CSOUND_COMMENT 1 #define SCE_CSOUND_NUMBER 2 #define SCE_CSOUND_OPERATOR 3 #define SCE_CSOUND_INSTR 4 #define SCE_CSOUND_IDENTIFIER 5 #define SCE_CSOUND_OPCODE 6 #define SCE_CSOUND_HEADERSTMT 7 #define SCE_CSOUND_USERKEYWORD 8 #define SCE_CSOUND_COMMENTBLOCK 9 #define SCE_CSOUND_PARAM 10 #define SCE_CSOUND_ARATE_VAR 11 #define SCE_CSOUND_KRATE_VAR 12 #define SCE_CSOUND_IRATE_VAR 13 #define SCE_CSOUND_GLOBAL_VAR 14 #define SCE_CSOUND_STRINGEOL 15 #define SCE_INNO_DEFAULT 0 #define SCE_INNO_COMMENT 1 #define SCE_INNO_KEYWORD 2 #define SCE_INNO_PARAMETER 3 #define SCE_INNO_SECTION 4 #define SCE_INNO_PREPROC 5 #define SCE_INNO_INLINE_EXPANSION 6 #define SCE_INNO_COMMENT_PASCAL 7 #define SCE_INNO_KEYWORD_PASCAL 8 #define SCE_INNO_KEYWORD_USER 9 #define SCE_INNO_STRING_DOUBLE 10 #define SCE_INNO_STRING_SINGLE 11 #define SCE_INNO_IDENTIFIER 12 #define SCE_OPAL_SPACE 0 #define SCE_OPAL_COMMENT_BLOCK 1 #define SCE_OPAL_COMMENT_LINE 2 #define SCE_OPAL_INTEGER 3 #define SCE_OPAL_KEYWORD 4 #define SCE_OPAL_SORT 5 #define SCE_OPAL_STRING 6 #define SCE_OPAL_PAR 7 #define SCE_OPAL_BOOL_CONST 8 #define SCE_OPAL_DEFAULT 32 #define SCE_SPICE_DEFAULT 0 #define SCE_SPICE_IDENTIFIER 1 #define SCE_SPICE_KEYWORD 2 #define SCE_SPICE_KEYWORD2 3 #define SCE_SPICE_KEYWORD3 4 #define SCE_SPICE_NUMBER 5 #define SCE_SPICE_DELIMITER 6 #define SCE_SPICE_VALUE 7 #define SCE_SPICE_COMMENTLINE 8 #define SCE_CMAKE_DEFAULT 0 #define SCE_CMAKE_COMMENT 1 #define SCE_CMAKE_STRINGDQ 2 #define SCE_CMAKE_STRINGLQ 3 #define SCE_CMAKE_STRINGRQ 4 #define SCE_CMAKE_COMMANDS 5 #define SCE_CMAKE_PARAMETERS 6 #define SCE_CMAKE_VARIABLE 7 #define SCE_CMAKE_USERDEFINED 8 #define SCE_CMAKE_WHILEDEF 9 #define SCE_CMAKE_FOREACHDEF 10 #define SCE_CMAKE_IFDEFINEDEF 11 #define SCE_CMAKE_MACRODEF 12 #define SCE_CMAKE_STRINGVAR 13 #define SCE_CMAKE_NUMBER 14 #define SCE_GAP_DEFAULT 0 #define SCE_GAP_IDENTIFIER 1 #define SCE_GAP_KEYWORD 2 #define SCE_GAP_KEYWORD2 3 #define SCE_GAP_KEYWORD3 4 #define SCE_GAP_KEYWORD4 5 #define SCE_GAP_STRING 6 #define SCE_GAP_CHAR 7 #define SCE_GAP_OPERATOR 8 #define SCE_GAP_COMMENT 9 #define SCE_GAP_NUMBER 10 #define SCE_GAP_STRINGEOL 11 #define SCE_PLM_DEFAULT 0 #define SCE_PLM_COMMENT 1 #define SCE_PLM_STRING 2 #define SCE_PLM_NUMBER 3 #define SCE_PLM_IDENTIFIER 4 #define SCE_PLM_OPERATOR 5 #define SCE_PLM_CONTROL 6 #define SCE_PLM_KEYWORD 7 #define SCE_4GL_DEFAULT 0 #define SCE_4GL_NUMBER 1 #define SCE_4GL_WORD 2 #define SCE_4GL_STRING 3 #define SCE_4GL_CHARACTER 4 #define SCE_4GL_PREPROCESSOR 5 #define SCE_4GL_OPERATOR 6 #define SCE_4GL_IDENTIFIER 7 #define SCE_4GL_BLOCK 8 #define SCE_4GL_END 9 #define SCE_4GL_COMMENT1 10 #define SCE_4GL_COMMENT2 11 #define SCE_4GL_COMMENT3 12 #define SCE_4GL_COMMENT4 13 #define SCE_4GL_COMMENT5 14 #define SCE_4GL_COMMENT6 15 #define SCE_4GL_DEFAULT_ 16 #define SCE_4GL_NUMBER_ 17 #define SCE_4GL_WORD_ 18 #define SCE_4GL_STRING_ 19 #define SCE_4GL_CHARACTER_ 20 #define SCE_4GL_PREPROCESSOR_ 21 #define SCE_4GL_OPERATOR_ 22 #define SCE_4GL_IDENTIFIER_ 23 #define SCE_4GL_BLOCK_ 24 #define SCE_4GL_END_ 25 #define SCE_4GL_COMMENT1_ 26 #define SCE_4GL_COMMENT2_ 27 #define SCE_4GL_COMMENT3_ 28 #define SCE_4GL_COMMENT4_ 29 #define SCE_4GL_COMMENT5_ 30 #define SCE_4GL_COMMENT6_ 31 #define SCE_ABAQUS_DEFAULT 0 #define SCE_ABAQUS_COMMENT 1 #define SCE_ABAQUS_COMMENTBLOCK 2 #define SCE_ABAQUS_NUMBER 3 #define SCE_ABAQUS_STRING 4 #define SCE_ABAQUS_OPERATOR 5 #define SCE_ABAQUS_WORD 6 #define SCE_ABAQUS_PROCESSOR 7 #define SCE_ABAQUS_COMMAND 8 #define SCE_ABAQUS_SLASHCOMMAND 9 #define SCE_ABAQUS_STARCOMMAND 10 #define SCE_ABAQUS_ARGUMENT 11 #define SCE_ABAQUS_FUNCTION 12 #define SCE_ASY_DEFAULT 0 #define SCE_ASY_COMMENT 1 #define SCE_ASY_COMMENTLINE 2 #define SCE_ASY_NUMBER 3 #define SCE_ASY_WORD 4 #define SCE_ASY_STRING 5 #define SCE_ASY_CHARACTER 6 #define SCE_ASY_OPERATOR 7 #define SCE_ASY_IDENTIFIER 8 #define SCE_ASY_STRINGEOL 9 #define SCE_ASY_COMMENTLINEDOC 10 #define SCE_ASY_WORD2 11 #define SCE_R_DEFAULT 0 #define SCE_R_COMMENT 1 #define SCE_R_KWORD 2 #define SCE_R_BASEKWORD 3 #define SCE_R_OTHERKWORD 4 #define SCE_R_NUMBER 5 #define SCE_R_STRING 6 #define SCE_R_STRING2 7 #define SCE_R_OPERATOR 8 #define SCE_R_IDENTIFIER 9 #define SCE_R_INFIX 10 #define SCE_R_INFIXEOL 11 #define SCE_MAGIK_DEFAULT 0 #define SCE_MAGIK_COMMENT 1 #define SCE_MAGIK_HYPER_COMMENT 16 #define SCE_MAGIK_STRING 2 #define SCE_MAGIK_CHARACTER 3 #define SCE_MAGIK_NUMBER 4 #define SCE_MAGIK_IDENTIFIER 5 #define SCE_MAGIK_OPERATOR 6 #define SCE_MAGIK_FLOW 7 #define SCE_MAGIK_CONTAINER 8 #define SCE_MAGIK_BRACKET_BLOCK 9 #define SCE_MAGIK_BRACE_BLOCK 10 #define SCE_MAGIK_SQBRACKET_BLOCK 11 #define SCE_MAGIK_UNKNOWN_KEYWORD 12 #define SCE_MAGIK_KEYWORD 13 #define SCE_MAGIK_PRAGMA 14 #define SCE_MAGIK_SYMBOL 15 #define SCE_POWERSHELL_DEFAULT 0 #define SCE_POWERSHELL_COMMENT 1 #define SCE_POWERSHELL_STRING 2 #define SCE_POWERSHELL_CHARACTER 3 #define SCE_POWERSHELL_NUMBER 4 #define SCE_POWERSHELL_VARIABLE 5 #define SCE_POWERSHELL_OPERATOR 6 #define SCE_POWERSHELL_IDENTIFIER 7 #define SCE_POWERSHELL_KEYWORD 8 #define SCE_POWERSHELL_CMDLET 9 #define SCE_POWERSHELL_ALIAS 10 #define SCE_POWERSHELL_FUNCTION 11 #define SCE_POWERSHELL_USER1 12 #define SCE_POWERSHELL_COMMENTSTREAM 13 #define SCE_POWERSHELL_HERE_STRING 14 #define SCE_POWERSHELL_HERE_CHARACTER 15 #define SCE_POWERSHELL_COMMENTDOCKEYWORD 16 #define SCE_MYSQL_DEFAULT 0 #define SCE_MYSQL_COMMENT 1 #define SCE_MYSQL_COMMENTLINE 2 #define SCE_MYSQL_VARIABLE 3 #define SCE_MYSQL_SYSTEMVARIABLE 4 #define SCE_MYSQL_KNOWNSYSTEMVARIABLE 5 #define SCE_MYSQL_NUMBER 6 #define SCE_MYSQL_MAJORKEYWORD 7 #define SCE_MYSQL_KEYWORD 8 #define SCE_MYSQL_DATABASEOBJECT 9 #define SCE_MYSQL_PROCEDUREKEYWORD 10 #define SCE_MYSQL_STRING 11 #define SCE_MYSQL_SQSTRING 12 #define SCE_MYSQL_DQSTRING 13 #define SCE_MYSQL_OPERATOR 14 #define SCE_MYSQL_FUNCTION 15 #define SCE_MYSQL_IDENTIFIER 16 #define SCE_MYSQL_QUOTEDIDENTIFIER 17 #define SCE_MYSQL_USER1 18 #define SCE_MYSQL_USER2 19 #define SCE_MYSQL_USER3 20 #define SCE_MYSQL_HIDDENCOMMAND 21 #define SCE_MYSQL_PLACEHOLDER 22 #define SCE_PO_DEFAULT 0 #define SCE_PO_COMMENT 1 #define SCE_PO_MSGID 2 #define SCE_PO_MSGID_TEXT 3 #define SCE_PO_MSGSTR 4 #define SCE_PO_MSGSTR_TEXT 5 #define SCE_PO_MSGCTXT 6 #define SCE_PO_MSGCTXT_TEXT 7 #define SCE_PO_FUZZY 8 #define SCE_PO_PROGRAMMER_COMMENT 9 #define SCE_PO_REFERENCE 10 #define SCE_PO_FLAGS 11 #define SCE_PO_MSGID_TEXT_EOL 12 #define SCE_PO_MSGSTR_TEXT_EOL 13 #define SCE_PO_MSGCTXT_TEXT_EOL 14 #define SCE_PO_ERROR 15 #define SCE_PAS_DEFAULT 0 #define SCE_PAS_IDENTIFIER 1 #define SCE_PAS_COMMENT 2 #define SCE_PAS_COMMENT2 3 #define SCE_PAS_COMMENTLINE 4 #define SCE_PAS_PREPROCESSOR 5 #define SCE_PAS_PREPROCESSOR2 6 #define SCE_PAS_NUMBER 7 #define SCE_PAS_HEXNUMBER 8 #define SCE_PAS_WORD 9 #define SCE_PAS_STRING 10 #define SCE_PAS_STRINGEOL 11 #define SCE_PAS_CHARACTER 12 #define SCE_PAS_OPERATOR 13 #define SCE_PAS_ASM 14 #define SCE_SORCUS_DEFAULT 0 #define SCE_SORCUS_COMMAND 1 #define SCE_SORCUS_PARAMETER 2 #define SCE_SORCUS_COMMENTLINE 3 #define SCE_SORCUS_STRING 4 #define SCE_SORCUS_STRINGEOL 5 #define SCE_SORCUS_IDENTIFIER 6 #define SCE_SORCUS_OPERATOR 7 #define SCE_SORCUS_NUMBER 8 #define SCE_SORCUS_CONSTANT 9 #define SCE_POWERPRO_DEFAULT 0 #define SCE_POWERPRO_COMMENTBLOCK 1 #define SCE_POWERPRO_COMMENTLINE 2 #define SCE_POWERPRO_NUMBER 3 #define SCE_POWERPRO_WORD 4 #define SCE_POWERPRO_WORD2 5 #define SCE_POWERPRO_WORD3 6 #define SCE_POWERPRO_WORD4 7 #define SCE_POWERPRO_DOUBLEQUOTEDSTRING 8 #define SCE_POWERPRO_SINGLEQUOTEDSTRING 9 #define SCE_POWERPRO_LINECONTINUE 10 #define SCE_POWERPRO_OPERATOR 11 #define SCE_POWERPRO_IDENTIFIER 12 #define SCE_POWERPRO_STRINGEOL 13 #define SCE_POWERPRO_VERBATIM 14 #define SCE_POWERPRO_ALTQUOTE 15 #define SCE_POWERPRO_FUNCTION 16 #define SCE_SML_DEFAULT 0 #define SCE_SML_IDENTIFIER 1 #define SCE_SML_TAGNAME 2 #define SCE_SML_KEYWORD 3 #define SCE_SML_KEYWORD2 4 #define SCE_SML_KEYWORD3 5 #define SCE_SML_LINENUM 6 #define SCE_SML_OPERATOR 7 #define SCE_SML_NUMBER 8 #define SCE_SML_CHAR 9 #define SCE_SML_STRING 11 #define SCE_SML_COMMENT 12 #define SCE_SML_COMMENT1 13 #define SCE_SML_COMMENT2 14 #define SCE_SML_COMMENT3 15 #define SCE_MARKDOWN_DEFAULT 0 #define SCE_MARKDOWN_LINE_BEGIN 1 #define SCE_MARKDOWN_STRONG1 2 #define SCE_MARKDOWN_STRONG2 3 #define SCE_MARKDOWN_EM1 4 #define SCE_MARKDOWN_EM2 5 #define SCE_MARKDOWN_HEADER1 6 #define SCE_MARKDOWN_HEADER2 7 #define SCE_MARKDOWN_HEADER3 8 #define SCE_MARKDOWN_HEADER4 9 #define SCE_MARKDOWN_HEADER5 10 #define SCE_MARKDOWN_HEADER6 11 #define SCE_MARKDOWN_PRECHAR 12 #define SCE_MARKDOWN_ULIST_ITEM 13 #define SCE_MARKDOWN_OLIST_ITEM 14 #define SCE_MARKDOWN_BLOCKQUOTE 15 #define SCE_MARKDOWN_STRIKEOUT 16 #define SCE_MARKDOWN_HRULE 17 #define SCE_MARKDOWN_LINK 18 #define SCE_MARKDOWN_CODE 19 #define SCE_MARKDOWN_CODE2 20 #define SCE_MARKDOWN_CODEBK 21 #define SCE_TXT2TAGS_DEFAULT 0 #define SCE_TXT2TAGS_LINE_BEGIN 1 #define SCE_TXT2TAGS_STRONG1 2 #define SCE_TXT2TAGS_STRONG2 3 #define SCE_TXT2TAGS_EM1 4 #define SCE_TXT2TAGS_EM2 5 #define SCE_TXT2TAGS_HEADER1 6 #define SCE_TXT2TAGS_HEADER2 7 #define SCE_TXT2TAGS_HEADER3 8 #define SCE_TXT2TAGS_HEADER4 9 #define SCE_TXT2TAGS_HEADER5 10 #define SCE_TXT2TAGS_HEADER6 11 #define SCE_TXT2TAGS_PRECHAR 12 #define SCE_TXT2TAGS_ULIST_ITEM 13 #define SCE_TXT2TAGS_OLIST_ITEM 14 #define SCE_TXT2TAGS_BLOCKQUOTE 15 #define SCE_TXT2TAGS_STRIKEOUT 16 #define SCE_TXT2TAGS_HRULE 17 #define SCE_TXT2TAGS_LINK 18 #define SCE_TXT2TAGS_CODE 19 #define SCE_TXT2TAGS_CODE2 20 #define SCE_TXT2TAGS_CODEBK 21 #define SCE_TXT2TAGS_COMMENT 22 #define SCE_TXT2TAGS_OPTION 23 #define SCE_TXT2TAGS_PREPROC 24 #define SCE_TXT2TAGS_POSTPROC 25 #define SCE_A68K_DEFAULT 0 #define SCE_A68K_COMMENT 1 #define SCE_A68K_NUMBER_DEC 2 #define SCE_A68K_NUMBER_BIN 3 #define SCE_A68K_NUMBER_HEX 4 #define SCE_A68K_STRING1 5 #define SCE_A68K_OPERATOR 6 #define SCE_A68K_CPUINSTRUCTION 7 #define SCE_A68K_EXTINSTRUCTION 8 #define SCE_A68K_REGISTER 9 #define SCE_A68K_DIRECTIVE 10 #define SCE_A68K_MACRO_ARG 11 #define SCE_A68K_LABEL 12 #define SCE_A68K_STRING2 13 #define SCE_A68K_IDENTIFIER 14 #define SCE_A68K_MACRO_DECLARATION 15 #define SCE_A68K_COMMENT_WORD 16 #define SCE_A68K_COMMENT_SPECIAL 17 #define SCE_A68K_COMMENT_DOXYGEN 18 #define SCE_MODULA_DEFAULT 0 #define SCE_MODULA_COMMENT 1 #define SCE_MODULA_DOXYCOMM 2 #define SCE_MODULA_DOXYKEY 3 #define SCE_MODULA_KEYWORD 4 #define SCE_MODULA_RESERVED 5 #define SCE_MODULA_NUMBER 6 #define SCE_MODULA_BASENUM 7 #define SCE_MODULA_FLOAT 8 #define SCE_MODULA_STRING 9 #define SCE_MODULA_STRSPEC 10 #define SCE_MODULA_CHAR 11 #define SCE_MODULA_CHARSPEC 12 #define SCE_MODULA_PROC 13 #define SCE_MODULA_PRAGMA 14 #define SCE_MODULA_PRGKEY 15 #define SCE_MODULA_OPERATOR 16 #define SCE_MODULA_BADSTR 17 #define SCE_COFFEESCRIPT_DEFAULT 0 #define SCE_COFFEESCRIPT_COMMENT 1 #define SCE_COFFEESCRIPT_COMMENTLINE 2 #define SCE_COFFEESCRIPT_COMMENTDOC 3 #define SCE_COFFEESCRIPT_NUMBER 4 #define SCE_COFFEESCRIPT_WORD 5 #define SCE_COFFEESCRIPT_STRING 6 #define SCE_COFFEESCRIPT_CHARACTER 7 #define SCE_COFFEESCRIPT_UUID 8 #define SCE_COFFEESCRIPT_PREPROCESSOR 9 #define SCE_COFFEESCRIPT_OPERATOR 10 #define SCE_COFFEESCRIPT_IDENTIFIER 11 #define SCE_COFFEESCRIPT_STRINGEOL 12 #define SCE_COFFEESCRIPT_VERBATIM 13 #define SCE_COFFEESCRIPT_REGEX 14 #define SCE_COFFEESCRIPT_COMMENTLINEDOC 15 #define SCE_COFFEESCRIPT_WORD2 16 #define SCE_COFFEESCRIPT_COMMENTDOCKEYWORD 17 #define SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18 #define SCE_COFFEESCRIPT_GLOBALCLASS 19 #define SCE_COFFEESCRIPT_STRINGRAW 20 #define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21 #define SCE_COFFEESCRIPT_COMMENTBLOCK 22 #define SCE_COFFEESCRIPT_VERBOSE_REGEX 23 #define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24 #define SCE_AVS_DEFAULT 0 #define SCE_AVS_COMMENTBLOCK 1 #define SCE_AVS_COMMENTBLOCKN 2 #define SCE_AVS_COMMENTLINE 3 #define SCE_AVS_NUMBER 4 #define SCE_AVS_OPERATOR 5 #define SCE_AVS_IDENTIFIER 6 #define SCE_AVS_STRING 7 #define SCE_AVS_TRIPLESTRING 8 #define SCE_AVS_KEYWORD 9 #define SCE_AVS_FILTER 10 #define SCE_AVS_PLUGIN 11 #define SCE_AVS_FUNCTION 12 #define SCE_AVS_CLIPPROP 13 #define SCE_AVS_USERDFN 14 #define SCE_ECL_DEFAULT 0 #define SCE_ECL_COMMENT 1 #define SCE_ECL_COMMENTLINE 2 #define SCE_ECL_NUMBER 3 #define SCE_ECL_STRING 4 #define SCE_ECL_WORD0 5 #define SCE_ECL_OPERATOR 6 #define SCE_ECL_CHARACTER 7 #define SCE_ECL_UUID 8 #define SCE_ECL_PREPROCESSOR 9 #define SCE_ECL_UNKNOWN 10 #define SCE_ECL_IDENTIFIER 11 #define SCE_ECL_STRINGEOL 12 #define SCE_ECL_VERBATIM 13 #define SCE_ECL_REGEX 14 #define SCE_ECL_COMMENTLINEDOC 15 #define SCE_ECL_WORD1 16 #define SCE_ECL_COMMENTDOCKEYWORD 17 #define SCE_ECL_COMMENTDOCKEYWORDERROR 18 #define SCE_ECL_WORD2 19 #define SCE_ECL_WORD3 20 #define SCE_ECL_WORD4 21 #define SCE_ECL_WORD5 22 #define SCE_ECL_COMMENTDOC 23 #define SCE_ECL_ADDED 24 #define SCE_ECL_DELETED 25 #define SCE_ECL_CHANGED 26 #define SCE_ECL_MOVED 27 #define SCE_OSCRIPT_DEFAULT 0 #define SCE_OSCRIPT_LINE_COMMENT 1 #define SCE_OSCRIPT_BLOCK_COMMENT 2 #define SCE_OSCRIPT_DOC_COMMENT 3 #define SCE_OSCRIPT_PREPROCESSOR 4 #define SCE_OSCRIPT_NUMBER 5 #define SCE_OSCRIPT_SINGLEQUOTE_STRING 6 #define SCE_OSCRIPT_DOUBLEQUOTE_STRING 7 #define SCE_OSCRIPT_CONSTANT 8 #define SCE_OSCRIPT_IDENTIFIER 9 #define SCE_OSCRIPT_GLOBAL 10 #define SCE_OSCRIPT_KEYWORD 11 #define SCE_OSCRIPT_OPERATOR 12 #define SCE_OSCRIPT_LABEL 13 #define SCE_OSCRIPT_TYPE 14 #define SCE_OSCRIPT_FUNCTION 15 #define SCE_OSCRIPT_OBJECT 16 #define SCE_OSCRIPT_PROPERTY 17 #define SCE_OSCRIPT_METHOD 18 #define SCE_VISUALPROLOG_DEFAULT 0 #define SCE_VISUALPROLOG_KEY_MAJOR 1 #define SCE_VISUALPROLOG_KEY_MINOR 2 #define SCE_VISUALPROLOG_KEY_DIRECTIVE 3 #define SCE_VISUALPROLOG_COMMENT_BLOCK 4 #define SCE_VISUALPROLOG_COMMENT_LINE 5 #define SCE_VISUALPROLOG_COMMENT_KEY 6 #define SCE_VISUALPROLOG_COMMENT_KEY_ERROR 7 #define SCE_VISUALPROLOG_IDENTIFIER 8 #define SCE_VISUALPROLOG_VARIABLE 9 #define SCE_VISUALPROLOG_ANONYMOUS 10 #define SCE_VISUALPROLOG_NUMBER 11 #define SCE_VISUALPROLOG_OPERATOR 12 #define SCE_VISUALPROLOG_CHARACTER 13 #define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14 #define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15 #define SCE_VISUALPROLOG_STRING 16 #define SCE_VISUALPROLOG_STRING_ESCAPE 17 #define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18 #define SCE_VISUALPROLOG_STRING_EOL_OPEN 19 #define SCE_VISUALPROLOG_STRING_VERBATIM 20 #define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21 #define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22 #define SCE_STTXT_DEFAULT 0 #define SCE_STTXT_COMMENT 1 #define SCE_STTXT_COMMENTLINE 2 #define SCE_STTXT_KEYWORD 3 #define SCE_STTXT_TYPE 4 #define SCE_STTXT_FUNCTION 5 #define SCE_STTXT_FB 6 #define SCE_STTXT_NUMBER 7 #define SCE_STTXT_HEXNUMBER 8 #define SCE_STTXT_PRAGMA 9 #define SCE_STTXT_OPERATOR 10 #define SCE_STTXT_CHARACTER 11 #define SCE_STTXT_STRING1 12 #define SCE_STTXT_STRING2 13 #define SCE_STTXT_STRINGEOL 14 #define SCE_STTXT_IDENTIFIER 15 #define SCE_STTXT_DATETIME 16 #define SCE_STTXT_VARS 17 #define SCE_STTXT_PRAGMAS 18 #define SCE_KVIRC_DEFAULT 0 #define SCE_KVIRC_COMMENT 1 #define SCE_KVIRC_COMMENTBLOCK 2 #define SCE_KVIRC_STRING 3 #define SCE_KVIRC_WORD 4 #define SCE_KVIRC_KEYWORD 5 #define SCE_KVIRC_FUNCTION_KEYWORD 6 #define SCE_KVIRC_FUNCTION 7 #define SCE_KVIRC_VARIABLE 8 #define SCE_KVIRC_NUMBER 9 #define SCE_KVIRC_OPERATOR 10 #define SCE_KVIRC_STRING_FUNCTION 11 #define SCE_KVIRC_STRING_VARIABLE 12 #define SCE_RUST_DEFAULT 0 #define SCE_RUST_COMMENTBLOCK 1 #define SCE_RUST_COMMENTLINE 2 #define SCE_RUST_COMMENTBLOCKDOC 3 #define SCE_RUST_COMMENTLINEDOC 4 #define SCE_RUST_NUMBER 5 #define SCE_RUST_WORD 6 #define SCE_RUST_WORD2 7 #define SCE_RUST_WORD3 8 #define SCE_RUST_WORD4 9 #define SCE_RUST_WORD5 10 #define SCE_RUST_WORD6 11 #define SCE_RUST_WORD7 12 #define SCE_RUST_STRING 13 #define SCE_RUST_STRINGR 14 #define SCE_RUST_CHARACTER 15 #define SCE_RUST_OPERATOR 16 #define SCE_RUST_IDENTIFIER 17 #define SCE_RUST_LIFETIME 18 #define SCE_RUST_MACRO 19 #define SCE_RUST_LEXERROR 20 #define SCE_RUST_BYTESTRING 21 #define SCE_RUST_BYTESTRINGR 22 #define SCE_RUST_BYTECHARACTER 23 #define SCE_DMAP_DEFAULT 0 #define SCE_DMAP_COMMENT 1 #define SCE_DMAP_NUMBER 2 #define SCE_DMAP_STRING1 3 #define SCE_DMAP_STRING2 4 #define SCE_DMAP_STRINGEOL 5 #define SCE_DMAP_OPERATOR 6 #define SCE_DMAP_IDENTIFIER 7 #define SCE_DMAP_WORD 8 #define SCE_DMAP_WORD2 9 #define SCE_DMAP_WORD3 10 #define SCE_DMIS_DEFAULT 0 #define SCE_DMIS_COMMENT 1 #define SCE_DMIS_STRING 2 #define SCE_DMIS_NUMBER 3 #define SCE_DMIS_KEYWORD 4 #define SCE_DMIS_MAJORWORD 5 #define SCE_DMIS_MINORWORD 6 #define SCE_DMIS_UNSUPPORTED_MAJOR 7 #define SCE_DMIS_UNSUPPORTED_MINOR 8 #define SCE_DMIS_LABEL 9 #define SCE_REG_DEFAULT 0 #define SCE_REG_COMMENT 1 #define SCE_REG_VALUENAME 2 #define SCE_REG_STRING 3 #define SCE_REG_HEXDIGIT 4 #define SCE_REG_VALUETYPE 5 #define SCE_REG_ADDEDKEY 6 #define SCE_REG_DELETEDKEY 7 #define SCE_REG_ESCAPED 8 #define SCE_REG_KEYPATH_GUID 9 #define SCE_REG_STRING_GUID 10 #define SCE_REG_PARAMETER 11 #define SCE_REG_OPERATOR 12 #define SCE_BIBTEX_DEFAULT 0 #define SCE_BIBTEX_ENTRY 1 #define SCE_BIBTEX_UNKNOWN_ENTRY 2 #define SCE_BIBTEX_KEY 3 #define SCE_BIBTEX_PARAMETER 4 #define SCE_BIBTEX_VALUE 5 #define SCE_BIBTEX_COMMENT 6 #define SCE_HEX_DEFAULT 0 #define SCE_HEX_RECSTART 1 #define SCE_HEX_RECTYPE 2 #define SCE_HEX_RECTYPE_UNKNOWN 3 #define SCE_HEX_BYTECOUNT 4 #define SCE_HEX_BYTECOUNT_WRONG 5 #define SCE_HEX_NOADDRESS 6 #define SCE_HEX_DATAADDRESS 7 #define SCE_HEX_RECCOUNT 8 #define SCE_HEX_STARTADDRESS 9 #define SCE_HEX_ADDRESSFIELD_UNKNOWN 10 #define SCE_HEX_EXTENDEDADDRESS 11 #define SCE_HEX_DATA_ODD 12 #define SCE_HEX_DATA_EVEN 13 #define SCE_HEX_DATA_UNKNOWN 14 #define SCE_HEX_DATA_EMPTY 15 #define SCE_HEX_CHECKSUM 16 #define SCE_HEX_CHECKSUM_WRONG 17 #define SCE_HEX_GARBAGE 18 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif scintilla/include/Face.pyc0000644000175000017500000000667512112516455014516 0ustar neilneil PPc@s;dZdZdZdZdddYZdS(cCs\|ddjo|d }n|iddjo||id }n|i}|S(Nis s##(tfindtstrip(tline((s../../include/Face.pyt sanitiseLines  c Cs|idd\}}|id\}}|id\}}|id\}}|id\}}|||||fS(Nt it(t=t)t,(tsplit( t featureValtretTypetrestt nameIdenttparamstnametvaluetparam1tparam2((s../../include/Face.pytdecodeFunction s cCsO|idd\}}|id\}}|id\}}|||fS(NRiRR(R (R R R R RRR((s../../include/Face.pyt decodeEventscCs}|i}d}d}d}d|joE|id\}}d|jo|id\}}qp|}n|||fS(NtRR(RR (tptparamttypeRRtnv((s../../include/Face.pyt decodeParams    tFacecBseZdZdZRS(cCs(g|_h|_h|_h|_dS(N(tordertfeaturestvaluestevents(tself((s../../include/Face.pyt__init__'s   c Csd}g}d}t|}xe|iD]W}t|}|o>|ddjoA|ddjo,|og}d}n|i|dq~qd}|idd\}}|djoyt|\} }} } } Wntj od |GHnXt| } t| }h |d 6| d 6| d 6| dd6| dd6| dd6|dd6|dd6|dd6|d6|d6|i|<| |i jot d| d|nd|i | <|i i|q|djot |\} }} h|d 6| d 6| d 6|d6|d6|i|<| |i jot d| d|nd|i | <|i i|q|djo |}q|djozy|idd\}} Wn%tj od|GHt nXh|d 6|d6| d 6|i|<|i i|q|djp |djoN|idd\}} h|d 6|d6| d 6|i|<|i i|qq+q+WdS( NRit#iRitfuntgettsetsFailed to decode %st FeatureTypet ReturnTypetValuet Param1Typet Param1Namet Param1Valuet Param2Typet Param2Namet Param2ValuetCategorytCommentsDuplicate value tevtsDuplicate event tcattvalRs Failure %stenutlex(sfunsgetsset(topent readlinesRtappendR Rt ValueErrorRRRt ExceptionRRR(R RtcurrentCategorytcurrentCommenttcurrentCommentFinishedtfileRt featureTypeR R RRRtp1tp2((s../../include/Face.pyt ReadFromFile-s        !!       (t__name__t __module__R!RB(((s../../include/Face.pyR%s N((RRRRR(((s../../include/Face.pyts    scintilla/include/ScintillaWidget.h0000644000175000017500000000261212075650364016373 0ustar neilneil/* Scintilla source code edit control */ /** @file ScintillaWidget.h ** Definition of Scintilla widget for GTK+. ** Only needed by GTK+ code but is harmless on other platforms. **/ /* Copyright 1998-2001 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ #ifndef SCINTILLAWIDGET_H #define SCINTILLAWIDGET_H #if defined(GTK) #ifdef __cplusplus extern "C" { #endif #define SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_CAST (obj, scintilla_get_type (), ScintillaObject) #define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass) #define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ()) typedef struct _ScintillaObject ScintillaObject; typedef struct _ScintillaClass ScintillaClass; struct _ScintillaObject { GtkContainer cont; void *pscin; }; struct _ScintillaClass { GtkContainerClass parent_class; void (* command) (ScintillaObject *ttt); void (* notify) (ScintillaObject *ttt); }; GType scintilla_get_type (void); GtkWidget* scintilla_new (void); void scintilla_set_id (ScintillaObject *sci, uptr_t id); sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam); void scintilla_release_resources(void); #define SCINTILLA_NOTIFY "sci-notify" #ifdef __cplusplus } #endif #endif #endif scintilla/include/Scintilla.h0000644000175000017500000011022512557522743015233 0ustar neilneil/* Scintilla source code edit control */ /** @file Scintilla.h ** Interface to the edit control. **/ /* Copyright 1998-2003 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ /* Most of this file is automatically generated from the Scintilla.iface interface definition * file which contains any comments about the definitions. HFacer.py does the generation. */ #ifndef SCINTILLA_H #define SCINTILLA_H #include "Sci_Position.h" #ifdef __cplusplus extern "C" { #endif #if defined(_WIN32) /* Return false on failure: */ int Scintilla_RegisterClasses(void *hInstance); int Scintilla_ReleaseResources(void); #endif int Scintilla_LinkLexers(void); #ifdef __cplusplus } #endif /* Here should be placed typedefs for uptr_t, an unsigned integer type large enough to * hold a pointer and sptr_t, a signed integer large enough to hold a pointer. * May need to be changed for 64 bit platforms. */ #if defined(_WIN32) #include #endif #ifdef MAXULONG_PTR typedef ULONG_PTR uptr_t; typedef LONG_PTR sptr_t; #else typedef unsigned long uptr_t; typedef long sptr_t; #endif typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 #define SCI_START 2000 #define SCI_OPTIONAL_START 3000 #define SCI_LEXER_START 4000 #define SCI_ADDTEXT 2001 #define SCI_ADDSTYLEDTEXT 2002 #define SCI_INSERTTEXT 2003 #define SCI_CHANGEINSERTION 2672 #define SCI_CLEARALL 2004 #define SCI_DELETERANGE 2645 #define SCI_CLEARDOCUMENTSTYLE 2005 #define SCI_GETLENGTH 2006 #define SCI_GETCHARAT 2007 #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 #define SCWS_VISIBLEAFTERINDENT 2 #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 #define SCI_POSITIONFROMPOINT 2022 #define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 #define SCI_GOTOPOS 2025 #define SCI_SETANCHOR 2026 #define SCI_GETCURLINE 2027 #define SCI_GETENDSTYLED 2028 #define SC_EOL_CRLF 0 #define SC_EOL_CR 1 #define SC_EOL_LF 2 #define SCI_CONVERTEOLS 2029 #define SCI_GETEOLMODE 2030 #define SCI_SETEOLMODE 2031 #define SCI_STARTSTYLING 2032 #define SCI_SETSTYLING 2033 #define SCI_GETBUFFEREDDRAW 2034 #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 #define SC_IME_WINDOWED 0 #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 #define SC_MARK_ARROW 2 #define SC_MARK_SMALLRECT 3 #define SC_MARK_SHORTARROW 4 #define SC_MARK_EMPTY 5 #define SC_MARK_ARROWDOWN 6 #define SC_MARK_MINUS 7 #define SC_MARK_PLUS 8 #define SC_MARK_VLINE 9 #define SC_MARK_LCORNER 10 #define SC_MARK_TCORNER 11 #define SC_MARK_BOXPLUS 12 #define SC_MARK_BOXPLUSCONNECTED 13 #define SC_MARK_BOXMINUS 14 #define SC_MARK_BOXMINUSCONNECTED 15 #define SC_MARK_LCORNERCURVE 16 #define SC_MARK_TCORNERCURVE 17 #define SC_MARK_CIRCLEPLUS 18 #define SC_MARK_CIRCLEPLUSCONNECTED 19 #define SC_MARK_CIRCLEMINUS 20 #define SC_MARK_CIRCLEMINUSCONNECTED 21 #define SC_MARK_BACKGROUND 22 #define SC_MARK_DOTDOTDOT 23 #define SC_MARK_ARROWS 24 #define SC_MARK_PIXMAP 25 #define SC_MARK_FULLRECT 26 #define SC_MARK_LEFTRECT 27 #define SC_MARK_AVAILABLE 28 #define SC_MARK_UNDERLINE 29 #define SC_MARK_RGBAIMAGE 30 #define SC_MARK_BOOKMARK 31 #define SC_MARK_CHARACTER 10000 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 #define SC_MARKNUM_FOLDERTAIL 28 #define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 #define SC_MASK_FOLDERS 0xFE000000 #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERSETBACKSELECTED 2292 #define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 #define SCI_MARKERDELETEALL 2045 #define SCI_MARKERGET 2046 #define SCI_MARKERNEXT 2047 #define SCI_MARKERPREVIOUS 2048 #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 #define SC_MAX_MARGIN 4 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 #define SC_MARGIN_BACK 2 #define SC_MARGIN_FORE 3 #define SC_MARGIN_TEXT 4 #define SC_MARGIN_RTEXT 5 #define SCI_SETMARGINTYPEN 2240 #define SCI_GETMARGINTYPEN 2241 #define SCI_SETMARGINWIDTHN 2242 #define SCI_GETMARGINWIDTHN 2243 #define SCI_SETMARGINMASKN 2244 #define SCI_GETMARGINMASKN 2245 #define SCI_SETMARGINSENSITIVEN 2246 #define SCI_GETMARGINSENSITIVEN 2247 #define SCI_SETMARGINCURSORN 2248 #define SCI_GETMARGINCURSORN 2249 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 #define STYLE_BRACEBAD 35 #define STYLE_CONTROLCHAR 36 #define STYLE_INDENTGUIDE 37 #define STYLE_CALLTIP 38 #define STYLE_LASTPREDEFINED 39 #define STYLE_MAX 255 #define SC_CHARSET_ANSI 0 #define SC_CHARSET_DEFAULT 1 #define SC_CHARSET_BALTIC 186 #define SC_CHARSET_CHINESEBIG5 136 #define SC_CHARSET_EASTEUROPE 238 #define SC_CHARSET_GB2312 134 #define SC_CHARSET_GREEK 161 #define SC_CHARSET_HANGUL 129 #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 #define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 #define SC_CHARSET_TURKISH 162 #define SC_CHARSET_JOHAB 130 #define SC_CHARSET_HEBREW 177 #define SC_CHARSET_ARABIC 178 #define SC_CHARSET_VIETNAMESE 163 #define SC_CHARSET_THAI 222 #define SC_CHARSET_8859_15 1000 #define SCI_STYLECLEARALL 2050 #define SCI_STYLESETFORE 2051 #define SCI_STYLESETBACK 2052 #define SCI_STYLESETBOLD 2053 #define SCI_STYLESETITALIC 2054 #define SCI_STYLESETSIZE 2055 #define SCI_STYLESETFONT 2056 #define SCI_STYLESETEOLFILLED 2057 #define SCI_STYLERESETDEFAULT 2058 #define SCI_STYLESETUNDERLINE 2059 #define SC_CASE_MIXED 0 #define SC_CASE_UPPER 1 #define SC_CASE_LOWER 2 #define SC_CASE_CAMEL 3 #define SCI_STYLEGETFORE 2481 #define SCI_STYLEGETBACK 2482 #define SCI_STYLEGETBOLD 2483 #define SCI_STYLEGETITALIC 2484 #define SCI_STYLEGETSIZE 2485 #define SCI_STYLEGETFONT 2486 #define SCI_STYLEGETEOLFILLED 2487 #define SCI_STYLEGETUNDERLINE 2488 #define SCI_STYLEGETCASE 2489 #define SCI_STYLEGETCHARACTERSET 2490 #define SCI_STYLEGETVISIBLE 2491 #define SCI_STYLEGETCHANGEABLE 2492 #define SCI_STYLEGETHOTSPOT 2493 #define SCI_STYLESETCASE 2060 #define SC_FONT_SIZE_MULTIPLIER 100 #define SCI_STYLESETSIZEFRACTIONAL 2061 #define SCI_STYLEGETSIZEFRACTIONAL 2062 #define SC_WEIGHT_NORMAL 400 #define SC_WEIGHT_SEMIBOLD 600 #define SC_WEIGHT_BOLD 700 #define SCI_STYLESETWEIGHT 2063 #define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_GETSELEOLFILLED 2479 #define SCI_SETSELEOLFILLED 2480 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 #define SCI_CLEARALLCMDKEYS 2072 #define SCI_SETSTYLINGEX 2073 #define SCI_STYLESETVISIBLE 2074 #define SCI_GETCARETPERIOD 2075 #define SCI_SETCARETPERIOD 2076 #define SCI_SETWORDCHARS 2077 #define SCI_GETWORDCHARS 2646 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 #define INDIC_DIAGONAL 3 #define INDIC_STRIKE 4 #define INDIC_HIDDEN 5 #define INDIC_BOX 6 #define INDIC_ROUNDBOX 7 #define INDIC_STRAIGHTBOX 8 #define INDIC_DASH 9 #define INDIC_DOTS 10 #define INDIC_SQUIGGLELOW 11 #define INDIC_DOTBOX 12 #define INDIC_SQUIGGLEPIXMAP 13 #define INDIC_COMPOSITIONTHICK 14 #define INDIC_COMPOSITIONTHIN 15 #define INDIC_FULLBOX 16 #define INDIC_TEXTFORE 17 #define INDIC_IME 32 #define INDIC_IME_MAX 35 #define INDIC_MAX 35 #define INDIC_CONTAINER 8 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 #define INDIC2_MASK 0x80 #define INDICS_MASK 0xE0 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 #define SCI_INDICGETFORE 2083 #define SCI_INDICSETUNDER 2510 #define SCI_INDICGETUNDER 2511 #define SCI_INDICSETHOVERSTYLE 2680 #define SCI_INDICGETHOVERSTYLE 2681 #define SCI_INDICSETHOVERFORE 2682 #define SCI_INDICGETHOVERFORE 2683 #define SC_INDICVALUEBIT 0x1000000 #define SC_INDICVALUEMASK 0xFFFFFF #define SC_INDICFLAG_VALUEFORE 1 #define SCI_INDICSETFLAGS 2684 #define SCI_INDICGETFLAGS 2685 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 #define SCI_GETWHITESPACESIZE 2087 #define SCI_SETSTYLEBITS 2090 #define SCI_GETSTYLEBITS 2091 #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 #define SCI_GETCARETLINEVISIBLE 2095 #define SCI_SETCARETLINEVISIBLE 2096 #define SCI_GETCARETLINEBACK 2097 #define SCI_SETCARETLINEBACK 2098 #define SCI_STYLESETCHANGEABLE 2099 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 #define SCI_AUTOCACTIVE 2102 #define SCI_AUTOCPOSSTART 2103 #define SCI_AUTOCCOMPLETE 2104 #define SCI_AUTOCSTOPS 2105 #define SCI_AUTOCSETSEPARATOR 2106 #define SCI_AUTOCGETSEPARATOR 2107 #define SCI_AUTOCSELECT 2108 #define SCI_AUTOCSETCANCELATSTART 2110 #define SCI_AUTOCGETCANCELATSTART 2111 #define SCI_AUTOCSETFILLUPS 2112 #define SCI_AUTOCSETCHOOSESINGLE 2113 #define SCI_AUTOCGETCHOOSESINGLE 2114 #define SCI_AUTOCSETIGNORECASE 2115 #define SCI_AUTOCGETIGNORECASE 2116 #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 #define SCI_CLEARREGISTEREDIMAGES 2408 #define SCI_AUTOCGETTYPESEPARATOR 2285 #define SCI_AUTOCSETTYPESEPARATOR 2286 #define SCI_AUTOCSETMAXWIDTH 2208 #define SCI_AUTOCGETMAXWIDTH 2209 #define SCI_AUTOCSETMAXHEIGHT 2210 #define SCI_AUTOCGETMAXHEIGHT 2211 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 #define SCI_GETUSETABS 2125 #define SCI_SETLINEINDENTATION 2126 #define SCI_GETLINEINDENTATION 2127 #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 #define SCI_COUNTCHARACTERS 2633 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SC_IV_NONE 0 #define SC_IV_REAL 1 #define SC_IV_LOOKFORWARD 2 #define SC_IV_LOOKBOTH 3 #define SCI_SETINDENTATIONGUIDES 2132 #define SCI_GETINDENTATIONGUIDES 2133 #define SCI_SETHIGHLIGHTGUIDE 2134 #define SCI_GETHIGHLIGHTGUIDE 2135 #define SCI_GETLINEENDPOSITION 2136 #define SCI_GETCODEPAGE 2137 #define SCI_GETCARETFORE 2138 #define SCI_GETREADONLY 2140 #define SCI_SETCURRENTPOS 2141 #define SCI_SETSELECTIONSTART 2142 #define SCI_GETSELECTIONSTART 2143 #define SCI_SETSELECTIONEND 2144 #define SCI_GETSELECTIONEND 2145 #define SCI_SETEMPTYSELECTION 2556 #define SCI_SETPRINTMAGNIFICATION 2146 #define SCI_GETPRINTMAGNIFICATION 2147 #define SC_PRINT_NORMAL 0 #define SC_PRINT_INVERTLIGHT 1 #define SC_PRINT_BLACKONWHITE 2 #define SC_PRINT_COLOURONWHITE 3 #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 #define SCFIND_WHOLEWORD 0x2 #define SCFIND_MATCHCASE 0x4 #define SCFIND_WORDSTART 0x00100000 #define SCFIND_REGEXP 0x00200000 #define SCFIND_POSIX 0x00400000 #define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 #define SCI_FORMATRANGE 2151 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 #define SCI_GETMARGINRIGHT 2158 #define SCI_GETMODIFY 2159 #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 #define SCI_GETTEXTRANGE 2162 #define SCI_HIDESELECTION 2163 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 #define SCI_POSITIONFROMLINE 2167 #define SCI_LINESCROLL 2168 #define SCI_SCROLLCARET 2169 #define SCI_SCROLLRANGE 2569 #define SCI_REPLACESEL 2170 #define SCI_SETREADONLY 2171 #define SCI_NULL 2172 #define SCI_CANPASTE 2173 #define SCI_CANUNDO 2174 #define SCI_EMPTYUNDOBUFFER 2175 #define SCI_UNDO 2176 #define SCI_CUT 2177 #define SCI_COPY 2178 #define SCI_PASTE 2179 #define SCI_CLEAR 2180 #define SCI_SETTEXT 2181 #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 #define SCI_SETCARETWIDTH 2188 #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 #define SCI_TARGETFROMSELECTION 2287 #define SCI_TARGETWHOLEDOCUMENT 2690 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 #define SCI_CALLTIPSHOW 2200 #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 #define SCI_CALLTIPPOSSTART 2203 #define SCI_CALLTIPSETPOSSTART 2214 #define SCI_CALLTIPSETHLT 2204 #define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPUSESTYLE 2212 #define SCI_CALLTIPSETPOSITION 2213 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 #define SC_FOLDLEVELNUMBERMASK 0x0FFF #define SCI_SETFOLDLEVEL 2222 #define SCI_GETFOLDLEVEL 2223 #define SCI_GETLASTCHILD 2224 #define SCI_GETFOLDPARENT 2225 #define SCI_SHOWLINES 2226 #define SCI_HIDELINES 2227 #define SCI_GETLINEVISIBLE 2228 #define SCI_GETALLLINESVISIBLE 2236 #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 #define SC_FOLDACTION_CONTRACT 0 #define SC_FOLDACTION_EXPAND 1 #define SC_FOLDACTION_TOGGLE 2 #define SCI_FOLDLINE 2237 #define SCI_FOLDCHILDREN 2238 #define SCI_EXPANDCHILDREN 2239 #define SCI_FOLDALL 2662 #define SCI_ENSUREVISIBLE 2232 #define SC_AUTOMATICFOLD_SHOW 0x0001 #define SC_AUTOMATICFOLD_CLICK 0x0002 #define SC_AUTOMATICFOLD_CHANGE 0x0004 #define SCI_SETAUTOMATICFOLD 2663 #define SCI_GETAUTOMATICFOLD 2664 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 #define SC_FOLDFLAG_LINESTATE 0x0080 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 #define SCI_GETTABINDENTS 2261 #define SCI_SETBACKSPACEUNINDENTS 2262 #define SCI_GETBACKSPACEUNINDENTS 2263 #define SC_TIME_FOREVER 10000000 #define SCI_SETMOUSEDWELLTIME 2264 #define SCI_GETMOUSEDWELLTIME 2265 #define SCI_WORDSTARTPOSITION 2266 #define SCI_WORDENDPOSITION 2267 #define SCI_ISRANGEWORD 2691 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 #define SC_WRAP_WHITESPACE 3 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 #define SC_WRAPVISUALFLAG_END 0x0001 #define SC_WRAPVISUALFLAG_START 0x0002 #define SC_WRAPVISUALFLAG_MARGIN 0x0004 #define SCI_SETWRAPVISUALFLAGS 2460 #define SCI_GETWRAPVISUALFLAGS 2461 #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define SC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define SC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define SCI_SETWRAPVISUALFLAGSLOCATION 2462 #define SCI_GETWRAPVISUALFLAGSLOCATION 2463 #define SCI_SETWRAPSTARTINDENT 2464 #define SCI_GETWRAPSTARTINDENT 2465 #define SC_WRAPINDENT_FIXED 0 #define SC_WRAPINDENT_SAME 1 #define SC_WRAPINDENT_INDENT 2 #define SCI_SETWRAPINDENTMODE 2472 #define SCI_GETWRAPINDENTMODE 2473 #define SC_CACHE_NONE 0 #define SC_CACHE_CARET 1 #define SC_CACHE_PAGE 2 #define SC_CACHE_DOCUMENT 3 #define SCI_SETLAYOUTCACHE 2272 #define SCI_GETLAYOUTCACHE 2273 #define SCI_SETSCROLLWIDTH 2274 #define SCI_GETSCROLLWIDTH 2275 #define SCI_SETSCROLLWIDTHTRACKING 2516 #define SCI_GETSCROLLWIDTHTRACKING 2517 #define SCI_TEXTWIDTH 2276 #define SCI_SETENDATLASTLINE 2277 #define SCI_GETENDATLASTLINE 2278 #define SCI_TEXTHEIGHT 2279 #define SCI_SETVSCROLLBAR 2280 #define SCI_GETVSCROLLBAR 2281 #define SCI_APPENDTEXT 2282 #define SCI_GETTWOPHASEDRAW 2283 #define SCI_SETTWOPHASEDRAW 2284 #define SC_PHASES_ONE 0 #define SC_PHASES_TWO 1 #define SC_PHASES_MULTIPLE 2 #define SCI_GETPHASESDRAW 2673 #define SCI_SETPHASESDRAW 2674 #define SC_EFF_QUALITY_MASK 0xF #define SC_EFF_QUALITY_DEFAULT 0 #define SC_EFF_QUALITY_NON_ANTIALIASED 1 #define SC_EFF_QUALITY_ANTIALIASED 2 #define SC_EFF_QUALITY_LCD_OPTIMIZED 3 #define SCI_SETFONTQUALITY 2611 #define SCI_GETFONTQUALITY 2612 #define SCI_SETFIRSTVISIBLELINE 2613 #define SC_MULTIPASTE_ONCE 0 #define SC_MULTIPASTE_EACH 1 #define SCI_SETMULTIPASTE 2614 #define SCI_GETMULTIPASTE 2615 #define SCI_GETTAG 2616 #define SCI_LINESJOIN 2288 #define SCI_LINESSPLIT 2289 #define SCI_SETFOLDMARGINCOLOUR 2290 #define SCI_SETFOLDMARGINHICOLOUR 2291 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 #define SCI_LINEUPEXTEND 2303 #define SCI_CHARLEFT 2304 #define SCI_CHARLEFTEXTEND 2305 #define SCI_CHARRIGHT 2306 #define SCI_CHARRIGHTEXTEND 2307 #define SCI_WORDLEFT 2308 #define SCI_WORDLEFTEXTEND 2309 #define SCI_WORDRIGHT 2310 #define SCI_WORDRIGHTEXTEND 2311 #define SCI_HOME 2312 #define SCI_HOMEEXTEND 2313 #define SCI_LINEEND 2314 #define SCI_LINEENDEXTEND 2315 #define SCI_DOCUMENTSTART 2316 #define SCI_DOCUMENTSTARTEXTEND 2317 #define SCI_DOCUMENTEND 2318 #define SCI_DOCUMENTENDEXTEND 2319 #define SCI_PAGEUP 2320 #define SCI_PAGEUPEXTEND 2321 #define SCI_PAGEDOWN 2322 #define SCI_PAGEDOWNEXTEND 2323 #define SCI_EDITTOGGLEOVERTYPE 2324 #define SCI_CANCEL 2325 #define SCI_DELETEBACK 2326 #define SCI_TAB 2327 #define SCI_BACKTAB 2328 #define SCI_NEWLINE 2329 #define SCI_FORMFEED 2330 #define SCI_VCHOME 2331 #define SCI_VCHOMEEXTEND 2332 #define SCI_ZOOMIN 2333 #define SCI_ZOOMOUT 2334 #define SCI_DELWORDLEFT 2335 #define SCI_DELWORDRIGHT 2336 #define SCI_DELWORDRIGHTEND 2518 #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 #define SCI_LINEDUPLICATE 2404 #define SCI_LOWERCASE 2340 #define SCI_UPPERCASE 2341 #define SCI_LINESCROLLDOWN 2342 #define SCI_LINESCROLLUP 2343 #define SCI_DELETEBACKNOTLINE 2344 #define SCI_HOMEDISPLAY 2345 #define SCI_HOMEDISPLAYEXTEND 2346 #define SCI_LINEENDDISPLAY 2347 #define SCI_LINEENDDISPLAYEXTEND 2348 #define SCI_HOMEWRAP 2349 #define SCI_HOMEWRAPEXTEND 2450 #define SCI_LINEENDWRAP 2451 #define SCI_LINEENDWRAPEXTEND 2452 #define SCI_VCHOMEWRAP 2453 #define SCI_VCHOMEWRAPEXTEND 2454 #define SCI_LINECOPY 2455 #define SCI_MOVECARETINSIDEVIEW 2401 #define SCI_LINELENGTH 2350 #define SCI_BRACEHIGHLIGHT 2351 #define SCI_BRACEHIGHLIGHTINDICATOR 2498 #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 #define SCI_SETDOCPOINTER 2358 #define SCI_SETMODEVENTMASK 2359 #define EDGE_NONE 0 #define EDGE_LINE 1 #define EDGE_BACKGROUND 2 #define SCI_GETEDGECOLUMN 2360 #define SCI_SETEDGECOLUMN 2361 #define SCI_GETEDGEMODE 2362 #define SCI_SETEDGEMODE 2363 #define SCI_GETEDGECOLOUR 2364 #define SCI_SETEDGECOLOUR 2365 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 #define SCI_LINESONSCREEN 2370 #define SCI_USEPOPUP 2371 #define SCI_SELECTIONISRECTANGLE 2372 #define SCI_SETZOOM 2373 #define SCI_GETZOOM 2374 #define SCI_CREATEDOCUMENT 2375 #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 #define SCI_GETMODEVENTMASK 2378 #define SCI_SETFOCUS 2380 #define SCI_GETFOCUS 2381 #define SC_STATUS_OK 0 #define SC_STATUS_FAILURE 1 #define SC_STATUS_BADALLOC 2 #define SC_STATUS_WARN_START 1000 #define SC_STATUS_WARN_REGEX 1001 #define SCI_SETSTATUS 2382 #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SC_CURSORNORMAL -1 #define SC_CURSORARROW 2 #define SC_CURSORWAIT 4 #define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 #define SCI_GETCONTROLCHARSYMBOL 2389 #define SCI_WORDPARTLEFT 2390 #define SCI_WORDPARTLEFTEXTEND 2391 #define SCI_WORDPARTRIGHT 2392 #define SCI_WORDPARTRIGHTEXTEND 2393 #define VISIBLE_SLOP 0x01 #define VISIBLE_STRICT 0x04 #define SCI_SETVISIBLEPOLICY 2394 #define SCI_DELLINELEFT 2395 #define SCI_DELLINERIGHT 2396 #define SCI_SETXOFFSET 2397 #define SCI_GETXOFFSET 2398 #define SCI_CHOOSECARETX 2399 #define SCI_GRABFOCUS 2400 #define CARET_SLOP 0x01 #define CARET_STRICT 0x04 #define CARET_JUMPS 0x10 #define CARET_EVEN 0x08 #define SCI_SETXCARETPOLICY 2402 #define SCI_SETYCARETPOLICY 2403 #define SCI_SETPRINTWRAPMODE 2406 #define SCI_GETPRINTWRAPMODE 2407 #define SCI_SETHOTSPOTACTIVEFORE 2410 #define SCI_GETHOTSPOTACTIVEFORE 2494 #define SCI_SETHOTSPOTACTIVEBACK 2411 #define SCI_GETHOTSPOTACTIVEBACK 2495 #define SCI_SETHOTSPOTACTIVEUNDERLINE 2412 #define SCI_GETHOTSPOTACTIVEUNDERLINE 2496 #define SCI_SETHOTSPOTSINGLELINE 2421 #define SCI_GETHOTSPOTSINGLELINE 2497 #define SCI_PARADOWN 2413 #define SCI_PARADOWNEXTEND 2414 #define SCI_PARAUP 2415 #define SCI_PARAUPEXTEND 2416 #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 #define SCI_POSITIONRELATIVE 2670 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 #define SC_SEL_RECTANGLE 1 #define SC_SEL_LINES 2 #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 #define SCI_GETSELECTIONMODE 2423 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 #define SCI_LINEUPRECTEXTEND 2427 #define SCI_CHARLEFTRECTEXTEND 2428 #define SCI_CHARRIGHTRECTEXTEND 2429 #define SCI_HOMERECTEXTEND 2430 #define SCI_VCHOMERECTEXTEND 2431 #define SCI_LINEENDRECTEXTEND 2432 #define SCI_PAGEUPRECTEXTEND 2433 #define SCI_PAGEDOWNRECTEXTEND 2434 #define SCI_STUTTEREDPAGEUP 2435 #define SCI_STUTTEREDPAGEUPEXTEND 2436 #define SCI_STUTTEREDPAGEDOWN 2437 #define SCI_STUTTEREDPAGEDOWNEXTEND 2438 #define SCI_WORDLEFTEND 2439 #define SCI_WORDLEFTENDEXTEND 2440 #define SCI_WORDRIGHTEND 2441 #define SCI_WORDRIGHTENDEXTEND 2442 #define SCI_SETWHITESPACECHARS 2443 #define SCI_GETWHITESPACECHARS 2647 #define SCI_SETPUNCTUATIONCHARS 2648 #define SCI_GETPUNCTUATIONCHARS 2649 #define SCI_SETCHARSDEFAULT 2444 #define SCI_AUTOCGETCURRENT 2445 #define SCI_AUTOCGETCURRENTTEXT 2610 #define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0 #define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1 #define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634 #define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635 #define SC_MULTIAUTOC_ONCE 0 #define SC_MULTIAUTOC_EACH 1 #define SCI_AUTOCSETMULTI 2636 #define SCI_AUTOCGETMULTI 2637 #define SC_ORDER_PRESORTED 0 #define SC_ORDER_PERFORMSORT 1 #define SC_ORDER_CUSTOM 2 #define SCI_AUTOCSETORDER 2660 #define SCI_AUTOCGETORDER 2661 #define SCI_ALLOCATE 2446 #define SCI_TARGETASUTF8 2447 #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 #define SCI_GETCARETSTICKY 2457 #define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 #define SCI_SELECTIONDUPLICATE 2469 #define SC_ALPHA_TRANSPARENT 0 #define SC_ALPHA_OPAQUE 255 #define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 #define CARETSTYLE_LINE 1 #define CARETSTYLE_BLOCK 2 #define SCI_SETCARETSTYLE 2512 #define SCI_GETCARETSTYLE 2513 #define SCI_SETINDICATORCURRENT 2500 #define SCI_GETINDICATORCURRENT 2501 #define SCI_SETINDICATORVALUE 2502 #define SCI_GETINDICATORVALUE 2503 #define SCI_INDICATORFILLRANGE 2504 #define SCI_INDICATORCLEARRANGE 2505 #define SCI_INDICATORALLONFOR 2506 #define SCI_INDICATORVALUEAT 2507 #define SCI_INDICATORSTART 2508 #define SCI_INDICATOREND 2509 #define SCI_SETPOSITIONCACHE 2514 #define SCI_GETPOSITIONCACHE 2515 #define SCI_COPYALLOWLINE 2519 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 #define SCI_GETGAPPOSITION 2644 #define SCI_INDICSETALPHA 2523 #define SCI_INDICGETALPHA 2524 #define SCI_INDICSETOUTLINEALPHA 2558 #define SCI_INDICGETOUTLINEALPHA 2559 #define SCI_SETEXTRAASCENT 2525 #define SCI_GETEXTRAASCENT 2526 #define SCI_SETEXTRADESCENT 2527 #define SCI_GETEXTRADESCENT 2528 #define SCI_MARKERSYMBOLDEFINED 2529 #define SCI_MARGINSETTEXT 2530 #define SCI_MARGINGETTEXT 2531 #define SCI_MARGINSETSTYLE 2532 #define SCI_MARGINGETSTYLE 2533 #define SCI_MARGINSETSTYLES 2534 #define SCI_MARGINGETSTYLES 2535 #define SCI_MARGINTEXTCLEARALL 2536 #define SCI_MARGINSETSTYLEOFFSET 2537 #define SCI_MARGINGETSTYLEOFFSET 2538 #define SC_MARGINOPTION_NONE 0 #define SC_MARGINOPTION_SUBLINESELECT 1 #define SCI_SETMARGINOPTIONS 2539 #define SCI_GETMARGINOPTIONS 2557 #define SCI_ANNOTATIONSETTEXT 2540 #define SCI_ANNOTATIONGETTEXT 2541 #define SCI_ANNOTATIONSETSTYLE 2542 #define SCI_ANNOTATIONGETSTYLE 2543 #define SCI_ANNOTATIONSETSTYLES 2544 #define SCI_ANNOTATIONGETSTYLES 2545 #define SCI_ANNOTATIONGETLINES 2546 #define SCI_ANNOTATIONCLEARALL 2547 #define ANNOTATION_HIDDEN 0 #define ANNOTATION_STANDARD 1 #define ANNOTATION_BOXED 2 #define ANNOTATION_INDENTED 3 #define SCI_ANNOTATIONSETVISIBLE 2548 #define SCI_ANNOTATIONGETVISIBLE 2549 #define SCI_ANNOTATIONSETSTYLEOFFSET 2550 #define SCI_ANNOTATIONGETSTYLEOFFSET 2551 #define SCI_RELEASEALLEXTENDEDSTYLES 2552 #define SCI_ALLOCATEEXTENDEDSTYLES 2553 #define UNDO_MAY_COALESCE 1 #define SCI_ADDUNDOACTION 2560 #define SCI_CHARPOSITIONFROMPOINT 2561 #define SCI_CHARPOSITIONFROMPOINTCLOSE 2562 #define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668 #define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669 #define SCI_SETMULTIPLESELECTION 2563 #define SCI_GETMULTIPLESELECTION 2564 #define SCI_SETADDITIONALSELECTIONTYPING 2565 #define SCI_GETADDITIONALSELECTIONTYPING 2566 #define SCI_SETADDITIONALCARETSBLINK 2567 #define SCI_GETADDITIONALCARETSBLINK 2568 #define SCI_SETADDITIONALCARETSVISIBLE 2608 #define SCI_GETADDITIONALCARETSVISIBLE 2609 #define SCI_GETSELECTIONS 2570 #define SCI_GETSELECTIONEMPTY 2650 #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 #define SCI_DROPSELECTIONN 2671 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 #define SCI_SETSELECTIONNCARET 2576 #define SCI_GETSELECTIONNCARET 2577 #define SCI_SETSELECTIONNANCHOR 2578 #define SCI_GETSELECTIONNANCHOR 2579 #define SCI_SETSELECTIONNCARETVIRTUALSPACE 2580 #define SCI_GETSELECTIONNCARETVIRTUALSPACE 2581 #define SCI_SETSELECTIONNANCHORVIRTUALSPACE 2582 #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 #define SCI_SETSELECTIONNEND 2586 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 #define SCI_SETRECTANGULARSELECTIONANCHOR 2590 #define SCI_GETRECTANGULARSELECTIONANCHOR 2591 #define SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE 2592 #define SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE 2593 #define SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2594 #define SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE 2595 #define SCVS_NONE 0 #define SCVS_RECTANGULARSELECTION 1 #define SCVS_USERACCESSIBLE 2 #define SCI_SETVIRTUALSPACEOPTIONS 2596 #define SCI_GETVIRTUALSPACEOPTIONS 2597 #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598 #define SCI_GETRECTANGULARSELECTIONMODIFIER 2599 #define SCI_SETADDITIONALSELFORE 2600 #define SCI_SETADDITIONALSELBACK 2601 #define SCI_SETADDITIONALSELALPHA 2602 #define SCI_GETADDITIONALSELALPHA 2603 #define SCI_SETADDITIONALCARETFORE 2604 #define SCI_GETADDITIONALCARETFORE 2605 #define SCI_ROTATESELECTION 2606 #define SCI_SWAPMAINANCHORCARET 2607 #define SCI_MULTIPLESELECTADDNEXT 2688 #define SCI_MULTIPLESELECTADDEACH 2689 #define SCI_CHANGELEXERSTATE 2617 #define SCI_CONTRACTEDFOLDNEXT 2618 #define SCI_VERTICALCENTRECARET 2619 #define SCI_MOVESELECTEDLINESUP 2620 #define SCI_MOVESELECTEDLINESDOWN 2621 #define SCI_SETIDENTIFIER 2622 #define SCI_GETIDENTIFIER 2623 #define SCI_RGBAIMAGESETWIDTH 2624 #define SCI_RGBAIMAGESETHEIGHT 2625 #define SCI_RGBAIMAGESETSCALE 2651 #define SCI_MARKERDEFINERGBAIMAGE 2626 #define SCI_REGISTERRGBAIMAGE 2627 #define SCI_SCROLLTOSTART 2628 #define SCI_SCROLLTOEND 2629 #define SC_TECHNOLOGY_DEFAULT 0 #define SC_TECHNOLOGY_DIRECTWRITE 1 #define SC_TECHNOLOGY_DIRECTWRITERETAIN 2 #define SC_TECHNOLOGY_DIRECTWRITEDC 3 #define SCI_SETTECHNOLOGY 2630 #define SCI_GETTECHNOLOGY 2631 #define SCI_CREATELOADER 2632 #define SCI_FINDINDICATORSHOW 2640 #define SCI_FINDINDICATORFLASH 2641 #define SCI_FINDINDICATORHIDE 2642 #define SCI_VCHOMEDISPLAY 2652 #define SCI_VCHOMEDISPLAYEXTEND 2653 #define SCI_GETCARETLINEVISIBLEALWAYS 2654 #define SCI_SETCARETLINEVISIBLEALWAYS 2655 #define SC_LINE_END_TYPE_DEFAULT 0 #define SC_LINE_END_TYPE_UNICODE 1 #define SCI_SETLINEENDTYPESALLOWED 2656 #define SCI_GETLINEENDTYPESALLOWED 2657 #define SCI_GETLINEENDTYPESACTIVE 2658 #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 #define KEYWORDSET_MAX 8 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 #define SCI_GETSTYLEBITSNEEDED 4011 #define SCI_GETLEXERLANGUAGE 4012 #define SCI_PRIVATELEXERCALL 4013 #define SCI_PROPERTYNAMES 4014 #define SC_TYPE_BOOLEAN 0 #define SC_TYPE_INTEGER 1 #define SC_TYPE_STRING 2 #define SCI_PROPERTYTYPE 4015 #define SCI_DESCRIBEPROPERTY 4016 #define SCI_DESCRIBEKEYWORDSETS 4017 #define SCI_GETLINEENDTYPESSUPPORTED 4018 #define SCI_ALLOCATESUBSTYLES 4020 #define SCI_GETSUBSTYLESSTART 4021 #define SCI_GETSUBSTYLESLENGTH 4022 #define SCI_GETSTYLEFROMSUBSTYLE 4027 #define SCI_GETPRIMARYSTYLEFROMSTYLE 4028 #define SCI_FREESUBSTYLES 4023 #define SCI_SETIDENTIFIERS 4024 #define SCI_DISTANCETOSECONDARYSTYLES 4025 #define SCI_GETSUBSTYLEBASES 4026 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 #define SC_MOD_CHANGEFOLD 0x8 #define SC_PERFORMED_USER 0x10 #define SC_PERFORMED_UNDO 0x20 #define SC_PERFORMED_REDO 0x40 #define SC_MULTISTEPUNDOREDO 0x80 #define SC_LASTSTEPINUNDOREDO 0x100 #define SC_MOD_CHANGEMARKER 0x200 #define SC_MOD_BEFOREINSERT 0x400 #define SC_MOD_BEFOREDELETE 0x800 #define SC_MULTILINEUNDOREDO 0x1000 #define SC_STARTACTION 0x2000 #define SC_MOD_CHANGEINDICATOR 0x4000 #define SC_MOD_CHANGELINESTATE 0x8000 #define SC_MOD_CHANGEMARGIN 0x10000 #define SC_MOD_CHANGEANNOTATION 0x20000 #define SC_MOD_CONTAINER 0x40000 #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 #define SC_MODEVENTMASKALL 0x3FFFFF #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 #define SC_UPDATE_H_SCROLL 0x8 #define SCEN_CHANGE 768 #define SCEN_SETFOCUS 512 #define SCEN_KILLFOCUS 256 #define SCK_DOWN 300 #define SCK_UP 301 #define SCK_LEFT 302 #define SCK_RIGHT 303 #define SCK_HOME 304 #define SCK_END 305 #define SCK_PRIOR 306 #define SCK_NEXT 307 #define SCK_DELETE 308 #define SCK_INSERT 309 #define SCK_ESCAPE 7 #define SCK_BACK 8 #define SCK_TAB 9 #define SCK_RETURN 13 #define SCK_ADD 310 #define SCK_SUBTRACT 311 #define SCK_DIVIDE 312 #define SCK_WIN 313 #define SCK_RWIN 314 #define SCK_MENU 315 #define SCMOD_NORM 0 #define SCMOD_SHIFT 1 #define SCMOD_CTRL 2 #define SCMOD_ALT 4 #define SCMOD_SUPER 8 #define SCMOD_META 16 #define SC_AC_FILLUP 1 #define SC_AC_DOUBLECLICK 2 #define SC_AC_TAB 3 #define SC_AC_NEWLINE 4 #define SC_AC_COMMAND 5 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 #define SCN_SAVEPOINTLEFT 2003 #define SCN_MODIFYATTEMPTRO 2004 #define SCN_KEY 2005 #define SCN_DOUBLECLICK 2006 #define SCN_UPDATEUI 2007 #define SCN_MODIFIED 2008 #define SCN_MACRORECORD 2009 #define SCN_MARGINCLICK 2010 #define SCN_NEEDSHOWN 2011 #define SCN_PAINTED 2013 #define SCN_USERLISTSELECTION 2014 #define SCN_URIDROPPED 2015 #define SCN_DWELLSTART 2016 #define SCN_DWELLEND 2017 #define SCN_ZOOM 2018 #define SCN_HOTSPOTCLICK 2019 #define SCN_HOTSPOTDOUBLECLICK 2020 #define SCN_CALLTIPCLICK 2021 #define SCN_AUTOCSELECTION 2022 #define SCN_INDICATORCLICK 2023 #define SCN_INDICATORRELEASE 2024 #define SCN_AUTOCCANCELLED 2025 #define SCN_AUTOCCHARDELETED 2026 #define SCN_HOTSPOTRELEASECLICK 2027 #define SCN_FOCUSIN 2028 #define SCN_FOCUSOUT 2029 #define SCN_AUTOCCOMPLETED 2030 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ #if defined(__cplusplus) && defined(SCI_NAMESPACE) namespace Scintilla { #endif struct Sci_CharacterRange { Sci_PositionCR cpMin; Sci_PositionCR cpMax; }; struct Sci_TextRange { struct Sci_CharacterRange chrg; char *lpstrText; }; struct Sci_TextToFind { struct Sci_CharacterRange chrg; const char *lpstrText; struct Sci_CharacterRange chrgText; }; #define CharacterRange Sci_CharacterRange #define TextRange Sci_TextRange #define TextToFind Sci_TextToFind typedef void *Sci_SurfaceID; struct Sci_Rectangle { int left; int top; int right; int bottom; }; /* This structure is used in printing and requires some of the graphics types * from Platform.h. Not needed by most client code. */ struct Sci_RangeToFormat { Sci_SurfaceID hdc; Sci_SurfaceID hdcTarget; struct Sci_Rectangle rc; struct Sci_Rectangle rcPage; struct Sci_CharacterRange chrg; }; #define RangeToFormat Sci_RangeToFormat struct Sci_NotifyHeader { /* Compatible with Windows NMHDR. * hwndFrom is really an environment specific window handle or pointer * but most clients of Scintilla.h do not have this type visible. */ void *hwndFrom; uptr_t idFrom; unsigned int code; }; #define NotifyHeader Sci_NotifyHeader struct SCNotification { struct Sci_NotifyHeader nmhdr; Sci_Position position; /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ int ch; /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ /* SCN_USERLISTSELECTION */ int modifiers; /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ int modificationType; /* SCN_MODIFIED */ const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ Sci_Position length; /* SCN_MODIFIED */ Sci_Position linesAdded; /* SCN_MODIFIED */ int message; /* SCN_MACRORECORD */ uptr_t wParam; /* SCN_MACRORECORD */ sptr_t lParam; /* SCN_MACRORECORD */ Sci_Position line; /* SCN_MODIFIED */ int foldLevelNow; /* SCN_MODIFIED */ int foldLevelPrev; /* SCN_MODIFIED */ int margin; /* SCN_MARGINCLICK */ int listType; /* SCN_USERLISTSELECTION */ int x; /* SCN_DWELLSTART, SCN_DWELLEND */ int y; /* SCN_DWELLSTART, SCN_DWELLEND */ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ int updated; /* SCN_UPDATEUI */ int listCompletionMethod; /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */ }; #if defined(__cplusplus) && defined(SCI_NAMESPACE) } #endif #ifdef INCLUDE_DEPRECATED_FEATURES #define SC_CP_DBCS 1 #define SCI_SETUSEPALETTE 2039 #define SCI_GETUSEPALETTE 2139 #define SCI_SETKEYSUNICODE 2521 #define SCI_GETKEYSUNICODE 2522 #endif #endif scintilla/include/Platform.h0000644000175000017500000003451512514105506015067 0ustar neilneil// Scintilla source code edit control /** @file Platform.h ** Interface to platform facilities. Also includes some basic utilities. ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. **/ // Copyright 1998-2009 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATFORM_H #define PLATFORM_H // PLAT_GTK = GTK+ on Linux or Win32 // PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 // PLAT_WIN = Win32 API on Win32 OS // PLAT_WX is wxWindows on any supported platform // PLAT_TK = Tcl/TK on Linux or Win32 #define PLAT_GTK 0 #define PLAT_GTK_WIN32 0 #define PLAT_GTK_MACOSX 0 #define PLAT_MACOSX 0 #define PLAT_WIN 0 #define PLAT_WX 0 #define PLAT_QT 0 #define PLAT_FOX 0 #define PLAT_CURSES 0 #define PLAT_TK 0 #if defined(FOX) #undef PLAT_FOX #define PLAT_FOX 1 #elif defined(__WX__) #undef PLAT_WX #define PLAT_WX 1 #elif defined(CURSES) #undef PLAT_CURSES #define PLAT_CURSES 1 #elif defined(SCINTILLA_QT) #undef PLAT_QT #define PLAT_QT 1 #elif defined(TK) #undef PLAT_TK #define PLAT_TK 1 #elif defined(GTK) #undef PLAT_GTK #define PLAT_GTK 1 #if defined(__WIN32__) || defined(_MSC_VER) #undef PLAT_GTK_WIN32 #define PLAT_GTK_WIN32 1 #endif #if defined(__APPLE__) #undef PLAT_GTK_MACOSX #define PLAT_GTK_MACOSX 1 #endif #elif defined(__APPLE__) #undef PLAT_MACOSX #define PLAT_MACOSX 1 #else #undef PLAT_WIN #define PLAT_WIN 1 #endif #ifdef SCI_NAMESPACE namespace Scintilla { #endif typedef float XYPOSITION; typedef double XYACCUMULATOR; inline int RoundXYPosition(XYPOSITION xyPos) { return int(xyPos + 0.5); } // Underlying the implementation of the platform classes are platform specific types. // Sometimes these need to be passed around by client code so they are defined here typedef void *FontID; typedef void *SurfaceID; typedef void *WindowID; typedef void *MenuID; typedef void *TickerID; typedef void *Function; typedef void *IdlerID; /** * A geometric point class. * Point is similar to the Win32 POINT and GTK+ GdkPoint types. */ class Point { public: XYPOSITION x; XYPOSITION y; explicit Point(XYPOSITION x_=0, XYPOSITION y_=0) : x(x_), y(y_) { } static Point FromInts(int x_, int y_) { return Point(static_cast(x_), static_cast(y_)); } // Other automatically defined methods (assignment, copy constructor, destructor) are fine static Point FromLong(long lpoint); }; /** * A geometric rectangle class. * PRectangle is similar to the Win32 RECT. * PRectangles contain their top and left sides, but not their right and bottom sides. */ class PRectangle { public: XYPOSITION left; XYPOSITION top; XYPOSITION right; XYPOSITION bottom; explicit PRectangle(XYPOSITION left_=0, XYPOSITION top_=0, XYPOSITION right_=0, XYPOSITION bottom_ = 0) : left(left_), top(top_), right(right_), bottom(bottom_) { } static PRectangle FromInts(int left_, int top_, int right_, int bottom_) { return PRectangle(static_cast(left_), static_cast(top_), static_cast(right_), static_cast(bottom_)); } // Other automatically defined methods (assignment, copy constructor, destructor) are fine bool operator==(PRectangle &rc) const { return (rc.left == left) && (rc.right == right) && (rc.top == top) && (rc.bottom == bottom); } bool Contains(Point pt) const { return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); } bool ContainsWholePixel(Point pt) const { // Does the rectangle contain all of the pixel to left/below the point return (pt.x >= left) && ((pt.x+1) <= right) && (pt.y >= top) && ((pt.y+1) <= bottom); } bool Contains(PRectangle rc) const { return (rc.left >= left) && (rc.right <= right) && (rc.top >= top) && (rc.bottom <= bottom); } bool Intersects(PRectangle other) const { return (right > other.left) && (left < other.right) && (bottom > other.top) && (top < other.bottom); } void Move(XYPOSITION xDelta, XYPOSITION yDelta) { left += xDelta; top += yDelta; right += xDelta; bottom += yDelta; } XYPOSITION Width() const { return right - left; } XYPOSITION Height() const { return bottom - top; } bool Empty() const { return (Height() <= 0) || (Width() <= 0); } }; /** * Holds a desired RGB colour. */ class ColourDesired { long co; public: ColourDesired(long lcol=0) { co = lcol; } ColourDesired(unsigned int red, unsigned int green, unsigned int blue) { Set(red, green, blue); } bool operator==(const ColourDesired &other) const { return co == other.co; } void Set(long lcol) { co = lcol; } void Set(unsigned int red, unsigned int green, unsigned int blue) { co = red | (green << 8) | (blue << 16); } static inline unsigned int ValueOfHex(const char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; else if (ch >= 'A' && ch <= 'F') return ch - 'A' + 10; else if (ch >= 'a' && ch <= 'f') return ch - 'a' + 10; else return 0; } void Set(const char *val) { if (*val == '#') { val++; } unsigned int r = ValueOfHex(val[0]) * 16 + ValueOfHex(val[1]); unsigned int g = ValueOfHex(val[2]) * 16 + ValueOfHex(val[3]); unsigned int b = ValueOfHex(val[4]) * 16 + ValueOfHex(val[5]); Set(r, g, b); } long AsLong() const { return co; } unsigned int GetRed() const { return co & 0xff; } unsigned int GetGreen() const { return (co >> 8) & 0xff; } unsigned int GetBlue() const { return (co >> 16) & 0xff; } }; /** * Font management. */ struct FontParameters { const char *faceName; float size; int weight; bool italic; int extraFontFlag; int technology; int characterSet; FontParameters( const char *faceName_, float size_=10, int weight_=400, bool italic_=false, int extraFontFlag_=0, int technology_=0, int characterSet_=0) : faceName(faceName_), size(size_), weight(weight_), italic(italic_), extraFontFlag(extraFontFlag_), technology(technology_), characterSet(characterSet_) { } }; class Font { protected: FontID fid; // Private so Font objects can not be copied Font(const Font &); Font &operator=(const Font &); public: Font(); virtual ~Font(); virtual void Create(const FontParameters &fp); virtual void Release(); FontID GetID() { return fid; } // Alias another font - caller guarantees not to Release void SetID(FontID fid_) { fid = fid_; } friend class Surface; friend class SurfaceImpl; }; /** * A surface abstracts a place to draw. */ class Surface { private: // Private so Surface objects can not be copied Surface(const Surface &) {} Surface &operator=(const Surface &) { return *this; } public: Surface() {} virtual ~Surface() {} static Surface *Allocate(int technology); virtual void Init(WindowID wid)=0; virtual void Init(SurfaceID sid, WindowID wid)=0; virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0; virtual void Release()=0; virtual bool Initialised()=0; virtual void PenColour(ColourDesired fore)=0; virtual int LogPixelsY()=0; virtual int DeviceHeightFont(int points)=0; virtual void MoveTo(int x_, int y_)=0; virtual void LineTo(int x_, int y_)=0; virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back)=0; virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void FillRectangle(PRectangle rc, ColourDesired back)=0; virtual void FillRectangle(PRectangle rc, Surface &surfacePattern)=0; virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, ColourDesired outline, int alphaOutline, int flags)=0; virtual void DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) = 0; virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0; virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0; virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0; virtual XYPOSITION WidthChar(Font &font_, char ch)=0; virtual XYPOSITION Ascent(Font &font_)=0; virtual XYPOSITION Descent(Font &font_)=0; virtual XYPOSITION InternalLeading(Font &font_)=0; virtual XYPOSITION ExternalLeading(Font &font_)=0; virtual XYPOSITION Height(Font &font_)=0; virtual XYPOSITION AverageCharWidth(Font &font_)=0; virtual void SetClip(PRectangle rc)=0; virtual void FlushCachedState()=0; virtual void SetUnicodeMode(bool unicodeMode_)=0; virtual void SetDBCSMode(int codePage)=0; }; /** * A simple callback action passing one piece of untyped user data. */ typedef void (*CallBackAction)(void*); /** * Class to hide the details of window manipulation. * Does not own the window which will normally have a longer life than this object. */ class Window { protected: WindowID wid; public: Window() : wid(0), cursorLast(cursorInvalid) { } Window(const Window &source) : wid(source.wid), cursorLast(cursorInvalid) { } virtual ~Window(); Window &operator=(WindowID wid_) { wid = wid_; return *this; } WindowID GetID() const { return wid; } bool Created() const { return wid != 0; } void Destroy(); bool HasFocus(); PRectangle GetPosition(); void SetPosition(PRectangle rc); void SetPositionRelative(PRectangle rc, Window relativeTo); PRectangle GetClientPosition(); void Show(bool show=true); void InvalidateAll(); void InvalidateRectangle(PRectangle rc); virtual void SetFont(Font &font); enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand }; void SetCursor(Cursor curs); void SetTitle(const char *s); PRectangle GetMonitorRect(Point pt); private: Cursor cursorLast; }; /** * Listbox management. */ class ListBox : public Window { public: ListBox(); virtual ~ListBox(); static ListBox *Allocate(); virtual void SetFont(Font &font)=0; virtual void Create(Window &parent, int ctrlID, Point location, int lineHeight_, bool unicodeMode_, int technology_)=0; virtual void SetAverageCharWidth(int width)=0; virtual void SetVisibleRows(int rows)=0; virtual int GetVisibleRows() const=0; virtual PRectangle GetDesiredRect()=0; virtual int CaretFromEdge()=0; virtual void Clear()=0; virtual void Append(char *s, int type = -1)=0; virtual int Length()=0; virtual void Select(int n)=0; virtual int GetSelection()=0; virtual int Find(const char *prefix)=0; virtual void GetValue(int n, char *value, int len)=0; virtual void RegisterImage(int type, const char *xpm_data)=0; virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage) = 0; virtual void ClearRegisteredImages()=0; virtual void SetDoubleClickAction(CallBackAction, void *)=0; virtual void SetList(const char* list, char separator, char typesep)=0; }; /** * Menu management. */ class Menu { MenuID mid; public: Menu(); MenuID GetID() { return mid; } void CreatePopUp(); void Destroy(); void Show(Point pt, Window &w); }; class ElapsedTime { long bigBit; long littleBit; public: ElapsedTime(); double Duration(bool reset=false); }; /** * Dynamic Library (DLL/SO/...) loading */ class DynamicLibrary { public: virtual ~DynamicLibrary() {} /// @return Pointer to function "name", or NULL on failure. virtual Function FindFunction(const char *name) = 0; /// @return true if the library was loaded successfully. virtual bool IsValid() = 0; /// @return An instance of a DynamicLibrary subclass with "modulePath" loaded. static DynamicLibrary *Load(const char *modulePath); }; #if defined(__clang__) # if __has_feature(attribute_analyzer_noreturn) # define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn)) # else # define CLANG_ANALYZER_NORETURN # endif #else # define CLANG_ANALYZER_NORETURN #endif /** * Platform class used to retrieve system wide parameters such as double click speed * and chrome colour. Not a creatable object, more of a module with several functions. */ class Platform { // Private so Platform objects can not be copied Platform(const Platform &) {} Platform &operator=(const Platform &) { return *this; } public: // Should be private because no new Platforms are ever created // but gcc warns about this Platform() {} ~Platform() {} static ColourDesired Chrome(); static ColourDesired ChromeHighlight(); static const char *DefaultFont(); static int DefaultFontSize(); static unsigned int DoubleClickTime(); static bool MouseButtonBounce(); static void DebugDisplay(const char *s); static bool IsKeyDown(int key); static long SendScintilla( WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); static long SendScintillaPointer( WindowID w, unsigned int msg, unsigned long wParam=0, void *lParam=0); static bool IsDBCSLeadByte(int codePage, char ch); static int DBCSCharLength(int codePage, const char *s); static int DBCSCharMaxLength(); // These are utility functions not really tied to a platform static int Minimum(int a, int b); static int Maximum(int a, int b); // Next three assume 16 bit shorts and 32 bit longs static long LongFromTwoShorts(short a,short b) { return (a) | ((b) << 16); } static short HighShortFromLong(long x) { return static_cast(x >> 16); } static short LowShortFromLong(long x) { return static_cast(x & 0xffff); } static void DebugPrintf(const char *format, ...); static bool ShowAssertionPopUps(bool assertionPopUps_); static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN; static int Clamp(int val, int minVal, int maxVal); }; #ifdef NDEBUG #define PLATFORM_ASSERT(c) ((void)0) #else #ifdef SCI_NAMESPACE #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Scintilla::Platform::Assert(#c, __FILE__, __LINE__)) #else #define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) #endif #endif #ifdef SCI_NAMESPACE } #endif #if defined(__GNUC__) && defined(SCINTILLA_QT) #pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #endif scintilla/include/Sci_Position.h0000644000175000017500000000132312557522743015711 0ustar neilneil// Scintilla source code edit control /** @file Sci_Position.h ** Define the Sci_Position type used in Scintilla's external interfaces. ** These need to be available to clients written in C so are not in a C++ namespace. **/ // Copyright 2015 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef SCI_POSITION_H #define SCI_POSITION_H // Basic signed type used throughout interface typedef int Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold typedef unsigned int Sci_PositionU; // For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE typedef long Sci_PositionCR; #endif scintilla/include/ILexer.h0000644000175000017500000001011712557522743014500 0ustar neilneil// Scintilla source code edit control /** @file ILexer.h ** Interface between Scintilla and lexers. **/ // Copyright 1998-2010 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef ILEXER_H #define ILEXER_H #include "Sci_Position.h" #ifdef SCI_NAMESPACE namespace Scintilla { #endif #ifdef _WIN32 #define SCI_METHOD __stdcall #else #define SCI_METHOD #endif enum { dvOriginal=0, dvLineEnd=1 }; class IDocument { public: virtual int SCI_METHOD Version() const = 0; virtual void SCI_METHOD SetErrorStatus(int status) = 0; virtual Sci_Position SCI_METHOD Length() const = 0; virtual void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const = 0; virtual char SCI_METHOD StyleAt(Sci_Position position) const = 0; virtual Sci_Position SCI_METHOD LineFromPosition(Sci_Position position) const = 0; virtual Sci_Position SCI_METHOD LineStart(Sci_Position line) const = 0; virtual int SCI_METHOD GetLevel(Sci_Position line) const = 0; virtual int SCI_METHOD SetLevel(Sci_Position line, int level) = 0; virtual int SCI_METHOD GetLineState(Sci_Position line) const = 0; virtual int SCI_METHOD SetLineState(Sci_Position line, int state) = 0; virtual void SCI_METHOD StartStyling(Sci_Position position, char mask) = 0; virtual bool SCI_METHOD SetStyleFor(Sci_Position length, char style) = 0; virtual bool SCI_METHOD SetStyles(Sci_Position length, const char *styles) = 0; virtual void SCI_METHOD DecorationSetCurrentIndicator(int indicator) = 0; virtual void SCI_METHOD DecorationFillRange(Sci_Position position, int value, Sci_Position fillLength) = 0; virtual void SCI_METHOD ChangeLexerState(Sci_Position start, Sci_Position end) = 0; virtual int SCI_METHOD CodePage() const = 0; virtual bool SCI_METHOD IsDBCSLeadByte(char ch) const = 0; virtual const char * SCI_METHOD BufferPointer() = 0; virtual int SCI_METHOD GetLineIndentation(Sci_Position line) = 0; }; class IDocumentWithLineEnd : public IDocument { public: virtual Sci_Position SCI_METHOD LineEnd(Sci_Position line) const = 0; virtual Sci_Position SCI_METHOD GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const = 0; virtual int SCI_METHOD GetCharacterAndWidth(Sci_Position position, Sci_Position *pWidth) const = 0; }; enum { lvOriginal=0, lvSubStyles=1 }; class ILexer { public: virtual int SCI_METHOD Version() const = 0; virtual void SCI_METHOD Release() = 0; virtual const char * SCI_METHOD PropertyNames() = 0; virtual int SCI_METHOD PropertyType(const char *name) = 0; virtual const char * SCI_METHOD DescribeProperty(const char *name) = 0; virtual Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) = 0; virtual const char * SCI_METHOD DescribeWordListSets() = 0; virtual Sci_Position SCI_METHOD WordListSet(int n, const char *wl) = 0; virtual void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0; virtual void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) = 0; virtual void * SCI_METHOD PrivateCall(int operation, void *pointer) = 0; }; class ILexerWithSubStyles : public ILexer { public: virtual int SCI_METHOD LineEndTypesSupported() = 0; virtual int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) = 0; virtual int SCI_METHOD SubStylesStart(int styleBase) = 0; virtual int SCI_METHOD SubStylesLength(int styleBase) = 0; virtual int SCI_METHOD StyleFromSubStyle(int subStyle) = 0; virtual int SCI_METHOD PrimaryStyleFromStyle(int style) = 0; virtual void SCI_METHOD FreeSubStyles() = 0; virtual void SCI_METHOD SetIdentifiers(int style, const char *identifiers) = 0; virtual int SCI_METHOD DistanceToSecondaryStyles() = 0; virtual const char * SCI_METHOD GetSubStyleBases() = 0; }; class ILoader { public: virtual int SCI_METHOD Release() = 0; // Returns a status code from SC_STATUS_* virtual int SCI_METHOD AddData(char *data, Sci_Position length) = 0; virtual void * SCI_METHOD ConvertToDocument() = 0; }; #ifdef SCI_NAMESPACE } #endif #endif scintilla/lexers/0000755000175000017500000000000012557522743013016 5ustar neilneilscintilla/lexers/LexBash.cxx0000644000175000017500000006170612557522743015102 0ustar neilneil// Scintilla source code edit control /** @file LexBash.cxx ** Lexer for Bash. **/ // Copyright 2004-2012 by Neil Hodgson // Adapted from LexPerl by Kein-Hong Man 2004 // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #define HERE_DELIM_MAX 256 // define this if you want 'invalid octals' to be marked as errors // usually, this is not a good idea, permissive lexing is better #undef PEDANTIC_OCTAL #define BASH_BASE_ERROR 65 #define BASH_BASE_DECIMAL 66 #define BASH_BASE_HEX 67 #ifdef PEDANTIC_OCTAL #define BASH_BASE_OCTAL 68 #define BASH_BASE_OCTAL_ERROR 69 #endif // state constants for parts of a bash command segment #define BASH_CMD_BODY 0 #define BASH_CMD_START 1 #define BASH_CMD_WORD 2 #define BASH_CMD_TEST 3 #define BASH_CMD_ARITH 4 #define BASH_CMD_DELIM 5 // state constants for nested delimiter pairs, used by // SCE_SH_STRING and SCE_SH_BACKTICKS processing #define BASH_DELIM_LITERAL 0 #define BASH_DELIM_STRING 1 #define BASH_DELIM_CSTRING 2 #define BASH_DELIM_LSTRING 3 #define BASH_DELIM_COMMAND 4 #define BASH_DELIM_BACKTICK 5 #define BASH_DELIM_STACK_MAX 7 static inline int translateBashDigit(int ch) { if (ch >= '0' && ch <= '9') { return ch - '0'; } else if (ch >= 'a' && ch <= 'z') { return ch - 'a' + 10; } else if (ch >= 'A' && ch <= 'Z') { return ch - 'A' + 36; } else if (ch == '@') { return 62; } else if (ch == '_') { return 63; } return BASH_BASE_ERROR; } static inline int getBashNumberBase(char *s) { int i = 0; int base = 0; while (*s) { base = base * 10 + (*s++ - '0'); i++; } if (base > 64 || i > 2) { return BASH_BASE_ERROR; } return base; } static int opposite(int ch) { if (ch == '(') return ')'; if (ch == '[') return ']'; if (ch == '{') return '}'; if (ch == '<') return '>'; return ch; } static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList cmdDelimiter, bashStruct, bashStruct_in; cmdDelimiter.Set("| || |& & && ; ;; ( ) { }"); bashStruct.Set("if elif fi while until else then do done esac eval"); bashStruct_in.Set("for case select"); CharacterSet setWordStart(CharacterSet::setAlpha, "_"); // note that [+-] are often parts of identifiers in shell scripts CharacterSet setWord(CharacterSet::setAlphaNum, "._+-"); CharacterSet setMetaCharacter(CharacterSet::setNone, "|&;()<> \t\r\n"); setMetaCharacter.Add(0); CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/(ch); Delimiter[DelimiterLength] = '\0'; } ~HereDocCls() { delete []Delimiter; } }; HereDocCls HereDoc; class QuoteCls { // Class to manage quote pairs (simplified vs LexPerl) public: int Count; int Up, Down; QuoteCls() { Count = 0; Up = '\0'; Down = '\0'; } void Open(int u) { Count++; Up = u; Down = opposite(Up); } void Start(int u) { Count = 0; Open(u); } }; QuoteCls Quote; class QuoteStackCls { // Class to manage quote pairs that nest public: int Count; int Up, Down; int Style; int Depth; // levels pushed int *CountStack; int *UpStack; int *StyleStack; QuoteStackCls() { Count = 0; Up = '\0'; Down = '\0'; Style = 0; Depth = 0; CountStack = new int[BASH_DELIM_STACK_MAX]; UpStack = new int[BASH_DELIM_STACK_MAX]; StyleStack = new int[BASH_DELIM_STACK_MAX]; } void Start(int u, int s) { Count = 1; Up = u; Down = opposite(Up); Style = s; } void Push(int u, int s) { if (Depth >= BASH_DELIM_STACK_MAX) return; CountStack[Depth] = Count; UpStack [Depth] = Up; StyleStack[Depth] = Style; Depth++; Count = 1; Up = u; Down = opposite(Up); Style = s; } void Pop(void) { if (Depth <= 0) return; Depth--; Count = CountStack[Depth]; Up = UpStack [Depth]; Style = StyleStack[Depth]; Down = opposite(Up); } ~QuoteStackCls() { delete []CountStack; delete []UpStack; delete []StyleStack; } }; QuoteStackCls QuoteStack; int numBase = 0; int digit; Sci_PositionU endPos = startPos + length; int cmdState = BASH_CMD_START; int testExprType = 0; // Always backtracks to the start of a line that is not a continuation // of the previous line (i.e. start of a bash command segment) Sci_Position ln = styler.GetLine(startPos); if (ln > 0 && startPos == static_cast(styler.LineStart(ln))) ln--; for (;;) { startPos = styler.LineStart(ln); if (ln == 0 || styler.GetLineState(ln) == BASH_CMD_START) break; ln--; } initStyle = SCE_SH_DEFAULT; StyleContext sc(startPos, endPos - startPos, initStyle, styler); for (; sc.More(); sc.Forward()) { // handle line continuation, updates per-line stored state if (sc.atLineStart) { ln = styler.GetLine(sc.currentPos); if (sc.state == SCE_SH_STRING || sc.state == SCE_SH_BACKTICKS || sc.state == SCE_SH_CHARACTER || sc.state == SCE_SH_HERE_Q || sc.state == SCE_SH_COMMENTLINE || sc.state == SCE_SH_PARAM) { // force backtrack while retaining cmdState styler.SetLineState(ln, BASH_CMD_BODY); } else { if (ln > 0) { if ((sc.GetRelative(-3) == '\\' && sc.GetRelative(-2) == '\r' && sc.chPrev == '\n') || sc.GetRelative(-2) == '\\') { // handle '\' line continuation // retain last line's state } else cmdState = BASH_CMD_START; } styler.SetLineState(ln, cmdState); } } // controls change of cmdState at the end of a non-whitespace element // states BODY|TEST|ARITH persist until the end of a command segment // state WORD persist, but ends with 'in' or 'do' construct keywords int cmdStateNew = BASH_CMD_BODY; if (cmdState == BASH_CMD_TEST || cmdState == BASH_CMD_ARITH || cmdState == BASH_CMD_WORD) cmdStateNew = cmdState; int stylePrev = sc.state; // Determine if the current state should terminate. switch (sc.state) { case SCE_SH_OPERATOR: sc.SetState(SCE_SH_DEFAULT); if (cmdState == BASH_CMD_DELIM) // if command delimiter, start new command cmdStateNew = BASH_CMD_START; else if (sc.chPrev == '\\') // propagate command state if line continued cmdStateNew = cmdState; break; case SCE_SH_WORD: // "." never used in Bash variable names but used in file names if (!setWord.Contains(sc.ch)) { char s[500]; char s2[10]; sc.GetCurrent(s, sizeof(s)); // allow keywords ending in a whitespace or command delimiter s2[0] = static_cast(sc.ch); s2[1] = '\0'; bool keywordEnds = IsASpace(sc.ch) || cmdDelimiter.InList(s2); // 'in' or 'do' may be construct keywords if (cmdState == BASH_CMD_WORD) { if (strcmp(s, "in") == 0 && keywordEnds) cmdStateNew = BASH_CMD_BODY; else if (strcmp(s, "do") == 0 && keywordEnds) cmdStateNew = BASH_CMD_START; else sc.ChangeState(SCE_SH_IDENTIFIER); sc.SetState(SCE_SH_DEFAULT); break; } // a 'test' keyword starts a test expression if (strcmp(s, "test") == 0) { if (cmdState == BASH_CMD_START && keywordEnds) { cmdStateNew = BASH_CMD_TEST; testExprType = 0; } else sc.ChangeState(SCE_SH_IDENTIFIER); } // detect bash construct keywords else if (bashStruct.InList(s)) { if (cmdState == BASH_CMD_START && keywordEnds) cmdStateNew = BASH_CMD_START; else sc.ChangeState(SCE_SH_IDENTIFIER); } // 'for'|'case'|'select' needs 'in'|'do' to be highlighted later else if (bashStruct_in.InList(s)) { if (cmdState == BASH_CMD_START && keywordEnds) cmdStateNew = BASH_CMD_WORD; else sc.ChangeState(SCE_SH_IDENTIFIER); } // disambiguate option items and file test operators else if (s[0] == '-') { if (cmdState != BASH_CMD_TEST) sc.ChangeState(SCE_SH_IDENTIFIER); } // disambiguate keywords and identifiers else if (cmdState != BASH_CMD_START || !(keywords.InList(s) && keywordEnds)) { sc.ChangeState(SCE_SH_IDENTIFIER); } sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_IDENTIFIER: if (sc.chPrev == '\\') { // for escaped chars sc.ForwardSetState(SCE_SH_DEFAULT); } else if (!setWord.Contains(sc.ch)) { sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_NUMBER: digit = translateBashDigit(sc.ch); if (numBase == BASH_BASE_DECIMAL) { if (sc.ch == '#') { char s[10]; sc.GetCurrent(s, sizeof(s)); numBase = getBashNumberBase(s); if (numBase != BASH_BASE_ERROR) break; } else if (IsADigit(sc.ch)) break; } else if (numBase == BASH_BASE_HEX) { if (IsADigit(sc.ch, 16)) break; #ifdef PEDANTIC_OCTAL } else if (numBase == BASH_BASE_OCTAL || numBase == BASH_BASE_OCTAL_ERROR) { if (digit <= 7) break; if (digit <= 9) { numBase = BASH_BASE_OCTAL_ERROR; break; } #endif } else if (numBase == BASH_BASE_ERROR) { if (digit <= 9) break; } else { // DD#DDDD number style handling if (digit != BASH_BASE_ERROR) { if (numBase <= 36) { // case-insensitive if base<=36 if (digit >= 36) digit -= 26; } if (digit < numBase) break; if (digit <= 9) { numBase = BASH_BASE_ERROR; break; } } } // fallthrough when number is at an end or error if (numBase == BASH_BASE_ERROR #ifdef PEDANTIC_OCTAL || numBase == BASH_BASE_OCTAL_ERROR #endif ) { sc.ChangeState(SCE_SH_ERROR); } sc.SetState(SCE_SH_DEFAULT); break; case SCE_SH_COMMENTLINE: if (sc.atLineEnd && sc.chPrev != '\\') { sc.SetState(SCE_SH_DEFAULT); } break; case SCE_SH_HERE_DELIM: // From Bash info: // --------------- // Specifier format is: <<[-]WORD // Optional '-' is for removal of leading tabs from here-doc. // Whitespace acceptable after <<[-] operator // if (HereDoc.State == 0) { // '<<' encountered HereDoc.Quote = sc.chNext; HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; if (sc.chNext == '\'' || sc.chNext == '\"') { // a quoted here-doc delimiter (' or ") sc.Forward(); HereDoc.Quoted = true; HereDoc.State = 1; } else if (setHereDoc.Contains(sc.chNext)) { // an unquoted here-doc delimiter, no special handling // TODO check what exactly bash considers part of the delim HereDoc.State = 1; } else if (sc.chNext == '<') { // HERE string <<< sc.Forward(); sc.ForwardSetState(SCE_SH_DEFAULT); } else if (IsASpace(sc.chNext)) { // eat whitespace } else if (setLeftShift.Contains(sc.chNext)) { // left shift << or <<= operator cases sc.ChangeState(SCE_SH_OPERATOR); sc.ForwardSetState(SCE_SH_DEFAULT); } else { // symbols terminates; deprecated zero-length delimiter HereDoc.State = 1; } } else if (HereDoc.State == 1) { // collect the delimiter // * if single quoted, there's no escape // * if double quoted, there are \\ and \" escapes if ((HereDoc.Quote == '\'' && sc.ch != HereDoc.Quote) || (HereDoc.Quoted && sc.ch != HereDoc.Quote && sc.ch != '\\') || (HereDoc.Quote != '\'' && sc.chPrev == '\\') || (setHereDoc2.Contains(sc.ch))) { HereDoc.Append(sc.ch); } else if (HereDoc.Quoted && sc.ch == HereDoc.Quote) { // closing quote => end of delimiter sc.ForwardSetState(SCE_SH_DEFAULT); } else if (sc.ch == '\\') { if (HereDoc.Quoted && sc.chNext != HereDoc.Quote && sc.chNext != '\\') { // in quoted prefixes only \ and the quote eat the escape HereDoc.Append(sc.ch); } else { // skip escape prefix } } else if (!HereDoc.Quoted) { sc.SetState(SCE_SH_DEFAULT); } if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { // force blowup sc.SetState(SCE_SH_ERROR); HereDoc.State = 0; } } break; case SCE_SH_HERE_Q: // HereDoc.State == 2 if (sc.atLineStart) { sc.SetState(SCE_SH_HERE_Q); int prefixws = 0; while (sc.ch == '\t' && !sc.atLineEnd) { // tabulation prefix sc.Forward(); prefixws++; } if (prefixws > 0) sc.SetState(SCE_SH_HERE_Q); while (!sc.atLineEnd) { sc.Forward(); } char s[HERE_DELIM_MAX]; sc.GetCurrent(s, sizeof(s)); if (sc.LengthCurrent() == 0) { // '' or "" delimiters if ((prefixws == 0 || HereDoc.Indent) && HereDoc.Quoted && HereDoc.DelimiterLength == 0) sc.SetState(SCE_SH_DEFAULT); break; } if (s[strlen(s) - 1] == '\r') s[strlen(s) - 1] = '\0'; if (strcmp(HereDoc.Delimiter, s) == 0) { if ((prefixws == 0) || // indentation rule (prefixws > 0 && HereDoc.Indent)) { sc.SetState(SCE_SH_DEFAULT); break; } } } break; case SCE_SH_SCALAR: // variable names if (!setParam.Contains(sc.ch)) { if (sc.LengthCurrent() == 1) { // Special variable: $(, $_ etc. sc.ForwardSetState(SCE_SH_DEFAULT); } else { sc.SetState(SCE_SH_DEFAULT); } } break; case SCE_SH_STRING: // delimited styles, can nest case SCE_SH_BACKTICKS: if (sc.ch == '\\' && QuoteStack.Up != '\\') { if (QuoteStack.Style != BASH_DELIM_LITERAL) sc.Forward(); } else if (sc.ch == QuoteStack.Down) { QuoteStack.Count--; if (QuoteStack.Count == 0) { if (QuoteStack.Depth > 0) { QuoteStack.Pop(); } else sc.ForwardSetState(SCE_SH_DEFAULT); } } else if (sc.ch == QuoteStack.Up) { QuoteStack.Count++; } else { if (QuoteStack.Style == BASH_DELIM_STRING || QuoteStack.Style == BASH_DELIM_LSTRING ) { // do nesting for "string", $"locale-string" if (sc.ch == '`') { QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK); } else if (sc.ch == '$' && sc.chNext == '(') { sc.Forward(); QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND); } } else if (QuoteStack.Style == BASH_DELIM_COMMAND || QuoteStack.Style == BASH_DELIM_BACKTICK ) { // do nesting for $(command), `command` if (sc.ch == '\'') { QuoteStack.Push(sc.ch, BASH_DELIM_LITERAL); } else if (sc.ch == '\"') { QuoteStack.Push(sc.ch, BASH_DELIM_STRING); } else if (sc.ch == '`') { QuoteStack.Push(sc.ch, BASH_DELIM_BACKTICK); } else if (sc.ch == '$') { if (sc.chNext == '\'') { sc.Forward(); QuoteStack.Push(sc.ch, BASH_DELIM_CSTRING); } else if (sc.chNext == '\"') { sc.Forward(); QuoteStack.Push(sc.ch, BASH_DELIM_LSTRING); } else if (sc.chNext == '(') { sc.Forward(); QuoteStack.Push(sc.ch, BASH_DELIM_COMMAND); } } } } break; case SCE_SH_PARAM: // ${parameter} if (sc.ch == '\\' && Quote.Up != '\\') { sc.Forward(); } else if (sc.ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { sc.ForwardSetState(SCE_SH_DEFAULT); } } else if (sc.ch == Quote.Up) { Quote.Count++; } break; case SCE_SH_CHARACTER: // singly-quoted strings if (sc.ch == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { sc.ForwardSetState(SCE_SH_DEFAULT); } } break; } // Must check end of HereDoc state 1 before default state is handled if (HereDoc.State == 1 && sc.atLineEnd) { // Begin of here-doc (the line after the here-doc delimiter): // Lexically, the here-doc starts from the next line after the >>, but the // first line of here-doc seem to follow the style of the last EOL sequence HereDoc.State = 2; if (HereDoc.Quoted) { if (sc.state == SCE_SH_HERE_DELIM) { // Missing quote at end of string! We are stricter than bash. // Colour here-doc anyway while marking this bit as an error. sc.ChangeState(SCE_SH_ERROR); } // HereDoc.Quote always == '\'' sc.SetState(SCE_SH_HERE_Q); } else if (HereDoc.DelimiterLength == 0) { // no delimiter, illegal (but '' and "" are legal) sc.ChangeState(SCE_SH_ERROR); sc.SetState(SCE_SH_DEFAULT); } else { sc.SetState(SCE_SH_HERE_Q); } } // update cmdState about the current command segment if (stylePrev != SCE_SH_DEFAULT && sc.state == SCE_SH_DEFAULT) { cmdState = cmdStateNew; } // Determine if a new state should be entered. if (sc.state == SCE_SH_DEFAULT) { if (sc.ch == '\\') { // Bash can escape any non-newline as a literal sc.SetState(SCE_SH_IDENTIFIER); if (sc.chNext == '\r' || sc.chNext == '\n') sc.SetState(SCE_SH_OPERATOR); } else if (IsADigit(sc.ch)) { sc.SetState(SCE_SH_NUMBER); numBase = BASH_BASE_DECIMAL; if (sc.ch == '0') { // hex,octal if (sc.chNext == 'x' || sc.chNext == 'X') { numBase = BASH_BASE_HEX; sc.Forward(); } else if (IsADigit(sc.chNext)) { #ifdef PEDANTIC_OCTAL numBase = BASH_BASE_OCTAL; #else numBase = BASH_BASE_HEX; #endif } } } else if (setWordStart.Contains(sc.ch)) { sc.SetState(SCE_SH_WORD); } else if (sc.ch == '#') { if (stylePrev != SCE_SH_WORD && stylePrev != SCE_SH_IDENTIFIER && (sc.currentPos == 0 || setMetaCharacter.Contains(sc.chPrev))) { sc.SetState(SCE_SH_COMMENTLINE); } else { sc.SetState(SCE_SH_WORD); } } else if (sc.ch == '\"') { sc.SetState(SCE_SH_STRING); QuoteStack.Start(sc.ch, BASH_DELIM_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_SH_CHARACTER); Quote.Start(sc.ch); } else if (sc.ch == '`') { sc.SetState(SCE_SH_BACKTICKS); QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK); } else if (sc.ch == '$') { if (sc.Match("$((")) { sc.SetState(SCE_SH_OPERATOR); // handle '((' later continue; } sc.SetState(SCE_SH_SCALAR); sc.Forward(); if (sc.ch == '{') { sc.ChangeState(SCE_SH_PARAM); Quote.Start(sc.ch); } else if (sc.ch == '\'') { sc.ChangeState(SCE_SH_STRING); QuoteStack.Start(sc.ch, BASH_DELIM_CSTRING); } else if (sc.ch == '"') { sc.ChangeState(SCE_SH_STRING); QuoteStack.Start(sc.ch, BASH_DELIM_LSTRING); } else if (sc.ch == '(') { sc.ChangeState(SCE_SH_BACKTICKS); QuoteStack.Start(sc.ch, BASH_DELIM_COMMAND); } else if (sc.ch == '`') { // $` seen in a configure script, valid? sc.ChangeState(SCE_SH_BACKTICKS); QuoteStack.Start(sc.ch, BASH_DELIM_BACKTICK); } else { continue; // scalar has no delimiter pair } } else if (sc.Match('<', '<')) { sc.SetState(SCE_SH_HERE_DELIM); HereDoc.State = 0; if (sc.GetRelative(2) == '-') { // <<- indent case HereDoc.Indent = true; sc.Forward(); } else { HereDoc.Indent = false; } } else if (sc.ch == '-' && // one-char file test operators setSingleCharOp.Contains(sc.chNext) && !setWord.Contains(sc.GetRelative(2)) && IsASpace(sc.chPrev)) { sc.SetState(SCE_SH_WORD); sc.Forward(); } else if (setBashOperator.Contains(sc.ch)) { char s[10]; bool isCmdDelim = false; sc.SetState(SCE_SH_OPERATOR); // handle opening delimiters for test/arithmetic expressions - ((,[[,[ if (cmdState == BASH_CMD_START || cmdState == BASH_CMD_BODY) { if (sc.Match('(', '(')) { cmdState = BASH_CMD_ARITH; sc.Forward(); } else if (sc.Match('[', '[') && IsASpace(sc.GetRelative(2))) { cmdState = BASH_CMD_TEST; testExprType = 1; sc.Forward(); } else if (sc.ch == '[' && IsASpace(sc.chNext)) { cmdState = BASH_CMD_TEST; testExprType = 2; } } // special state -- for ((x;y;z)) in ... looping if (cmdState == BASH_CMD_WORD && sc.Match('(', '(')) { cmdState = BASH_CMD_ARITH; sc.Forward(); continue; } // handle command delimiters in command START|BODY|WORD state, also TEST if 'test' if (cmdState == BASH_CMD_START || cmdState == BASH_CMD_BODY || cmdState == BASH_CMD_WORD || (cmdState == BASH_CMD_TEST && testExprType == 0)) { s[0] = static_cast(sc.ch); if (setBashOperator.Contains(sc.chNext)) { s[1] = static_cast(sc.chNext); s[2] = '\0'; isCmdDelim = cmdDelimiter.InList(s); if (isCmdDelim) sc.Forward(); } if (!isCmdDelim) { s[1] = '\0'; isCmdDelim = cmdDelimiter.InList(s); } if (isCmdDelim) { cmdState = BASH_CMD_DELIM; continue; } } // handle closing delimiters for test/arithmetic expressions - )),]],] if (cmdState == BASH_CMD_ARITH && sc.Match(')', ')')) { cmdState = BASH_CMD_BODY; sc.Forward(); } else if (cmdState == BASH_CMD_TEST && IsASpace(sc.chPrev)) { if (sc.Match(']', ']') && testExprType == 1) { sc.Forward(); cmdState = BASH_CMD_BODY; } else if (sc.ch == ']' && testExprType == 2) { cmdState = BASH_CMD_BODY; } } } }// sc.state } sc.Complete(); if (sc.state == SCE_SH_HERE_Q) { styler.ChangeLexerState(sc.currentPos, styler.Length()); } sc.Complete(); } static bool IsCommentLine(Sci_Position line, Accessor &styler) { Sci_Position pos = styler.LineStart(line); Sci_Position eol_pos = styler.LineStart(line + 1) - 1; for (Sci_Position i = pos; i < eol_pos; i++) { char ch = styler[i]; if (ch == '#') return true; else if (ch != ' ' && ch != '\t') return false; } return false; } static void FoldBashDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; Sci_PositionU endPos = startPos + length; int visibleChars = 0; int skipHereCh = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); // Comment folding if (foldComment && atEOL && IsCommentLine(lineCurrent, styler)) { if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler)) levelCurrent++; else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent + 1, styler)) levelCurrent--; } if (style == SCE_SH_OPERATOR) { if (ch == '{') { levelCurrent++; } else if (ch == '}') { levelCurrent--; } } // Here Document folding if (style == SCE_SH_HERE_DELIM) { if (ch == '<' && chNext == '<') { if (styler.SafeGetCharAt(i + 2) == '<') { skipHereCh = 1; } else { if (skipHereCh == 0) { levelCurrent++; } else { skipHereCh = 0; } } } } else if (style == SCE_SH_HERE_Q && styler.StyleAt(i+1) == SCE_SH_DEFAULT) { levelCurrent--; } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const bashWordListDesc[] = { "Keywords", 0 }; LexerModule lmBash(SCLEX_BASH, ColouriseBashDoc, "bash", FoldBashDoc, bashWordListDesc); scintilla/lexers/LexPB.cxx0000644000175000017500000003046712557522743014526 0ustar neilneil// Scintilla source code edit control // @file LexPB.cxx // Lexer for PowerBasic by Roland Walter, roland@rowalt.de (for PowerBasic see www.powerbasic.com) // // Changes: // 17.10.2003: Toggling of subs/functions now until next sub/function - this gives better results // 29.10.2003: 1. Bug: Toggling didn't work for subs/functions added in editor // 2. Own colors for PB constants and Inline Assembler SCE_B_CONSTANT and SCE_B_ASM // 3. Several smaller syntax coloring improvements and speed optimizations // 12.07.2004: 1. Toggling for macros added // 2. Further folding speed optimitations (for people dealing with very large listings) // // Necessary changes for the PB lexer in Scintilla project: // - In SciLexer.h and Scintilla.iface: // // #define SCLEX_POWERBASIC 51 //ID for PowerBasic lexer // (...) // #define SCE_B_DEFAULT 0 //in both VB and PB lexer // #define SCE_B_COMMENT 1 //in both VB and PB lexer // #define SCE_B_NUMBER 2 //in both VB and PB lexer // #define SCE_B_KEYWORD 3 //in both VB and PB lexer // #define SCE_B_STRING 4 //in both VB and PB lexer // #define SCE_B_PREPROCESSOR 5 //VB lexer only, not in PB lexer // #define SCE_B_OPERATOR 6 //in both VB and PB lexer // #define SCE_B_IDENTIFIER 7 //in both VB and PB lexer // #define SCE_B_DATE 8 //VB lexer only, not in PB lexer // #define SCE_B_CONSTANT 13 //PB lexer only, not in VB lexer // #define SCE_B_ASM 14 //PB lexer only, not in VB lexer // - Statement added to KeyWords.cxx: 'LINK_LEXER(lmPB);' // - Statement added to scintilla_vc6.mak: '$(DIR_O)\LexPB.obj: ...\src\LexPB.cxx $(LEX_HEADERS)' // // Copyright for Scintilla: 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsTypeCharacter(const int ch) { return ch == '%' || ch == '&' || ch == '@' || ch == '!' || ch == '#' || ch == '$' || ch == '?'; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } bool MatchUpperCase(Accessor &styler, Sci_Position pos, const char *s) //Same as styler.Match() but uppercase comparison (a-z,A-Z and space only) { char ch; for (Sci_Position i=0; *s; i++) { ch=styler.SafeGetCharAt(pos+i); if (ch > 0x60) ch -= '\x20'; if (*s != ch) return false; s++; } return true; } static void ColourisePBDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,WordList *keywordlists[],Accessor &styler) { WordList &keywords = *keywordlists[0]; styler.StartAt(startPos); StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { switch (sc.state) { case SCE_B_OPERATOR: { sc.SetState(SCE_B_DEFAULT); break; } case SCE_B_KEYWORD: { if (!IsAWordChar(sc.ch)) { if (!IsTypeCharacter(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { if (strcmp(s, "rem") == 0) { sc.ChangeState(SCE_B_COMMENT); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else if (strcmp(s, "asm") == 0) { sc.ChangeState(SCE_B_ASM); if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} } else { sc.SetState(SCE_B_DEFAULT); } } else { sc.ChangeState(SCE_B_IDENTIFIER); sc.SetState(SCE_B_DEFAULT); } } } break; } case SCE_B_NUMBER: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_STRING: { if (sc.ch == '\"'){sc.ForwardSetState(SCE_B_DEFAULT);} break; } case SCE_B_CONSTANT: { if (!IsAWordChar(sc.ch)) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_COMMENT: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } case SCE_B_ASM: { if (sc.atLineEnd) {sc.SetState(SCE_B_DEFAULT);} break; } } //switch (sc.state) // Determine if a new state should be entered: if (sc.state == SCE_B_DEFAULT) { if (sc.ch == '\'') {sc.SetState(SCE_B_COMMENT);} else if (sc.ch == '\"') {sc.SetState(SCE_B_STRING);} else if (sc.ch == '&' && tolower(sc.chNext) == 'h') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'b') {sc.SetState(SCE_B_NUMBER);} else if (sc.ch == '&' && tolower(sc.chNext) == 'o') {sc.SetState(SCE_B_NUMBER);} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {sc.SetState(SCE_B_NUMBER);} else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '%') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '$') {sc.SetState(SCE_B_CONSTANT);} else if (sc.ch == '#') {sc.SetState(SCE_B_KEYWORD);} else if (sc.ch == '!') {sc.SetState(SCE_B_ASM);} else if (isoperator(static_cast(sc.ch)) || (sc.ch == '\\')) {sc.SetState(SCE_B_OPERATOR);} } } //for (; sc.More(); sc.Forward()) sc.Complete(); } //The folding routine for PowerBasic toggles SUBs and FUNCTIONs only. This was exactly what I wanted, //nothing more. I had worked with this kind of toggling for several years when I used the great good old //GFA Basic which is dead now. After testing the feature of toggling FOR-NEXT loops, WHILE-WEND loops //and so on too I found this is more disturbing then helping (for me). So if You think in another way //you can (or must) write Your own toggling routine ;-) static void FoldPBDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if( styler.GetPropertyInt("fold") == 0 ) return; Sci_PositionU endPos = startPos + length; Sci_Position lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; char chNext = styler[startPos]; bool fNewLine=true; bool fMightBeMultiLineMacro=false; bool fBeginOfCommentFound=false; for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (fNewLine) //Begin of a new line (The Sub/Function/Macro keywords may occur at begin of line only) { fNewLine=false; fBeginOfCommentFound=false; switch (ch) { case ' ': //Most lines start with space - so check this first, the code is the same as for 'default:' case '\t': //Handle tab too { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } case 'F': case 'f': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'S': case 's': { switch (chNext) { case 'U': case 'u': { if( MatchUpperCase(styler,i,"SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } case 'T': case 't': { if( MatchUpperCase(styler,i,"STATIC FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } else if( MatchUpperCase(styler,i,"STATIC SUB") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'C': case 'c': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"CALLBACK FUNCTION") ) { styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } break; } } break; } case 'M': case 'm': { switch (chNext) { case 'A': case 'a': { if( MatchUpperCase(styler,i,"MACRO") ) { fMightBeMultiLineMacro=true; //Set folder level at end of line, we have to check for single line macro } break; } } break; } default: { int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; styler.SetLevel(lineCurrent, lev); break; } } //switch (ch) } //if( fNewLine ) switch (ch) { case '=': //To test single line macros { if (fBeginOfCommentFound==false) fMightBeMultiLineMacro=false; //The found macro is a single line macro only; break; } case '\'': //A comment starts { fBeginOfCommentFound=true; break; } case '\n': { if (fMightBeMultiLineMacro) //The current line is the begin of a multi line macro { fMightBeMultiLineMacro=false; styler.SetLevel(lineCurrent, (SC_FOLDLEVELBASE << 16) | SC_FOLDLEVELHEADERFLAG); levelNext=SC_FOLDLEVELBASE+1; } lineCurrent++; levelCurrent = levelNext; fNewLine=true; break; } case '\r': { if (chNext != '\n') { lineCurrent++; levelCurrent = levelNext; fNewLine=true; } break; } } //switch (ch) } //for (Sci_PositionU i = startPos; i < endPos; i++) } static const char * const pbWordListDesc[] = { "Keywords", 0 }; LexerModule lmPB(SCLEX_POWERBASIC, ColourisePBDoc, "powerbasic", FoldPBDoc, pbWordListDesc); scintilla/lexers/LexModula.cxx0000644000175000017500000004023712557522743015442 0ustar neilneil// -*- coding: utf-8 -*- // Scintilla source code edit control /** * @file LexModula.cxx * @author Dariusz "DKnoto" Knociński * @date 2011/02/03 * @brief Lexer for Modula-2/3 documents. */ // The License.txt file describes the conditions under which this software may // be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif #ifdef DEBUG_LEX_MODULA #define DEBUG_STATE( p, c )\ fprintf( stderr, "Unknown state: currentPos = %ud, char = '%c'\n", p, c ); #else #define DEBUG_STATE( p, c ) #endif static inline bool IsDigitOfBase( unsigned ch, unsigned base ) { if( ch < '0' || ch > 'f' ) return false; if( base <= 10 ) { if( ch >= ( '0' + base ) ) return false; } else { if( ch > '9' ) { unsigned nb = base - 10; if( ( ch < 'A' ) || ( ch >= ( 'A' + nb ) ) ) { if( ( ch < 'a' ) || ( ch >= ( 'a' + nb ) ) ) { return false; } } } } return true; } static inline unsigned IsOperator( StyleContext & sc, WordList & op ) { int i; char s[3]; s[0] = sc.ch; s[1] = sc.chNext; s[2] = 0; for( i = 0; i < op.Length(); i++ ) { if( ( strlen( op.WordAt(i) ) == 2 ) && ( s[0] == op.WordAt(i)[0] && s[1] == op.WordAt(i)[1] ) ) { return 2; } } s[1] = 0; for( i = 0; i < op.Length(); i++ ) { if( ( strlen( op.WordAt(i) ) == 1 ) && ( s[0] == op.WordAt(i)[0] ) ) { return 1; } } return 0; } static inline bool IsEOL( Accessor &styler, Sci_PositionU curPos ) { unsigned ch = styler.SafeGetCharAt( curPos ); if( ( ch == '\r' && styler.SafeGetCharAt( curPos + 1 ) == '\n' ) || ( ch == '\n' ) ) { return true; } return false; } static inline bool checkStatement( Accessor &styler, Sci_Position &curPos, const char *stt, bool spaceAfter = true ) { int len = static_cast(strlen( stt )); int i; for( i = 0; i < len; i++ ) { if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) { return false; } } if( spaceAfter ) { if( ! isspace( styler.SafeGetCharAt( curPos + i ) ) ) { return false; } } curPos += ( len - 1 ); return true; } static inline bool checkEndSemicolon( Accessor &styler, Sci_Position &curPos, Sci_Position endPos ) { const char *stt = "END"; int len = static_cast(strlen( stt )); int i; for( i = 0; i < len; i++ ) { if( styler.SafeGetCharAt( curPos + i ) != stt[i] ) { return false; } } while( isspace( styler.SafeGetCharAt( curPos + i ) ) ) { i++; if( ( curPos + i ) >= endPos ) return false; } if( styler.SafeGetCharAt( curPos + i ) != ';' ) { return false; } curPos += ( i - 1 ); return true; } static inline bool checkKeyIdentOper( Accessor &styler, Sci_Position &curPos, Sci_Position endPos, const char *stt, const char etk ) { Sci_Position newPos = curPos; if( ! checkStatement( styler, newPos, stt ) ) return false; newPos++; if( newPos >= endPos ) return false; if( ! isspace( styler.SafeGetCharAt( newPos ) ) ) return false; newPos++; if( newPos >= endPos ) return false; while( isspace( styler.SafeGetCharAt( newPos ) ) ) { newPos++; if( newPos >= endPos ) return false; } if( ! isalpha( styler.SafeGetCharAt( newPos ) ) ) return false; newPos++; if( newPos >= endPos ) return false; char ch; ch = styler.SafeGetCharAt( newPos ); while( isalpha( ch ) || isdigit( ch ) || ch == '_' ) { newPos++; if( newPos >= endPos ) return false; ch = styler.SafeGetCharAt( newPos ); } while( isspace( styler.SafeGetCharAt( newPos ) ) ) { newPos++; if( newPos >= endPos ) return false; } if( styler.SafeGetCharAt( newPos ) != etk ) return false; curPos = newPos; return true; } static void FoldModulaDoc( Sci_PositionU startPos, Sci_Position length, int , WordList *[], Accessor &styler) { Sci_Position curLine = styler.GetLine(startPos); int curLevel = SC_FOLDLEVELBASE; Sci_Position endPos = startPos + length; if( curLine > 0 ) curLevel = styler.LevelAt( curLine - 1 ) >> 16; Sci_Position curPos = startPos; int style = styler.StyleAt( curPos ); int visChars = 0; int nextLevel = curLevel; while( curPos < endPos ) { if( ! isspace( styler.SafeGetCharAt( curPos ) ) ) visChars++; switch( style ) { case SCE_MODULA_COMMENT: if( checkStatement( styler, curPos, "(*" ) ) nextLevel++; else if( checkStatement( styler, curPos, "*)" ) ) nextLevel--; break; case SCE_MODULA_DOXYCOMM: if( checkStatement( styler, curPos, "(**", false ) ) nextLevel++; else if( checkStatement( styler, curPos, "*)" ) ) nextLevel--; break; case SCE_MODULA_KEYWORD: if( checkStatement( styler, curPos, "IF" ) ) nextLevel++; else if( checkStatement( styler, curPos, "BEGIN" ) ) nextLevel++; else if( checkStatement( styler, curPos, "TRY" ) ) nextLevel++; else if( checkStatement( styler, curPos, "LOOP" ) ) nextLevel++; else if( checkStatement( styler, curPos, "FOR" ) ) nextLevel++; else if( checkStatement( styler, curPos, "WHILE" ) ) nextLevel++; else if( checkStatement( styler, curPos, "REPEAT" ) ) nextLevel++; else if( checkStatement( styler, curPos, "UNTIL" ) ) nextLevel--; else if( checkStatement( styler, curPos, "WITH" ) ) nextLevel++; else if( checkStatement( styler, curPos, "CASE" ) ) nextLevel++; else if( checkStatement( styler, curPos, "TYPECASE" ) ) nextLevel++; else if( checkStatement( styler, curPos, "LOCK" ) ) nextLevel++; else if( checkKeyIdentOper( styler, curPos, endPos, "PROCEDURE", '(' ) ) nextLevel++; else if( checkKeyIdentOper( styler, curPos, endPos, "END", ';' ) ) { Sci_Position cln = curLine; int clv_old = curLevel; Sci_Position pos; char ch; int clv_new; while( cln > 0 ) { clv_new = styler.LevelAt( cln - 1 ) >> 16; if( clv_new < clv_old ) { nextLevel--; pos = styler.LineStart( cln ); while( ( ch = styler.SafeGetCharAt( pos ) ) != '\n' ) { if( ch == 'P' ) { if( styler.StyleAt(pos) == SCE_MODULA_KEYWORD ) { if( checkKeyIdentOper( styler, pos, endPos, "PROCEDURE", '(' ) ) { break; } } } pos++; } clv_old = clv_new; } cln--; } } else if( checkKeyIdentOper( styler, curPos, endPos, "END", '.' ) ) nextLevel--; else if( checkEndSemicolon( styler, curPos, endPos ) ) nextLevel--; else { while( styler.StyleAt( curPos + 1 ) == SCE_MODULA_KEYWORD ) curPos++; } break; default: break; } if( IsEOL( styler, curPos ) || ( curPos == endPos - 1 ) ) { int efectiveLevel = curLevel | nextLevel << 16; if( visChars == 0 ) efectiveLevel |= SC_FOLDLEVELWHITEFLAG; if( curLevel < nextLevel ) efectiveLevel |= SC_FOLDLEVELHEADERFLAG; if( efectiveLevel != styler.LevelAt(curLine) ) { styler.SetLevel(curLine, efectiveLevel ); } curLine++; curLevel = nextLevel; if( IsEOL( styler, curPos ) && ( curPos == endPos - 1 ) ) { styler.SetLevel( curLine, ( curLevel | curLevel << 16) | SC_FOLDLEVELWHITEFLAG); } visChars = 0; } curPos++; style = styler.StyleAt( curPos ); } } static inline bool skipWhiteSpaces( StyleContext & sc ) { while( isspace( sc.ch ) ) { sc.SetState( SCE_MODULA_DEFAULT ); if( sc.More() ) sc.Forward(); else return false; } return true; } static void ColouriseModulaDoc( Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *wl[], Accessor &styler ) { WordList& keyWords = *wl[0]; WordList& reservedWords = *wl[1]; WordList& operators = *wl[2]; WordList& pragmaWords = *wl[3]; WordList& escapeCodes = *wl[4]; WordList& doxyKeys = *wl[5]; const int BUFLEN = 128; char buf[BUFLEN]; int i, kl; Sci_Position charPos = 0; StyleContext sc( startPos, length, initStyle, styler ); while( sc.More() ) { switch( sc.state ) { case SCE_MODULA_DEFAULT: if( ! skipWhiteSpaces( sc ) ) break; if( sc.ch == '(' && sc.chNext == '*' ) { if( sc.GetRelative(2) == '*' ) { sc.SetState( SCE_MODULA_DOXYCOMM ); sc.Forward(); } else { sc.SetState( SCE_MODULA_COMMENT ); } sc.Forward(); } else if( isalpha( sc.ch ) ) { if( isupper( sc.ch ) && isupper( sc.chNext ) ) { for( i = 0; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(i); if( !isalpha( buf[i] ) && !(buf[i] == '_') ) break; } kl = i; buf[kl] = 0; if( keyWords.InList( buf ) ) { sc.SetState( SCE_MODULA_KEYWORD ); sc.Forward( kl ); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else if( reservedWords.InList( buf ) ) { sc.SetState( SCE_MODULA_RESERVED ); sc.Forward( kl ); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else { /** check procedure identifier */ } } else { for( i = 0; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(i); if( !isalpha( buf[i] ) && !isdigit( buf[i] ) && !(buf[i] == '_') ) break; } kl = i; buf[kl] = 0; sc.SetState( SCE_MODULA_DEFAULT ); sc.Forward( kl ); continue; } } else if( isdigit( sc.ch ) ) { sc.SetState( SCE_MODULA_NUMBER ); continue; } else if( sc.ch == '\"' ) { sc.SetState( SCE_MODULA_STRING ); } else if( sc.ch == '\'' ) { charPos = sc.currentPos; sc.SetState( SCE_MODULA_CHAR ); } else if( sc.ch == '<' && sc.chNext == '*' ) { sc.SetState( SCE_MODULA_PRAGMA ); sc.Forward(); } else { unsigned len = IsOperator( sc, operators ); if( len > 0 ) { sc.SetState( SCE_MODULA_OPERATOR ); sc.Forward( len ); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else { DEBUG_STATE( sc.currentPos, sc.ch ); } } break; case SCE_MODULA_COMMENT: if( sc.ch == '*' && sc.chNext == ')' ) { sc.Forward( 2 ); sc.SetState( SCE_MODULA_DEFAULT ); continue; } break; case SCE_MODULA_DOXYCOMM: switch( sc.ch ) { case '*': if( sc.chNext == ')' ) { sc.Forward( 2 ); sc.SetState( SCE_MODULA_DEFAULT ); continue; } break; case '@': if( islower( sc.chNext ) ) { for( i = 0; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(i+1); if( isspace( buf[i] ) ) break; } buf[i] = 0; kl = i; if( doxyKeys.InList( buf ) ) { sc.SetState( SCE_MODULA_DOXYKEY ); sc.Forward( kl + 1 ); sc.SetState( SCE_MODULA_DOXYCOMM ); } } break; default: break; } break; case SCE_MODULA_NUMBER: { buf[0] = sc.ch; for( i = 1; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(i); if( ! isdigit( buf[i] ) ) break; } kl = i; buf[kl] = 0; switch( sc.GetRelative(kl) ) { case '_': { int base = atoi( buf ); if( base < 2 || base > 16 ) { sc.SetState( SCE_MODULA_BADSTR ); } else { int imax; kl++; for( i = 0; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(kl+i); if( ! IsDigitOfBase( buf[i], 16 ) ) { break; } } imax = i; for( i = 0; i < imax; i++ ) { if( ! IsDigitOfBase( buf[i], base ) ) { sc.SetState( SCE_MODULA_BADSTR ); break; } } kl += imax; } sc.SetState( SCE_MODULA_BASENUM ); for( i = 0; i < kl; i++ ) { sc.Forward(); } sc.SetState( SCE_MODULA_DEFAULT ); continue; } break; case '.': if( sc.GetRelative(kl+1) == '.' ) { kl--; for( i = 0; i < kl; i++ ) { sc.Forward(); } sc.Forward(); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else { bool doNext = false; kl++; buf[0] = sc.GetRelative(kl); if( isdigit( buf[0] ) ) { for( i = 0;; i++ ) { if( !isdigit(sc.GetRelative(kl+i)) ) break; } kl += i; buf[0] = sc.GetRelative(kl); switch( buf[0] ) { case 'E': case 'e': case 'D': case 'd': case 'X': case 'x': kl++; buf[0] = sc.GetRelative(kl); if( buf[0] == '-' || buf[0] == '+' ) { kl++; } buf[0] = sc.GetRelative(kl); if( isdigit( buf[0] ) ) { for( i = 0;; i++ ) { if( !isdigit(sc.GetRelative(kl+i)) ) { buf[0] = sc.GetRelative(kl+i); break; } } kl += i; doNext = true; } else { sc.SetState( SCE_MODULA_BADSTR ); } break; default: doNext = true; break; } } else { sc.SetState( SCE_MODULA_BADSTR ); } if( doNext ) { if( ! isspace( buf[0] ) && buf[0] != ')' && buf[0] != '>' && buf[0] != '<' && buf[0] != '=' && buf[0] != '#' && buf[0] != '+' && buf[0] != '-' && buf[0] != '*' && buf[0] != '/' && buf[0] != ',' && buf[0] != ';' ) { sc.SetState( SCE_MODULA_BADSTR ); } else { kl--; } } } sc.SetState( SCE_MODULA_FLOAT ); for( i = 0; i < kl; i++ ) { sc.Forward(); } sc.SetState( SCE_MODULA_DEFAULT ); continue; break; default: for( i = 0; i < kl; i++ ) { sc.Forward(); } break; } sc.SetState( SCE_MODULA_DEFAULT ); continue; } break; case SCE_MODULA_STRING: if( sc.ch == '\"' ) { sc.Forward(); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else { if( sc.ch == '\\' ) { i = 1; if( IsDigitOfBase( sc.chNext, 8 ) ) { for( i = 1; i < BUFLEN - 1; i++ ) { if( ! IsDigitOfBase(sc.GetRelative(i+1), 8 ) ) break; } if( i == 3 ) { sc.SetState( SCE_MODULA_STRSPEC ); } else { sc.SetState( SCE_MODULA_BADSTR ); } } else { buf[0] = sc.chNext; buf[1] = 0; if( escapeCodes.InList( buf ) ) { sc.SetState( SCE_MODULA_STRSPEC ); } else { sc.SetState( SCE_MODULA_BADSTR ); } } sc.Forward(i+1); sc.SetState( SCE_MODULA_STRING ); continue; } } break; case SCE_MODULA_CHAR: if( sc.ch == '\'' ) { sc.Forward(); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else if( ( sc.currentPos - charPos ) == 1 ) { if( sc.ch == '\\' ) { i = 1; if( IsDigitOfBase( sc.chNext, 8 ) ) { for( i = 1; i < BUFLEN - 1; i++ ) { if( ! IsDigitOfBase(sc.GetRelative(i+1), 8 ) ) break; } if( i == 3 ) { sc.SetState( SCE_MODULA_CHARSPEC ); } else { sc.SetState( SCE_MODULA_BADSTR ); } } else { buf[0] = sc.chNext; buf[1] = 0; if( escapeCodes.InList( buf ) ) { sc.SetState( SCE_MODULA_CHARSPEC ); } else { sc.SetState( SCE_MODULA_BADSTR ); } } sc.Forward(i+1); sc.SetState( SCE_MODULA_CHAR ); continue; } } else { sc.SetState( SCE_MODULA_BADSTR ); sc.Forward(); sc.SetState( SCE_MODULA_CHAR ); continue; } break; case SCE_MODULA_PRAGMA: if( sc.ch == '*' && sc.chNext == '>' ) { sc.Forward(); sc.Forward(); sc.SetState( SCE_MODULA_DEFAULT ); continue; } else if( isupper( sc.ch ) && isupper( sc.chNext ) ) { buf[0] = sc.ch; buf[1] = sc.chNext; for( i = 2; i < BUFLEN - 1; i++ ) { buf[i] = sc.GetRelative(i); if( !isupper( buf[i] ) ) break; } kl = i; buf[kl] = 0; if( pragmaWords.InList( buf ) ) { sc.SetState( SCE_MODULA_PRGKEY ); sc.Forward( kl ); sc.SetState( SCE_MODULA_PRAGMA ); continue; } } break; default: break; } sc.Forward(); } sc.Complete(); } static const char *const modulaWordListDesc[] = { "Keywords", "ReservedKeywords", "Operators", "PragmaKeyswords", "EscapeCodes", "DoxygeneKeywords", 0 }; LexerModule lmModula( SCLEX_MODULA, ColouriseModulaDoc, "modula", FoldModulaDoc, modulaWordListDesc); scintilla/lexers/LexEScript.cxx0000644000175000017500000002003012557522743015557 0ustar neilneil// Scintilla source code edit control /** @file LexESCRIPT.cxx ** Lexer for ESCRIPT **/ // Copyright 2003 by Patrizio Bekerle (patrizio@bekerle.com) #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseESCRIPTDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; // Do not leak onto next line /*if (initStyle == SCE_ESCRIPT_STRINGEOL) initStyle = SCE_ESCRIPT_DEFAULT;*/ StyleContext sc(startPos, length, initStyle, styler); bool caseSensitive = styler.GetPropertyInt("escript.case.sensitive", 0) != 0; for (; sc.More(); sc.Forward()) { /*if (sc.atLineStart && (sc.state == SCE_ESCRIPT_STRING)) { // Prevent SCE_ESCRIPT_STRINGEOL from leaking back to previous line sc.SetState(SCE_ESCRIPT_STRING); }*/ // Handle line continuation generically. if (sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_ESCRIPT_OPERATOR || sc.state == SCE_ESCRIPT_BRACE) { sc.SetState(SCE_ESCRIPT_DEFAULT); } else if (sc.state == SCE_ESCRIPT_NUMBER) { if (!IsADigit(sc.ch) || sc.ch != '.') { sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_IDENTIFIER) { if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } // sc.GetCurrentLowered(s, sizeof(s)); if (keywords.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_ESCRIPT_WORD3); // sc.state = SCE_ESCRIPT_IDENTIFIER; } sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENT) { if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENTDOC) { if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_COMMENTLINE) { if (sc.atLineEnd) { sc.SetState(SCE_ESCRIPT_DEFAULT); } } else if (sc.state == SCE_ESCRIPT_STRING) { if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_ESCRIPT_DEFAULT); } } // Determine if a new state should be entered. if (sc.state == SCE_ESCRIPT_DEFAULT) { if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_ESCRIPT_NUMBER); } else if (IsAWordStart(sc.ch) || (sc.ch == '#')) { sc.SetState(SCE_ESCRIPT_IDENTIFIER); } else if (sc.Match('/', '*')) { sc.SetState(SCE_ESCRIPT_COMMENT); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { sc.SetState(SCE_ESCRIPT_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_ESCRIPT_STRING); //} else if (isoperator(static_cast(sc.ch))) { } else if (sc.ch == '+' || sc.ch == '-' || sc.ch == '*' || sc.ch == '/' || sc.ch == '=' || sc.ch == '<' || sc.ch == '>' || sc.ch == '&' || sc.ch == '|' || sc.ch == '!' || sc.ch == '?' || sc.ch == ':') { sc.SetState(SCE_ESCRIPT_OPERATOR); } else if (sc.ch == '{' || sc.ch == '}') { sc.SetState(SCE_ESCRIPT_BRACE); } } } sc.Complete(); } static int classifyFoldPointESCRIPT(const char* s, const char* prevWord) { int lev = 0; if (strcmp(prevWord, "end") == 0) return lev; if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "elseif") == 0) return -1; if (strcmp(s, "for") == 0 || strcmp(s, "foreach") == 0 || strcmp(s, "program") == 0 || strcmp(s, "function") == 0 || strcmp(s, "while") == 0 || strcmp(s, "case") == 0 || strcmp(s, "if") == 0 ) { lev = 1; } else if ( strcmp(s, "endfor") == 0 || strcmp(s, "endforeach") == 0 || strcmp(s, "endprogram") == 0 || strcmp(s, "endfunction") == 0 || strcmp(s, "endwhile") == 0 || strcmp(s, "endcase") == 0 || strcmp(s, "endif") == 0 ) { lev = -1; } return lev; } static bool IsStreamCommentStyle(int style) { return style == SCE_ESCRIPT_COMMENT || style == SCE_ESCRIPT_COMMENTDOC || style == SCE_ESCRIPT_COMMENTLINE; } static void FoldESCRIPTDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) { //~ bool foldComment = styler.GetPropertyInt("fold.comment") != 0; // Do not know how to fold the comment at the moment. bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldComment = true; Sci_PositionU endPos = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; Sci_Position lastStart = 0; char prevWord[32] = ""; for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelCurrent++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelCurrent--; } } if (foldComment && (style == SCE_ESCRIPT_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelCurrent++; } else if (chNext2 == '}') { levelCurrent--; } } } if (stylePrev == SCE_ESCRIPT_DEFAULT && style == SCE_ESCRIPT_WORD3) { // Store last word start point. lastStart = i; } if (style == SCE_ESCRIPT_WORD3) { if(iswordchar(ch) && !iswordchar(chNext)) { char s[32]; Sci_PositionU j; for(j = 0; ( j < 31 ) && ( j < i-lastStart+1 ); j++) { s[j] = static_cast(tolower(styler[lastStart + j])); } s[j] = '\0'; levelCurrent += classifyFoldPointESCRIPT(s, prevWord); strcpy(prevWord, s); } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; strcpy(prevWord, ""); } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const ESCRIPTWordLists[] = { "Primary keywords and identifiers", "Intrinsic functions", "Extended and user defined functions", 0, }; LexerModule lmESCRIPT(SCLEX_ESCRIPT, ColouriseESCRIPTDoc, "escript", FoldESCRIPTDoc, ESCRIPTWordLists); scintilla/lexers/LexDiff.cxx0000644000175000017500000001340412557522743015065 0ustar neilneil// Scintilla source code edit control /** @file LexDiff.cxx ** Lexer for diff results. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } #define DIFF_BUFFER_START_SIZE 16 // Note that ColouriseDiffLine analyzes only the first DIFF_BUFFER_START_SIZE // characters of each line to classify the line. static void ColouriseDiffLine(char *lineBuffer, Sci_Position endLine, Accessor &styler) { // It is needed to remember the current state to recognize starting // comment lines before the first "diff " or "--- ". If a real // difference starts then each line starting with ' ' is a whitespace // otherwise it is considered a comment (Only in..., Binary file...) if (0 == strncmp(lineBuffer, "diff ", 5)) { styler.ColourTo(endLine, SCE_DIFF_COMMAND); } else if (0 == strncmp(lineBuffer, "Index: ", 7)) { // For subversion's diff styler.ColourTo(endLine, SCE_DIFF_COMMAND); } else if (0 == strncmp(lineBuffer, "---", 3) && lineBuffer[3] != '-') { // In a context diff, --- appears in both the header and the position markers if (lineBuffer[3] == ' ' && atoi(lineBuffer + 4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else if (lineBuffer[3] == '\r' || lineBuffer[3] == '\n') styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "+++ ", 4)) { // I don't know of any diff where "+++ " is a position marker, but for // consistency, do the same as with "--- " and "*** ". if (atoi(lineBuffer+4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "====", 4)) { // For p4's diff styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "***", 3)) { // In a context diff, *** appears in both the header and the position markers. // Also ******** is a chunk header, but here it's treated as part of the // position marker since there is no separate style for a chunk header. if (lineBuffer[3] == ' ' && atoi(lineBuffer+4) && !strchr(lineBuffer, '/')) styler.ColourTo(endLine, SCE_DIFF_POSITION); else if (lineBuffer[3] == '*') styler.ColourTo(endLine, SCE_DIFF_POSITION); else styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (0 == strncmp(lineBuffer, "? ", 2)) { // For difflib styler.ColourTo(endLine, SCE_DIFF_HEADER); } else if (lineBuffer[0] == '@') { styler.ColourTo(endLine, SCE_DIFF_POSITION); } else if (lineBuffer[0] >= '0' && lineBuffer[0] <= '9') { styler.ColourTo(endLine, SCE_DIFF_POSITION); } else if (lineBuffer[0] == '-' || lineBuffer[0] == '<') { styler.ColourTo(endLine, SCE_DIFF_DELETED); } else if (lineBuffer[0] == '+' || lineBuffer[0] == '>') { styler.ColourTo(endLine, SCE_DIFF_ADDED); } else if (lineBuffer[0] == '!') { styler.ColourTo(endLine, SCE_DIFF_CHANGED); } else if (lineBuffer[0] != ' ') { styler.ColourTo(endLine, SCE_DIFF_COMMENT); } else { styler.ColourTo(endLine, SCE_DIFF_DEFAULT); } } static void ColouriseDiffDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { char lineBuffer[DIFF_BUFFER_START_SIZE] = ""; styler.StartAt(startPos); styler.StartSegment(startPos); Sci_PositionU linePos = 0; for (Sci_PositionU i = startPos; i < startPos + length; i++) { if (AtEOL(styler, i)) { if (linePos < DIFF_BUFFER_START_SIZE) { lineBuffer[linePos] = 0; } ColouriseDiffLine(lineBuffer, i, styler); linePos = 0; } else if (linePos < DIFF_BUFFER_START_SIZE - 1) { lineBuffer[linePos++] = styler[i]; } else if (linePos == DIFF_BUFFER_START_SIZE - 1) { lineBuffer[linePos++] = 0; } } if (linePos > 0) { // Last line does not have ending characters if (linePos < DIFF_BUFFER_START_SIZE) { lineBuffer[linePos] = 0; } ColouriseDiffLine(lineBuffer, startPos + length - 1, styler); } } static void FoldDiffDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { Sci_Position curLine = styler.GetLine(startPos); Sci_Position curLineStart = styler.LineStart(curLine); int prevLevel = curLine > 0 ? styler.LevelAt(curLine - 1) : SC_FOLDLEVELBASE; int nextLevel; do { int lineType = styler.StyleAt(curLineStart); if (lineType == SCE_DIFF_COMMAND) nextLevel = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; else if (lineType == SCE_DIFF_HEADER) nextLevel = (SC_FOLDLEVELBASE + 1) | SC_FOLDLEVELHEADERFLAG; else if (lineType == SCE_DIFF_POSITION && styler[curLineStart] != '-') nextLevel = (SC_FOLDLEVELBASE + 2) | SC_FOLDLEVELHEADERFLAG; else if (prevLevel & SC_FOLDLEVELHEADERFLAG) nextLevel = (prevLevel & SC_FOLDLEVELNUMBERMASK) + 1; else nextLevel = prevLevel; if ((nextLevel & SC_FOLDLEVELHEADERFLAG) && (nextLevel == prevLevel)) styler.SetLevel(curLine-1, prevLevel & ~SC_FOLDLEVELHEADERFLAG); styler.SetLevel(curLine, nextLevel); prevLevel = nextLevel; curLineStart = styler.LineStart(++curLine); } while (static_cast(startPos)+length > curLineStart); } static const char *const emptyWordListDesc[] = { 0 }; LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", FoldDiffDoc, emptyWordListDesc); scintilla/lexers/LexCLW.cxx0000644000175000017500000005317012557522743014646 0ustar neilneil// Scintilla source code edit control /** @file LexClw.cxx ** Lexer for Clarion. ** 2004/12/17 Updated Lexer **/ // Copyright 2003-2004 by Ron Schofield // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Is an end of line character inline bool IsEOL(const int ch) { return(ch == '\n'); } // Convert character to uppercase static char CharacterUpper(char chChar) { if (chChar < 'a' || chChar > 'z') { return(chChar); } else { return(static_cast(chChar - 'a' + 'A')); } } // Convert string to uppercase static void StringUpper(char *szString) { while (*szString) { *szString = CharacterUpper(*szString); szString++; } } // Is a label start character inline bool IsALabelStart(const int iChar) { return(isalpha(iChar) || iChar == '_'); } // Is a label character inline bool IsALabelCharacter(const int iChar) { return(isalnum(iChar) || iChar == '_' || iChar == ':'); } // Is the character is a ! and the the next character is not a ! inline bool IsACommentStart(const int iChar) { return(iChar == '!'); } // Is the character a Clarion hex character (ABCDEF) inline bool IsAHexCharacter(const int iChar, bool bCaseSensitive) { // Case insensitive. if (!bCaseSensitive) { if (strchr("ABCDEFabcdef", iChar) != NULL) { return(true); } } // Case sensitive else { if (strchr("ABCDEF", iChar) != NULL) { return(true); } } return(false); } // Is the character a Clarion base character (B=Binary, O=Octal, H=Hex) inline bool IsANumericBaseCharacter(const int iChar, bool bCaseSensitive) { // Case insensitive. if (!bCaseSensitive) { // If character is a numeric base character if (strchr("BOHboh", iChar) != NULL) { return(true); } } // Case sensitive else { // If character is a numeric base character if (strchr("BOH", iChar) != NULL) { return(true); } } return(false); } // Set the correct numeric constant state inline bool SetNumericConstantState(StyleContext &scDoc) { int iPoints = 0; // Point counter char cNumericString[512]; // Numeric string buffer // Buffer the current numberic string scDoc.GetCurrent(cNumericString, sizeof(cNumericString)); // Loop through the string until end of string (NULL termination) for (int iIndex = 0; cNumericString[iIndex] != '\0'; iIndex++) { // Depending on the character switch (cNumericString[iIndex]) { // Is a . (point) case '.' : // Increment point counter iPoints++; break; default : break; } } // If points found (can be more than one for improper formatted number if (iPoints > 0) { return(true); } // Else no points found else { return(false); } } // Get the next word in uppercase from the current position (keyword lookahead) inline bool GetNextWordUpper(Accessor &styler, Sci_PositionU uiStartPos, Sci_Position iLength, char *cWord) { Sci_PositionU iIndex = 0; // Buffer Index // Loop through the remaining string from the current position for (Sci_Position iOffset = uiStartPos; iOffset < iLength; iOffset++) { // Get the character from the buffer using the offset char cCharacter = styler[iOffset]; if (IsEOL(cCharacter)) { break; } // If the character is alphabet character if (isalpha(cCharacter)) { // Add UPPERCASE character to the word buffer cWord[iIndex++] = CharacterUpper(cCharacter); } } // Add null termination cWord[iIndex] = '\0'; // If no word was found if (iIndex == 0) { // Return failure return(false); } // Else word was found else { // Return success return(true); } } // Clarion Language Colouring Procedure static void ColouriseClarionDoc(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler, bool bCaseSensitive) { int iParenthesesLevel = 0; // Parenthese Level int iColumn1Label = false; // Label starts in Column 1 WordList &wlClarionKeywords = *wlKeywords[0]; // Clarion Keywords WordList &wlCompilerDirectives = *wlKeywords[1]; // Compiler Directives WordList &wlRuntimeExpressions = *wlKeywords[2]; // Runtime Expressions WordList &wlBuiltInProcsFuncs = *wlKeywords[3]; // Builtin Procedures and Functions WordList &wlStructsDataTypes = *wlKeywords[4]; // Structures and Data Types WordList &wlAttributes = *wlKeywords[5]; // Procedure Attributes WordList &wlStandardEquates = *wlKeywords[6]; // Standard Equates WordList &wlLabelReservedWords = *wlKeywords[7]; // Clarion Reserved Keywords (Labels) WordList &wlProcLabelReservedWords = *wlKeywords[8]; // Clarion Reserved Keywords (Procedure Labels) const char wlProcReservedKeywordList[] = "PROCEDURE FUNCTION"; WordList wlProcReservedKeywords; wlProcReservedKeywords.Set(wlProcReservedKeywordList); const char wlCompilerKeywordList[] = "COMPILE OMIT"; WordList wlCompilerKeywords; wlCompilerKeywords.Set(wlCompilerKeywordList); const char wlLegacyStatementsList[] = "BOF EOF FUNCTION POINTER SHARE"; WordList wlLegacyStatements; wlLegacyStatements.Set(wlLegacyStatementsList); StyleContext scDoc(uiStartPos, iLength, iInitStyle, accStyler); // lex source code for (; scDoc.More(); scDoc.Forward()) { // // Determine if the current state should terminate. // // Label State Handling if (scDoc.state == SCE_CLW_LABEL) { // If the character is not a valid label if (!IsALabelCharacter(scDoc.ch)) { // If the character is a . (dot syntax) if (scDoc.ch == '.') { // Turn off column 1 label flag as label now cannot be reserved work iColumn1Label = false; // Uncolour the . (dot) to default state, move forward one character, // and change back to the label state. scDoc.SetState(SCE_CLW_DEFAULT); scDoc.Forward(); scDoc.SetState(SCE_CLW_LABEL); } // Else check label else { char cLabel[512]; // Label buffer // Buffer the current label string scDoc.GetCurrent(cLabel,sizeof(cLabel)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cLabel); } // Else if UPPERCASE label string is in the Clarion compiler keyword list if (wlCompilerKeywords.InList(cLabel) && iColumn1Label){ // change the label to error state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Else if UPPERCASE label string is in the Clarion reserved keyword list else if (wlLabelReservedWords.InList(cLabel) && iColumn1Label){ // change the label to error state scDoc.ChangeState(SCE_CLW_ERROR); } // Else if UPPERCASE label string is else if (wlProcLabelReservedWords.InList(cLabel) && iColumn1Label) { char cWord[512]; // Word buffer // Get the next word from the current position if (GetNextWordUpper(accStyler,scDoc.currentPos,uiStartPos+iLength,cWord)) { // If the next word is a procedure reserved word if (wlProcReservedKeywords.InList(cWord)) { // Change the label to error state scDoc.ChangeState(SCE_CLW_ERROR); } } } // Else if label string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cLabel)) { // change the state to compiler directive state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Terminate the label state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } } // Keyword State Handling else if (scDoc.state == SCE_CLW_KEYWORD) { // If character is : (colon) if (scDoc.ch == ':') { char cEquate[512]; // Equate buffer // Move forward to include : (colon) in buffer scDoc.Forward(); // Buffer the equate string scDoc.GetCurrent(cEquate,sizeof(cEquate)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cEquate); } // If statement string is in the equate list if (wlStandardEquates.InList(cEquate)) { // Change to equate state scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); } } // If the character is not a valid label character else if (!IsALabelCharacter(scDoc.ch)) { char cStatement[512]; // Statement buffer // Buffer the statement string scDoc.GetCurrent(cStatement,sizeof(cStatement)); // If case insensitive, convert string to UPPERCASE to match passed keywords. if (!bCaseSensitive) { StringUpper(cStatement); } // If statement string is in the Clarion keyword list if (wlClarionKeywords.InList(cStatement)) { // Change the statement string to the Clarion keyword state scDoc.ChangeState(SCE_CLW_KEYWORD); } // Else if statement string is in the compiler directive keyword list else if (wlCompilerDirectives.InList(cStatement)) { // Change the statement string to the compiler directive state scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); } // Else if statement string is in the runtime expressions keyword list else if (wlRuntimeExpressions.InList(cStatement)) { // Change the statement string to the runtime expressions state scDoc.ChangeState(SCE_CLW_RUNTIME_EXPRESSIONS); } // Else if statement string is in the builtin procedures and functions keyword list else if (wlBuiltInProcsFuncs.InList(cStatement)) { // Change the statement string to the builtin procedures and functions state scDoc.ChangeState(SCE_CLW_BUILTIN_PROCEDURES_FUNCTION); } // Else if statement string is in the tructures and data types keyword list else if (wlStructsDataTypes.InList(cStatement)) { // Change the statement string to the structures and data types state scDoc.ChangeState(SCE_CLW_STRUCTURE_DATA_TYPE); } // Else if statement string is in the procedure attribute keyword list else if (wlAttributes.InList(cStatement)) { // Change the statement string to the procedure attribute state scDoc.ChangeState(SCE_CLW_ATTRIBUTE); } // Else if statement string is in the standard equate keyword list else if (wlStandardEquates.InList(cStatement)) { // Change the statement string to the standard equate state scDoc.ChangeState(SCE_CLW_STANDARD_EQUATE); } // Else if statement string is in the deprecated or legacy keyword list else if (wlLegacyStatements.InList(cStatement)) { // Change the statement string to the standard equate state scDoc.ChangeState(SCE_CLW_DEPRECATED); } // Else the statement string doesn't match any work list else { // Change the statement string to the default state scDoc.ChangeState(SCE_CLW_DEFAULT); } // Terminate the keyword state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } // String State Handling else if (scDoc.state == SCE_CLW_STRING) { // If the character is an ' (single quote) if (scDoc.ch == '\'') { // Set the state to default and move forward colouring // the ' (single quote) as default state // terminating the string state scDoc.SetState(SCE_CLW_DEFAULT); scDoc.Forward(); } // If the next character is an ' (single quote) if (scDoc.chNext == '\'') { // Move forward one character and set to default state // colouring the next ' (single quote) as default state // terminating the string state scDoc.ForwardSetState(SCE_CLW_DEFAULT); scDoc.Forward(); } } // Picture String State Handling else if (scDoc.state == SCE_CLW_PICTURE_STRING) { // If the character is an ( (open parenthese) if (scDoc.ch == '(') { // Increment the parenthese level iParenthesesLevel++; } // Else if the character is a ) (close parenthese) else if (scDoc.ch == ')') { // If the parenthese level is set to zero // parentheses matched if (!iParenthesesLevel) { scDoc.SetState(SCE_CLW_DEFAULT); } // Else parenthese level is greater than zero // still looking for matching parentheses else { // Decrement the parenthese level iParenthesesLevel--; } } } // Standard Equate State Handling else if (scDoc.state == SCE_CLW_STANDARD_EQUATE) { if (!isalnum(scDoc.ch)) { scDoc.SetState(SCE_CLW_DEFAULT); } } // Integer Constant State Handling else if (scDoc.state == SCE_CLW_INTEGER_CONSTANT) { // If the character is not a digit (0-9) // or character is not a hexidecimal character (A-F) // or character is not a . (point) // or character is not a numberic base character (B,O,H) if (!(isdigit(scDoc.ch) || IsAHexCharacter(scDoc.ch, bCaseSensitive) || scDoc.ch == '.' || IsANumericBaseCharacter(scDoc.ch, bCaseSensitive))) { // If the number was a real if (SetNumericConstantState(scDoc)) { // Colour the matched string to the real constant state scDoc.ChangeState(SCE_CLW_REAL_CONSTANT); } // Else the number was an integer else { // Colour the matched string to an integer constant state scDoc.ChangeState(SCE_CLW_INTEGER_CONSTANT); } // Terminate the integer constant state and set to default state scDoc.SetState(SCE_CLW_DEFAULT); } } // // Determine if a new state should be entered. // // Beginning of Line Handling if (scDoc.atLineStart) { // Reset the column 1 label flag iColumn1Label = false; // If column 1 character is a label start character if (IsALabelStart(scDoc.ch)) { // Label character is found in column 1 // so set column 1 label flag and clear last column 1 label iColumn1Label = true; // Set the state to label scDoc.SetState(SCE_CLW_LABEL); } // else if character is a space or tab else if (IsASpace(scDoc.ch)){ // Set to default state scDoc.SetState(SCE_CLW_DEFAULT); } // else if comment start (!) or is an * (asterisk) else if (IsACommentStart(scDoc.ch) || scDoc.ch == '*' ) { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); } // else the character is a ? (question mark) else if (scDoc.ch == '?') { // Change to the compiler directive state, move forward, // colouring the ? (question mark), change back to default state. scDoc.ChangeState(SCE_CLW_COMPILER_DIRECTIVE); scDoc.Forward(); scDoc.SetState(SCE_CLW_DEFAULT); } // else an invalid character in column 1 else { // Set to error state scDoc.SetState(SCE_CLW_ERROR); } } // End of Line Handling else if (scDoc.atLineEnd) { // Reset to the default state at the end of each line. scDoc.SetState(SCE_CLW_DEFAULT); } // Default Handling else { // If in default state if (scDoc.state == SCE_CLW_DEFAULT) { // If is a letter could be a possible statement if (isalpha(scDoc.ch)) { // Set the state to Clarion Keyword and verify later scDoc.SetState(SCE_CLW_KEYWORD); } // else is a number else if (isdigit(scDoc.ch)) { // Set the state to Integer Constant and verify later scDoc.SetState(SCE_CLW_INTEGER_CONSTANT); } // else if the start of a comment or a | (line continuation) else if (IsACommentStart(scDoc.ch) || scDoc.ch == '|') { // then set the state to comment. scDoc.SetState(SCE_CLW_COMMENT); } // else if the character is a ' (single quote) else if (scDoc.ch == '\'') { // If the character is also a ' (single quote) // Embedded Apostrophe if (scDoc.chNext == '\'') { // Move forward colouring it as default state scDoc.ForwardSetState(SCE_CLW_DEFAULT); } else { // move to the next character and then set the state to comment. scDoc.ForwardSetState(SCE_CLW_STRING); } } // else the character is an @ (ampersand) else if (scDoc.ch == '@') { // Case insensitive. if (!bCaseSensitive) { // If character is a valid picture token character if (strchr("DEKNPSTdeknpst", scDoc.chNext) != NULL) { // Set to the picture string state scDoc.SetState(SCE_CLW_PICTURE_STRING); } } // Case sensitive else { // If character is a valid picture token character if (strchr("DEKNPST", scDoc.chNext) != NULL) { // Set the picture string state scDoc.SetState(SCE_CLW_PICTURE_STRING); } } } } } } // lexing complete scDoc.Complete(); } // Clarion Language Case Sensitive Colouring Procedure static void ColouriseClarionDocSensitive(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, true); } // Clarion Language Case Insensitive Colouring Procedure static void ColouriseClarionDocInsensitive(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *wlKeywords[], Accessor &accStyler) { ColouriseClarionDoc(uiStartPos, iLength, iInitStyle, wlKeywords, accStyler, false); } // Fill Buffer static void FillBuffer(Sci_PositionU uiStart, Sci_PositionU uiEnd, Accessor &accStyler, char *szBuffer, Sci_PositionU uiLength) { Sci_PositionU uiPos = 0; while ((uiPos < uiEnd - uiStart + 1) && (uiPos < uiLength-1)) { szBuffer[uiPos] = static_cast(toupper(accStyler[uiStart + uiPos])); uiPos++; } szBuffer[uiPos] = '\0'; } // Classify Clarion Fold Point static int ClassifyClarionFoldPoint(int iLevel, const char* szString) { if (!(isdigit(szString[0]) || (szString[0] == '.'))) { if (strcmp(szString, "PROCEDURE") == 0) { // iLevel = SC_FOLDLEVELBASE + 1; } else if (strcmp(szString, "MAP") == 0 || strcmp(szString,"ACCEPT") == 0 || strcmp(szString,"BEGIN") == 0 || strcmp(szString,"CASE") == 0 || strcmp(szString,"EXECUTE") == 0 || strcmp(szString,"IF") == 0 || strcmp(szString,"ITEMIZE") == 0 || strcmp(szString,"INTERFACE") == 0 || strcmp(szString,"JOIN") == 0 || strcmp(szString,"LOOP") == 0 || strcmp(szString,"MODULE") == 0 || strcmp(szString,"RECORD") == 0) { iLevel++; } else if (strcmp(szString, "APPLICATION") == 0 || strcmp(szString, "CLASS") == 0 || strcmp(szString, "DETAIL") == 0 || strcmp(szString, "FILE") == 0 || strcmp(szString, "FOOTER") == 0 || strcmp(szString, "FORM") == 0 || strcmp(szString, "GROUP") == 0 || strcmp(szString, "HEADER") == 0 || strcmp(szString, "INTERFACE") == 0 || strcmp(szString, "MENU") == 0 || strcmp(szString, "MENUBAR") == 0 || strcmp(szString, "OLE") == 0 || strcmp(szString, "OPTION") == 0 || strcmp(szString, "QUEUE") == 0 || strcmp(szString, "REPORT") == 0 || strcmp(szString, "SHEET") == 0 || strcmp(szString, "TAB") == 0 || strcmp(szString, "TOOLBAR") == 0 || strcmp(szString, "VIEW") == 0 || strcmp(szString, "WINDOW") == 0) { iLevel++; } else if (strcmp(szString, "END") == 0 || strcmp(szString, "UNTIL") == 0 || strcmp(szString, "WHILE") == 0) { iLevel--; } } return(iLevel); } // Clarion Language Folding Procedure static void FoldClarionDoc(Sci_PositionU uiStartPos, Sci_Position iLength, int iInitStyle, WordList *[], Accessor &accStyler) { Sci_PositionU uiEndPos = uiStartPos + iLength; Sci_Position iLineCurrent = accStyler.GetLine(uiStartPos); int iLevelPrev = accStyler.LevelAt(iLineCurrent) & SC_FOLDLEVELNUMBERMASK; int iLevelCurrent = iLevelPrev; char chNext = accStyler[uiStartPos]; int iStyle = iInitStyle; int iStyleNext = accStyler.StyleAt(uiStartPos); int iVisibleChars = 0; Sci_Position iLastStart = 0; for (Sci_PositionU uiPos = uiStartPos; uiPos < uiEndPos; uiPos++) { char chChar = chNext; chNext = accStyler.SafeGetCharAt(uiPos + 1); int iStylePrev = iStyle; iStyle = iStyleNext; iStyleNext = accStyler.StyleAt(uiPos + 1); bool bEOL = (chChar == '\r' && chNext != '\n') || (chChar == '\n'); if (iStylePrev == SCE_CLW_DEFAULT) { if (iStyle == SCE_CLW_KEYWORD || iStyle == SCE_CLW_STRUCTURE_DATA_TYPE) { // Store last word start point. iLastStart = uiPos; } } if (iStylePrev == SCE_CLW_KEYWORD || iStylePrev == SCE_CLW_STRUCTURE_DATA_TYPE) { if(iswordchar(chChar) && !iswordchar(chNext)) { char chBuffer[100]; FillBuffer(iLastStart, uiPos, accStyler, chBuffer, sizeof(chBuffer)); iLevelCurrent = ClassifyClarionFoldPoint(iLevelCurrent,chBuffer); // if ((iLevelCurrent == SC_FOLDLEVELBASE + 1) && iLineCurrent > 1) { // accStyler.SetLevel(iLineCurrent-1,SC_FOLDLEVELBASE); // iLevelPrev = SC_FOLDLEVELBASE; // } } } if (bEOL) { int iLevel = iLevelPrev; if ((iLevelCurrent > iLevelPrev) && (iVisibleChars > 0)) iLevel |= SC_FOLDLEVELHEADERFLAG; if (iLevel != accStyler.LevelAt(iLineCurrent)) { accStyler.SetLevel(iLineCurrent,iLevel); } iLineCurrent++; iLevelPrev = iLevelCurrent; iVisibleChars = 0; } if (!isspacechar(chChar)) iVisibleChars++; } // Fill in the real level of the next line, keeping the current flags // as they will be filled in later. int iFlagsNext = accStyler.LevelAt(iLineCurrent) & ~SC_FOLDLEVELNUMBERMASK; accStyler.SetLevel(iLineCurrent, iLevelPrev | iFlagsNext); } // Word List Descriptions static const char * const rgWordListDescriptions[] = { "Clarion Keywords", "Compiler Directives", "Built-in Procedures and Functions", "Runtime Expressions", "Structure and Data Types", "Attributes", "Standard Equates", "Reserved Words (Labels)", "Reserved Words (Procedure Labels)", 0, }; // Case Sensitive Clarion Language Lexer LexerModule lmClw(SCLEX_CLW, ColouriseClarionDocSensitive, "clarion", FoldClarionDoc, rgWordListDescriptions); // Case Insensitive Clarion Language Lexer LexerModule lmClwNoCase(SCLEX_CLWNOCASE, ColouriseClarionDocInsensitive, "clarionnocase", FoldClarionDoc, rgWordListDescriptions); scintilla/lexers/LexNsis.cxx0000644000175000017500000004463612557522743015144 0ustar neilneil// Scintilla source code edit control /** @file LexNsis.cxx ** Lexer for NSIS **/ // Copyright 2003 - 2005 by Angelo Mandato // Last Updated: 03/13/2005 // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif /* // located in SciLexer.h #define SCLEX_NSIS 43 #define SCE_NSIS_DEFAULT 0 #define SCE_NSIS_COMMENT 1 #define SCE_NSIS_STRINGDQ 2 #define SCE_NSIS_STRINGLQ 3 #define SCE_NSIS_STRINGRQ 4 #define SCE_NSIS_FUNCTION 5 #define SCE_NSIS_VARIABLE 6 #define SCE_NSIS_LABEL 7 #define SCE_NSIS_USERDEFINED 8 #define SCE_NSIS_SECTIONDEF 9 #define SCE_NSIS_SUBSECTIONDEF 10 #define SCE_NSIS_IFDEFINEDEF 11 #define SCE_NSIS_MACRODEF 12 #define SCE_NSIS_STRINGVAR 13 #define SCE_NSIS_NUMBER 14 // ADDED for Scintilla v1.63 #define SCE_NSIS_SECTIONGROUP 15 #define SCE_NSIS_PAGEEX 16 #define SCE_NSIS_FUNCTIONDEF 17 #define SCE_NSIS_COMMENTBOX 18 */ static bool isNsisNumber(char ch) { return (ch >= '0' && ch <= '9'); } static bool isNsisChar(char ch) { return (ch == '.' ) || (ch == '_' ) || isNsisNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool isNsisLetter(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); } static bool NsisNextLineHasElse(Sci_PositionU start, Sci_PositionU end, Accessor &styler) { Sci_Position nNextLine = -1; for( Sci_PositionU i = start; i < end; i++ ) { char cNext = styler.SafeGetCharAt( i ); if( cNext == '\n' ) { nNextLine = i+1; break; } } if( nNextLine == -1 ) // We never found the next line... return false; for( Sci_PositionU firstChar = nNextLine; firstChar < end; firstChar++ ) { char cNext = styler.SafeGetCharAt( firstChar ); if( cNext == ' ' ) continue; if( cNext == '\t' ) continue; if( cNext == '!' ) { if( styler.Match(firstChar, "!else") ) return true; } break; } return false; } static int NsisCmp( const char *s1, const char *s2, bool bIgnoreCase ) { if( bIgnoreCase ) return CompareCaseInsensitive( s1, s2); return strcmp( s1, s2 ); } static int calculateFoldNsis(Sci_PositionU start, Sci_PositionU end, int foldlevel, Accessor &styler, bool bElse, bool foldUtilityCmd ) { int style = styler.StyleAt(end); // If the word is too long, it is not what we are looking for if( end - start > 20 ) return foldlevel; if( foldUtilityCmd ) { // Check the style at this point, if it is not valid, then return zero if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF && style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_IFDEFINEDEF && style != SCE_NSIS_MACRODEF && style != SCE_NSIS_SECTIONGROUP && style != SCE_NSIS_PAGEEX ) return foldlevel; } else { if( style != SCE_NSIS_FUNCTIONDEF && style != SCE_NSIS_SECTIONDEF && style != SCE_NSIS_SUBSECTIONDEF && style != SCE_NSIS_SECTIONGROUP && style != SCE_NSIS_PAGEEX ) return foldlevel; } int newFoldlevel = foldlevel; bool bIgnoreCase = false; if( styler.GetPropertyInt("nsis.ignorecase") == 1 ) bIgnoreCase = true; char s[20]; // The key word we are looking for has atmost 13 characters s[0] = '\0'; for (Sci_PositionU i = 0; i < end - start + 1 && i < 19; i++) { s[i] = static_cast( styler[ start + i ] ); s[i + 1] = '\0'; } if( s[0] == '!' ) { if( NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 || NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!macro", bIgnoreCase ) == 0 ) newFoldlevel++; else if( NsisCmp(s, "!endif", bIgnoreCase) == 0 || NsisCmp(s, "!macroend", bIgnoreCase ) == 0 ) newFoldlevel--; else if( bElse && NsisCmp(s, "!else", bIgnoreCase) == 0 ) newFoldlevel++; } else { if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionGroup", bIgnoreCase ) == 0 || NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "SubSection", bIgnoreCase ) == 0 || NsisCmp(s, "PageEx", bIgnoreCase ) == 0 ) newFoldlevel++; else if( NsisCmp(s, "SectionGroupEnd", bIgnoreCase ) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase ) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase ) == 0 ) newFoldlevel--; } return newFoldlevel; } static int classifyWordNsis(Sci_PositionU start, Sci_PositionU end, WordList *keywordLists[], Accessor &styler ) { bool bIgnoreCase = false; if( styler.GetPropertyInt("nsis.ignorecase") == 1 ) bIgnoreCase = true; bool bUserVars = false; if( styler.GetPropertyInt("nsis.uservars") == 1 ) bUserVars = true; char s[100]; s[0] = '\0'; s[1] = '\0'; WordList &Functions = *keywordLists[0]; WordList &Variables = *keywordLists[1]; WordList &Lables = *keywordLists[2]; WordList &UserDefined = *keywordLists[3]; for (Sci_PositionU i = 0; i < end - start + 1 && i < 99; i++) { if( bIgnoreCase ) s[i] = static_cast( tolower(styler[ start + i ] ) ); else s[i] = static_cast( styler[ start + i ] ); s[i + 1] = '\0'; } // Check for special words... if( NsisCmp(s, "!macro", bIgnoreCase ) == 0 || NsisCmp(s, "!macroend", bIgnoreCase) == 0 ) // Covers !macro and !macroend return SCE_NSIS_MACRODEF; if( NsisCmp(s, "!ifdef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifndef", bIgnoreCase) == 0 || NsisCmp(s, "!endif", bIgnoreCase) == 0 ) // Covers !ifdef, !ifndef and !endif return SCE_NSIS_IFDEFINEDEF; if( NsisCmp(s, "!if", bIgnoreCase ) == 0 || NsisCmp(s, "!else", bIgnoreCase ) == 0 ) // Covers !if and else return SCE_NSIS_IFDEFINEDEF; if (NsisCmp(s, "!ifmacrodef", bIgnoreCase ) == 0 || NsisCmp(s, "!ifmacrondef", bIgnoreCase ) == 0 ) // Covers !ifmacrodef and !ifnmacrodef return SCE_NSIS_IFDEFINEDEF; if( NsisCmp(s, "SectionGroup", bIgnoreCase) == 0 || NsisCmp(s, "SectionGroupEnd", bIgnoreCase) == 0 ) // Covers SectionGroup and SectionGroupEnd return SCE_NSIS_SECTIONGROUP; if( NsisCmp(s, "Section", bIgnoreCase ) == 0 || NsisCmp(s, "SectionEnd", bIgnoreCase) == 0 ) // Covers Section and SectionEnd return SCE_NSIS_SECTIONDEF; if( NsisCmp(s, "SubSection", bIgnoreCase) == 0 || NsisCmp(s, "SubSectionEnd", bIgnoreCase) == 0 ) // Covers SubSection and SubSectionEnd return SCE_NSIS_SUBSECTIONDEF; if( NsisCmp(s, "PageEx", bIgnoreCase) == 0 || NsisCmp(s, "PageExEnd", bIgnoreCase) == 0 ) // Covers PageEx and PageExEnd return SCE_NSIS_PAGEEX; if( NsisCmp(s, "Function", bIgnoreCase) == 0 || NsisCmp(s, "FunctionEnd", bIgnoreCase) == 0 ) // Covers Function and FunctionEnd return SCE_NSIS_FUNCTIONDEF; if ( Functions.InList(s) ) return SCE_NSIS_FUNCTION; if ( Variables.InList(s) ) return SCE_NSIS_VARIABLE; if ( Lables.InList(s) ) return SCE_NSIS_LABEL; if( UserDefined.InList(s) ) return SCE_NSIS_USERDEFINED; if( strlen(s) > 3 ) { if( s[1] == '{' && s[strlen(s)-1] == '}' ) return SCE_NSIS_VARIABLE; } // See if the variable is a user defined variable if( s[0] == '$' && bUserVars ) { bool bHasSimpleNsisChars = true; for (Sci_PositionU j = 1; j < end - start + 1 && j < 99; j++) { if( !isNsisChar( s[j] ) ) { bHasSimpleNsisChars = false; break; } } if( bHasSimpleNsisChars ) return SCE_NSIS_VARIABLE; } // To check for numbers if( isNsisNumber( s[0] ) ) { bool bHasSimpleNsisNumber = true; for (Sci_PositionU j = 1; j < end - start + 1 && j < 99; j++) { if( !isNsisNumber( s[j] ) ) { bHasSimpleNsisNumber = false; break; } } if( bHasSimpleNsisNumber ) return SCE_NSIS_NUMBER; } return SCE_NSIS_DEFAULT; } static void ColouriseNsisDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_NSIS_DEFAULT; if( startPos > 0 ) state = styler.StyleAt(startPos-1); // Use the style from the previous line, usually default, but could be commentbox styler.StartAt( startPos ); styler.GetLine( startPos ); Sci_PositionU nLengthDoc = startPos + length; styler.StartSegment( startPos ); char cCurrChar; bool bVarInString = false; bool bClassicVarInString = false; Sci_PositionU i; for( i = startPos; i < nLengthDoc; i++ ) { cCurrChar = styler.SafeGetCharAt( i ); char cNextChar = styler.SafeGetCharAt(i+1); switch(state) { case SCE_NSIS_DEFAULT: if( cCurrChar == ';' || cCurrChar == '#' ) // we have a comment line { styler.ColourTo(i-1, state ); state = SCE_NSIS_COMMENT; break; } if( cCurrChar == '"' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGDQ; bVarInString = false; bClassicVarInString = false; break; } if( cCurrChar == '\'' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGRQ; bVarInString = false; bClassicVarInString = false; break; } if( cCurrChar == '`' ) { styler.ColourTo(i-1, state ); state = SCE_NSIS_STRINGLQ; bVarInString = false; bClassicVarInString = false; break; } // NSIS KeyWord,Function, Variable, UserDefined: if( cCurrChar == '$' || isNsisChar(cCurrChar) || cCurrChar == '!' ) { styler.ColourTo(i-1,state); state = SCE_NSIS_FUNCTION; // If it is a number, we must check and set style here first... if( isNsisNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) ) styler.ColourTo( i, SCE_NSIS_NUMBER); break; } if( cCurrChar == '/' && cNextChar == '*' ) { styler.ColourTo(i-1,state); state = SCE_NSIS_COMMENTBOX; break; } break; case SCE_NSIS_COMMENT: if( cNextChar == '\n' || cNextChar == '\r' ) { // Special case: if( cCurrChar == '\\' ) { styler.ColourTo(i-2,state); styler.ColourTo(i,SCE_NSIS_DEFAULT); } else { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } } break; case SCE_NSIS_STRINGDQ: case SCE_NSIS_STRINGLQ: case SCE_NSIS_STRINGRQ: if( styler.SafeGetCharAt(i-1) == '\\' && styler.SafeGetCharAt(i-2) == '$' ) break; // Ignore the next character, even if it is a quote of some sort if( cCurrChar == '"' && state == SCE_NSIS_STRINGDQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cCurrChar == '`' && state == SCE_NSIS_STRINGLQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cCurrChar == '\'' && state == SCE_NSIS_STRINGRQ ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; break; } if( cNextChar == '\r' || cNextChar == '\n' ) { Sci_Position nCurLine = styler.GetLine(i+1); Sci_Position nBack = i; // We need to check if the previous line has a \ in it... bool bNextLine = false; while( nBack > 0 ) { if( styler.GetLine(nBack) != nCurLine ) break; char cTemp = styler.SafeGetCharAt(nBack, 'a'); // Letter 'a' is safe here if( cTemp == '\\' ) { bNextLine = true; break; } if( cTemp != '\r' && cTemp != '\n' && cTemp != '\t' && cTemp != ' ' ) break; nBack--; } if( bNextLine ) { styler.ColourTo(i+1,state); } if( bNextLine == false ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } } break; case SCE_NSIS_FUNCTION: // NSIS KeyWord: if( cCurrChar == '$' ) state = SCE_NSIS_DEFAULT; else if( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) ) state = SCE_NSIS_DEFAULT; else if( (isNsisChar(cCurrChar) && !isNsisChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) { state = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler ); styler.ColourTo( i, state); state = SCE_NSIS_DEFAULT; } else if( !isNsisChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) { if( classifyWordNsis( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_NSIS_NUMBER ) styler.ColourTo( i-1, SCE_NSIS_NUMBER ); state = SCE_NSIS_DEFAULT; if( cCurrChar == '"' ) { state = SCE_NSIS_STRINGDQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '`' ) { state = SCE_NSIS_STRINGLQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '\'' ) { state = SCE_NSIS_STRINGRQ; bVarInString = false; bClassicVarInString = false; } else if( cCurrChar == '#' || cCurrChar == ';' ) { state = SCE_NSIS_COMMENT; } } break; case SCE_NSIS_COMMENTBOX: if( styler.SafeGetCharAt(i-1) == '*' && cCurrChar == '/' ) { styler.ColourTo(i,state); state = SCE_NSIS_DEFAULT; } break; } if( state == SCE_NSIS_COMMENT || state == SCE_NSIS_COMMENTBOX ) { styler.ColourTo(i,state); } else if( state == SCE_NSIS_STRINGDQ || state == SCE_NSIS_STRINGLQ || state == SCE_NSIS_STRINGRQ ) { bool bIngoreNextDollarSign = false; bool bUserVars = false; if( styler.GetPropertyInt("nsis.uservars") == 1 ) bUserVars = true; if( bVarInString && cCurrChar == '$' ) { bVarInString = false; bIngoreNextDollarSign = true; } else if( bVarInString && cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' || cNextChar == '"' || cNextChar == '`' || cNextChar == '\'' ) ) { styler.ColourTo( i+1, SCE_NSIS_STRINGVAR); bVarInString = false; bIngoreNextDollarSign = false; } // Covers "$INSTDIR and user vars like $MYVAR" else if( bVarInString && !isNsisChar(cNextChar) ) { int nWordState = classifyWordNsis( styler.GetStartSegment(), i, keywordLists, styler); if( nWordState == SCE_NSIS_VARIABLE ) styler.ColourTo( i, SCE_NSIS_STRINGVAR); else if( bUserVars ) styler.ColourTo( i, SCE_NSIS_STRINGVAR); bVarInString = false; } // Covers "${TEST}..." else if( bClassicVarInString && cNextChar == '}' ) { styler.ColourTo( i+1, SCE_NSIS_STRINGVAR); bClassicVarInString = false; } // Start of var in string if( !bIngoreNextDollarSign && cCurrChar == '$' && cNextChar == '{' ) { styler.ColourTo( i-1, state); bClassicVarInString = true; bVarInString = false; } else if( !bIngoreNextDollarSign && cCurrChar == '$' ) { styler.ColourTo( i-1, state); bVarInString = true; bClassicVarInString = false; } } } // Colourise remaining document styler.ColourTo(nLengthDoc-1,state); } static void FoldNsisDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { // No folding enabled, no reason to continue... if( styler.GetPropertyInt("fold") == 0 ) return; bool foldAtElse = styler.GetPropertyInt("fold.at.else", 0) == 1; bool foldUtilityCmd = styler.GetPropertyInt("nsis.foldutilcmd", 1) == 1; bool blockComment = false; Sci_Position lineCurrent = styler.GetLine(startPos); Sci_PositionU safeStartPos = styler.LineStart( lineCurrent ); bool bArg1 = true; Sci_Position nWordStart = -1; int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; int style = styler.StyleAt(safeStartPos); if( style == SCE_NSIS_COMMENTBOX ) { if( styler.SafeGetCharAt(safeStartPos) == '/' && styler.SafeGetCharAt(safeStartPos+1) == '*' ) levelNext++; blockComment = true; } for (Sci_PositionU i = safeStartPos; i < startPos + length; i++) { char chCurr = styler.SafeGetCharAt(i); style = styler.StyleAt(i); if( blockComment && style != SCE_NSIS_COMMENTBOX ) { levelNext--; blockComment = false; } else if( !blockComment && style == SCE_NSIS_COMMENTBOX ) { levelNext++; blockComment = true; } if( bArg1 && !blockComment) { if( nWordStart == -1 && (isNsisLetter(chCurr) || chCurr == '!') ) { nWordStart = i; } else if( isNsisLetter(chCurr) == false && nWordStart > -1 ) { int newLevel = calculateFoldNsis( nWordStart, i-1, levelNext, styler, foldAtElse, foldUtilityCmd ); if( newLevel == levelNext ) { if( foldAtElse && foldUtilityCmd ) { if( NsisNextLineHasElse(i, startPos + length, styler) ) levelNext--; } } else levelNext = newLevel; bArg1 = false; } } if( chCurr == '\n' ) { if( bArg1 && foldAtElse && foldUtilityCmd && !blockComment ) { if( NsisNextLineHasElse(i, startPos + length, styler) ) levelNext--; } // If we are on a new line... int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext ) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; levelCurrent = levelNext; bArg1 = true; // New line, lets look at first argument again nWordStart = -1; } } int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); } static const char * const nsisWordLists[] = { "Functions", "Variables", "Lables", "UserDefined", 0, }; LexerModule lmNsis(SCLEX_NSIS, ColouriseNsisDoc, "nsis", FoldNsisDoc, nsisWordLists); scintilla/lexers/LexPowerPro.cxx0000644000175000017500000004775712557522743016014 0ustar neilneil// Scintilla source code edit control // @file LexPowerPro.cxx // PowerPro utility, written by Bruce Switzer, is available from http://powerpro.webeddie.com // PowerPro lexer is written by Christopher Bean (cbean@cb-software.net) // // Lexer code heavily borrowed from: // LexAU3.cxx by Jos van der Zande // LexCPP.cxx by Neil Hodgson // LexVB.cxx by Neil Hodgson // // Changes: // 2008-10-25 - Initial release // 2008-10-26 - Changed how is hilighted in 'function ' so that // local isFunction = "" and local functions = "" don't get falsely highlighted // 2008-12-14 - Added bounds checking for szFirstWord and szDo // - Replaced SetOfCharacters with CharacterSet // - Made sure that CharacterSet::Contains is passed only positive values // - Made sure that the return value of Accessor::SafeGetCharAt is positive before // passing to functions that require positive values like isspacechar() // - Removed unused visibleChars processing from ColourisePowerProDoc() // - Fixed bug with folding logic where line continuations didn't end where // they were supposed to // - Moved all helper functions to the top of the file // 2010-06-03 - Added onlySpaces variable to allow the @function and ;comment styles to be indented // - Modified HasFunction function to be a bit more robust // - Renamed HasFunction function to IsFunction // - Cleanup // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsStreamCommentStyle(int style) { return style == SCE_POWERPRO_COMMENTBLOCK; } static inline bool IsLineEndChar(unsigned char ch) { return ch == 0x0a //LF || ch == 0x0c //FF || ch == 0x0d; //CR } static bool IsContinuationLine(Sci_PositionU szLine, Accessor &styler) { Sci_Position startPos = styler.LineStart(szLine); Sci_Position endPos = styler.LineStart(szLine + 1) - 2; while (startPos < endPos) { char stylech = styler.StyleAt(startPos); if (!(stylech == SCE_POWERPRO_COMMENTBLOCK)) { char ch = styler.SafeGetCharAt(endPos); char chPrev = styler.SafeGetCharAt(endPos - 1); char chPrevPrev = styler.SafeGetCharAt(endPos - 2); if (ch > 0 && chPrev > 0 && chPrevPrev > 0 && !isspacechar(ch) && !isspacechar(chPrev) && !isspacechar(chPrevPrev) ) return (chPrevPrev == ';' && chPrev == ';' && ch == '+'); } endPos--; // skip to next char } return false; } // Routine to find first none space on the current line and return its Style // needed for comment lines not starting on pos 1 static int GetStyleFirstWord(Sci_Position szLine, Accessor &styler) { Sci_Position startPos = styler.LineStart(szLine); Sci_Position endPos = styler.LineStart(szLine + 1) - 1; char ch = styler.SafeGetCharAt(startPos); while (ch > 0 && isspacechar(ch) && startPos < endPos) { startPos++; // skip to next char ch = styler.SafeGetCharAt(startPos); } return styler.StyleAt(startPos); } //returns true if there is a function to highlight //used to highlight in 'function ' //note: // sample line (without quotes): "\tfunction asdf() // currentPos will be the position of 'a' static bool IsFunction(Accessor &styler, Sci_PositionU currentPos) { const char function[10] = "function "; //10 includes \0 unsigned int numberOfCharacters = sizeof(function) - 1; Sci_PositionU position = currentPos - numberOfCharacters; //compare each character with the letters in the function array //return false if ALL don't match for (Sci_PositionU i = 0; i < numberOfCharacters; i++) { char c = styler.SafeGetCharAt(position++); if (c != function[i]) return false; } //make sure that there are only spaces (or tabs) between the beginning //of the line and the function declaration position = currentPos - numberOfCharacters - 1; //-1 to move to char before 'function' for (Sci_PositionU j = 0; j < 16; j++) { //check up to 16 preceeding characters char c = styler.SafeGetCharAt(position--, '\0'); //if can't read char, return NUL (past beginning of document) if (c <= 0) //reached beginning of document return true; if (c > 0 && IsLineEndChar(c)) return true; else if (c > 0 && !IsASpaceOrTab(c)) return false; } //fall-through return false; } static void ColourisePowerProDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler, bool caseSensitive) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; //define the character sets CharacterSet setWordStart(CharacterSet::setAlpha, "_@", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); StyleContext sc(startPos, length, initStyle, styler); char s_save[100]; //for last line highlighting //are there only spaces between the first letter of the line and the beginning of the line bool onlySpaces = true; for (; sc.More(); sc.Forward()) { // save the total current word for eof processing char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if ((sc.ch > 0) && setWord.Contains(sc.ch)) { strcpy(s_save,s); int tp = static_cast(strlen(s_save)); if (tp < 99) { s_save[tp] = static_cast(tolower(sc.ch)); s_save[tp+1] = '\0'; } } if (sc.atLineStart) { if (sc.state == SCE_POWERPRO_DOUBLEQUOTEDSTRING) { // Prevent SCE_POWERPRO_STRINGEOL from leaking back to previous line which // ends with a line continuation by locking in the state upto this position. sc.SetState(SCE_POWERPRO_DOUBLEQUOTEDSTRING); } } // Determine if the current state should terminate. switch (sc.state) { case SCE_POWERPRO_OPERATOR: sc.SetState(SCE_POWERPRO_DEFAULT); break; case SCE_POWERPRO_NUMBER: if (!IsADigit(sc.ch)) sc.SetState(SCE_POWERPRO_DEFAULT); break; case SCE_POWERPRO_IDENTIFIER: //if ((sc.ch > 0) && !setWord.Contains(sc.ch) || (sc.ch == '.')) { // use this line if don't want to match keywords with . in them. ie: win.debug will match both win and debug so win debug will also be colorized if ((sc.ch > 0) && !setWord.Contains(sc.ch)){ // || (sc.ch == '.')) { // use this line if you want to match keywords with a . ie: win.debug will only match win.debug neither win nor debug will be colorized separately char s[1000]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (keywords.InList(s)) { sc.ChangeState(SCE_POWERPRO_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_POWERPRO_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_POWERPRO_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_POWERPRO_WORD4); } sc.SetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_LINECONTINUE: if (sc.atLineStart) { sc.SetState(SCE_POWERPRO_DEFAULT); } else if (sc.Match('/', '*') || sc.Match('/', '/')) { sc.SetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_COMMENTBLOCK: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_COMMENTLINE: if (sc.atLineStart) { sc.SetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_DOUBLEQUOTEDSTRING: if (sc.atLineEnd) { sc.ChangeState(SCE_POWERPRO_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_SINGLEQUOTEDSTRING: if (sc.atLineEnd) { sc.ChangeState(SCE_POWERPRO_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_POWERPRO_DEFAULT); } break; case SCE_POWERPRO_VERBATIM: if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_POWERPRO_DEFAULT); } } break; case SCE_POWERPRO_ALTQUOTE: if (sc.ch == '#') { if (sc.chNext == '#') { sc.Forward(); } else { sc.ForwardSetState(SCE_POWERPRO_DEFAULT); } } break; case SCE_POWERPRO_FUNCTION: if (isspacechar(sc.ch) || sc.ch == '(') { sc.SetState(SCE_POWERPRO_DEFAULT); } break; } // Determine if a new state should be entered. if (sc.state == SCE_POWERPRO_DEFAULT) { if (sc.Match('?', '\"')) { sc.SetState(SCE_POWERPRO_VERBATIM); sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_POWERPRO_NUMBER); }else if (sc.Match('?','#')) { if (sc.ch == '?' && sc.chNext == '#') { sc.SetState(SCE_POWERPRO_ALTQUOTE); sc.Forward(); } } else if (IsFunction(styler, sc.currentPos)) { //highlight in 'function ' sc.SetState(SCE_POWERPRO_FUNCTION); } else if (onlySpaces && sc.ch == '@') { //alternate function definition [label] sc.SetState(SCE_POWERPRO_FUNCTION); } else if ((sc.ch > 0) && (setWordStart.Contains(sc.ch) || (sc.ch == '?'))) { sc.SetState(SCE_POWERPRO_IDENTIFIER); } else if (sc.Match(";;+")) { sc.SetState(SCE_POWERPRO_LINECONTINUE); } else if (sc.Match('/', '*')) { sc.SetState(SCE_POWERPRO_COMMENTBLOCK); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { sc.SetState(SCE_POWERPRO_COMMENTLINE); } else if (onlySpaces && sc.ch == ';') { //legacy comment that can only have blank space in front of it sc.SetState(SCE_POWERPRO_COMMENTLINE); } else if (sc.Match(";;")) { sc.SetState(SCE_POWERPRO_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_POWERPRO_DOUBLEQUOTEDSTRING); } else if (sc.ch == '\'') { sc.SetState(SCE_POWERPRO_SINGLEQUOTEDSTRING); } else if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_POWERPRO_OPERATOR); } } //maintain a record of whether or not all the preceding characters on //a line are space characters if (onlySpaces && !IsASpaceOrTab(sc.ch)) onlySpaces = false; //reset when starting a new line if (sc.atLineEnd) onlySpaces = true; } //************************************* // Colourize the last word correctly //************************************* if (sc.state == SCE_POWERPRO_IDENTIFIER) { if (keywords.InList(s_save)) { sc.ChangeState(SCE_POWERPRO_WORD); sc.SetState(SCE_POWERPRO_DEFAULT); } else if (keywords2.InList(s_save)) { sc.ChangeState(SCE_POWERPRO_WORD2); sc.SetState(SCE_POWERPRO_DEFAULT); } else if (keywords3.InList(s_save)) { sc.ChangeState(SCE_POWERPRO_WORD3); sc.SetState(SCE_POWERPRO_DEFAULT); } else if (keywords4.InList(s_save)) { sc.ChangeState(SCE_POWERPRO_WORD4); sc.SetState(SCE_POWERPRO_DEFAULT); } else { sc.SetState(SCE_POWERPRO_DEFAULT); } } sc.Complete(); } static void FoldPowerProDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { //define the character sets CharacterSet setWordStart(CharacterSet::setAlpha, "_@", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); //used to tell if we're recursively folding the whole document, or just a small piece (ie: if statement or 1 function) bool isFoldingAll = true; Sci_Position endPos = startPos + length; Sci_Position lastLine = styler.GetLine(styler.Length()); //used to help fold the last line correctly // get settings from the config files for folding comments and preprocessor lines bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldInComment = styler.GetPropertyInt("fold.comment") == 2; bool foldCompact = true; // Backtrack to previous line in case need to fix its fold status Sci_Position lineCurrent = styler.GetLine(startPos); if (startPos > 0) { isFoldingAll = false; if (lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } } // vars for style of previous/current/next lines int style = GetStyleFirstWord(lineCurrent,styler); int stylePrev = 0; // find the first previous line without continuation character at the end while ((lineCurrent > 0 && IsContinuationLine(lineCurrent, styler)) || (lineCurrent > 1 && IsContinuationLine(lineCurrent - 1, styler))) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } if (lineCurrent > 0) { stylePrev = GetStyleFirstWord(lineCurrent-1,styler); } // vars for getting first word to check for keywords bool isFirstWordStarted = false; bool isFirstWordEnded = false; const unsigned int FIRST_WORD_MAX_LEN = 10; char szFirstWord[FIRST_WORD_MAX_LEN] = ""; unsigned int firstWordLen = 0; char szDo[3]=""; int szDolen = 0; bool isDoLastWord = false; // var for indentlevel int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelNext = levelCurrent; int visibleChars = 0; int functionCount = 0; char chNext = styler.SafeGetCharAt(startPos); char chPrev = '\0'; char chPrevPrev = '\0'; char chPrevPrevPrev = '\0'; for (Sci_Position i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch > 0) && setWord.Contains(ch)) visibleChars++; // get the syle for the current character neede to check in comment int stylech = styler.StyleAt(i); // start the capture of the first word if (!isFirstWordStarted && (ch > 0)) { if (setWord.Contains(ch) || setWordStart.Contains(ch) || ch == ';' || ch == '/') { isFirstWordStarted = true; if (firstWordLen < FIRST_WORD_MAX_LEN - 1) { szFirstWord[firstWordLen++] = static_cast(tolower(ch)); szFirstWord[firstWordLen] = '\0'; } } } // continue capture of the first word on the line else if (isFirstWordStarted && !isFirstWordEnded && (ch > 0)) { if (!setWord.Contains(ch)) { isFirstWordEnded = true; } else if (firstWordLen < (FIRST_WORD_MAX_LEN - 1)) { szFirstWord[firstWordLen++] = static_cast(tolower(ch)); szFirstWord[firstWordLen] = '\0'; } } if (stylech != SCE_POWERPRO_COMMENTLINE) { //reset isDoLastWord if we find a character(ignoring spaces) after 'do' if (isDoLastWord && (ch > 0) && setWord.Contains(ch)) isDoLastWord = false; // --find out if the word "do" is the last on a "if" line-- // collect each letter and put it into a buffer 2 chars long // if we end up with "do" in the buffer when we reach the end of // the line, "do" was the last word on the line if ((ch > 0) && isFirstWordEnded && strcmp(szFirstWord, "if") == 0) { if (szDolen == 2) { szDo[0] = szDo[1]; szDo[1] = static_cast(tolower(ch)); szDo[2] = '\0'; if (strcmp(szDo, "do") == 0) isDoLastWord = true; } else if (szDolen < 2) { szDo[szDolen++] = static_cast(tolower(ch)); szDo[szDolen] = '\0'; } } } // End of Line found so process the information if ((ch == '\r' && chNext != '\n') // \r\n || ch == '\n' // \n || i == endPos) { // end of selection // ************************** // Folding logic for Keywords // ************************** // if a keyword is found on the current line and the line doesn't end with ;;+ (continuation) // and we are not inside a commentblock. if (firstWordLen > 0 && chPrev != '+' && chPrevPrev != ';' && chPrevPrevPrev !=';' && (!IsStreamCommentStyle(style) || foldInComment) ) { // only fold "if" last keyword is "then" (else its a one line if) if (strcmp(szFirstWord, "if") == 0 && isDoLastWord) levelNext++; // create new fold for these words if (strcmp(szFirstWord, "for") == 0) levelNext++; //handle folding for functions/labels //Note: Functions and labels don't have an explicit end like [end function] // 1. functions/labels end at the start of another function // 2. functions/labels end at the end of the file if ((strcmp(szFirstWord, "function") == 0) || (firstWordLen > 0 && szFirstWord[0] == '@')) { if (isFoldingAll) { //if we're folding the whole document (recursivly by lua script) if (functionCount > 0) { levelCurrent--; } else { levelNext++; } functionCount++; } else { //if just folding a small piece (by clicking on the minus sign next to the word) levelCurrent--; } } // end the fold for these words before the current line if (strcmp(szFirstWord, "endif") == 0 || strcmp(szFirstWord, "endfor") == 0) { levelNext--; levelCurrent--; } // end the fold for these words before the current line and Start new fold if (strcmp(szFirstWord, "else") == 0 || strcmp(szFirstWord, "elseif") == 0 ) levelCurrent--; } // Preprocessor and Comment folding int styleNext = GetStyleFirstWord(lineCurrent + 1,styler); // ********************************* // Folding logic for Comment blocks // ********************************* if (foldComment && IsStreamCommentStyle(style)) { // Start of a comment block if (stylePrev != style && IsStreamCommentStyle(styleNext) && styleNext == style) { levelNext++; } // fold till the last line for normal comment lines else if (IsStreamCommentStyle(stylePrev) && styleNext != SCE_POWERPRO_COMMENTLINE && stylePrev == SCE_POWERPRO_COMMENTLINE && style == SCE_POWERPRO_COMMENTLINE) { levelNext--; } // fold till the one but last line for Blockcomment lines else if (IsStreamCommentStyle(stylePrev) && styleNext != SCE_POWERPRO_COMMENTBLOCK && style == SCE_POWERPRO_COMMENTBLOCK) { levelNext--; levelCurrent--; } } int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); // reset values for the next line lineCurrent++; stylePrev = style; style = styleNext; levelCurrent = levelNext; visibleChars = 0; // if the last characters are ;;+ then don't reset since the line continues on the next line. if (chPrev != '+' && chPrevPrev != ';' && chPrevPrevPrev != ';') { firstWordLen = 0; szDolen = 0; isFirstWordStarted = false; isFirstWordEnded = false; isDoLastWord = false; //blank out first word for (unsigned int i = 0; i < FIRST_WORD_MAX_LEN; i++) szFirstWord[i] = '\0'; } } // save the last processed characters if ((ch > 0) && !isspacechar(ch)) { chPrevPrevPrev = chPrevPrev; chPrevPrev = chPrev; chPrev = ch; } } //close folds on the last line - without this a 'phantom' //fold can appear when an open fold is on the last line //this can occur because functions and labels don't have an explicit end if (lineCurrent >= lastLine) { int lev = 0; lev |= SC_FOLDLEVELWHITEFLAG; styler.SetLevel(lineCurrent, lev); } } static const char * const powerProWordLists[] = { "Keyword list 1", "Keyword list 2", "Keyword list 3", "Keyword list 4", 0, }; static void ColourisePowerProDocWrapper(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { ColourisePowerProDoc(startPos, length, initStyle, keywordlists, styler, false); } LexerModule lmPowerPro(SCLEX_POWERPRO, ColourisePowerProDocWrapper, "powerpro", FoldPowerProDoc, powerProWordLists); scintilla/lexers/LexCPP.cxx0000644000175000017500000015000712557522743014640 0ustar neilneil// Scintilla source code edit control /** @file LexCPP.cxx ** Lexer for C++, C, Java, and JavaScript. ** Further folding features and configuration properties added by "Udo Lechner" **/ // Copyright 1998-2005 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #include "SparseState.h" #include "SubStyles.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif namespace { // Use an unnamed namespace to protect the functions and classes from name conflicts bool IsSpaceEquiv(int state) { return (state <= SCE_C_COMMENTDOC) || // including SCE_C_DEFAULT, SCE_C_COMMENT, SCE_C_COMMENTLINE (state == SCE_C_COMMENTLINEDOC) || (state == SCE_C_COMMENTDOCKEYWORD) || (state == SCE_C_COMMENTDOCKEYWORDERROR); } // Preconditions: sc.currentPos points to a character after '+' or '-'. // The test for pos reaching 0 should be redundant, // and is in only for safety measures. // Limitation: this code will give the incorrect answer for code like // a = b+++/ptn/... // Putting a space between the '++' post-inc operator and the '+' binary op // fixes this, and is highly recommended for readability anyway. bool FollowsPostfixOperator(StyleContext &sc, LexAccessor &styler) { Sci_Position pos = (Sci_Position) sc.currentPos; while (--pos > 0) { char ch = styler[pos]; if (ch == '+' || ch == '-') { return styler[pos - 1] == ch; } } return false; } bool followsReturnKeyword(StyleContext &sc, LexAccessor &styler) { // Don't look at styles, so no need to flush. Sci_Position pos = (Sci_Position) sc.currentPos; Sci_Position currentLine = styler.GetLine(pos); Sci_Position lineStartPos = styler.LineStart(currentLine); while (--pos > lineStartPos) { char ch = styler.SafeGetCharAt(pos); if (ch != ' ' && ch != '\t') { break; } } const char *retBack = "nruter"; const char *s = retBack; while (*s && pos >= lineStartPos && styler.SafeGetCharAt(pos) == *s) { s++; pos--; } return !*s; } bool IsSpaceOrTab(int ch) { return ch == ' ' || ch == '\t'; } bool OnlySpaceOrTab(const std::string &s) { for (std::string::const_iterator it = s.begin(); it != s.end(); ++it) { if (!IsSpaceOrTab(*it)) return false; } return true; } std::vector StringSplit(const std::string &text, int separator) { std::vector vs(text.empty() ? 0 : 1); for (std::string::const_iterator it = text.begin(); it != text.end(); ++it) { if (*it == separator) { vs.push_back(std::string()); } else { vs.back() += *it; } } return vs; } struct BracketPair { std::vector::iterator itBracket; std::vector::iterator itEndBracket; }; BracketPair FindBracketPair(std::vector &tokens) { BracketPair bp; std::vector::iterator itTok = std::find(tokens.begin(), tokens.end(), "("); bp.itBracket = tokens.end(); bp.itEndBracket = tokens.end(); if (itTok != tokens.end()) { bp.itBracket = itTok; size_t nest = 0; while (itTok != tokens.end()) { if (*itTok == "(") { nest++; } else if (*itTok == ")") { nest--; if (nest == 0) { bp.itEndBracket = itTok; return bp; } } ++itTok; } } bp.itBracket = tokens.end(); return bp; } void highlightTaskMarker(StyleContext &sc, LexAccessor &styler, int activity, WordList &markerList, bool caseSensitive){ if ((isoperator(sc.chPrev) || IsASpace(sc.chPrev)) && markerList.Length()) { const int lengthMarker = 50; char marker[lengthMarker+1]; Sci_Position currPos = (Sci_Position) sc.currentPos; int i = 0; while (i < lengthMarker) { char ch = styler.SafeGetCharAt(currPos + i); if (IsASpace(ch) || isoperator(ch)) { break; } if (caseSensitive) marker[i] = ch; else marker[i] = static_cast(tolower(ch)); i++; } marker[i] = '\0'; if (markerList.InList(marker)) { sc.SetState(SCE_C_TASKMARKER|activity); } } } struct EscapeSequence { int digitsLeft; CharacterSet setHexDigits; CharacterSet setOctDigits; CharacterSet setNoneNumeric; CharacterSet *escapeSetValid; EscapeSequence() { digitsLeft = 0; escapeSetValid = 0; setHexDigits = CharacterSet(CharacterSet::setDigits, "ABCDEFabcdef"); setOctDigits = CharacterSet(CharacterSet::setNone, "01234567"); } void resetEscapeState(int nextChar) { digitsLeft = 0; escapeSetValid = &setNoneNumeric; if (nextChar == 'U') { digitsLeft = 9; escapeSetValid = &setHexDigits; } else if (nextChar == 'u') { digitsLeft = 5; escapeSetValid = &setHexDigits; } else if (nextChar == 'x') { digitsLeft = 5; escapeSetValid = &setHexDigits; } else if (setOctDigits.Contains(nextChar)) { digitsLeft = 3; escapeSetValid = &setOctDigits; } } bool atEscapeEnd(int currChar) const { return (digitsLeft <= 0) || !escapeSetValid->Contains(currChar); } }; std::string GetRestOfLine(LexAccessor &styler, Sci_Position start, bool allowSpace) { std::string restOfLine; Sci_Position i =0; char ch = styler.SafeGetCharAt(start, '\n'); Sci_Position endLine = styler.LineEnd(styler.GetLine(start)); while (((start+i) < endLine) && (ch != '\r')) { char chNext = styler.SafeGetCharAt(start + i + 1, '\n'); if (ch == '/' && (chNext == '/' || chNext == '*')) break; if (allowSpace || (ch != ' ')) restOfLine += ch; i++; ch = chNext; } return restOfLine; } bool IsStreamCommentStyle(int style) { return style == SCE_C_COMMENT || style == SCE_C_COMMENTDOC || style == SCE_C_COMMENTDOCKEYWORD || style == SCE_C_COMMENTDOCKEYWORDERROR; } struct PPDefinition { Sci_Position line; std::string key; std::string value; bool isUndef; std::string arguments; PPDefinition(Sci_Position line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, std::string arguments_="") : line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) { } }; class LinePPState { int state; int ifTaken; int level; bool ValidLevel() const { return level >= 0 && level < 32; } int maskLevel() const { return 1 << level; } public: LinePPState() : state(0), ifTaken(0), level(-1) { } bool IsInactive() const { return state != 0; } bool CurrentIfTaken() const { return (ifTaken & maskLevel()) != 0; } void StartSection(bool on) { level++; if (ValidLevel()) { if (on) { state &= ~maskLevel(); ifTaken |= maskLevel(); } else { state |= maskLevel(); ifTaken &= ~maskLevel(); } } } void EndSection() { if (ValidLevel()) { state &= ~maskLevel(); ifTaken &= ~maskLevel(); } level--; } void InvertCurrentLevel() { if (ValidLevel()) { state ^= maskLevel(); ifTaken |= maskLevel(); } } }; // Hold the preprocessor state for each line seen. // Currently one entry per line but could become sparse with just one entry per preprocessor line. class PPStates { std::vector vlls; public: LinePPState ForLine(Sci_Position line) const { if ((line > 0) && (vlls.size() > static_cast(line))) { return vlls[line]; } else { return LinePPState(); } } void Add(Sci_Position line, LinePPState lls) { vlls.resize(line+1); vlls[line] = lls; } }; // An individual named option for use in an OptionSet // Options used for LexerCPP struct OptionsCPP { bool stylingWithinPreprocessor; bool identifiersAllowDollars; bool trackPreprocessor; bool updatePreprocessor; bool verbatimStringsAllowEscapes; bool triplequotedStrings; bool hashquotedStrings; bool backQuotedStrings; bool escapeSequence; bool fold; bool foldSyntaxBased; bool foldComment; bool foldCommentMultiline; bool foldCommentExplicit; std::string foldExplicitStart; std::string foldExplicitEnd; bool foldExplicitAnywhere; bool foldPreprocessor; bool foldCompact; bool foldAtElse; OptionsCPP() { stylingWithinPreprocessor = false; identifiersAllowDollars = true; trackPreprocessor = true; updatePreprocessor = true; verbatimStringsAllowEscapes = false; triplequotedStrings = false; hashquotedStrings = false; backQuotedStrings = false; escapeSequence = false; fold = false; foldSyntaxBased = true; foldComment = false; foldCommentMultiline = true; foldCommentExplicit = true; foldExplicitStart = ""; foldExplicitEnd = ""; foldExplicitAnywhere = false; foldPreprocessor = false; foldCompact = false; foldAtElse = false; } }; const char *const cppWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "Documentation comment keywords", "Global classes and typedefs", "Preprocessor definitions", "Task marker and error marker keywords", 0, }; struct OptionSetCPP : public OptionSet { OptionSetCPP() { DefineProperty("styling.within.preprocessor", &OptionsCPP::stylingWithinPreprocessor, "For C++ code, determines whether all preprocessor code is styled in the " "preprocessor style (0, the default) or only from the initial # to the end " "of the command word(1)."); DefineProperty("lexer.cpp.allow.dollars", &OptionsCPP::identifiersAllowDollars, "Set to 0 to disallow the '$' character in identifiers with the cpp lexer."); DefineProperty("lexer.cpp.track.preprocessor", &OptionsCPP::trackPreprocessor, "Set to 1 to interpret #if/#else/#endif to grey out code that is not active."); DefineProperty("lexer.cpp.update.preprocessor", &OptionsCPP::updatePreprocessor, "Set to 1 to update preprocessor definitions when #define found."); DefineProperty("lexer.cpp.verbatim.strings.allow.escapes", &OptionsCPP::verbatimStringsAllowEscapes, "Set to 1 to allow verbatim strings to contain escape sequences."); DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings, "Set to 1 to enable highlighting of triple-quoted strings."); DefineProperty("lexer.cpp.hashquoted.strings", &OptionsCPP::hashquotedStrings, "Set to 1 to enable highlighting of hash-quoted strings."); DefineProperty("lexer.cpp.backquoted.strings", &OptionsCPP::backQuotedStrings, "Set to 1 to enable highlighting of back-quoted raw strings ."); DefineProperty("lexer.cpp.escape.sequence", &OptionsCPP::escapeSequence, "Set to 1 to enable highlighting of escape sequences in strings"); DefineProperty("fold", &OptionsCPP::fold); DefineProperty("fold.cpp.syntax.based", &OptionsCPP::foldSyntaxBased, "Set this property to 0 to disable syntax based folding."); DefineProperty("fold.comment", &OptionsCPP::foldComment, "This option enables folding multi-line comments and explicit fold points when using the C++ lexer. " "Explicit fold points allows adding extra folding by placing a //{ comment at the start and a //} " "at the end of a section that should fold."); DefineProperty("fold.cpp.comment.multiline", &OptionsCPP::foldCommentMultiline, "Set this property to 0 to disable folding multi-line comments when fold.comment=1."); DefineProperty("fold.cpp.comment.explicit", &OptionsCPP::foldCommentExplicit, "Set this property to 0 to disable folding explicit fold points when fold.comment=1."); DefineProperty("fold.cpp.explicit.start", &OptionsCPP::foldExplicitStart, "The string to use for explicit fold start points, replacing the standard //{."); DefineProperty("fold.cpp.explicit.end", &OptionsCPP::foldExplicitEnd, "The string to use for explicit fold end points, replacing the standard //}."); DefineProperty("fold.cpp.explicit.anywhere", &OptionsCPP::foldExplicitAnywhere, "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); DefineProperty("fold.preprocessor", &OptionsCPP::foldPreprocessor, "This option enables folding preprocessor directives when using the C++ lexer. " "Includes C#'s explicit #region and #endregion folding directives."); DefineProperty("fold.compact", &OptionsCPP::foldCompact); DefineProperty("fold.at.else", &OptionsCPP::foldAtElse, "This option enables C++ folding on a \"} else {\" line of an if statement."); DefineWordListSets(cppWordLists); } }; const char styleSubable[] = {SCE_C_IDENTIFIER, SCE_C_COMMENTDOCKEYWORD, 0}; } class LexerCPP : public ILexerWithSubStyles { bool caseSensitive; CharacterSet setWord; CharacterSet setNegationOp; CharacterSet setArithmethicOp; CharacterSet setRelOp; CharacterSet setLogicalOp; CharacterSet setWordStart; PPStates vlls; std::vector ppDefineHistory; WordList keywords; WordList keywords2; WordList keywords3; WordList keywords4; WordList ppDefinitions; WordList markerList; struct SymbolValue { std::string value; std::string arguments; SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) { } SymbolValue &operator = (const std::string &value_) { value = value_; arguments.clear(); return *this; } bool IsMacro() const { return !arguments.empty(); } }; typedef std::map SymbolTable; SymbolTable preprocessorDefinitionsStart; OptionsCPP options; OptionSetCPP osCPP; EscapeSequence escapeSeq; SparseState rawStringTerminators; enum { activeFlag = 0x40 }; enum { ssIdentifier, ssDocKeyword }; SubStyles subStyles; public: explicit LexerCPP(bool caseSensitive_) : caseSensitive(caseSensitive_), setWord(CharacterSet::setAlphaNum, "._", 0x80, true), setNegationOp(CharacterSet::setNone, "!"), setArithmethicOp(CharacterSet::setNone, "+-/*%"), setRelOp(CharacterSet::setNone, "=!<>"), setLogicalOp(CharacterSet::setNone, "|&"), subStyles(styleSubable, 0x80, 0x40, activeFlag) { } virtual ~LexerCPP() { } void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvSubStyles; } const char * SCI_METHOD PropertyNames() { return osCPP.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osCPP.PropertyType(name); } const char * SCI_METHOD DescribeProperty(const char *name) { return osCPP.DescribeProperty(name); } Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets() { return osCPP.DescribeWordListSets(); } Sci_Position SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void * SCI_METHOD PrivateCall(int, void *) { return 0; } int SCI_METHOD LineEndTypesSupported() { return SC_LINE_END_TYPE_UNICODE; } int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) { return subStyles.Allocate(styleBase, numberStyles); } int SCI_METHOD SubStylesStart(int styleBase) { return subStyles.Start(styleBase); } int SCI_METHOD SubStylesLength(int styleBase) { return subStyles.Length(styleBase); } int SCI_METHOD StyleFromSubStyle(int subStyle) { int styleBase = subStyles.BaseStyle(MaskActive(subStyle)); int active = subStyle & activeFlag; return styleBase | active; } int SCI_METHOD PrimaryStyleFromStyle(int style) { return MaskActive(style); } void SCI_METHOD FreeSubStyles() { subStyles.Free(); } void SCI_METHOD SetIdentifiers(int style, const char *identifiers) { subStyles.SetIdentifiers(style, identifiers); } int SCI_METHOD DistanceToSecondaryStyles() { return activeFlag; } const char * SCI_METHOD GetSubStyleBases() { return styleSubable; } static ILexer *LexerFactoryCPP() { return new LexerCPP(true); } static ILexer *LexerFactoryCPPInsensitive() { return new LexerCPP(false); } static int MaskActive(int style) { return style & ~activeFlag; } void EvaluateTokens(std::vector &tokens, const SymbolTable &preprocessorDefinitions); std::vector Tokenize(const std::string &expr) const; bool EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions); }; Sci_Position SCI_METHOD LexerCPP::PropertySet(const char *key, const char *val) { if (osCPP.PropertySet(&options, key, val)) { if (strcmp(key, "lexer.cpp.allow.dollars") == 0) { setWord = CharacterSet(CharacterSet::setAlphaNum, "._", 0x80, true); if (options.identifiersAllowDollars) { setWord.Add('$'); } } return 0; } return -1; } Sci_Position SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; case 1: wordListN = &keywords2; break; case 2: wordListN = &keywords3; break; case 3: wordListN = &keywords4; break; case 4: wordListN = &ppDefinitions; break; case 5: wordListN = &markerList; break; } Sci_Position firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; if (n == 4) { // Rebuild preprocessorDefinitions preprocessorDefinitionsStart.clear(); for (int nDefinition = 0; nDefinition < ppDefinitions.Length(); nDefinition++) { const char *cpDefinition = ppDefinitions.WordAt(nDefinition); const char *cpEquals = strchr(cpDefinition, '='); if (cpEquals) { std::string name(cpDefinition, cpEquals - cpDefinition); std::string val(cpEquals+1); size_t bracket = name.find('('); size_t bracketEnd = name.find(')'); if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) { // Macro std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1); name = name.substr(0, bracket); preprocessorDefinitionsStart[name] = SymbolValue(val, args); } else { preprocessorDefinitionsStart[name] = val; } } else { std::string name(cpDefinition); std::string val("1"); preprocessorDefinitionsStart[name] = val; } } } } } return firstModification; } // Functor used to truncate history struct After { Sci_Position line; explicit After(Sci_Position line_) : line(line_) {} bool operator()(PPDefinition &p) const { return p.line > line; } }; void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-"); CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-"); CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]"); setWordStart = CharacterSet(CharacterSet::setAlpha, "_", 0x80, true); CharacterSet setInvalidRawFirst(CharacterSet::setNone, " )\\\t\v\f\n"); if (options.identifiersAllowDollars) { setWordStart.Add('$'); } int chPrevNonWhite = ' '; int visibleChars = 0; bool lastWordWasUUID = false; int styleBeforeDCKeyword = SCE_C_DEFAULT; int styleBeforeTaskMarker = SCE_C_DEFAULT; bool continuationLine = false; bool isIncludePreprocessor = false; bool isStringInPreprocessor = false; bool inRERange = false; bool seenDocKeyBrace = false; Sci_Position lineCurrent = styler.GetLine(startPos); if ((MaskActive(initStyle) == SCE_C_PREPROCESSOR) || (MaskActive(initStyle) == SCE_C_COMMENTLINE) || (MaskActive(initStyle) == SCE_C_COMMENTLINEDOC)) { // Set continuationLine if last character of previous line is '\' if (lineCurrent > 0) { Sci_Position endLinePrevious = styler.LineEnd(lineCurrent - 1); if (endLinePrevious > 0) { continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\'; } } } // look back to set chPrevNonWhite properly for better regex colouring if (startPos > 0) { Sci_Position back = startPos; while (--back && IsSpaceEquiv(MaskActive(styler.StyleAt(back)))) ; if (MaskActive(styler.StyleAt(back)) == SCE_C_OPERATOR) { chPrevNonWhite = styler.SafeGetCharAt(back); } } StyleContext sc(startPos, length, initStyle, styler, static_cast(0xff)); LinePPState preproc = vlls.ForLine(lineCurrent); bool definitionsChanged = false; // Truncate ppDefineHistory before current line if (!options.updatePreprocessor) ppDefineHistory.clear(); std::vector::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(lineCurrent-1)); if (itInvalid != ppDefineHistory.end()) { ppDefineHistory.erase(itInvalid, ppDefineHistory.end()); definitionsChanged = true; } SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart; for (std::vector::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) { if (itDef->isUndef) preprocessorDefinitions.erase(itDef->key); else preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments); } std::string rawStringTerminator = rawStringTerminators.ValueAt(lineCurrent-1); SparseState rawSTNew(lineCurrent); int activitySet = preproc.IsInactive() ? activeFlag : 0; const WordClassifier &classifierIdentifiers = subStyles.Classifier(SCE_C_IDENTIFIER); const WordClassifier &classifierDocKeyWords = subStyles.Classifier(SCE_C_COMMENTDOCKEYWORD); Sci_Position lineEndNext = styler.LineEnd(lineCurrent); for (; sc.More();) { if (sc.atLineStart) { // Using MaskActive() is not needed in the following statement. // Inside inactive preprocessor declaration, state will be reset anyway at the end of this block. if ((sc.state == SCE_C_STRING) || (sc.state == SCE_C_CHARACTER)) { // Prevent SCE_C_STRINGEOL from leaking back to previous line which // ends with a line continuation by locking in the state up to this position. sc.SetState(sc.state); } if ((MaskActive(sc.state) == SCE_C_PREPROCESSOR) && (!continuationLine)) { sc.SetState(SCE_C_DEFAULT|activitySet); } // Reset states to beginning of colourise so no surprises // if different sets of lines lexed. visibleChars = 0; lastWordWasUUID = false; isIncludePreprocessor = false; inRERange = false; if (preproc.IsInactive()) { activitySet = activeFlag; sc.SetState(sc.state | activitySet); } } if (sc.atLineEnd) { lineCurrent++; lineEndNext = styler.LineEnd(lineCurrent); vlls.Add(lineCurrent, preproc); if (rawStringTerminator != "") { rawSTNew.Set(lineCurrent-1, rawStringTerminator); } } // Handle line continuation generically. if (sc.ch == '\\') { if (static_cast((sc.currentPos+1)) >= lineEndNext) { lineCurrent++; lineEndNext = styler.LineEnd(lineCurrent); vlls.Add(lineCurrent, preproc); sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { // Even in UTF-8, \r and \n are separate sc.Forward(); } continuationLine = true; sc.Forward(); continue; } } const bool atLineEndBeforeSwitch = sc.atLineEnd; // Determine if the current state should terminate. switch (MaskActive(sc.state)) { case SCE_C_OPERATOR: sc.SetState(SCE_C_DEFAULT|activitySet); break; case SCE_C_NUMBER: // We accept almost anything because of hex. and number suffixes if (sc.ch == '_') { sc.ChangeState(SCE_C_USERLITERAL|activitySet); } else if (!(setWord.Contains(sc.ch) || (sc.ch == '\'') || ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E' || sc.chPrev == 'p' || sc.chPrev == 'P')))) { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_USERLITERAL: if (!(setWord.Contains(sc.ch))) sc.SetState(SCE_C_DEFAULT|activitySet); break; case SCE_C_IDENTIFIER: if (sc.atLineStart || sc.atLineEnd || !setWord.Contains(sc.ch) || (sc.ch == '.')) { char s[1000]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (keywords.InList(s)) { lastWordWasUUID = strcmp(s, "uuid") == 0; sc.ChangeState(SCE_C_WORD|activitySet); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_C_WORD2|activitySet); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_C_GLOBALCLASS|activitySet); } else { int subStyle = classifierIdentifiers.ValueFor(s); if (subStyle >= 0) { sc.ChangeState(subStyle|activitySet); } } const bool literalString = sc.ch == '\"'; if (literalString || sc.ch == '\'') { size_t lenS = strlen(s); const bool raw = literalString && sc.chPrev == 'R' && !setInvalidRawFirst.Contains(sc.chNext); if (raw) s[lenS--] = '\0'; bool valid = (lenS == 0) || ((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) || ((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8')); if (valid) { if (literalString) { if (raw) { // Set the style of the string prefix to SCE_C_STRINGRAW but then change to // SCE_C_DEFAULT as that allows the raw string start code to run. sc.ChangeState(SCE_C_STRINGRAW|activitySet); sc.SetState(SCE_C_DEFAULT|activitySet); } else { sc.ChangeState(SCE_C_STRING|activitySet); } } else { sc.ChangeState(SCE_C_CHARACTER|activitySet); } } else { sc.SetState(SCE_C_DEFAULT | activitySet); } } else { sc.SetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_PREPROCESSOR: if (options.stylingWithinPreprocessor) { if (IsASpace(sc.ch)) { sc.SetState(SCE_C_DEFAULT|activitySet); } } else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) { isStringInPreprocessor = false; } else if (!isStringInPreprocessor) { if ((isIncludePreprocessor && sc.Match('<')) || sc.Match('\"')) { isStringInPreprocessor = true; } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { sc.SetState(SCE_C_PREPROCESSORCOMMENTDOC|activitySet); } else { sc.SetState(SCE_C_PREPROCESSORCOMMENT|activitySet); } sc.Forward(); // Eat the * } else if (sc.Match('/', '/')) { sc.SetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_PREPROCESSORCOMMENT: case SCE_C_PREPROCESSORCOMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_PREPROCESSOR|activitySet); continue; // Without advancing in case of '\'. } break; case SCE_C_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } else { styleBeforeTaskMarker = SCE_C_COMMENT; highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive); } break; case SCE_C_COMMENTDOC: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '*') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet); } } break; case SCE_C_COMMENTLINE: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT|activitySet); } else { styleBeforeTaskMarker = SCE_C_COMMENTLINE; highlightTaskMarker(sc, styler, activitySet, markerList, caseSensitive); } break; case SCE_C_COMMENTLINEDOC: if (sc.atLineStart && !continuationLine) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '@' || sc.ch == '\\') { // JavaDoc and Doxygen support // Verify that we have the conditions to mark a comment-doc-keyword if ((IsASpace(sc.chPrev) || sc.chPrev == '/' || sc.chPrev == '!') && (!IsASpace(sc.chNext))) { styleBeforeDCKeyword = SCE_C_COMMENTLINEDOC; sc.SetState(SCE_C_COMMENTDOCKEYWORD|activitySet); } } break; case SCE_C_COMMENTDOCKEYWORD: if ((styleBeforeDCKeyword == SCE_C_COMMENTDOC) && sc.Match('*', '/')) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR); sc.Forward(); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); seenDocKeyBrace = false; } else if (sc.ch == '[' || sc.ch == '{') { seenDocKeyBrace = true; } else if (!setDoxygen.Contains(sc.ch) && !(seenDocKeyBrace && (sc.ch == ',' || sc.ch == '.'))) { char s[100]; if (caseSensitive) { sc.GetCurrent(s, sizeof(s)); } else { sc.GetCurrentLowered(s, sizeof(s)); } if (!(IsASpace(sc.ch) || (sc.ch == 0))) { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet); } else if (!keywords3.InList(s + 1)) { int subStyleCDKW = classifierDocKeyWords.ValueFor(s+1); if (subStyleCDKW >= 0) { sc.ChangeState(subStyleCDKW|activitySet); } else { sc.ChangeState(SCE_C_COMMENTDOCKEYWORDERROR|activitySet); } } sc.SetState(styleBeforeDCKeyword|activitySet); seenDocKeyBrace = false; } break; case SCE_C_STRING: if (sc.atLineEnd) { sc.ChangeState(SCE_C_STRINGEOL|activitySet); } else if (isIncludePreprocessor) { if (sc.ch == '>') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); isIncludePreprocessor = false; } } else if (sc.ch == '\\') { if (options.escapeSequence) { sc.SetState(SCE_C_ESCAPESEQUENCE|activitySet); escapeSeq.resetEscapeState(sc.chNext); } sc.Forward(); // Skip all characters after the backslash } else if (sc.ch == '\"') { if (sc.chNext == '_') { sc.ChangeState(SCE_C_USERLITERAL|activitySet); } else { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_ESCAPESEQUENCE: escapeSeq.digitsLeft--; if (!escapeSeq.atEscapeEnd(sc.ch)) { break; } if (sc.ch == '"') { sc.SetState(SCE_C_STRING|activitySet); sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '\\') { escapeSeq.resetEscapeState(sc.chNext); sc.Forward(); } else { sc.SetState(SCE_C_STRING|activitySet); if (sc.atLineEnd) { sc.ChangeState(SCE_C_STRINGEOL|activitySet); } } break; case SCE_C_HASHQUOTEDSTRING: if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_STRINGRAW: if (sc.Match(rawStringTerminator.c_str())) { for (size_t termPos=rawStringTerminator.size(); termPos; termPos--) sc.Forward(); sc.SetState(SCE_C_DEFAULT|activitySet); rawStringTerminator = ""; } break; case SCE_C_CHARACTER: if (sc.atLineEnd) { sc.ChangeState(SCE_C_STRINGEOL|activitySet); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { if (sc.chNext == '_') { sc.ChangeState(SCE_C_USERLITERAL|activitySet); } else { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_REGEX: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (! inRERange && sc.ch == '/') { sc.Forward(); while ((sc.ch < 0x80) && islower(sc.ch)) sc.Forward(); // gobble regex flags sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.ch == '\\' && (static_cast(sc.currentPos+1) < lineEndNext)) { // Gobble up the escaped character sc.Forward(); } else if (sc.ch == '[') { inRERange = true; } else if (sc.ch == ']') { inRERange = false; } break; case SCE_C_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_VERBATIM: if (options.verbatimStringsAllowEscapes && (sc.ch == '\\')) { sc.Forward(); // Skip all characters after the backslash } else if (sc.ch == '\"') { if (sc.chNext == '\"') { sc.Forward(); } else { sc.ForwardSetState(SCE_C_DEFAULT|activitySet); } } break; case SCE_C_TRIPLEVERBATIM: if (sc.Match("\"\"\"")) { while (sc.Match('"')) { sc.Forward(); } sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_UUID: if (sc.atLineEnd || sc.ch == ')') { sc.SetState(SCE_C_DEFAULT|activitySet); } break; case SCE_C_TASKMARKER: if (isoperator(sc.ch) || IsASpace(sc.ch)) { sc.SetState(styleBeforeTaskMarker|activitySet); styleBeforeTaskMarker = SCE_C_DEFAULT; } } if (sc.atLineEnd && !atLineEndBeforeSwitch) { // State exit processing consumed characters up to end of line. lineCurrent++; lineEndNext = styler.LineEnd(lineCurrent); vlls.Add(lineCurrent, preproc); } // Determine if a new state should be entered. if (MaskActive(sc.state) == SCE_C_DEFAULT) { if (sc.Match('@', '\"')) { sc.SetState(SCE_C_VERBATIM|activitySet); sc.Forward(); } else if (options.triplequotedStrings && sc.Match("\"\"\"")) { sc.SetState(SCE_C_TRIPLEVERBATIM|activitySet); sc.Forward(2); } else if (options.hashquotedStrings && sc.Match('#', '\"')) { sc.SetState(SCE_C_HASHQUOTEDSTRING|activitySet); sc.Forward(); } else if (options.backQuotedStrings && sc.Match('`')) { sc.SetState(SCE_C_STRINGRAW|activitySet); rawStringTerminator = "`"; } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID|activitySet); lastWordWasUUID = false; } else { sc.SetState(SCE_C_NUMBER|activitySet); } } else if (!sc.atLineEnd && (setWordStart.Contains(sc.ch) || (sc.ch == '@'))) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID|activitySet); lastWordWasUUID = false; } else { sc.SetState(SCE_C_IDENTIFIER|activitySet); } } else if (sc.Match('/', '*')) { if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTDOC|activitySet); } else { sc.SetState(SCE_C_COMMENT|activitySet); } sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if ((sc.Match("///") && !sc.Match("////")) || sc.Match("//!")) // Support of Qt/Doxygen doc. style sc.SetState(SCE_C_COMMENTLINEDOC|activitySet); else sc.SetState(SCE_C_COMMENTLINE|activitySet); } else if (sc.ch == '/' && (setOKBeforeRE.Contains(chPrevNonWhite) || followsReturnKeyword(sc, styler)) && (!setCouldBePostOp.Contains(chPrevNonWhite) || !FollowsPostfixOperator(sc, styler))) { sc.SetState(SCE_C_REGEX|activitySet); // JavaScript's RegEx inRERange = false; } else if (sc.ch == '\"') { if (sc.chPrev == 'R') { styler.Flush(); if (MaskActive(styler.StyleAt(sc.currentPos - 1)) == SCE_C_STRINGRAW) { sc.SetState(SCE_C_STRINGRAW|activitySet); rawStringTerminator = ")"; for (Sci_Position termPos = sc.currentPos + 1;; termPos++) { char chTerminator = styler.SafeGetCharAt(termPos, '('); if (chTerminator == '(') break; rawStringTerminator += chTerminator; } rawStringTerminator += '\"'; } else { sc.SetState(SCE_C_STRING|activitySet); } } else { sc.SetState(SCE_C_STRING|activitySet); } isIncludePreprocessor = false; // ensure that '>' won't end the string } else if (isIncludePreprocessor && sc.ch == '<') { sc.SetState(SCE_C_STRING|activitySet); } else if (sc.ch == '\'') { sc.SetState(SCE_C_CHARACTER|activitySet); } else if (sc.ch == '#' && visibleChars == 0) { // Preprocessor commands are alone on their line sc.SetState(SCE_C_PREPROCESSOR|activitySet); // Skip whitespace between # and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_C_DEFAULT|activitySet); } else if (sc.Match("include")) { isIncludePreprocessor = true; } else { if (options.trackPreprocessor) { if (sc.Match("ifdef") || sc.Match("ifndef")) { bool isIfDef = sc.Match("ifdef"); int i = isIfDef ? 5 : 6; std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false); bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end(); preproc.StartSection(isIfDef == foundDef); } else if (sc.Match("if")) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true); bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions); preproc.StartSection(ifGood); } else if (sc.Match("else")) { if (!preproc.CurrentIfTaken()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (sc.Match("elif")) { // Ensure only one chosen out of #if .. #elif .. #elif .. #else .. #endif if (!preproc.CurrentIfTaken()) { // Similar to #if std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 2, true); bool ifGood = EvaluateExpression(restOfLine, preprocessorDefinitions); if (ifGood) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } } else if (sc.Match("endif")) { preproc.EndSection(); activitySet = preproc.IsInactive() ? activeFlag : 0; sc.ChangeState(SCE_C_PREPROCESSOR|activitySet); } else if (sc.Match("define")) { if (options.updatePreprocessor && !preproc.IsInactive()) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true); size_t startName = 0; while ((startName < restOfLine.length()) && IsSpaceOrTab(restOfLine[startName])) startName++; size_t endName = startName; while ((endName < restOfLine.length()) && setWord.Contains(static_cast(restOfLine[endName]))) endName++; std::string key = restOfLine.substr(startName, endName-startName); if ((endName < restOfLine.length()) && (restOfLine.at(endName) == '(')) { // Macro size_t endArgs = endName; while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')')) endArgs++; std::string args = restOfLine.substr(endName + 1, endArgs - endName - 1); size_t startValue = endArgs+1; while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; std::string value; if (startValue < restOfLine.length()) value = restOfLine.substr(startValue); preprocessorDefinitions[key] = SymbolValue(value, args); ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value, false, args)); definitionsChanged = true; } else { // Value size_t startValue = endName; while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; std::string value = restOfLine.substr(startValue); preprocessorDefinitions[key] = value; ppDefineHistory.push_back(PPDefinition(lineCurrent, key, value)); definitionsChanged = true; } } } else if (sc.Match("undef")) { if (options.updatePreprocessor && !preproc.IsInactive()) { const std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, false); std::vector tokens = Tokenize(restOfLine); if (tokens.size() >= 1) { const std::string key = tokens[0]; preprocessorDefinitions.erase(key); ppDefineHistory.push_back(PPDefinition(lineCurrent, key, "", true)); definitionsChanged = true; } } } } } } else if (isoperator(sc.ch)) { sc.SetState(SCE_C_OPERATOR|activitySet); } } if (!IsASpace(sc.ch) && !IsSpaceEquiv(MaskActive(sc.state))) { chPrevNonWhite = sc.ch; visibleChars++; } continuationLine = false; sc.Forward(); } const bool rawStringsChanged = rawStringTerminators.Merge(rawSTNew, lineCurrent); if (definitionsChanged || rawStringsChanged) styler.ChangeLexerState(startPos, startPos + length); sc.Complete(); } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". void SCI_METHOD LexerCPP::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { if (!options.fold) return; LexAccessor styler(pAccess); Sci_PositionU endPos = startPos + length; int visibleChars = 0; bool inLineComment = false; Sci_Position lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; Sci_PositionU lineStartNext = styler.LineStart(lineCurrent+1); int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = MaskActive(styler.StyleAt(startPos)); int style = MaskActive(initStyle); const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty(); for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = MaskActive(styler.StyleAt(i + 1)); bool atEOL = i == (lineStartNext-1); if ((style == SCE_C_COMMENTLINE) || (style == SCE_C_COMMENTLINEDOC)) inLineComment = true; if (options.foldComment && options.foldCommentMultiline && IsStreamCommentStyle(style) && !inLineComment) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (options.foldComment && options.foldCommentExplicit && ((style == SCE_C_COMMENTLINE) || options.foldExplicitAnywhere)) { if (userDefinedFoldMarkers) { if (styler.Match(i, options.foldExplicitStart.c_str())) { levelNext++; } else if (styler.Match(i, options.foldExplicitEnd.c_str())) { levelNext--; } } else { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } } if (options.foldPreprocessor && (style == SCE_C_PREPROCESSOR)) { if (ch == '#') { Sci_PositionU j = i + 1; while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "region") || styler.Match(j, "if")) { levelNext++; } else if (styler.Match(j, "end")) { levelNext--; } } } if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) { if (ch == '{' || ch == '[') { // Measure the minimum before a '{' to allow // folding on "} else {" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (ch == '}' || ch == ']') { levelNext--; } } if (!IsASpace(ch)) visibleChars++; if (atEOL || (i == endPos-1)) { int levelUse = levelCurrent; if (options.foldSyntaxBased && options.foldAtElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; lineStartNext = styler.LineStart(lineCurrent+1); levelCurrent = levelNext; levelMinCurrent = levelCurrent; if (atEOL && (i == static_cast(styler.Length()-1))) { // There is an empty line at end of file so give it same level and empty styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG); } visibleChars = 0; inLineComment = false; } } } void LexerCPP::EvaluateTokens(std::vector &tokens, const SymbolTable &preprocessorDefinitions) { // Remove whitespace tokens tokens.erase(std::remove_if(tokens.begin(), tokens.end(), OnlySpaceOrTab), tokens.end()); // Evaluate defined statements to either 0 or 1 for (size_t i=0; (i+1)) SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+2]); if (it != preprocessorDefinitions.end()) { val = "1"; } tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 4); } else { // Spurious '(' so erase as more likely to result in false tokens.erase(tokens.begin() + i + 1, tokens.begin() + i + 2); } } else { // defined SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i+1]); if (it != preprocessorDefinitions.end()) { val = "1"; } } tokens[i] = val; } else { i++; } } // Evaluate identifiers const size_t maxIterations = 100; size_t iterations = 0; // Limit number of iterations in case there is a recursive macro. for (size_t i = 0; (i(tokens[i][0]))) { SymbolTable::const_iterator it = preprocessorDefinitions.find(tokens[i]); if (it != preprocessorDefinitions.end()) { // Tokenize value std::vector macroTokens = Tokenize(it->second.value); if (it->second.IsMacro()) { if ((i + 1 < tokens.size()) && (tokens.at(i + 1) == "(")) { // Create map of argument name to value std::vector argumentNames = StringSplit(it->second.arguments, ','); std::map arguments; size_t arg = 0; size_t tok = i+2; while ((tok < tokens.size()) && (arg < argumentNames.size()) && (tokens.at(tok) != ")")) { if (tokens.at(tok) != ",") { arguments[argumentNames.at(arg)] = tokens.at(tok); arg++; } tok++; } // Remove invocation tokens.erase(tokens.begin() + i, tokens.begin() + tok + 1); // Substitute values into macro macroTokens.erase(std::remove_if(macroTokens.begin(), macroTokens.end(), OnlySpaceOrTab), macroTokens.end()); for (size_t iMacro = 0; iMacro < macroTokens.size();) { if (setWordStart.Contains(static_cast(macroTokens[iMacro][0]))) { std::map::const_iterator itFind = arguments.find(macroTokens[iMacro]); if (itFind != arguments.end()) { // TODO: Possible that value will be expression so should insert tokenized form macroTokens[iMacro] = itFind->second; } } iMacro++; } // Insert results back into tokens tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end()); } else { i++; } } else { // Remove invocation tokens.erase(tokens.begin() + i); // Insert results back into tokens tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end()); } } else { // Identifier not found tokens.erase(tokens.begin() + i); } } else { i++; } } // Find bracketed subexpressions and recurse on them BracketPair bracketPair = FindBracketPair(tokens); while (bracketPair.itBracket != tokens.end()) { std::vector inBracket(bracketPair.itBracket + 1, bracketPair.itEndBracket); EvaluateTokens(inBracket, preprocessorDefinitions); // The insertion is done before the removal because there were failures with the opposite approach tokens.insert(bracketPair.itBracket, inBracket.begin(), inBracket.end()); bracketPair = FindBracketPair(tokens); tokens.erase(bracketPair.itBracket, bracketPair.itEndBracket + 1); bracketPair = FindBracketPair(tokens); } // Evaluate logical negations for (size_t j=0; (j+1)::iterator itInsert = tokens.erase(tokens.begin() + j, tokens.begin() + j + 2); tokens.insert(itInsert, isTrue ? "1" : "0"); } else { j++; } } // Evaluate expressions in precedence order enum precedence { precArithmetic, precRelative, precLogical }; for (int prec=precArithmetic; prec <= precLogical; prec++) { // Looking at 3 tokens at a time so end at 2 before end for (size_t k=0; (k+2)") result = valA > valB; else if (tokens[k+1] == ">=") result = valA >= valB; else if (tokens[k+1] == "==") result = valA == valB; else if (tokens[k+1] == "!=") result = valA != valB; else if (tokens[k+1] == "||") result = valA || valB; else if (tokens[k+1] == "&&") result = valA && valB; char sResult[30]; sprintf(sResult, "%d", result); std::vector::iterator itInsert = tokens.erase(tokens.begin() + k, tokens.begin() + k + 3); tokens.insert(itInsert, sResult); } else { k++; } } } } std::vector LexerCPP::Tokenize(const std::string &expr) const { // Break into tokens std::vector tokens; const char *cp = expr.c_str(); while (*cp) { std::string word; if (setWord.Contains(static_cast(*cp))) { // Identifiers and numbers while (setWord.Contains(static_cast(*cp))) { word += *cp; cp++; } } else if (IsSpaceOrTab(*cp)) { while (IsSpaceOrTab(*cp)) { word += *cp; cp++; } } else if (setRelOp.Contains(static_cast(*cp))) { word += *cp; cp++; if (setRelOp.Contains(static_cast(*cp))) { word += *cp; cp++; } } else if (setLogicalOp.Contains(static_cast(*cp))) { word += *cp; cp++; if (setLogicalOp.Contains(static_cast(*cp))) { word += *cp; cp++; } } else { // Should handle strings, characters, and comments here word += *cp; cp++; } tokens.push_back(word); } return tokens; } bool LexerCPP::EvaluateExpression(const std::string &expr, const SymbolTable &preprocessorDefinitions) { std::vector tokens = Tokenize(expr); EvaluateTokens(tokens, preprocessorDefinitions); // "0" or "" -> false else true bool isFalse = tokens.empty() || ((tokens.size() == 1) && ((tokens[0] == "") || tokens[0] == "0")); return !isFalse; } LexerModule lmCPP(SCLEX_CPP, LexerCPP::LexerFactoryCPP, "cpp", cppWordLists); LexerModule lmCPPNoCase(SCLEX_CPPNOCASE, LexerCPP::LexerFactoryCPPInsensitive, "cppnocase", cppWordLists); scintilla/lexers/LexTCL.cxx0000644000175000017500000002550612557522743014645 0ustar neilneil// Scintilla source code edit control /** @file LexTCL.cxx ** Lexer for TCL language. **/ // Copyright 1998-2001 by Andre Arpin // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Extended to accept accented characters static inline bool IsAWordChar(int ch) { return ch >= 0x80 || (isalnum(ch) || ch == '_' || ch ==':' || ch=='.'); // : name space separator } static inline bool IsAWordStart(int ch) { return ch >= 0x80 || (ch ==':' || isalpha(ch) || ch == '_'); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (IsADigit(ch, 0x10) || toupper(ch) == 'E' || ch == '.' || ch == '-' || ch == '+'); } static void ColouriseTCLDoc(Sci_PositionU startPos, Sci_Position length, int , WordList *keywordlists[], Accessor &styler) { #define isComment(s) (s==SCE_TCL_COMMENT || s==SCE_TCL_COMMENTLINE || s==SCE_TCL_COMMENT_BOX || s==SCE_TCL_BLOCK_COMMENT) bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool commentLevel = false; bool subBrace = false; // substitution begin with a brace ${.....} enum tLineState {LS_DEFAULT, LS_OPEN_COMMENT, LS_OPEN_DOUBLE_QUOTE, LS_COMMENT_BOX, LS_MASK_STATE = 0xf, LS_COMMAND_EXPECTED = 16, LS_BRACE_ONLY = 32 } lineState = LS_DEFAULT; bool prevSlash = false; int currentLevel = 0; bool expected = 0; bool subParen = 0; Sci_Position currentLine = styler.GetLine(startPos); if (currentLine > 0) currentLine--; length += startPos - styler.LineStart(currentLine); // make sure lines overlap startPos = styler.LineStart(currentLine); WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; WordList &keywords9 = *keywordlists[8]; if (currentLine > 0) { int ls = styler.GetLineState(currentLine - 1); lineState = tLineState(ls & LS_MASK_STATE); expected = LS_COMMAND_EXPECTED == tLineState(ls & LS_COMMAND_EXPECTED); subBrace = LS_BRACE_ONLY == tLineState(ls & LS_BRACE_ONLY); currentLevel = styler.LevelAt(currentLine - 1) >> 17; commentLevel = (styler.LevelAt(currentLine - 1) >> 16) & 1; } else styler.SetLevel(0, SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG); bool visibleChars = false; int previousLevel = currentLevel; StyleContext sc(startPos, length, SCE_TCL_DEFAULT, styler); for (; ; sc.Forward()) { next: if (sc.ch=='\r' && sc.chNext == '\n') // only ignore \r on PC process on the mac continue; bool atEnd = !sc.More(); // make sure we coloured the last word if (lineState != LS_DEFAULT) { sc.SetState(SCE_TCL_DEFAULT); if (lineState == LS_OPEN_COMMENT) sc.SetState(SCE_TCL_COMMENTLINE); else if (lineState == LS_OPEN_DOUBLE_QUOTE) sc.SetState(SCE_TCL_IN_QUOTE); else if (lineState == LS_COMMENT_BOX && (sc.ch == '#' || (sc.ch == ' ' && sc.chNext=='#'))) sc.SetState(SCE_TCL_COMMENT_BOX); lineState = LS_DEFAULT; } if (subBrace) { // ${ overrides every thing even \ except } if (sc.ch == '}') { subBrace = false; sc.SetState(SCE_TCL_OPERATOR); sc.ForwardSetState(SCE_TCL_DEFAULT); goto next; } else sc.SetState(SCE_TCL_SUB_BRACE); if (!sc.atLineEnd) continue; } else if (sc.state == SCE_TCL_DEFAULT || sc.state ==SCE_TCL_OPERATOR) { expected &= isspacechar(static_cast(sc.ch)) || IsAWordStart(sc.ch) || sc.ch =='#'; } else if (sc.state == SCE_TCL_SUBSTITUTION) { switch (sc.ch) { case '(': subParen=true; sc.SetState(SCE_TCL_OPERATOR); sc.ForwardSetState(SCE_TCL_SUBSTITUTION); continue; case ')': sc.SetState(SCE_TCL_OPERATOR); subParen=false; continue; case '$': continue; case ',': sc.SetState(SCE_TCL_OPERATOR); if (subParen) sc.ForwardSetState(SCE_TCL_SUBSTITUTION); continue; default : // maybe spaces should be allowed ??? if (!IsAWordChar(sc.ch)) { // probably the code is wrong sc.SetState(SCE_TCL_DEFAULT); subParen = 0; } break; } } else if (isComment(sc.state)) { } else if (!IsAWordChar(sc.ch)) { if ((sc.state == SCE_TCL_IDENTIFIER && expected) || sc.state == SCE_TCL_MODIFIER) { char w[100]; char *s=w; sc.GetCurrent(w, sizeof(w)); if (w[strlen(w)-1]=='\r') w[strlen(w)-1]=0; while (*s == ':') // ignore leading : like in ::set a 10 ++s; bool quote = sc.state == SCE_TCL_IN_QUOTE; if (commentLevel || expected) { if (keywords.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD); } else if (keywords2.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD2); } else if (keywords3.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD3); } else if (keywords4.InList(s)) { sc.ChangeState(quote ? SCE_TCL_WORD_IN_QUOTE : SCE_TCL_WORD4); } else if (sc.GetRelative(-static_cast(strlen(s))-1) == '{' && keywords5.InList(s) && sc.ch == '}') { // {keyword} exactly no spaces sc.ChangeState(SCE_TCL_EXPAND); } if (keywords6.InList(s)) { sc.ChangeState(SCE_TCL_WORD5); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_TCL_WORD6); } else if (keywords8.InList(s)) { sc.ChangeState(SCE_TCL_WORD7); } else if (keywords9.InList(s)) { sc.ChangeState(SCE_TCL_WORD8); } } expected = false; sc.SetState(quote ? SCE_TCL_IN_QUOTE : SCE_TCL_DEFAULT); } else if (sc.state == SCE_TCL_MODIFIER || sc.state == SCE_TCL_IDENTIFIER) { sc.SetState(SCE_TCL_DEFAULT); } } if (atEnd) break; if (sc.atLineEnd) { lineState = LS_DEFAULT; currentLine = styler.GetLine(sc.currentPos); if (foldComment && sc.state!=SCE_TCL_COMMENT && isComment(sc.state)) { if (currentLevel == 0) { ++currentLevel; commentLevel = true; } } else { if (visibleChars && commentLevel) { --currentLevel; --previousLevel; commentLevel = false; } } int flag = 0; if (!visibleChars) flag = SC_FOLDLEVELWHITEFLAG; if (currentLevel > previousLevel) flag = SC_FOLDLEVELHEADERFLAG; styler.SetLevel(currentLine, flag + previousLevel + SC_FOLDLEVELBASE + (currentLevel << 17) + (commentLevel << 16)); // Update the line state, so it can be seen by next line if (sc.state == SCE_TCL_IN_QUOTE) { lineState = LS_OPEN_DOUBLE_QUOTE; } else { if (prevSlash) { if (isComment(sc.state)) lineState = LS_OPEN_COMMENT; } else if (sc.state == SCE_TCL_COMMENT_BOX) lineState = LS_COMMENT_BOX; } styler.SetLineState(currentLine, (subBrace ? LS_BRACE_ONLY : 0) | (expected ? LS_COMMAND_EXPECTED : 0) | lineState); if (lineState == LS_COMMENT_BOX) sc.ForwardSetState(SCE_TCL_COMMENT_BOX); else if (lineState == LS_OPEN_DOUBLE_QUOTE) sc.ForwardSetState(SCE_TCL_IN_QUOTE); else sc.ForwardSetState(SCE_TCL_DEFAULT); prevSlash = false; previousLevel = currentLevel; goto next; } if (prevSlash) { prevSlash = false; if (sc.ch == '#' && IsANumberChar(sc.chNext)) sc.ForwardSetState(SCE_TCL_NUMBER); continue; } prevSlash = sc.ch == '\\'; if (isComment(sc.state)) continue; if (sc.atLineStart) { visibleChars = false; if (sc.state!=SCE_TCL_IN_QUOTE && !isComment(sc.state)) { sc.SetState(SCE_TCL_DEFAULT); expected = IsAWordStart(sc.ch)|| isspacechar(static_cast(sc.ch)); } } switch (sc.state) { case SCE_TCL_NUMBER: if (!IsANumberChar(sc.ch)) sc.SetState(SCE_TCL_DEFAULT); break; case SCE_TCL_IN_QUOTE: if (sc.ch == '"') { sc.ForwardSetState(SCE_TCL_DEFAULT); visibleChars = true; // necessary if a " is the first and only character on a line goto next; } else if (sc.ch == '[' || sc.ch == ']' || sc.ch == '$') { sc.SetState(SCE_TCL_OPERATOR); expected = sc.ch == '['; sc.ForwardSetState(SCE_TCL_IN_QUOTE); goto next; } continue; case SCE_TCL_OPERATOR: sc.SetState(SCE_TCL_DEFAULT); break; } if (sc.ch == '#') { if (visibleChars) { if (sc.state != SCE_TCL_IN_QUOTE && expected) sc.SetState(SCE_TCL_COMMENT); } else { sc.SetState(SCE_TCL_COMMENTLINE); if (sc.chNext == '~') sc.SetState(SCE_TCL_BLOCK_COMMENT); if (sc.atLineStart && (sc.chNext == '#' || sc.chNext == '-')) sc.SetState(SCE_TCL_COMMENT_BOX); } } if (!isspacechar(static_cast(sc.ch))) { visibleChars = true; } if (sc.ch == '\\') { prevSlash = true; continue; } // Determine if a new state should be entered. if (sc.state == SCE_TCL_DEFAULT) { if (IsAWordStart(sc.ch)) { sc.SetState(SCE_TCL_IDENTIFIER); } else if (IsADigit(sc.ch) && !IsAWordChar(sc.chPrev)) { sc.SetState(SCE_TCL_NUMBER); } else { switch (sc.ch) { case '\"': sc.SetState(SCE_TCL_IN_QUOTE); break; case '{': sc.SetState(SCE_TCL_OPERATOR); expected = true; ++currentLevel; break; case '}': sc.SetState(SCE_TCL_OPERATOR); expected = true; --currentLevel; break; case '[': expected = true; case ']': case '(': case ')': sc.SetState(SCE_TCL_OPERATOR); break; case ';': expected = true; break; case '$': subParen = 0; if (sc.chNext != '{') { sc.SetState(SCE_TCL_SUBSTITUTION); } else { sc.SetState(SCE_TCL_OPERATOR); // $ sc.Forward(); // { sc.ForwardSetState(SCE_TCL_SUB_BRACE); subBrace = true; } break; case '#': if ((isspacechar(static_cast(sc.chPrev))|| isoperator(static_cast(sc.chPrev))) && IsADigit(sc.chNext,0x10)) sc.SetState(SCE_TCL_NUMBER); break; case '-': sc.SetState(IsADigit(sc.chNext)? SCE_TCL_NUMBER: SCE_TCL_MODIFIER); break; default: if (isoperator(static_cast(sc.ch))) { sc.SetState(SCE_TCL_OPERATOR); } } } } } sc.Complete(); } static const char *const tclWordListDesc[] = { "TCL Keywords", "TK Keywords", "iTCL Keywords", "tkCommands", "expand", "user1", "user2", "user3", "user4", 0 }; // this code supports folding in the colourizer LexerModule lmTCL(SCLEX_TCL, ColouriseTCLDoc, "tcl", 0, tclWordListDesc); scintilla/lexers/LexMySQL.cxx0000644000175000017500000004406212557522743015166 0ustar neilneil/** * Scintilla source code edit control * @file LexMySQL.cxx * Lexer for MySQL * * Improved by Mike Lischke * Adopted from LexSQL.cxx by Anders Karlsson * Original work by Neil Hodgson * Copyright 1998-2005 by Neil Hodgson * The License.txt file describes the conditions under which this software may be distributed. */ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(int ch) { return (ch < 0x80) && (isalpha(ch) || ch == '_'); } static inline bool IsANumberChar(int ch) { // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. return (ch < 0x80) && (isdigit(ch) || toupper(ch) == 'E' || ch == '.' || ch == '-' || ch == '+'); } //-------------------------------------------------------------------------------------------------- /** * Check if the current content context represent a keyword and set the context state if so. */ static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[], int activeState) { int length = sc.LengthCurrent() + 1; // +1 for the next char char* s = new char[length]; sc.GetCurrentLowered(s, length); if (keywordlists[0]->InList(s)) sc.ChangeState(SCE_MYSQL_MAJORKEYWORD | activeState); else if (keywordlists[1]->InList(s)) sc.ChangeState(SCE_MYSQL_KEYWORD | activeState); else if (keywordlists[2]->InList(s)) sc.ChangeState(SCE_MYSQL_DATABASEOBJECT | activeState); else if (keywordlists[3]->InList(s)) sc.ChangeState(SCE_MYSQL_FUNCTION | activeState); else if (keywordlists[5]->InList(s)) sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD | activeState); else if (keywordlists[6]->InList(s)) sc.ChangeState(SCE_MYSQL_USER1 | activeState); else if (keywordlists[7]->InList(s)) sc.ChangeState(SCE_MYSQL_USER2 | activeState); else if (keywordlists[8]->InList(s)) sc.ChangeState(SCE_MYSQL_USER3 | activeState); delete [] s; } //-------------------------------------------------------------------------------------------------- #define HIDDENCOMMAND_STATE 0x40 // Offset for states within a hidden command. #define MASKACTIVE(style) (style & ~HIDDENCOMMAND_STATE) static void SetDefaultState(StyleContext& sc, int activeState) { if (activeState == 0) sc.SetState(SCE_MYSQL_DEFAULT); else sc.SetState(SCE_MYSQL_HIDDENCOMMAND); } static void ForwardDefaultState(StyleContext& sc, int activeState) { if (activeState == 0) sc.ForwardSetState(SCE_MYSQL_DEFAULT); else sc.ForwardSetState(SCE_MYSQL_HIDDENCOMMAND); } static void ColouriseMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler, 127); int activeState = (initStyle == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : initStyle & HIDDENCOMMAND_STATE; for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. switch (MASKACTIVE(sc.state)) { case SCE_MYSQL_OPERATOR: SetDefaultState(sc, activeState); break; case SCE_MYSQL_NUMBER: // We stop the number definition on non-numerical non-dot non-eE non-sign char. if (!IsANumberChar(sc.ch)) SetDefaultState(sc, activeState); break; case SCE_MYSQL_IDENTIFIER: // Switch from identifier to keyword state and open a new state for the new char. if (!IsAWordChar(sc.ch)) { CheckForKeyword(sc, keywordlists, activeState); // Additional check for function keywords needed. // A function name must be followed by an opening parenthesis. if (MASKACTIVE(sc.state) == SCE_MYSQL_FUNCTION && sc.ch != '(') { if (activeState > 0) sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND); else sc.ChangeState(SCE_MYSQL_DEFAULT); } SetDefaultState(sc, activeState); } break; case SCE_MYSQL_VARIABLE: if (!IsAWordChar(sc.ch)) SetDefaultState(sc, activeState); break; case SCE_MYSQL_SYSTEMVARIABLE: if (!IsAWordChar(sc.ch)) { Sci_Position length = sc.LengthCurrent() + 1; char* s = new char[length]; sc.GetCurrentLowered(s, length); // Check for known system variables here. if (keywordlists[4]->InList(&s[2])) sc.ChangeState(SCE_MYSQL_KNOWNSYSTEMVARIABLE | activeState); delete [] s; SetDefaultState(sc, activeState); } break; case SCE_MYSQL_QUOTEDIDENTIFIER: if (sc.ch == '`') { if (sc.chNext == '`') sc.Forward(); // Ignore it else ForwardDefaultState(sc, activeState); } break; case SCE_MYSQL_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); ForwardDefaultState(sc, activeState); } break; case SCE_MYSQL_COMMENTLINE: if (sc.atLineStart) SetDefaultState(sc, activeState); break; case SCE_MYSQL_SQSTRING: if (sc.ch == '\\') sc.Forward(); // Escape sequence else if (sc.ch == '\'') { // End of single quoted string reached? if (sc.chNext == '\'') sc.Forward(); else ForwardDefaultState(sc, activeState); } break; case SCE_MYSQL_DQSTRING: if (sc.ch == '\\') sc.Forward(); // Escape sequence else if (sc.ch == '\"') { // End of single quoted string reached? if (sc.chNext == '\"') sc.Forward(); else ForwardDefaultState(sc, activeState); } break; case SCE_MYSQL_PLACEHOLDER: if (sc.Match('}', '>')) { sc.Forward(); ForwardDefaultState(sc, activeState); } break; } if (sc.state == SCE_MYSQL_HIDDENCOMMAND && sc.Match('*', '/')) { activeState = 0; sc.Forward(); ForwardDefaultState(sc, activeState); } // Determine if a new state should be entered. if (sc.state == SCE_MYSQL_DEFAULT || sc.state == SCE_MYSQL_HIDDENCOMMAND) { switch (sc.ch) { case '@': if (sc.chNext == '@') { sc.SetState(SCE_MYSQL_SYSTEMVARIABLE | activeState); sc.Forward(2); // Skip past @@. } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_MYSQL_VARIABLE | activeState); sc.Forward(); // Skip past @. } else sc.SetState(SCE_MYSQL_OPERATOR | activeState); break; case '`': sc.SetState(SCE_MYSQL_QUOTEDIDENTIFIER | activeState); break; case '#': sc.SetState(SCE_MYSQL_COMMENTLINE | activeState); break; case '\'': sc.SetState(SCE_MYSQL_SQSTRING | activeState); break; case '\"': sc.SetState(SCE_MYSQL_DQSTRING | activeState); break; default: if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) sc.SetState(SCE_MYSQL_NUMBER | activeState); else if (IsAWordStart(sc.ch)) sc.SetState(SCE_MYSQL_IDENTIFIER | activeState); else if (sc.Match('/', '*')) { sc.SetState(SCE_MYSQL_COMMENT | activeState); // Skip comment introducer and check for hidden command. sc.Forward(2); if (sc.ch == '!') { activeState = HIDDENCOMMAND_STATE; sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND); } } else if (sc.Match('<', '{')) { sc.SetState(SCE_MYSQL_PLACEHOLDER | activeState); } else if (sc.Match("--")) { // Special MySQL single line comment. sc.SetState(SCE_MYSQL_COMMENTLINE | activeState); sc.Forward(2); // Check the third character too. It must be a space or EOL. if (sc.ch != ' ' && sc.ch != '\n' && sc.ch != '\r') sc.ChangeState(SCE_MYSQL_OPERATOR | activeState); } else if (isoperator(static_cast(sc.ch))) sc.SetState(SCE_MYSQL_OPERATOR | activeState); } } } // Do a final check for keywords if we currently have an identifier, to highlight them // also at the end of a line. if (sc.state == SCE_MYSQL_IDENTIFIER) { CheckForKeyword(sc, keywordlists, activeState); // Additional check for function keywords needed. // A function name must be followed by an opening parenthesis. if (sc.state == SCE_MYSQL_FUNCTION && sc.ch != '(') SetDefaultState(sc, activeState); } sc.Complete(); } //-------------------------------------------------------------------------------------------------- /** * Helper function to determine if we have a foldable comment currently. */ static bool IsStreamCommentStyle(int style) { return MASKACTIVE(style) == SCE_MYSQL_COMMENT; } //-------------------------------------------------------------------------------------------------- /** * Code copied from StyleContext and modified to work here. Should go into Accessor as a * companion to Match()... */ bool MatchIgnoreCase(Accessor &styler, Sci_Position currentPos, const char *s) { for (Sci_Position n = 0; *s; n++) { if (*s != tolower(styler.SafeGetCharAt(currentPos + n))) return false; s++; } return true; } //-------------------------------------------------------------------------------------------------- // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment. static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) { bool foldComment = styler.GetPropertyInt("fold.comment") != 0; bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; bool foldOnlyBegin = styler.GetPropertyInt("fold.sql.only.begin", 0) != 0; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16; int levelNext = levelCurrent; int styleNext = styler.StyleAt(startPos); int style = initStyle; int activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE; bool endPending = false; bool whenPending = false; bool elseIfPending = false; char nextChar = styler.SafeGetCharAt(startPos); for (Sci_PositionU i = startPos; length > 0; i++, length--) { int stylePrev = style; int lastActiveState = activeState; style = styleNext; styleNext = styler.StyleAt(i + 1); activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE; char currentChar = nextChar; nextChar = styler.SafeGetCharAt(i + 1); bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n'); switch (MASKACTIVE(style)) { case SCE_MYSQL_COMMENT: if (foldComment) { // Multiline comment style /* .. */ just started or is still in progress. if (IsStreamCommentStyle(style) && !IsStreamCommentStyle(stylePrev)) levelNext++; } break; case SCE_MYSQL_COMMENTLINE: if (foldComment) { // Not really a standard, but we add support for single line comments // with special curly braces syntax as foldable comments too. // MySQL needs -- comments to be followed by space or control char if (styler.Match(i, "--")) { char chNext2 = styler.SafeGetCharAt(i + 2); char chNext3 = styler.SafeGetCharAt(i + 3); if (chNext2 == '{' || chNext3 == '{') levelNext++; else if (chNext2 == '}' || chNext3 == '}') levelNext--; } } break; case SCE_MYSQL_HIDDENCOMMAND: /* if (endPending) { // A conditional command is not a white space so it should end the current block // before opening a new one. endPending = false; levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } }*/ if (activeState != lastActiveState) levelNext++; break; case SCE_MYSQL_OPERATOR: if (endPending) { endPending = false; levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } if (currentChar == '(') levelNext++; else if (currentChar == ')') { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } break; case SCE_MYSQL_MAJORKEYWORD: case SCE_MYSQL_KEYWORD: case SCE_MYSQL_FUNCTION: case SCE_MYSQL_PROCEDUREKEYWORD: // Reserved and other keywords. if (style != stylePrev) { // END decreases the folding level, regardless which keyword follows. bool endFound = MatchIgnoreCase(styler, i, "end"); if (endPending) { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } else if (!endFound) { if (MatchIgnoreCase(styler, i, "begin")) levelNext++; else { if (!foldOnlyBegin) { bool whileFound = MatchIgnoreCase(styler, i, "while"); bool loopFound = MatchIgnoreCase(styler, i, "loop"); bool repeatFound = MatchIgnoreCase(styler, i, "repeat"); bool caseFound = MatchIgnoreCase(styler, i, "case"); if (whileFound || loopFound || repeatFound || caseFound) levelNext++; else { // IF alone does not increase the fold level as it is also used in non-block'ed // code like DROP PROCEDURE blah IF EXISTS. // Instead THEN opens the new level (if not part of an ELSEIF or WHEN (case) branch). if (MatchIgnoreCase(styler, i, "then")) { if (!elseIfPending && !whenPending) levelNext++; else { elseIfPending = false; whenPending = false; } } else { // Neither of if/then/while/loop/repeat/case, so check for // sub parts of IF and CASE. if (MatchIgnoreCase(styler, i, "elseif")) elseIfPending = true; if (MatchIgnoreCase(styler, i, "when")) whenPending = true; } } } } } // Keep the current end state for the next round. endPending = endFound; } break; default: if (!isspacechar(currentChar) && endPending) { // END followed by a non-whitespace character (not covered by other cases like identifiers) // also should end a folding block. Typical case: END followed by self defined delimiter. levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } break; } // Go up one level if we just ended a multi line comment. if (IsStreamCommentStyle(stylePrev) && !IsStreamCommentStyle(style)) { levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } if (activeState == 0 && lastActiveState != 0) { // Decrease fold level when we left a hidden command. levelNext--; if (levelNext < SC_FOLDLEVELBASE) levelNext = SC_FOLDLEVELBASE; } if (atEOL) { // Apply the new folding level to this line. // Leave pending states as they are otherwise a line break will de-sync // code folding and valid syntax. int levelUse = levelCurrent; int lev = levelUse | levelNext << 16; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) styler.SetLevel(lineCurrent, lev); lineCurrent++; levelCurrent = levelNext; visibleChars = 0; } if (!isspacechar(currentChar)) visibleChars++; } } //-------------------------------------------------------------------------------------------------- static const char * const mysqlWordListDesc[] = { "Major Keywords", "Keywords", "Database Objects", "Functions", "System Variables", "Procedure keywords", "User Keywords 1", "User Keywords 2", "User Keywords 3", 0 }; LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc); scintilla/lexers/LexVerilog.cxx0000644000175000017500000010503512557522743015626 0ustar neilneil// Scintilla source code edit control /** @file LexVerilog.cxx ** Lexer for Verilog. ** Written by Avi Yegudin, based on C++ lexer by Neil Hodgson **/ // Copyright 1998-2002 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #include "SubStyles.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif namespace { // Use an unnamed namespace to protect the functions and classes from name conflicts struct PPDefinition { Sci_Position line; std::string key; std::string value; bool isUndef; std::string arguments; PPDefinition(Sci_Position line_, const std::string &key_, const std::string &value_, bool isUndef_ = false, std::string arguments_="") : line(line_), key(key_), value(value_), isUndef(isUndef_), arguments(arguments_) { } }; class LinePPState { int state; int ifTaken; int level; bool ValidLevel() const { return level >= 0 && level < 32; } int maskLevel() const { return 1 << level; } public: LinePPState() : state(0), ifTaken(0), level(-1) { } bool IsInactive() const { return state != 0; } bool CurrentIfTaken() const { return (ifTaken & maskLevel()) != 0; } void StartSection(bool on) { level++; if (ValidLevel()) { if (on) { state &= ~maskLevel(); ifTaken |= maskLevel(); } else { state |= maskLevel(); ifTaken &= ~maskLevel(); } } } void EndSection() { if (ValidLevel()) { state &= ~maskLevel(); ifTaken &= ~maskLevel(); } level--; } void InvertCurrentLevel() { if (ValidLevel()) { state ^= maskLevel(); ifTaken |= maskLevel(); } } }; // Hold the preprocessor state for each line seen. // Currently one entry per line but could become sparse with just one entry per preprocessor line. class PPStates { std::vector vlls; public: LinePPState ForLine(Sci_Position line) const { if ((line > 0) && (vlls.size() > static_cast(line))) { return vlls[line]; } else { return LinePPState(); } } void Add(Sci_Position line, LinePPState lls) { vlls.resize(line+1); vlls[line] = lls; } }; // Options used for LexerVerilog struct OptionsVerilog { bool foldComment; bool foldPreprocessor; bool foldPreprocessorElse; bool foldCompact; bool foldAtElse; bool foldAtModule; bool trackPreprocessor; bool updatePreprocessor; bool portStyling; bool allUppercaseDocKeyword; OptionsVerilog() { foldComment = false; foldPreprocessor = false; foldPreprocessorElse = false; foldCompact = false; foldAtElse = false; foldAtModule = false; // for backwards compatibility, preprocessor functionality is disabled by default trackPreprocessor = false; updatePreprocessor = false; // for backwards compatibility, treat input/output/inout as regular keywords portStyling = false; // for backwards compatibility, don't treat all uppercase identifiers as documentation keywords allUppercaseDocKeyword = false; } }; struct OptionSetVerilog : public OptionSet { OptionSetVerilog() { DefineProperty("fold.comment", &OptionsVerilog::foldComment, "This option enables folding multi-line comments when using the Verilog lexer."); DefineProperty("fold.preprocessor", &OptionsVerilog::foldPreprocessor, "This option enables folding preprocessor directives when using the Verilog lexer."); DefineProperty("fold.compact", &OptionsVerilog::foldCompact); DefineProperty("fold.at.else", &OptionsVerilog::foldAtElse, "This option enables folding on the else line of an if statement."); DefineProperty("fold.verilog.flags", &OptionsVerilog::foldAtModule, "This option enables folding module definitions. Typically source files " "contain only one module definition so this option is somewhat useless."); DefineProperty("lexer.verilog.track.preprocessor", &OptionsVerilog::trackPreprocessor, "Set to 1 to interpret `if/`else/`endif to grey out code that is not active."); DefineProperty("lexer.verilog.update.preprocessor", &OptionsVerilog::updatePreprocessor, "Set to 1 to update preprocessor definitions when `define, `undef, or `undefineall found."); DefineProperty("lexer.verilog.portstyling", &OptionsVerilog::portStyling, "Set to 1 to style input, output, and inout ports differently from regular keywords."); DefineProperty("lexer.verilog.allupperkeywords", &OptionsVerilog::allUppercaseDocKeyword, "Set to 1 to style identifiers that are all uppercase as documentation keyword."); DefineProperty("lexer.verilog.fold.preprocessor.else", &OptionsVerilog::foldPreprocessorElse, "This option enables folding on `else and `elsif preprocessor directives."); } }; const char styleSubable[] = {0}; } class LexerVerilog : public ILexerWithSubStyles { CharacterSet setWord; WordList keywords; WordList keywords2; WordList keywords3; WordList keywords4; WordList keywords5; WordList ppDefinitions; PPStates vlls; std::vector ppDefineHistory; struct SymbolValue { std::string value; std::string arguments; SymbolValue(const std::string &value_="", const std::string &arguments_="") : value(value_), arguments(arguments_) { } SymbolValue &operator = (const std::string &value_) { value = value_; arguments.clear(); return *this; } bool IsMacro() const { return !arguments.empty(); } }; typedef std::map SymbolTable; SymbolTable preprocessorDefinitionsStart; OptionsVerilog options; OptionSetVerilog osVerilog; enum { activeFlag = 0x40 }; SubStyles subStyles; // states at end of line (EOL) during fold operations: // foldExternFlag: EOL while parsing an extern function/task declaration terminated by ';' // foldWaitDisableFlag: EOL while parsing wait or disable statement, terminated by "fork" or '(' // typdefFlag: EOL while parsing typedef statement, terminated by ';' enum {foldExternFlag = 0x01, foldWaitDisableFlag = 0x02, typedefFlag = 0x04, protectedFlag = 0x08}; // map using line number as key to store fold state information std::map foldState; public: LexerVerilog() : setWord(CharacterSet::setAlphaNum, "._", 0x80, true), subStyles(styleSubable, 0x80, 0x40, activeFlag) { } virtual ~LexerVerilog() {} int SCI_METHOD Version() const { return lvSubStyles; } void SCI_METHOD Release() { delete this; } const char* SCI_METHOD PropertyNames() { return osVerilog.PropertyNames(); } int SCI_METHOD PropertyType(const char* name) { return osVerilog.PropertyType(name); } const char* SCI_METHOD DescribeProperty(const char* name) { return osVerilog.DescribeProperty(name); } Sci_Position SCI_METHOD PropertySet(const char* key, const char* val) { return osVerilog.PropertySet(&options, key, val); } const char* SCI_METHOD DescribeWordListSets() { return osVerilog.DescribeWordListSets(); } Sci_Position SCI_METHOD WordListSet(int n, const char* wl); void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void* SCI_METHOD PrivateCall(int, void*) { return 0; } int SCI_METHOD LineEndTypesSupported() { return SC_LINE_END_TYPE_UNICODE; } int SCI_METHOD AllocateSubStyles(int styleBase, int numberStyles) { return subStyles.Allocate(styleBase, numberStyles); } int SCI_METHOD SubStylesStart(int styleBase) { return subStyles.Start(styleBase); } int SCI_METHOD SubStylesLength(int styleBase) { return subStyles.Length(styleBase); } int SCI_METHOD StyleFromSubStyle(int subStyle) { int styleBase = subStyles.BaseStyle(MaskActive(subStyle)); int active = subStyle & activeFlag; return styleBase | active; } int SCI_METHOD PrimaryStyleFromStyle(int style) { return MaskActive(style); } void SCI_METHOD FreeSubStyles() { subStyles.Free(); } void SCI_METHOD SetIdentifiers(int style, const char *identifiers) { subStyles.SetIdentifiers(style, identifiers); } int SCI_METHOD DistanceToSecondaryStyles() { return activeFlag; } const char * SCI_METHOD GetSubStyleBases() { return styleSubable; } static ILexer* LexerFactoryVerilog() { return new LexerVerilog(); } static int MaskActive(int style) { return style & ~activeFlag; } std::vector Tokenize(const std::string &expr) const; }; Sci_Position SCI_METHOD LexerVerilog::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; case 1: wordListN = &keywords2; break; case 2: wordListN = &keywords3; break; case 3: wordListN = &keywords4; break; case 4: wordListN = &keywords5; break; case 5: wordListN = &ppDefinitions; break; } Sci_Position firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; if (n == 5) { // Rebuild preprocessorDefinitions preprocessorDefinitionsStart.clear(); for (int nDefinition = 0; nDefinition < ppDefinitions.Length(); nDefinition++) { const char *cpDefinition = ppDefinitions.WordAt(nDefinition); const char *cpEquals = strchr(cpDefinition, '='); if (cpEquals) { std::string name(cpDefinition, cpEquals - cpDefinition); std::string val(cpEquals+1); size_t bracket = name.find('('); size_t bracketEnd = name.find(')'); if ((bracket != std::string::npos) && (bracketEnd != std::string::npos)) { // Macro std::string args = name.substr(bracket + 1, bracketEnd - bracket - 1); name = name.substr(0, bracket); preprocessorDefinitionsStart[name] = SymbolValue(val, args); } else { preprocessorDefinitionsStart[name] = val; } } else { std::string name(cpDefinition); std::string val("1"); preprocessorDefinitionsStart[name] = val; } } } } } return firstModification; } static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '\''|| ch == '$'); } static inline bool IsAWordStart(const int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '$'); } static inline bool AllUpperCase(const char *a) { while (*a) { if (*a >= 'a' && *a <= 'z') return false; a++; } return true; } // Functor used to truncate history struct After { Sci_Position line; explicit After(Sci_Position line_) : line(line_) {} bool operator()(PPDefinition &p) const { return p.line > line; } }; static std::string GetRestOfLine(LexAccessor &styler, Sci_Position start, bool allowSpace) { std::string restOfLine; Sci_Position i =0; char ch = styler.SafeGetCharAt(start, '\n'); Sci_Position endLine = styler.LineEnd(styler.GetLine(start)); while (((start+i) < endLine) && (ch != '\r')) { char chNext = styler.SafeGetCharAt(start + i + 1, '\n'); if (ch == '/' && (chNext == '/' || chNext == '*')) break; if (allowSpace || (ch != ' ')) restOfLine += ch; i++; ch = chNext; } return restOfLine; } static bool IsSpaceOrTab(int ch) { return ch == ' ' || ch == '\t'; } void SCI_METHOD LexerVerilog::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); const int kwOther=0, kwDot=0x100, kwInput=0x200, kwOutput=0x300, kwInout=0x400, kwProtected=0x800; int lineState = kwOther; bool continuationLine = false; Sci_Position curLine = styler.GetLine(startPos); if (curLine > 0) lineState = styler.GetLineState(curLine - 1); // Do not leak onto next line if (initStyle == SCE_V_STRINGEOL) initStyle = SCE_V_DEFAULT; if ((MaskActive(initStyle) == SCE_V_PREPROCESSOR) || (MaskActive(initStyle) == SCE_V_COMMENTLINE) || (MaskActive(initStyle) == SCE_V_COMMENTLINEBANG)) { // Set continuationLine if last character of previous line is '\' if (curLine > 0) { Sci_Position endLinePrevious = styler.LineEnd(curLine - 1); if (endLinePrevious > 0) { continuationLine = styler.SafeGetCharAt(endLinePrevious-1) == '\\'; } } } StyleContext sc(startPos, length, initStyle, styler); LinePPState preproc = vlls.ForLine(curLine); bool definitionsChanged = false; // Truncate ppDefineHistory before current line if (!options.updatePreprocessor) ppDefineHistory.clear(); std::vector::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(curLine-1)); if (itInvalid != ppDefineHistory.end()) { ppDefineHistory.erase(itInvalid, ppDefineHistory.end()); definitionsChanged = true; } SymbolTable preprocessorDefinitions = preprocessorDefinitionsStart; for (std::vector::iterator itDef = ppDefineHistory.begin(); itDef != ppDefineHistory.end(); ++itDef) { if (itDef->isUndef) preprocessorDefinitions.erase(itDef->key); else preprocessorDefinitions[itDef->key] = SymbolValue(itDef->value, itDef->arguments); } int activitySet = preproc.IsInactive() ? activeFlag : 0; Sci_Position lineEndNext = styler.LineEnd(curLine); bool isEscapedId = false; // true when parsing an escaped Identifier bool isProtected = (lineState&kwProtected) != 0; // true when parsing a protected region for (; sc.More(); sc.Forward()) { if (sc.atLineStart) { if (sc.state == SCE_V_STRING) { // Prevent SCE_V_STRINGEOL from leaking back to previous line sc.SetState(SCE_V_STRING); } if ((MaskActive(sc.state) == SCE_V_PREPROCESSOR) && (!continuationLine)) { sc.SetState(SCE_V_DEFAULT|activitySet); } if (preproc.IsInactive()) { activitySet = activeFlag; sc.SetState(sc.state | activitySet); } } if (sc.atLineEnd) { curLine++; lineEndNext = styler.LineEnd(curLine); vlls.Add(curLine, preproc); // Update the line state, so it can be seen by next line styler.SetLineState(curLine, lineState); isEscapedId = false; // EOL terminates an escaped Identifier } // Handle line continuation generically. if (sc.ch == '\\') { if (static_cast((sc.currentPos+1)) >= lineEndNext) { curLine++; lineEndNext = styler.LineEnd(curLine); vlls.Add(curLine, preproc); // Update the line state, so it can be seen by next line styler.SetLineState(curLine, lineState); sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { // Even in UTF-8, \r and \n are separate sc.Forward(); } continuationLine = true; sc.Forward(); continue; } } // for comment keyword if (MaskActive(sc.state) == SCE_V_COMMENT_WORD && !IsAWordChar(sc.ch)) { char s[100]; int state = lineState & 0xff; sc.GetCurrent(s, sizeof(s)); if (keywords5.InList(s)) { sc.ChangeState(SCE_V_COMMENT_WORD|activitySet); } else { sc.ChangeState(state|activitySet); } sc.SetState(state|activitySet); } const bool atLineEndBeforeSwitch = sc.atLineEnd; // Determine if the current state should terminate. switch (MaskActive(sc.state)) { case SCE_V_OPERATOR: sc.SetState(SCE_V_DEFAULT|activitySet); break; case SCE_V_NUMBER: if (!(IsAWordChar(sc.ch) || (sc.ch == '?'))) { sc.SetState(SCE_V_DEFAULT|activitySet); } break; case SCE_V_IDENTIFIER: if (!isEscapedId &&(!IsAWordChar(sc.ch) || (sc.ch == '.'))) { char s[100]; lineState &= 0xff00; sc.GetCurrent(s, sizeof(s)); if (options.portStyling && (strcmp(s, "input") == 0)) { lineState = kwInput; sc.ChangeState(SCE_V_INPUT|activitySet); } else if (options.portStyling && (strcmp(s, "output") == 0)) { lineState = kwOutput; sc.ChangeState(SCE_V_OUTPUT|activitySet); } else if (options.portStyling && (strcmp(s, "inout") == 0)) { lineState = kwInout; sc.ChangeState(SCE_V_INOUT|activitySet); } else if (lineState == kwInput) { sc.ChangeState(SCE_V_INPUT|activitySet); } else if (lineState == kwOutput) { sc.ChangeState(SCE_V_OUTPUT|activitySet); } else if (lineState == kwInout) { sc.ChangeState(SCE_V_INOUT|activitySet); } else if (lineState == kwDot) { lineState = kwOther; if (options.portStyling) sc.ChangeState(SCE_V_PORT_CONNECT|activitySet); } else if (keywords.InList(s)) { sc.ChangeState(SCE_V_WORD|activitySet); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_V_WORD2|activitySet); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_V_WORD3|activitySet); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_V_USER|activitySet); } else if (options.allUppercaseDocKeyword && AllUpperCase(s)) { sc.ChangeState(SCE_V_USER|activitySet); } sc.SetState(SCE_V_DEFAULT|activitySet); } break; case SCE_V_PREPROCESSOR: if (!IsAWordChar(sc.ch) || sc.atLineEnd) { sc.SetState(SCE_V_DEFAULT|activitySet); } break; case SCE_V_COMMENT: if (sc.Match('*', '/')) { sc.Forward(); sc.ForwardSetState(SCE_V_DEFAULT|activitySet); } else if (IsAWordStart(sc.ch)) { lineState = sc.state | (lineState & 0xff00); sc.SetState(SCE_V_COMMENT_WORD|activitySet); } break; case SCE_V_COMMENTLINE: case SCE_V_COMMENTLINEBANG: if (sc.atLineStart) { sc.SetState(SCE_V_DEFAULT|activitySet); } else if (IsAWordStart(sc.ch)) { lineState = sc.state | (lineState & 0xff00); sc.SetState(SCE_V_COMMENT_WORD|activitySet); } break; case SCE_V_STRING: if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_V_DEFAULT|activitySet); } else if (sc.atLineEnd) { sc.ChangeState(SCE_V_STRINGEOL|activitySet); sc.ForwardSetState(SCE_V_DEFAULT|activitySet); } break; } if (sc.atLineEnd && !atLineEndBeforeSwitch) { // State exit processing consumed characters up to end of line. curLine++; lineEndNext = styler.LineEnd(curLine); vlls.Add(curLine, preproc); // Update the line state, so it can be seen by next line styler.SetLineState(curLine, lineState); isEscapedId = false; // EOL terminates an escaped Identifier } // Determine if a new state should be entered. if (MaskActive(sc.state) == SCE_V_DEFAULT) { if (sc.ch == '`') { sc.SetState(SCE_V_PREPROCESSOR|activitySet); // Skip whitespace between ` and preprocessor word do { sc.Forward(); } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); if (sc.atLineEnd) { sc.SetState(SCE_V_DEFAULT|activitySet); styler.SetLineState(curLine, lineState); } else { if (sc.Match("protected")) { isProtected = true; lineState |= kwProtected; styler.SetLineState(curLine, lineState); } else if (sc.Match("endprotected")) { isProtected = false; lineState &= ~kwProtected; styler.SetLineState(curLine, lineState); } else if (!isProtected && options.trackPreprocessor) { if (sc.Match("ifdef") || sc.Match("ifndef")) { bool isIfDef = sc.Match("ifdef"); int i = isIfDef ? 5 : 6; std::string restOfLine = GetRestOfLine(styler, sc.currentPos + i + 1, false); bool foundDef = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end(); preproc.StartSection(isIfDef == foundDef); } else if (sc.Match("else")) { if (!preproc.CurrentIfTaken()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) { sc.ChangeState(SCE_V_PREPROCESSOR|activitySet); } } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) { sc.ChangeState(SCE_V_PREPROCESSOR|activitySet); } } } else if (sc.Match("elsif")) { // Ensure only one chosen out of `if .. `elsif .. `elsif .. `else .. `endif if (!preproc.CurrentIfTaken()) { // Similar to `ifdef std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true); bool ifGood = preprocessorDefinitions.find(restOfLine) != preprocessorDefinitions.end(); if (ifGood) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_V_PREPROCESSOR|activitySet); } } else if (!preproc.IsInactive()) { preproc.InvertCurrentLevel(); activitySet = preproc.IsInactive() ? activeFlag : 0; if (!activitySet) sc.ChangeState(SCE_V_PREPROCESSOR|activitySet); } } else if (sc.Match("endif")) { preproc.EndSection(); activitySet = preproc.IsInactive() ? activeFlag : 0; sc.ChangeState(SCE_V_PREPROCESSOR|activitySet); } else if (sc.Match("define")) { if (options.updatePreprocessor && !preproc.IsInactive()) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 6, true); size_t startName = 0; while ((startName < restOfLine.length()) && IsSpaceOrTab(restOfLine[startName])) startName++; size_t endName = startName; while ((endName < restOfLine.length()) && setWord.Contains(static_cast(restOfLine[endName]))) endName++; std::string key = restOfLine.substr(startName, endName-startName); if ((endName < restOfLine.length()) && (restOfLine.at(endName) == '(')) { // Macro size_t endArgs = endName; while ((endArgs < restOfLine.length()) && (restOfLine[endArgs] != ')')) endArgs++; std::string args = restOfLine.substr(endName + 1, endArgs - endName - 1); size_t startValue = endArgs+1; while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; std::string value; if (startValue < restOfLine.length()) value = restOfLine.substr(startValue); preprocessorDefinitions[key] = SymbolValue(value, args); ppDefineHistory.push_back(PPDefinition(curLine, key, value, false, args)); definitionsChanged = true; } else { // Value size_t startValue = endName; while ((startValue < restOfLine.length()) && IsSpaceOrTab(restOfLine[startValue])) startValue++; std::string value = restOfLine.substr(startValue); preprocessorDefinitions[key] = value; ppDefineHistory.push_back(PPDefinition(curLine, key, value)); definitionsChanged = true; } } } else if (sc.Match("undefineall")) { if (options.updatePreprocessor && !preproc.IsInactive()) { // remove all preprocessor definitions std::map::iterator itDef; for(itDef = preprocessorDefinitions.begin(); itDef != preprocessorDefinitions.end(); ++itDef) { ppDefineHistory.push_back(PPDefinition(curLine, itDef->first, "", true)); } preprocessorDefinitions.clear(); definitionsChanged = true; } } else if (sc.Match("undef")) { if (options.updatePreprocessor && !preproc.IsInactive()) { std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, true); std::vector tokens = Tokenize(restOfLine); std::string key; if (tokens.size() >= 1) { key = tokens[0]; preprocessorDefinitions.erase(key); ppDefineHistory.push_back(PPDefinition(curLine, key, "", true)); definitionsChanged = true; } } } } } } else if (!isProtected) { if (IsADigit(sc.ch) || (sc.ch == '\'') || (sc.ch == '.' && IsADigit(sc.chNext))) { sc.SetState(SCE_V_NUMBER|activitySet); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_V_IDENTIFIER|activitySet); } else if (sc.Match('/', '*')) { sc.SetState(SCE_V_COMMENT|activitySet); sc.Forward(); // Eat the * so it isn't used for the end of the comment } else if (sc.Match('/', '/')) { if (sc.Match("//!")) // Nice to have a different comment style sc.SetState(SCE_V_COMMENTLINEBANG|activitySet); else sc.SetState(SCE_V_COMMENTLINE|activitySet); } else if (sc.ch == '\"') { sc.SetState(SCE_V_STRING|activitySet); } else if (sc.ch == '\\') { // escaped identifier, everything is ok up to whitespace isEscapedId = true; sc.SetState(SCE_V_IDENTIFIER|activitySet); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '@' || sc.ch == '#') { sc.SetState(SCE_V_OPERATOR|activitySet); if (sc.ch == '.') lineState = kwDot; if (sc.ch == ';') lineState = kwOther; } } } if (isEscapedId && isspacechar(sc.ch)) { isEscapedId = false; } } if (definitionsChanged) { styler.ChangeLexerState(startPos, startPos + length); } sc.Complete(); } static bool IsStreamCommentStyle(int style) { return style == SCE_V_COMMENT; } static bool IsCommentLine(Sci_Position line, LexAccessor &styler) { Sci_Position pos = styler.LineStart(line); Sci_Position eolPos = styler.LineStart(line + 1) - 1; for (Sci_Position i = pos; i < eolPos; i++) { char ch = styler[i]; char chNext = styler.SafeGetCharAt(i + 1); int style = styler.StyleAt(i); if (ch == '/' && chNext == '/' && (style == SCE_V_COMMENTLINE || style == SCE_V_COMMENTLINEBANG)) { return true; } else if (!IsASpaceOrTab(ch)) { return false; } } return false; } // Store both the current line's fold level and the next lines in the // level store to make it easy to pick up with each increment // and to make it possible to fiddle the current level for "} else {". void SCI_METHOD LexerVerilog::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); bool foldAtBrace = 1; bool foldAtParenthese = 1; Sci_Position lineCurrent = styler.GetLine(startPos); // Move back one line to be compatible with LexerModule::Fold behavior, fixes problem with foldComment behavior if (lineCurrent > 0) { lineCurrent--; Sci_Position newStartPos = styler.LineStart(lineCurrent); length += startPos - newStartPos; startPos = newStartPos; initStyle = 0; if (startPos > 0) { initStyle = styler.StyleAt(startPos - 1); } } Sci_PositionU endPos = startPos + length; int visibleChars = 0; int levelCurrent = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; int levelMinCurrent = levelCurrent; int levelNext = levelCurrent; char chNext = styler[startPos]; int styleNext = MaskActive(styler.StyleAt(startPos)); int style = MaskActive(initStyle); // restore fold state (if it exists) for prior line int stateCurrent = 0; std::map::iterator foldStateIterator = foldState.find(lineCurrent-1); if (foldStateIterator != foldState.end()) { stateCurrent = foldStateIterator->second; } // remove all foldState entries after lineCurrent-1 foldStateIterator = foldState.upper_bound(lineCurrent-1); if (foldStateIterator != foldState.end()) { foldState.erase(foldStateIterator, foldState.end()); } for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = MaskActive(styler.StyleAt(i + 1)); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (!(stateCurrent & protectedFlag)) { if (options.foldComment && IsStreamCommentStyle(style)) { if (!IsStreamCommentStyle(stylePrev)) { levelNext++; } else if (!IsStreamCommentStyle(styleNext) && !atEOL) { // Comments don't end at end of line and the next character may be unstyled. levelNext--; } } if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler)) { if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler)) levelNext++; else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent+1, styler)) levelNext--; } if (options.foldComment && (style == SCE_V_COMMENTLINE)) { if ((ch == '/') && (chNext == '/')) { char chNext2 = styler.SafeGetCharAt(i + 2); if (chNext2 == '{') { levelNext++; } else if (chNext2 == '}') { levelNext--; } } } } if (ch == '`') { Sci_PositionU j = i + 1; while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { j++; } if (styler.Match(j, "protected")) { stateCurrent |= protectedFlag; levelNext++; } else if (styler.Match(j, "endprotected")) { stateCurrent &= ~protectedFlag; levelNext--; } else if (!(stateCurrent & protectedFlag) && options.foldPreprocessor && (style == SCE_V_PREPROCESSOR)) { if (styler.Match(j, "if")) { if (options.foldPreprocessorElse) { // Measure the minimum before a begin to allow // folding on "end else begin" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } } levelNext++; } else if (options.foldPreprocessorElse && styler.Match(j, "else")) { levelNext--; if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (options.foldPreprocessorElse && styler.Match(j, "elsif")) { levelNext--; // Measure the minimum before a begin to allow // folding on "end else begin" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (styler.Match(j, "endif")) { levelNext--; } } } if (style == SCE_V_OPERATOR) { if (foldAtParenthese) { if (ch == '(') { levelNext++; } else if (ch == ')') { levelNext--; } } // semicolons terminate external declarations if (ch == ';') { // extern and pure virtual declarations terminated by semicolon if (stateCurrent & foldExternFlag) { levelNext--; stateCurrent &= ~foldExternFlag; } // wait and disable statements terminated by semicolon if (stateCurrent & foldWaitDisableFlag) { stateCurrent &= ~foldWaitDisableFlag; } // typedef statements terminated by semicolon if (stateCurrent & typedefFlag) { stateCurrent &= ~typedefFlag; } } // wait and disable statements containing '(' will not contain "fork" keyword, special processing is not needed if (ch == '(') { if (stateCurrent & foldWaitDisableFlag) { stateCurrent &= ~foldWaitDisableFlag; } } } if (style == SCE_V_OPERATOR) { if (foldAtBrace) { if (ch == '{') { levelNext++; } else if (ch == '}') { levelNext--; } } } if (style == SCE_V_WORD && stylePrev != SCE_V_WORD) { Sci_PositionU j = i; if (styler.Match(j, "case") || styler.Match(j, "casex") || styler.Match(j, "casez") || styler.Match(j, "covergroup") || styler.Match(j, "function") || styler.Match(j, "generate") || styler.Match(j, "interface") || styler.Match(j, "package") || styler.Match(j, "primitive") || styler.Match(j, "program") || styler.Match(j, "sequence") || styler.Match(j, "specify") || styler.Match(j, "table") || styler.Match(j, "task") || (styler.Match(j, "module") && options.foldAtModule)) { levelNext++; } else if (styler.Match(j, "begin")) { // Measure the minimum before a begin to allow // folding on "end else begin" if (levelMinCurrent > levelNext) { levelMinCurrent = levelNext; } levelNext++; } else if (styler.Match(j, "class")) { // class does not introduce a block when used in a typedef statement if (!(stateCurrent & typedefFlag)) levelNext++; } else if (styler.Match(j, "fork")) { // fork does not introduce a block when used in a wait or disable statement if (stateCurrent & foldWaitDisableFlag) { stateCurrent &= ~foldWaitDisableFlag; } else levelNext++; } else if (styler.Match(j, "endcase") || styler.Match(j, "endclass") || styler.Match(j, "endfunction") || styler.Match(j, "endgenerate") || styler.Match(j, "endgroup") || styler.Match(j, "endinterface") || styler.Match(j, "endpackage") || styler.Match(j, "endprimitive") || styler.Match(j, "endprogram") || styler.Match(j, "endsequence") || styler.Match(j, "endspecify") || styler.Match(j, "endtable") || styler.Match(j, "endtask") || styler.Match(j, "join") || styler.Match(j, "join_any") || styler.Match(j, "join_none") || (styler.Match(j, "endmodule") && options.foldAtModule) || (styler.Match(j, "end") && !IsAWordChar(styler.SafeGetCharAt(j + 3)))) { levelNext--; } else if (styler.Match(j, "extern") || styler.Match(j, "pure")) { // extern and pure virtual functions/tasks are terminated by ';' not endfunction/endtask stateCurrent |= foldExternFlag; } else if (styler.Match(j, "disable") || styler.Match(j, "wait")) { // fork does not introduce a block when used in a wait or disable statement stateCurrent |= foldWaitDisableFlag; } else if (styler.Match(j, "typedef")) { stateCurrent |= typedefFlag; } } if (atEOL) { int levelUse = levelCurrent; if (options.foldAtElse||options.foldPreprocessorElse) { levelUse = levelMinCurrent; } int lev = levelUse | levelNext << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (levelUse < levelNext) lev |= SC_FOLDLEVELHEADERFLAG; if (stateCurrent) { foldState[lineCurrent] = stateCurrent; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelCurrent = levelNext; levelMinCurrent = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } } std::vector LexerVerilog::Tokenize(const std::string &expr) const { // Break into tokens std::vector tokens; const char *cp = expr.c_str(); while (*cp) { std::string word; if (setWord.Contains(static_cast(*cp))) { // Identifiers and numbers while (setWord.Contains(static_cast(*cp))) { word += *cp; cp++; } } else if (IsSpaceOrTab(*cp)) { while (IsSpaceOrTab(*cp)) { cp++; } continue; } else { // Should handle strings, characters, and comments here word += *cp; cp++; } tokens.push_back(word); } return tokens; } static const char * const verilogWordLists[] = { "Primary keywords and identifiers", "Secondary keywords and identifiers", "System Tasks", "User defined tasks and identifiers", "Documentation comment keywords", "Preprocessor definitions", 0, }; LexerModule lmVerilog(SCLEX_VERILOG, LexerVerilog::LexerFactoryVerilog, "verilog", verilogWordLists); scintilla/lexers/LexRebol.cxx0000644000175000017500000002500512557522743015260 0ustar neilneil// Scintilla source code edit control /** @file LexRebol.cxx ** Lexer for REBOL. ** Written by Pascal Hurni, inspired from LexLua by Paul Winwood & Marcos E. Wurzius & Philippe Lhoste ** ** History: ** 2005-04-07 First release. ** 2005-04-10 Closing parens and brackets go now in default style ** String and comment nesting should be more safe **/ // Copyright 2005 by Pascal Hurni // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsAWordChar(const int ch) { return (isalnum(ch) || ch == '?' || ch == '!' || ch == '.' || ch == '\'' || ch == '+' || ch == '-' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~'); } static inline bool IsAWordStart(const int ch, const int ch2) { return ((ch == '+' || ch == '-' || ch == '.') && !isdigit(ch2)) || (isalpha(ch) || ch == '?' || ch == '!' || ch == '\'' || ch == '*' || ch == '&' || ch == '|' || ch == '=' || ch == '_' || ch == '~'); } static inline bool IsAnOperator(const int ch, const int ch2, const int ch3) { // One char operators if (IsASpaceOrTab(ch2)) { return ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '<' || ch == '>' || ch == '=' || ch == '?'; } // Two char operators if (IsASpaceOrTab(ch3)) { return (ch == '*' && ch2 == '*') || (ch == '/' && ch2 == '/') || (ch == '<' && (ch2 == '=' || ch2 == '>')) || (ch == '>' && ch2 == '=') || (ch == '=' && (ch2 == '=' || ch2 == '?')) || (ch == '?' && ch2 == '?'); } return false; } static inline bool IsBinaryStart(const int ch, const int ch2, const int ch3, const int ch4) { return (ch == '#' && ch2 == '{') || (IsADigit(ch) && ch2 == '#' && ch3 == '{' ) || (IsADigit(ch) && IsADigit(ch2) && ch3 == '#' && ch4 == '{' ); } static void ColouriseRebolDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; Sci_Position currentLine = styler.GetLine(startPos); // Initialize the braced string {.. { ... } ..} nesting level, if we are inside such a string. int stringLevel = 0; if (initStyle == SCE_REBOL_BRACEDSTRING || initStyle == SCE_REBOL_COMMENTBLOCK) { stringLevel = styler.GetLineState(currentLine - 1); } bool blockComment = initStyle == SCE_REBOL_COMMENTBLOCK; int dotCount = 0; // Do not leak onto next line if (initStyle == SCE_REBOL_COMMENTLINE) { initStyle = SCE_REBOL_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); if (startPos == 0) { sc.SetState(SCE_REBOL_PREFACE); } for (; sc.More(); sc.Forward()) { //--- What to do at line end ? if (sc.atLineEnd) { // Can be either inside a {} string or simply at eol if (sc.state != SCE_REBOL_BRACEDSTRING && sc.state != SCE_REBOL_COMMENTBLOCK && sc.state != SCE_REBOL_BINARY && sc.state != SCE_REBOL_PREFACE) sc.SetState(SCE_REBOL_DEFAULT); // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); switch (sc.state) { case SCE_REBOL_BRACEDSTRING: case SCE_REBOL_COMMENTBLOCK: // Inside a braced string, we set the line state styler.SetLineState(currentLine, stringLevel); break; default: // Reset the line state styler.SetLineState(currentLine, 0); break; } // continue with next char continue; } //--- What to do on white-space ? if (IsASpaceOrTab(sc.ch)) { // Return to default if any of these states if (sc.state == SCE_REBOL_OPERATOR || sc.state == SCE_REBOL_CHARACTER || sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR || sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_FILE || sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME || sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE || sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_EMAIL) { sc.SetState(SCE_REBOL_DEFAULT); } } //--- Specialize state ? // URL, Email look like identifier if (sc.state == SCE_REBOL_IDENTIFIER) { if (sc.ch == ':' && !IsASpace(sc.chNext)) { sc.ChangeState(SCE_REBOL_URL); } else if (sc.ch == '@') { sc.ChangeState(SCE_REBOL_EMAIL); } else if (sc.ch == '$') { sc.ChangeState(SCE_REBOL_MONEY); } } // Words look like identifiers if (sc.state == SCE_REBOL_IDENTIFIER || (sc.state >= SCE_REBOL_WORD && sc.state <= SCE_REBOL_WORD8)) { // Keywords ? if (!IsAWordChar(sc.ch) || sc.Match('/')) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); blockComment = strcmp(s, "comment") == 0; if (keywords8.InList(s)) { sc.ChangeState(SCE_REBOL_WORD8); } else if (keywords7.InList(s)) { sc.ChangeState(SCE_REBOL_WORD7); } else if (keywords6.InList(s)) { sc.ChangeState(SCE_REBOL_WORD6); } else if (keywords5.InList(s)) { sc.ChangeState(SCE_REBOL_WORD5); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_REBOL_WORD4); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_REBOL_WORD3); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_REBOL_WORD2); } else if (keywords.InList(s)) { sc.ChangeState(SCE_REBOL_WORD); } // Keep same style if there are refinements if (!sc.Match('/')) { sc.SetState(SCE_REBOL_DEFAULT); } } // special numbers } else if (sc.state == SCE_REBOL_NUMBER) { switch (sc.ch) { case 'x': sc.ChangeState(SCE_REBOL_PAIR); break; case ':': sc.ChangeState(SCE_REBOL_TIME); break; case '-': case '/': sc.ChangeState(SCE_REBOL_DATE); break; case '.': if (++dotCount >= 2) sc.ChangeState(SCE_REBOL_TUPLE); break; } } //--- Determine if the current state should terminate if (sc.state == SCE_REBOL_QUOTEDSTRING || sc.state == SCE_REBOL_CHARACTER) { if (sc.ch == '^' && sc.chNext == '\"') { sc.Forward(); } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_BRACEDSTRING || sc.state == SCE_REBOL_COMMENTBLOCK) { if (sc.ch == '}') { if (--stringLevel == 0) { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.ch == '{') { stringLevel++; } } else if (sc.state == SCE_REBOL_BINARY) { if (sc.ch == '}') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_TAG) { if (sc.ch == '>') { sc.ForwardSetState(SCE_REBOL_DEFAULT); } } else if (sc.state == SCE_REBOL_PREFACE) { if (sc.MatchIgnoreCase("rebol")) { int i; for (i=5; IsASpaceOrTab(styler.SafeGetCharAt(sc.currentPos+i, 0)); i++); if (sc.GetRelative(i) == '[') sc.SetState(SCE_REBOL_DEFAULT); } } //--- Parens and bracket changes to default style when the current is a number if (sc.state == SCE_REBOL_NUMBER || sc.state == SCE_REBOL_PAIR || sc.state == SCE_REBOL_TUPLE || sc.state == SCE_REBOL_MONEY || sc.state == SCE_REBOL_ISSUE || sc.state == SCE_REBOL_EMAIL || sc.state == SCE_REBOL_URL || sc.state == SCE_REBOL_DATE || sc.state == SCE_REBOL_TIME) { if (sc.ch == '(' || sc.ch == '[' || sc.ch == ')' || sc.ch == ']') { sc.SetState(SCE_REBOL_DEFAULT); } } //--- Determine if a new state should be entered. if (sc.state == SCE_REBOL_DEFAULT) { if (IsAnOperator(sc.ch, sc.chNext, sc.GetRelative(2))) { sc.SetState(SCE_REBOL_OPERATOR); } else if (IsBinaryStart(sc.ch, sc.chNext, sc.GetRelative(2), sc.GetRelative(3))) { sc.SetState(SCE_REBOL_BINARY); } else if (IsAWordStart(sc.ch, sc.chNext)) { sc.SetState(SCE_REBOL_IDENTIFIER); } else if (IsADigit(sc.ch) || sc.ch == '+' || sc.ch == '-' || /*Decimal*/ sc.ch == '.' || sc.ch == ',') { dotCount = 0; sc.SetState(SCE_REBOL_NUMBER); } else if (sc.ch == '\"') { sc.SetState(SCE_REBOL_QUOTEDSTRING); } else if (sc.ch == '{') { sc.SetState(blockComment ? SCE_REBOL_COMMENTBLOCK : SCE_REBOL_BRACEDSTRING); ++stringLevel; } else if (sc.ch == ';') { sc.SetState(SCE_REBOL_COMMENTLINE); } else if (sc.ch == '$') { sc.SetState(SCE_REBOL_MONEY); } else if (sc.ch == '%') { sc.SetState(SCE_REBOL_FILE); } else if (sc.ch == '<') { sc.SetState(SCE_REBOL_TAG); } else if (sc.ch == '#' && sc.chNext == '"') { sc.SetState(SCE_REBOL_CHARACTER); sc.Forward(); } else if (sc.ch == '#' && sc.chNext != '"' && sc.chNext != '{' ) { sc.SetState(SCE_REBOL_ISSUE); } } } sc.Complete(); } static void FoldRebolDoc(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, WordList *[], Accessor &styler) { Sci_PositionU lengthDoc = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); for (Sci_PositionU i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_REBOL_DEFAULT) { if (ch == '[') { levelCurrent++; } else if (ch == ']') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const rebolWordListDesc[] = { "Keywords", 0 }; LexerModule lmREBOL(SCLEX_REBOL, ColouriseRebolDoc, "rebol", FoldRebolDoc, rebolWordListDesc); scintilla/lexers/LexTCMD.cxx0000644000175000017500000004047612557522743014755 0ustar neilneil// Scintilla\ source code edit control /** @file LexTCMD.cxx ** Lexer for Take Command / TCC batch scripts (.bat, .btm, .cmd). **/ // Written by Rex Conn (rconn [at] jpsoft [dot] com) // based on the CMD lexer // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool IsAlphabetic(int ch) { return IsASCII(ch) && isalpha(ch); } static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators static bool IsBOperator(char ch) { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '&') || (ch == '!') || (ch == '?') || (ch == '*') || (ch == '(') || (ch == ')'); } // Tests for BATCH Separators static bool IsBSeparator(char ch) { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == ' ') || (ch == '\t') || (ch == '[') || (ch == ']') || (ch == '\"') || (ch == '\'') || (ch == '/'); } // Find length of CMD FOR variable with modifier (%~...) or return 0 static unsigned int GetBatchVarLen( char *wordBuffer ) { int nLength = 0; if ( wordBuffer[0] == '%' ) { if ( wordBuffer[1] == '~' ) nLength = 2; else if (( wordBuffer[1] == '%' ) && ( wordBuffer[2] == '~' )) nLength++; else return 0; for ( ; ( wordBuffer[nLength] ); nLength++ ) { switch ( toupper(wordBuffer[nLength]) ) { case 'A': // file attributes case 'D': // drive letter only case 'F': // fully qualified path name case 'N': // filename only case 'P': // path only case 'S': // short name case 'T': // date / time of file case 'X': // file extension only case 'Z': // file size break; default: return nLength; } } } return nLength; } static void ColouriseTCMDLine( char *lineBuffer, Sci_PositionU lengthLine, Sci_PositionU startLine, Sci_PositionU endPos, WordList *keywordlists[], Accessor &styler) { Sci_PositionU offset = 0; // Line Buffer Offset char wordBuffer[260]; // Word Buffer - large to catch long paths Sci_PositionU wbl; // Word Buffer Length Sci_PositionU wbo; // Word Buffer Offset - also Special Keyword Buffer Length WordList &keywords = *keywordlists[0]; // Internal Commands // WordList &keywords2 = *keywordlists[1]; // Aliases (optional) bool isDelayedExpansion = 1; // !var! bool continueProcessing = true; // Used to toggle Regular Keyword Checking // Special Keywords are those that allow certain characters without whitespace after the command // Examples are: cd. cd\ echo: echo. path= bool inString = false; // Used for processing while "" // Special Keyword Buffer used to determine if the first n characters is a Keyword char sKeywordBuffer[260] = ""; // Special Keyword Buffer bool sKeywordFound; // Exit Special Keyword for-loop if found // Skip leading whitespace while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); if ( offset >= lengthLine ) return; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { if (lineBuffer[offset + 1] == ':') { // Colorize Fake Label (Comment) - :: is the same as REM styler.ColourTo(endPos, SCE_TCMD_COMMENT); } else { // Colorize Real Label styler.ColourTo(endPos, SCE_TCMD_LABEL); } return; // Check for Comment - return if found } else if (( CompareNCaseInsensitive(lineBuffer+offset, "rem", 3) == 0 ) && (( lineBuffer[offset+3] == 0 ) || ( isspace(lineBuffer[offset+3] )))) { styler.ColourTo(endPos, SCE_TCMD_COMMENT); return; // Check for Drive Change (Drive Change is internal command) - return if found } else if ((IsAlphabetic(lineBuffer[offset])) && (lineBuffer[offset + 1] == ':') && ((isspacechar(lineBuffer[offset + 2])) || (((lineBuffer[offset + 2] == '\\')) && (isspacechar(lineBuffer[offset + 3]))))) { // Colorize Regular Keyword styler.ColourTo(endPos, SCE_TCMD_WORD); return; } // Check for Hide Command (@ECHO OFF/ON) if (lineBuffer[offset] == '@') { styler.ColourTo(startLine + offset, SCE_TCMD_HIDE); offset++; } // Skip whitespace while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Read remainder of line word-at-a-time or remainder-of-word-at-a-time while (offset < lengthLine) { if (offset > startLine) { // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); } // Copy word from Line Buffer into Word Buffer wbl = 0; for (; offset < lengthLine && ( wbl < 260 ) && !isspacechar(lineBuffer[offset]); wbl++, offset++) { wordBuffer[wbl] = static_cast(tolower(lineBuffer[offset])); } wordBuffer[wbl] = '\0'; wbo = 0; // Check for Separator if (IsBSeparator(wordBuffer[0])) { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); if (wordBuffer[0] == '"') inString = !inString; // Check for Regular expression } else if (( wordBuffer[0] == ':' ) && ( wordBuffer[1] == ':' ) && (continueProcessing)) { // Colorize Regular exoressuin styler.ColourTo(startLine + offset - 1, SCE_TCMD_DEFAULT); // No need to Reset Offset // Check for Labels in text (... :label) } else if (wordBuffer[0] == ':' && isspacechar(lineBuffer[offset - wbl - 1])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); // Colorize Label styler.ColourTo(startLine + offset - 1, SCE_TCMD_CLABEL); // No need to Reset Offset // Check for delayed expansion Variable (!x...!) } else if (isDelayedExpansion && wordBuffer[0] == '!') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); wbo++; // Search to end of word for second ! while ((wbo < wbl) && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } if (wordBuffer[wbo] == '!') { wbo++; // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_EXPANSION); } else { wbo = 1; // Colorize Symbol styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT); } // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Regular Keyword in list } else if ((keywords.InList(wordBuffer)) && (!inString) && (continueProcessing)) { // ECHO, PATH, and PROMPT require no further Regular Keyword Checking if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || (CompareCaseInsensitive(wordBuffer, "path") == 0) || (CompareCaseInsensitive(wordBuffer, "prompt") == 0)) { continueProcessing = false; } // Colorize Regular keyword styler.ColourTo(startLine + offset - 1, SCE_TCMD_WORD); // No need to Reset Offset } else if ((wordBuffer[0] != '%') && (wordBuffer[0] != '!') && (!IsBOperator(wordBuffer[0])) && (!inString) && (continueProcessing)) { // a few commands accept "illegal" syntax -- cd\, echo., etc. sscanf( wordBuffer, "%[^.<>|&=\\/]", sKeywordBuffer ); sKeywordFound = false; if ((CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "cd") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "path") == 0) || (CompareCaseInsensitive(sKeywordBuffer, "prompt") == 0)) { // no further Regular Keyword Checking continueProcessing = false; sKeywordFound = true; wbo = (Sci_PositionU)strlen( sKeywordBuffer ); // Colorize Special Keyword as Regular Keyword styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_WORD); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Default Text if (!sKeywordFound) { wbo = 0; // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a) } else if (wordBuffer[0] == '%') { unsigned int varlen; unsigned int n = 1; // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); wbo++; // check for %[nn] syntax if ( wordBuffer[1] == '[' ) { n++; while ((n < wbl) && (wordBuffer[n] != ']')) { n++; } if ( wordBuffer[n] == ']' ) n++; goto ColorizeArg; } // Search to end of word for second % or to the first terminator (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Check for Argument (%n) or (%*) if (((isdigit(wordBuffer[1])) || (wordBuffer[1] == '*')) && (wordBuffer[wbo] != '%')) { while (( wordBuffer[n] ) && ( strchr( "%0123456789*#$", wordBuffer[n] ) != NULL )) n++; ColorizeArg: // Colorize Argument styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - n); // Check for Variable with modifiers (%~...) } else if ((varlen = GetBatchVarLen(wordBuffer)) != 0) { // Colorize Variable styler.ColourTo(startLine + offset - 1 - (wbl - varlen), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - varlen); // Check for Environment Variable (%x...%) } else if (( wordBuffer[1] ) && ( wordBuffer[1] != '%')) { if ( wordBuffer[wbo] == '%' ) wbo++; // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_ENVIRONMENT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Local Variable (%%a) } else if ( (wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] != '%') && (!IsBOperator(wordBuffer[2])) && (!IsBSeparator(wordBuffer[2]))) { n = 2; while (( wordBuffer[n] ) && (!IsBOperator(wordBuffer[n])) && (!IsBSeparator(wordBuffer[n]))) n++; // Colorize Local Variable styler.ColourTo(startLine + offset - 1 - (wbl - n), SCE_TCMD_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - n); // Check for %% } else if ((wbl > 1) && (wordBuffer[1] == '%')) { // Colorize Symbols styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - 2); } else { // Colorize Symbol styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Operator } else if (IsBOperator(wordBuffer[0])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_TCMD_DEFAULT); // Check for Pipe, compound, or conditional Operator if ((wordBuffer[0] == '|') || (wordBuffer[0] == '&')) { // Colorize Pipe Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); continueProcessing = true; // Check for Other Operator } else { // Check for > Operator if ((wordBuffer[0] == '>') || (wordBuffer[0] == '<')) { // Turn Keyword and External Command / Program checking back on continueProcessing = true; } // Colorize Other Operator if (!inString || !(wordBuffer[0] == '(' || wordBuffer[0] == ')')) styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_TCMD_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!isDelayedExpansion || wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_TCMD_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Skip whitespace - nothing happens if Offset was Reset while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } } // Colorize Default Text for remainder of line - currently not lexed styler.ColourTo(endPos, SCE_TCMD_DEFAULT); } static void ColouriseTCMDDoc( Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, WordList *keywordlists[], Accessor &styler ) { char lineBuffer[16384]; styler.StartAt(startPos); styler.StartSegment(startPos); Sci_PositionU linePos = 0; Sci_PositionU startLine = startPos; for (Sci_PositionU i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseTCMDLine(lineBuffer, linePos, startLine, i, keywordlists, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters lineBuffer[linePos] = '\0'; ColouriseTCMDLine(lineBuffer, linePos, startLine, startPos + length - 1, keywordlists, styler); } } // Convert string to upper case static void StrUpr(char *s) { while (*s) { *s = MakeUpperCase(*s); s++; } } // Folding support (for DO, IFF, SWITCH, TEXT, and command groups) static void FoldTCMDDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { Sci_Position line = styler.GetLine(startPos); int level = styler.LevelAt(line); int levelIndent = 0; Sci_PositionU endPos = startPos + length; char s[16] = ""; char chPrev = styler.SafeGetCharAt(startPos - 1); // Scan for ( and ) for (Sci_PositionU i = startPos; i < endPos; i++) { int c = styler.SafeGetCharAt(i, '\n'); int style = styler.StyleAt(i); bool bLineStart = ((chPrev == '\r') || (chPrev == '\n')) || i == 0; if (style == SCE_TCMD_OPERATOR) { // CheckFoldPoint if (c == '(') { levelIndent += 1; } else if (c == ')') { levelIndent -= 1; } } if (( bLineStart ) && ( style == SCE_TCMD_WORD )) { for (Sci_PositionU j = 0; j < 10; j++) { if (!iswordchar(styler[i + j])) { break; } s[j] = styler[i + j]; s[j + 1] = '\0'; } StrUpr( s ); if ((strcmp(s, "DO") == 0) || (strcmp(s, "IFF") == 0) || (strcmp(s, "SWITCH") == 0) || (strcmp(s, "TEXT") == 0)) { levelIndent++; } else if ((strcmp(s, "ENDDO") == 0) || (strcmp(s, "ENDIFF") == 0) || (strcmp(s, "ENDSWITCH") == 0) || (strcmp(s, "ENDTEXT") == 0)) { levelIndent--; } } if (c == '\n') { // line end if (levelIndent > 0) { level |= SC_FOLDLEVELHEADERFLAG; } if (level != styler.LevelAt(line)) styler.SetLevel(line, level); level += levelIndent; if ((level & SC_FOLDLEVELNUMBERMASK) < SC_FOLDLEVELBASE) level = SC_FOLDLEVELBASE; line++; // reset state levelIndent = 0; level &= ~SC_FOLDLEVELHEADERFLAG; level &= ~SC_FOLDLEVELWHITEFLAG; } chPrev = c; } } static const char *const tcmdWordListDesc[] = { "Internal Commands", "Aliases", 0 }; LexerModule lmTCMD(SCLEX_TCMD, ColouriseTCMDDoc, "tcmd", FoldTCMDDoc, tcmdWordListDesc); scintilla/lexers/LexYAML.cxx0000644000175000017500000002521412557522743014761 0ustar neilneil// Scintilla source code edit control /** @file LexYAML.cxx ** Lexer for YAML. **/ // Copyright 2003- by Sean O'Dell // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static const char * const yamlWordListDesc[] = { "Keywords", 0 }; static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } static unsigned int SpaceCount(char* lineBuffer) { if (lineBuffer == NULL) return 0; char* headBuffer = lineBuffer; while (*headBuffer == ' ') headBuffer++; return headBuffer - lineBuffer; } #define YAML_STATE_BITSIZE 16 #define YAML_STATE_MASK (0xFFFF0000) #define YAML_STATE_DOCUMENT (1 << YAML_STATE_BITSIZE) #define YAML_STATE_VALUE (2 << YAML_STATE_BITSIZE) #define YAML_STATE_COMMENT (3 << YAML_STATE_BITSIZE) #define YAML_STATE_TEXT_PARENT (4 << YAML_STATE_BITSIZE) #define YAML_STATE_TEXT (5 << YAML_STATE_BITSIZE) static void ColouriseYAMLLine( char *lineBuffer, Sci_PositionU currentLine, Sci_PositionU lengthLine, Sci_PositionU startLine, Sci_PositionU endPos, WordList &keywords, Accessor &styler) { Sci_PositionU i = 0; bool bInQuotes = false; unsigned int indentAmount = SpaceCount(lineBuffer); if (currentLine > 0) { int parentLineState = styler.GetLineState(currentLine - 1); if ((parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT || (parentLineState&YAML_STATE_MASK) == YAML_STATE_TEXT_PARENT) { unsigned int parentIndentAmount = parentLineState&(~YAML_STATE_MASK); if (indentAmount > parentIndentAmount) { styler.SetLineState(currentLine, YAML_STATE_TEXT | parentIndentAmount); styler.ColourTo(endPos, SCE_YAML_TEXT); return; } } } styler.SetLineState(currentLine, 0); if (strncmp(lineBuffer, "---", 3) == 0) { // Document marker styler.SetLineState(currentLine, YAML_STATE_DOCUMENT); styler.ColourTo(endPos, SCE_YAML_DOCUMENT); return; } // Skip initial spaces while ((i < lengthLine) && lineBuffer[i] == ' ') { // YAML always uses space, never TABS or anything else i++; } if (lineBuffer[i] == '\t') { // if we skipped all spaces, and we are NOT inside a text block, this is wrong styler.ColourTo(endPos, SCE_YAML_ERROR); return; } if (lineBuffer[i] == '#') { // Comment styler.SetLineState(currentLine, YAML_STATE_COMMENT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } while (i < lengthLine) { if (lineBuffer[i] == '\'' || lineBuffer[i] == '\"') { bInQuotes = !bInQuotes; } else if (lineBuffer[i] == ':' && !bInQuotes) { styler.ColourTo(startLine + i - 1, SCE_YAML_IDENTIFIER); styler.ColourTo(startLine + i, SCE_YAML_OPERATOR); // Non-folding scalar i++; while ((i < lengthLine) && isspacechar(lineBuffer[i])) i++; Sci_PositionU endValue = lengthLine - 1; while ((endValue >= i) && isspacechar(lineBuffer[endValue])) endValue--; lineBuffer[endValue + 1] = '\0'; if (lineBuffer[i] == '|' || lineBuffer[i] == '>') { i++; if (lineBuffer[i] == '+' || lineBuffer[i] == '-') i++; while ((i < lengthLine) && isspacechar(lineBuffer[i])) i++; if (lineBuffer[i] == '\0') { styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount); styler.ColourTo(endPos, SCE_YAML_DEFAULT); return; } else if (lineBuffer[i] == '#') { styler.SetLineState(currentLine, YAML_STATE_TEXT_PARENT | indentAmount); styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } else { styler.ColourTo(endPos, SCE_YAML_ERROR); return; } } else if (lineBuffer[i] == '#') { styler.ColourTo(startLine + i - 1, SCE_YAML_DEFAULT); styler.ColourTo(endPos, SCE_YAML_COMMENT); return; } styler.SetLineState(currentLine, YAML_STATE_VALUE); if (lineBuffer[i] == '&' || lineBuffer[i] == '*') { styler.ColourTo(endPos, SCE_YAML_REFERENCE); return; } if (keywords.InList(&lineBuffer[i])) { // Convertible value (true/false, etc.) styler.ColourTo(endPos, SCE_YAML_KEYWORD); return; } else { Sci_PositionU i2 = i; while ((i < lengthLine) && lineBuffer[i]) { if (!(IsASCII(lineBuffer[i]) && isdigit(lineBuffer[i])) && lineBuffer[i] != '-' && lineBuffer[i] != '.' && lineBuffer[i] != ',') { styler.ColourTo(endPos, SCE_YAML_DEFAULT); return; } i++; } if (i > i2) { styler.ColourTo(endPos, SCE_YAML_NUMBER); return; } } break; // shouldn't get here, but just in case, the rest of the line is coloured the default } i++; } styler.ColourTo(endPos, SCE_YAML_DEFAULT); } static void ColouriseYAMLDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) { char lineBuffer[1024] = ""; styler.StartAt(startPos); styler.StartSegment(startPos); Sci_PositionU linePos = 0; Sci_PositionU startLine = startPos; Sci_PositionU endPos = startPos + length; Sci_PositionU maxPos = styler.Length(); Sci_PositionU lineCurrent = styler.GetLine(startPos); for (Sci_PositionU i = startPos; i < maxPos && i < endPos; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, i, *keywordLists[0], styler); linePos = 0; startLine = i + 1; lineCurrent++; } } if (linePos > 0) { // Last line does not have ending characters ColouriseYAMLLine(lineBuffer, lineCurrent, linePos, startLine, startPos + length - 1, *keywordLists[0], styler); } } static bool IsCommentLine(Sci_Position line, Accessor &styler) { Sci_Position pos = styler.LineStart(line); if (styler[pos] == '#') return true; return false; } static void FoldYAMLDoc(Sci_PositionU startPos, Sci_Position length, int /*initStyle - unused*/, WordList *[], Accessor &styler) { const Sci_Position maxPos = startPos + length; const Sci_Position maxLines = styler.GetLine(maxPos - 1); // Requested last line const Sci_Position docLines = styler.GetLine(styler.Length() - 1); // Available last line const bool foldComment = styler.GetPropertyInt("fold.comment.yaml") != 0; // Backtrack to previous non-blank line so we can determine indent level // for any white space lines // and so we can fix any preceding fold level (which is why we go back // at least one line in all cases) int spaceFlags = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); while (lineCurrent > 0) { lineCurrent--; indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, NULL); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG) && (!IsCommentLine(lineCurrent, styler))) break; } int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; // Set up initial loop state int prevComment = 0; if (lineCurrent >= 1) prevComment = foldComment && IsCommentLine(lineCurrent - 1, styler); // Process all characters to end of requested range // or comment that hangs over the end of the range. Cap processing in all cases // to end of document (in case of unclosed comment at end). while ((lineCurrent <= docLines) && ((lineCurrent <= maxLines) || prevComment)) { // Gather info int lev = indentCurrent; Sci_Position lineNext = lineCurrent + 1; int indentNext = indentCurrent; if (lineNext <= docLines) { // Information about next line is only available if not at end of document indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int comment = foldComment && IsCommentLine(lineCurrent, styler); const int comment_start = (comment && !prevComment && (lineNext <= docLines) && IsCommentLine(lineNext, styler) && (lev > SC_FOLDLEVELBASE)); const int comment_continue = (comment && prevComment); if (!comment) indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; if (indentNext & SC_FOLDLEVELWHITEFLAG) indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel; if (comment_start) { // Place fold point at start of a block of comments lev |= SC_FOLDLEVELHEADERFLAG; } else if (comment_continue) { // Add level to rest of lines in the block lev = lev + 1; } // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. while ((lineNext < docLines) && ((indentNext & SC_FOLDLEVELWHITEFLAG) || (lineNext <= docLines && IsCommentLine(lineNext, styler)))) { lineNext++; indentNext = styler.IndentAmount(lineNext, &spaceFlags, NULL); } const int levelAfterComments = indentNext & SC_FOLDLEVELNUMBERMASK; const int levelBeforeComments = Maximum(indentCurrentLevel,levelAfterComments); // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before Sci_Position skipLine = lineNext; int skipLevel = levelAfterComments; while (--skipLine > lineCurrent) { int skipLineIndent = styler.IndentAmount(skipLine, &spaceFlags, NULL); if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) skipLevel = levelBeforeComments; int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; styler.SetLevel(skipLine, skipLevel | whiteFlag); } // Set fold header on non-comment line if (!comment && !(indentCurrent & SC_FOLDLEVELWHITEFLAG) ) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) lev |= SC_FOLDLEVELHEADERFLAG; } // Keep track of block comment state of previous line prevComment = comment_start || comment_continue; // Set fold level for this line and move to next line styler.SetLevel(lineCurrent, lev); indentCurrent = indentNext; lineCurrent = lineNext; } // NOTE: Cannot set level of last line here because indentCurrent doesn't have // header flag set; the loop above is crafted to take care of this case! //styler.SetLevel(lineCurrent, indentCurrent); } LexerModule lmYAML(SCLEX_YAML, ColouriseYAMLDoc, "yaml", FoldYAMLDoc, yamlWordListDesc); scintilla/lexers/LexGAP.cxx0000644000175000017500000001553512557522743014633 0ustar neilneil// Scintilla source code edit control /** @file LexGAP.cxx ** Lexer for the GAP language. (The GAP System for Computational Discrete Algebra) ** http://www.gap-system.org **/ // Copyright 2007 by Istvan Szollosi ( szteven gmail com ) // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool IsGAPOperator(char ch) { if (IsASCII(ch) && isalnum(ch)) return false; if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '^' || ch == ',' || ch == '!' || ch == '.' || ch == '=' || ch == '<' || ch == '>' || ch == '(' || ch == ')' || ch == ';' || ch == '[' || ch == ']' || ch == '{' || ch == '}' || ch == ':' ) return true; return false; } static void GetRange(Sci_PositionU start, Sci_PositionU end, Accessor &styler, char *s, Sci_PositionU len) { Sci_PositionU i = 0; while ((i < end - start + 1) && (i < len-1)) { s[i] = static_cast(styler[start + i]); i++; } s[i] = '\0'; } static void ColouriseGAPDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords1 = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; // Do not leak onto next line if (initStyle == SCE_GAP_STRINGEOL) initStyle = SCE_GAP_DEFAULT; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { // Prevent SCE_GAP_STRINGEOL from leaking back to previous line if ( sc.atLineStart ) { if (sc.state == SCE_GAP_STRING) sc.SetState(SCE_GAP_STRING); if (sc.state == SCE_GAP_CHAR) sc.SetState(SCE_GAP_CHAR); } // Handle line continuation generically if (sc.ch == '\\' ) { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate switch (sc.state) { case SCE_GAP_OPERATOR : sc.SetState(SCE_GAP_DEFAULT); break; case SCE_GAP_NUMBER : if (!IsADigit(sc.ch)) { if (sc.ch == '\\') { if (!sc.atLineEnd) { if (!IsADigit(sc.chNext)) { sc.Forward(); sc.ChangeState(SCE_GAP_IDENTIFIER); } } } else if (isalpha(sc.ch) || sc.ch == '_') { sc.ChangeState(SCE_GAP_IDENTIFIER); } else sc.SetState(SCE_GAP_DEFAULT); } break; case SCE_GAP_IDENTIFIER : if (!(iswordstart(static_cast(sc.ch)) || sc.ch == '$')) { if (sc.ch == '\\') sc.Forward(); else { char s[1000]; sc.GetCurrent(s, sizeof(s)); if (keywords1.InList(s)) { sc.ChangeState(SCE_GAP_KEYWORD); } else if (keywords2.InList(s)) { sc.ChangeState(SCE_GAP_KEYWORD2); } else if (keywords3.InList(s)) { sc.ChangeState(SCE_GAP_KEYWORD3); } else if (keywords4.InList(s)) { sc.ChangeState(SCE_GAP_KEYWORD4); } sc.SetState(SCE_GAP_DEFAULT); } } break; case SCE_GAP_COMMENT : if (sc.atLineEnd) { sc.SetState(SCE_GAP_DEFAULT); } break; case SCE_GAP_STRING: if (sc.atLineEnd) { sc.ChangeState(SCE_GAP_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\"') { sc.ForwardSetState(SCE_GAP_DEFAULT); } break; case SCE_GAP_CHAR: if (sc.atLineEnd) { sc.ChangeState(SCE_GAP_STRINGEOL); } else if (sc.ch == '\\') { if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { sc.Forward(); } } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_GAP_DEFAULT); } break; case SCE_GAP_STRINGEOL: if (sc.atLineStart) { sc.SetState(SCE_GAP_DEFAULT); } break; } // Determine if a new state should be entered if (sc.state == SCE_GAP_DEFAULT) { if (IsGAPOperator(static_cast(sc.ch))) { sc.SetState(SCE_GAP_OPERATOR); } else if (IsADigit(sc.ch)) { sc.SetState(SCE_GAP_NUMBER); } else if (isalpha(sc.ch) || sc.ch == '_' || sc.ch == '\\' || sc.ch == '$' || sc.ch == '~') { sc.SetState(SCE_GAP_IDENTIFIER); if (sc.ch == '\\') sc.Forward(); } else if (sc.ch == '#') { sc.SetState(SCE_GAP_COMMENT); } else if (sc.ch == '\"') { sc.SetState(SCE_GAP_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_GAP_CHAR); } } } sc.Complete(); } static int ClassifyFoldPointGAP(const char* s) { int level = 0; if (strcmp(s, "function") == 0 || strcmp(s, "do") == 0 || strcmp(s, "if") == 0 || strcmp(s, "repeat") == 0 ) { level = 1; } else if (strcmp(s, "end") == 0 || strcmp(s, "od") == 0 || strcmp(s, "fi") == 0 || strcmp(s, "until") == 0 ) { level = -1; } return level; } static void FoldGAPDoc( Sci_PositionU startPos, Sci_Position length, int initStyle, WordList** , Accessor &styler) { Sci_PositionU endPos = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); int style = initStyle; Sci_Position lastStart = 0; for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (stylePrev != SCE_GAP_KEYWORD && style == SCE_GAP_KEYWORD) { // Store last word start point. lastStart = i; } if (stylePrev == SCE_GAP_KEYWORD) { if(iswordchar(ch) && !iswordchar(chNext)) { char s[100]; GetRange(lastStart, i, styler, s, sizeof(s)); levelCurrent += ClassifyFoldPointGAP(s); } } if (atEOL) { int lev = levelPrev; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const GAPWordListDesc[] = { "Keywords 1", "Keywords 2", "Keywords 3 (unused)", "Keywords 4 (unused)", 0 }; LexerModule lmGAP( SCLEX_GAP, ColouriseGAPDoc, "gap", FoldGAPDoc, GAPWordListDesc); scintilla/lexers/LexErlang.cxx0000644000175000017500000004006712557522743015432 0ustar neilneil// Scintilla source code edit control // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. /** @file LexErlang.cxx ** Lexer for Erlang. ** Enhanced by Etienne 'Lenain' Girondel (lenaing@gmail.com) ** Originally wrote by Peter-Henry Mander, ** based on Matlab lexer by Jos Fonseca. **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static int is_radix(int radix, int ch) { int digit; if (36 < radix || 2 > radix) return 0; if (isdigit(ch)) { digit = ch - '0'; } else if (isalnum(ch)) { digit = toupper(ch) - 'A' + 10; } else { return 0; } return (digit < radix); } typedef enum { STATE_NULL, COMMENT, COMMENT_FUNCTION, COMMENT_MODULE, COMMENT_DOC, COMMENT_DOC_MACRO, ATOM_UNQUOTED, ATOM_QUOTED, NODE_NAME_UNQUOTED, NODE_NAME_QUOTED, MACRO_START, MACRO_UNQUOTED, MACRO_QUOTED, RECORD_START, RECORD_UNQUOTED, RECORD_QUOTED, NUMERAL_START, NUMERAL_BASE_VALUE, NUMERAL_FLOAT, NUMERAL_EXPONENT, PREPROCESSOR } atom_parse_state_t; static inline bool IsAWordChar(const int ch) { return (ch < 0x80) && (ch != ' ') && (isalnum(ch) || ch == '_'); } static void ColouriseErlangDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { StyleContext sc(startPos, length, initStyle, styler); WordList &reservedWords = *keywordlists[0]; WordList &erlangBIFs = *keywordlists[1]; WordList &erlangPreproc = *keywordlists[2]; WordList &erlangModulesAtt = *keywordlists[3]; WordList &erlangDoc = *keywordlists[4]; WordList &erlangDocMacro = *keywordlists[5]; int radix_digits = 0; int exponent_digits = 0; atom_parse_state_t parse_state = STATE_NULL; atom_parse_state_t old_parse_state = STATE_NULL; bool to_late_to_comment = false; char cur[100]; int old_style = SCE_ERLANG_DEFAULT; styler.StartAt(startPos); for (; sc.More(); sc.Forward()) { int style = SCE_ERLANG_DEFAULT; if (STATE_NULL != parse_state) { switch (parse_state) { case STATE_NULL : sc.SetState(SCE_ERLANG_DEFAULT); break; /* COMMENTS ------------------------------------------------------*/ case COMMENT : { if (sc.ch != '%') { to_late_to_comment = true; } else if (!to_late_to_comment && sc.ch == '%') { // Switch to comment level 2 (Function) sc.ChangeState(SCE_ERLANG_COMMENT_FUNCTION); old_style = SCE_ERLANG_COMMENT_FUNCTION; parse_state = COMMENT_FUNCTION; sc.Forward(); } } // V--- Falling through! case COMMENT_FUNCTION : { if (sc.ch != '%') { to_late_to_comment = true; } else if (!to_late_to_comment && sc.ch == '%') { // Switch to comment level 3 (Module) sc.ChangeState(SCE_ERLANG_COMMENT_MODULE); old_style = SCE_ERLANG_COMMENT_MODULE; parse_state = COMMENT_MODULE; sc.Forward(); } } // V--- Falling through! case COMMENT_MODULE : { if (parse_state != COMMENT) { // Search for comment documentation if (sc.chNext == '@') { old_parse_state = parse_state; parse_state = ('{' == sc.ch) ? COMMENT_DOC_MACRO : COMMENT_DOC; sc.ForwardSetState(sc.state); } } // All comments types fall here. if (sc.atLineEnd) { to_late_to_comment = false; sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case COMMENT_DOC : // V--- Falling through! case COMMENT_DOC_MACRO : { if (!isalnum(sc.ch)) { // Try to match documentation comment sc.GetCurrent(cur, sizeof(cur)); if (parse_state == COMMENT_DOC_MACRO && erlangDocMacro.InList(cur)) { sc.ChangeState(SCE_ERLANG_COMMENT_DOC_MACRO); while (sc.ch != '}' && !sc.atLineEnd) sc.Forward(); } else if (erlangDoc.InList(cur)) { sc.ChangeState(SCE_ERLANG_COMMENT_DOC); } else { sc.ChangeState(old_style); } // Switch back to old state sc.SetState(old_style); parse_state = old_parse_state; } if (sc.atLineEnd) { to_late_to_comment = false; sc.ChangeState(old_style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Atoms ---------------------------------------------------------*/ case ATOM_UNQUOTED : { if ('@' == sc.ch){ parse_state = NODE_NAME_UNQUOTED; } else if (sc.ch == ':') { // Searching for module name if (sc.chNext == ' ') { // error sc.ChangeState(SCE_ERLANG_UNKNOWN); parse_state = STATE_NULL; } else { sc.Forward(); if (isalnum(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); sc.ChangeState(SCE_ERLANG_MODULES); sc.SetState(SCE_ERLANG_MODULES); } } } else if (!IsAWordChar(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); if (reservedWords.InList(cur)) { style = SCE_ERLANG_KEYWORD; } else if (erlangBIFs.InList(cur) && strcmp(cur,"erlang:")){ style = SCE_ERLANG_BIFS; } else if (sc.ch == '(' || '/' == sc.ch){ style = SCE_ERLANG_FUNCTION_NAME; } else { style = SCE_ERLANG_ATOM; } sc.ChangeState(style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case ATOM_QUOTED : { if ( '@' == sc.ch ){ parse_state = NODE_NAME_QUOTED; } else if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_ATOM); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Node names ----------------------------------------------------*/ case NODE_NAME_UNQUOTED : { if ('@' == sc.ch) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_NODE_NAME); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case NODE_NAME_QUOTED : { if ('@' == sc.ch) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_NODE_NAME_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Records -------------------------------------------------------*/ case RECORD_START : { if ('\'' == sc.ch) { parse_state = RECORD_QUOTED; } else if (isalpha(sc.ch) && islower(sc.ch)) { parse_state = RECORD_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case RECORD_UNQUOTED : { if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_RECORD); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case RECORD_QUOTED : { if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_RECORD_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Macros --------------------------------------------------------*/ case MACRO_START : { if ('\'' == sc.ch) { parse_state = MACRO_QUOTED; } else if (isalpha(sc.ch)) { parse_state = MACRO_UNQUOTED; } else { // error sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case MACRO_UNQUOTED : { if (!IsAWordChar(sc.ch)) { sc.ChangeState(SCE_ERLANG_MACRO); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; case MACRO_QUOTED : { if ('\'' == sc.ch && '\\' != sc.chPrev) { sc.ChangeState(SCE_ERLANG_MACRO_QUOTED); sc.ForwardSetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* -------------------------------------------------------------- */ /* Numerics ------------------------------------------------------*/ /* Simple integer */ case NUMERAL_START : { if (isdigit(sc.ch)) { radix_digits *= 10; radix_digits += sc.ch - '0'; // Assuming ASCII here! } else if ('#' == sc.ch) { if (2 > radix_digits || 36 < radix_digits) { sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { parse_state = NUMERAL_BASE_VALUE; } } else if ('.' == sc.ch && isdigit(sc.chNext)) { radix_digits = 0; parse_state = NUMERAL_FLOAT; } else if ('e' == sc.ch || 'E' == sc.ch) { exponent_digits = 0; parse_state = NUMERAL_EXPONENT; } else { radix_digits = 0; sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Integer in other base than 10 (x#yyy) */ case NUMERAL_BASE_VALUE : { if (!is_radix(radix_digits,sc.ch)) { radix_digits = 0; if (!isalnum(sc.ch)) sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Float (x.yyy) */ case NUMERAL_FLOAT : { if ('e' == sc.ch || 'E' == sc.ch) { exponent_digits = 0; parse_state = NUMERAL_EXPONENT; } else if (!isdigit(sc.ch)) { sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; /* Exponent, either integer or float (xEyy, x.yyEzzz) */ case NUMERAL_EXPONENT : { if (('-' == sc.ch || '+' == sc.ch) && (isdigit(sc.chNext))) { sc.Forward(); } else if (!isdigit(sc.ch)) { if (0 < exponent_digits) sc.ChangeState(SCE_ERLANG_NUMBER); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } else { ++exponent_digits; } } break; /* -------------------------------------------------------------- */ /* Preprocessor --------------------------------------------------*/ case PREPROCESSOR : { if (!IsAWordChar(sc.ch)) { sc.GetCurrent(cur, sizeof(cur)); if (erlangPreproc.InList(cur)) { style = SCE_ERLANG_PREPROC; } else if (erlangModulesAtt.InList(cur)) { style = SCE_ERLANG_MODULES_ATT; } sc.ChangeState(style); sc.SetState(SCE_ERLANG_DEFAULT); parse_state = STATE_NULL; } } break; } } /* End of : STATE_NULL != parse_state */ else { switch (sc.state) { case SCE_ERLANG_VARIABLE : { if (!IsAWordChar(sc.ch)) sc.SetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_STRING : { if (sc.ch == '\"' && sc.chPrev != '\\') sc.ForwardSetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_COMMENT : { if (sc.atLineEnd) sc.SetState(SCE_ERLANG_DEFAULT); } break; case SCE_ERLANG_CHARACTER : { if (sc.chPrev == '\\') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if (sc.ch != '\\') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } } break; case SCE_ERLANG_OPERATOR : { if (sc.chPrev == '.') { if (sc.ch == '*' || sc.ch == '/' || sc.ch == '\\' || sc.ch == '^') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else if (sc.ch == '\'') { sc.ForwardSetState(SCE_ERLANG_DEFAULT); } else { sc.SetState(SCE_ERLANG_DEFAULT); } } else { sc.SetState(SCE_ERLANG_DEFAULT); } } break; } } if (sc.state == SCE_ERLANG_DEFAULT) { bool no_new_state = false; switch (sc.ch) { case '\"' : sc.SetState(SCE_ERLANG_STRING); break; case '$' : sc.SetState(SCE_ERLANG_CHARACTER); break; case '%' : { parse_state = COMMENT; sc.SetState(SCE_ERLANG_COMMENT); } break; case '#' : { parse_state = RECORD_START; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '?' : { parse_state = MACRO_START; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '\'' : { parse_state = ATOM_QUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } break; case '+' : case '-' : { if (IsADigit(sc.chNext)) { parse_state = NUMERAL_START; radix_digits = 0; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (sc.ch != '+') { parse_state = PREPROCESSOR; sc.SetState(SCE_ERLANG_UNKNOWN); } } break; default : no_new_state = true; } if (no_new_state) { if (isdigit(sc.ch)) { parse_state = NUMERAL_START; radix_digits = sc.ch - '0'; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isupper(sc.ch) || '_' == sc.ch) { sc.SetState(SCE_ERLANG_VARIABLE); } else if (isalpha(sc.ch)) { parse_state = ATOM_UNQUOTED; sc.SetState(SCE_ERLANG_UNKNOWN); } else if (isoperator(static_cast(sc.ch)) || sc.ch == '\\') { sc.SetState(SCE_ERLANG_OPERATOR); } } } } sc.Complete(); } static int ClassifyErlangFoldPoint( Accessor &styler, int styleNext, Sci_Position keyword_start ) { int lev = 0; if (styler.Match(keyword_start,"case") || ( styler.Match(keyword_start,"fun") && (SCE_ERLANG_FUNCTION_NAME != styleNext) ) || styler.Match(keyword_start,"if") || styler.Match(keyword_start,"query") || styler.Match(keyword_start,"receive") ) { ++lev; } else if (styler.Match(keyword_start,"end")) { --lev; } return lev; } static void FoldErlangDoc( Sci_PositionU startPos, Sci_Position length, int initStyle, WordList** /*keywordlists*/, Accessor &styler ) { Sci_PositionU endPos = startPos + length; Sci_Position currentLine = styler.GetLine(startPos); int lev; int previousLevel = styler.LevelAt(currentLine) & SC_FOLDLEVELNUMBERMASK; int currentLevel = previousLevel; int styleNext = styler.StyleAt(startPos); int style = initStyle; int stylePrev; Sci_Position keyword_start = 0; char ch; char chNext = styler.SafeGetCharAt(startPos); bool atEOL; for (Sci_PositionU i = startPos; i < endPos; i++) { ch = chNext; chNext = styler.SafeGetCharAt(i + 1); // Get styles stylePrev = style; style = styleNext; styleNext = styler.StyleAt(i + 1); atEOL = ((ch == '\r') && (chNext != '\n')) || (ch == '\n'); if (stylePrev != SCE_ERLANG_KEYWORD && style == SCE_ERLANG_KEYWORD) { keyword_start = i; } // Fold on keywords if (stylePrev == SCE_ERLANG_KEYWORD && style != SCE_ERLANG_KEYWORD && style != SCE_ERLANG_ATOM ) { currentLevel += ClassifyErlangFoldPoint(styler, styleNext, keyword_start); } // Fold on comments if (style == SCE_ERLANG_COMMENT || style == SCE_ERLANG_COMMENT_MODULE || style == SCE_ERLANG_COMMENT_FUNCTION) { if (ch == '%' && chNext == '{') { currentLevel++; } else if (ch == '%' && chNext == '}') { currentLevel--; } } // Fold on braces if (style == SCE_ERLANG_OPERATOR) { if (ch == '{' || ch == '(' || ch == '[') { currentLevel++; } else if (ch == '}' || ch == ')' || ch == ']') { currentLevel--; } } if (atEOL) { lev = previousLevel; if (currentLevel > previousLevel) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(currentLine)) styler.SetLevel(currentLine, lev); currentLine++; previousLevel = currentLevel; } } // Fill in the real level of the next line, keeping the current flags as they will be filled in later styler.SetLevel(currentLine, previousLevel | (styler.LevelAt(currentLine) & ~SC_FOLDLEVELNUMBERMASK)); } static const char * const erlangWordListDesc[] = { "Erlang Reserved words", "Erlang BIFs", "Erlang Preprocessor", "Erlang Module Attributes", "Erlang Documentation", "Erlang Documentation Macro", 0 }; LexerModule lmErlang( SCLEX_ERLANG, ColouriseErlangDoc, "erlang", FoldErlangDoc, erlangWordListDesc); scintilla/lexers/LexProps.cxx0000644000175000017500000001256712557522743015331 0ustar neilneil// Scintilla source code edit control /** @file LexProps.cxx ** Lexer for properties files. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } static inline bool isassignchar(unsigned char ch) { return (ch == '=') || (ch == ':'); } static void ColourisePropsLine( char *lineBuffer, Sci_PositionU lengthLine, Sci_PositionU startLine, Sci_PositionU endPos, Accessor &styler, bool allowInitialSpaces) { Sci_PositionU i = 0; if (allowInitialSpaces) { while ((i < lengthLine) && isspacechar(lineBuffer[i])) // Skip initial spaces i++; } else { if (isspacechar(lineBuffer[i])) // don't allow initial spaces i = lengthLine; } if (i < lengthLine) { if (lineBuffer[i] == '#' || lineBuffer[i] == '!' || lineBuffer[i] == ';') { styler.ColourTo(endPos, SCE_PROPS_COMMENT); } else if (lineBuffer[i] == '[') { styler.ColourTo(endPos, SCE_PROPS_SECTION); } else if (lineBuffer[i] == '@') { styler.ColourTo(startLine + i, SCE_PROPS_DEFVAL); if (isassignchar(lineBuffer[i++])) styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } else { // Search for the '=' character while ((i < lengthLine) && !isassignchar(lineBuffer[i])) i++; if ((i < lengthLine) && isassignchar(lineBuffer[i])) { styler.ColourTo(startLine + i - 1, SCE_PROPS_KEY); styler.ColourTo(startLine + i, SCE_PROPS_ASSIGNMENT); styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } else { styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } } } else { styler.ColourTo(endPos, SCE_PROPS_DEFAULT); } } static void ColourisePropsDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); Sci_PositionU linePos = 0; Sci_PositionU startLine = startPos; // property lexer.props.allow.initial.spaces // For properties files, set to 0 to style all lines that start with whitespace in the default style. // This is not suitable for SciTE .properties files which use indentation for flow control but // can be used for RFC2822 text where indentation is used for continuation lines. bool allowInitialSpaces = styler.GetPropertyInt("lexer.props.allow.initial.spaces", 1) != 0; for (Sci_PositionU i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColourisePropsLine(lineBuffer, linePos, startLine, i, styler, allowInitialSpaces); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters ColourisePropsLine(lineBuffer, linePos, startLine, startPos + length - 1, styler, allowInitialSpaces); } } // adaption by ksc, using the "} else {" trick of 1.53 // 030721 static void FoldPropsDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; Sci_PositionU endPos = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); char chNext = styler[startPos]; int styleNext = styler.StyleAt(startPos); bool headerPoint = false; int lev; for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler[i+1]; int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if (style == SCE_PROPS_SECTION) { headerPoint = true; } if (atEOL) { lev = SC_FOLDLEVELBASE; if (lineCurrent > 0) { int levelPrevious = styler.LevelAt(lineCurrent - 1); if (levelPrevious & SC_FOLDLEVELHEADERFLAG) { lev = SC_FOLDLEVELBASE + 1; } else { lev = levelPrevious & SC_FOLDLEVELNUMBERMASK; } } if (headerPoint) { lev = SC_FOLDLEVELBASE; } if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if (headerPoint) { lev |= SC_FOLDLEVELHEADERFLAG; } if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; visibleChars = 0; headerPoint = false; } if (!isspacechar(ch)) visibleChars++; } if (lineCurrent > 0) { int levelPrevious = styler.LevelAt(lineCurrent - 1); if (levelPrevious & SC_FOLDLEVELHEADERFLAG) { lev = SC_FOLDLEVELBASE + 1; } else { lev = levelPrevious & SC_FOLDLEVELNUMBERMASK; } } else { lev = SC_FOLDLEVELBASE; } int flagsNext = styler.LevelAt(lineCurrent); styler.SetLevel(lineCurrent, lev | (flagsNext & ~SC_FOLDLEVELNUMBERMASK)); } static const char *const emptyWordListDesc[] = { 0 }; LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", FoldPropsDoc, emptyWordListDesc); scintilla/lexers/LexPerl.cxx0000644000175000017500000015357412557522743015134 0ustar neilneil// Scintilla source code edit control /** @file LexPerl.cxx ** Lexer for Perl. ** Converted to lexer object by "Udo Lechner" **/ // Copyright 1998-2008 by Neil Hodgson // Lexical analysis fixes by Kein-Hong Man // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #include "OptionSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Info for HERE document handling from perldata.pod (reformatted): // ---------------------------------------------------------------- // A line-oriented form of quoting is based on the shell ``here-doc'' syntax. // Following a << you specify a string to terminate the quoted material, and // all lines following the current line down to the terminating string are // the value of the item. // * The terminating string may be either an identifier (a word), or some // quoted text. // * If quoted, the type of quotes you use determines the treatment of the // text, just as in regular quoting. // * An unquoted identifier works like double quotes. // * There must be no space between the << and the identifier. // (If you put a space it will be treated as a null identifier, // which is valid, and matches the first empty line.) // (This is deprecated, -w warns of this syntax) // * The terminating string must appear by itself (unquoted and // with no surrounding whitespace) on the terminating line. #define HERE_DELIM_MAX 256 // maximum length of HERE doc delimiter #define PERLNUM_BINARY 1 // order is significant: 1-4 cannot have a dot #define PERLNUM_HEX 2 #define PERLNUM_OCTAL 3 #define PERLNUM_FLOAT_EXP 4 // exponent part only #define PERLNUM_DECIMAL 5 // 1-5 are numbers; 6-7 are strings #define PERLNUM_VECTOR 6 #define PERLNUM_V_VECTOR 7 #define PERLNUM_BAD 8 #define BACK_NONE 0 // lookback state for bareword disambiguation: #define BACK_OPERATOR 1 // whitespace/comments are insignificant #define BACK_KEYWORD 2 // operators/keywords are needed for disambiguation // all interpolated styles are different from their parent styles by a constant difference // we also assume SCE_PL_STRING_VAR is the interpolated style with the smallest value #define INTERPOLATE_SHIFT (SCE_PL_STRING_VAR - SCE_PL_STRING) static bool isPerlKeyword(Sci_PositionU start, Sci_PositionU end, WordList &keywords, LexAccessor &styler) { // old-style keyword matcher; needed because GetCurrent() needs // current segment to be committed, but we may abandon early... char s[100]; Sci_PositionU i, len = end - start; if (len > 30) { len = 30; } for (i = 0; i < len; i++, start++) s[i] = styler[start]; s[i] = '\0'; return keywords.InList(s); } static int disambiguateBareword(LexAccessor &styler, Sci_PositionU bk, Sci_PositionU fw, int backFlag, Sci_PositionU backPos, Sci_PositionU endPos) { // identifiers are recognized by Perl as barewords under some // conditions, the following attempts to do the disambiguation // by looking backward and forward; result in 2 LSB int result = 0; bool moreback = false; // true if passed newline/comments bool brace = false; // true if opening brace found // if BACK_NONE, neither operator nor keyword, so skip test if (backFlag == BACK_NONE) return result; // first look backwards past whitespace/comments to set EOL flag // (some disambiguation patterns must be on a single line) if (backPos <= static_cast(styler.LineStart(styler.GetLine(bk)))) moreback = true; // look backwards at last significant lexed item for disambiguation bk = backPos - 1; int ch = static_cast(styler.SafeGetCharAt(bk)); if (ch == '{' && !moreback) { // {bareword: possible variable spec brace = true; } else if ((ch == '&' && styler.SafeGetCharAt(bk - 1) != '&') // &bareword: subroutine call || styler.Match(bk - 1, "->") // ->bareword: part of variable spec || styler.Match(bk - 2, "sub")) { // sub bareword: subroutine declaration // (implied BACK_KEYWORD, no keywords end in 'sub'!) result |= 1; } // next, scan forward after word past tab/spaces only; // if ch isn't one of '[{(,' we can skip the test if ((ch == '{' || ch == '(' || ch == '['|| ch == ',') && fw < endPos) { while (ch = static_cast(styler.SafeGetCharAt(fw)), IsASpaceOrTab(ch) && fw < endPos) { fw++; } if ((ch == '}' && brace) // {bareword}: variable spec || styler.Match(fw, "=>")) { // [{(, bareword=>: hash literal result |= 2; } } return result; } static void skipWhitespaceComment(LexAccessor &styler, Sci_PositionU &p) { // when backtracking, we need to skip whitespace and comments int style; while ((p > 0) && (style = styler.StyleAt(p), style == SCE_PL_DEFAULT || style == SCE_PL_COMMENTLINE)) p--; } static int styleBeforeBracePair(LexAccessor &styler, Sci_PositionU bk) { // backtrack to find open '{' corresponding to a '}', balanced // return significant style to be tested for '/' disambiguation int braceCount = 1; if (bk == 0) return SCE_PL_DEFAULT; while (--bk > 0) { if (styler.StyleAt(bk) == SCE_PL_OPERATOR) { int bkch = static_cast(styler.SafeGetCharAt(bk)); if (bkch == ';') { // early out break; } else if (bkch == '}') { braceCount++; } else if (bkch == '{') { if (--braceCount == 0) break; } } } if (bk > 0 && braceCount == 0) { // balanced { found, bk > 0, skip more whitespace/comments bk--; skipWhitespaceComment(styler, bk); return styler.StyleAt(bk); } return SCE_PL_DEFAULT; } static int styleCheckIdentifier(LexAccessor &styler, Sci_PositionU bk) { // backtrack to classify sub-styles of identifier under test // return sub-style to be tested for '/' disambiguation if (styler.SafeGetCharAt(bk) == '>') // inputsymbol, like return 1; // backtrack to check for possible "->" or "::" before identifier while (bk > 0 && styler.StyleAt(bk) == SCE_PL_IDENTIFIER) { bk--; } while (bk > 0) { int bkstyle = styler.StyleAt(bk); if (bkstyle == SCE_PL_DEFAULT || bkstyle == SCE_PL_COMMENTLINE) { // skip whitespace, comments } else if (bkstyle == SCE_PL_OPERATOR) { // test for "->" and "::" if (styler.Match(bk - 1, "->") || styler.Match(bk - 1, "::")) return 2; } else return 3; // bare identifier bk--; } return 0; } static int podLineScan(LexAccessor &styler, Sci_PositionU &pos, Sci_PositionU endPos) { // forward scan the current line to classify line for POD style int state = -1; while (pos < endPos) { int ch = static_cast(styler.SafeGetCharAt(pos)); if (ch == '\n' || ch == '\r') { if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++; break; } if (IsASpaceOrTab(ch)) { // whitespace, take note if (state == -1) state = SCE_PL_DEFAULT; } else if (state == SCE_PL_DEFAULT) { // verbatim POD line state = SCE_PL_POD_VERB; } else if (state != SCE_PL_POD_VERB) { // regular POD line state = SCE_PL_POD; } pos++; } if (state == -1) state = SCE_PL_DEFAULT; return state; } static bool styleCheckSubPrototype(LexAccessor &styler, Sci_PositionU bk) { // backtrack to identify if we're starting a subroutine prototype // we also need to ignore whitespace/comments: // 'sub' [whitespace|comment] [whitespace|comment] styler.Flush(); skipWhitespaceComment(styler, bk); if (bk == 0 || styler.StyleAt(bk) != SCE_PL_IDENTIFIER) // check identifier return false; while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_IDENTIFIER)) { bk--; } skipWhitespaceComment(styler, bk); if (bk < 2 || styler.StyleAt(bk) != SCE_PL_WORD // check "sub" keyword || !styler.Match(bk - 2, "sub")) // assume suffix is unique! return false; return true; } static int actualNumStyle(int numberStyle) { if (numberStyle == PERLNUM_VECTOR || numberStyle == PERLNUM_V_VECTOR) { return SCE_PL_STRING; } else if (numberStyle == PERLNUM_BAD) { return SCE_PL_ERROR; } return SCE_PL_NUMBER; } static int opposite(int ch) { if (ch == '(') return ')'; if (ch == '[') return ']'; if (ch == '{') return '}'; if (ch == '<') return '>'; return ch; } static bool IsCommentLine(Sci_Position line, LexAccessor &styler) { Sci_Position pos = styler.LineStart(line); Sci_Position eol_pos = styler.LineStart(line + 1) - 1; for (Sci_Position i = pos; i < eol_pos; i++) { char ch = styler[i]; int style = styler.StyleAt(i); if (ch == '#' && style == SCE_PL_COMMENTLINE) return true; else if (!IsASpaceOrTab(ch)) return false; } return false; } static bool IsPackageLine(Sci_Position line, LexAccessor &styler) { Sci_Position pos = styler.LineStart(line); int style = styler.StyleAt(pos); if (style == SCE_PL_WORD && styler.Match(pos, "package")) { return true; } return false; } static int PodHeadingLevel(Sci_Position pos, LexAccessor &styler) { int lvl = static_cast(styler.SafeGetCharAt(pos + 5)); if (lvl >= '1' && lvl <= '4') { return lvl - '0'; } return 0; } // An individual named option for use in an OptionSet // Options used for LexerPerl struct OptionsPerl { bool fold; bool foldComment; bool foldCompact; // Custom folding of POD and packages bool foldPOD; // fold.perl.pod // Enable folding Pod blocks when using the Perl lexer. bool foldPackage; // fold.perl.package // Enable folding packages when using the Perl lexer. bool foldCommentExplicit; bool foldAtElse; OptionsPerl() { fold = false; foldComment = false; foldCompact = true; foldPOD = true; foldPackage = true; foldCommentExplicit = true; foldAtElse = false; } }; static const char *const perlWordListDesc[] = { "Keywords", 0 }; struct OptionSetPerl : public OptionSet { OptionSetPerl() { DefineProperty("fold", &OptionsPerl::fold); DefineProperty("fold.comment", &OptionsPerl::foldComment); DefineProperty("fold.compact", &OptionsPerl::foldCompact); DefineProperty("fold.perl.pod", &OptionsPerl::foldPOD, "Set to 0 to disable folding Pod blocks when using the Perl lexer."); DefineProperty("fold.perl.package", &OptionsPerl::foldPackage, "Set to 0 to disable folding packages when using the Perl lexer."); DefineProperty("fold.perl.comment.explicit", &OptionsPerl::foldCommentExplicit, "Set to 0 to disable explicit folding."); DefineProperty("fold.perl.at.else", &OptionsPerl::foldAtElse, "This option enables Perl folding on a \"} else {\" line of an if statement."); DefineWordListSets(perlWordListDesc); } }; class LexerPerl : public ILexer { CharacterSet setWordStart; CharacterSet setWord; CharacterSet setSpecialVar; CharacterSet setControlVar; WordList keywords; OptionsPerl options; OptionSetPerl osPerl; public: LexerPerl() : setWordStart(CharacterSet::setAlpha, "_", 0x80, true), setWord(CharacterSet::setAlphaNum, "_", 0x80, true), setSpecialVar(CharacterSet::setNone, "\"$;<>&`'+,./\\%:=~!?@[]"), setControlVar(CharacterSet::setNone, "ACDEFHILMNOPRSTVWX") { } virtual ~LexerPerl() { } void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvOriginal; } const char *SCI_METHOD PropertyNames() { return osPerl.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osPerl.PropertyType(name); } const char *SCI_METHOD DescribeProperty(const char *name) { return osPerl.DescribeProperty(name); } Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); const char *SCI_METHOD DescribeWordListSets() { return osPerl.DescribeWordListSets(); } Sci_Position SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void *SCI_METHOD PrivateCall(int, void *) { return 0; } static ILexer *LexerFactoryPerl() { return new LexerPerl(); } int InputSymbolScan(StyleContext &sc); void InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern=false); }; Sci_Position SCI_METHOD LexerPerl::PropertySet(const char *key, const char *val) { if (osPerl.PropertySet(&options, key, val)) { return 0; } return -1; } Sci_Position SCI_METHOD LexerPerl::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; } Sci_Position firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; } } return firstModification; } int LexerPerl::InputSymbolScan(StyleContext &sc) { // forward scan for matching > on same line; file handles int c, sLen = 0; while ((c = sc.GetRelativeCharacter(++sLen)) != 0) { if (c == '\r' || c == '\n') { return 0; } else if (c == '>') { if (sc.Match("<=>")) // '<=>' case return 0; return sLen; } } return 0; } void LexerPerl::InterpolateSegment(StyleContext &sc, int maxSeg, bool isPattern) { // interpolate a segment (with no active backslashes or delimiters within) // switch in or out of an interpolation style or continue current style // commit variable patterns if found, trim segment, repeat until done while (maxSeg > 0) { bool isVar = false; int sLen = 0; if ((maxSeg > 1) && (sc.ch == '$' || sc.ch == '@')) { // $#[$]*word [$@][$]*word (where word or {word} is always present) bool braces = false; sLen = 1; if (sc.ch == '$' && sc.chNext == '#') { // starts with $# sLen++; } while ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '$')) // >0 $ dereference within sLen++; if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '{')) { // { start for {word} sLen++; braces = true; } if (maxSeg > sLen) { int c = sc.GetRelativeCharacter(sLen); if (setWordStart.Contains(c)) { // word (various) sLen++; isVar = true; while (maxSeg > sLen) { if (!setWord.Contains(sc.GetRelativeCharacter(sLen))) break; sLen++; } } else if (braces && IsADigit(c) && (sLen == 2)) { // digit for ${digit} sLen++; isVar = true; } } if (braces) { if ((maxSeg > sLen) && (sc.GetRelativeCharacter(sLen) == '}')) { // } end for {word} sLen++; } else isVar = false; } } if (!isVar && (maxSeg > 1)) { // $- or @-specific variable patterns int c = sc.chNext; if (sc.ch == '$') { sLen = 1; if (IsADigit(c)) { // $[0-9] and slurp trailing digits sLen++; isVar = true; while ((maxSeg > sLen) && IsADigit(sc.GetRelativeCharacter(sLen))) sLen++; } else if (setSpecialVar.Contains(c)) { // $ special variables sLen++; isVar = true; } else if (!isPattern && ((c == '(') || (c == ')') || (c == '|'))) { // $ additional sLen++; isVar = true; } else if (c == '^') { // $^A control-char style sLen++; if ((maxSeg > sLen) && setControlVar.Contains(sc.GetRelativeCharacter(sLen))) { sLen++; isVar = true; } } } else if (sc.ch == '@') { sLen = 1; if (!isPattern && ((c == '+') || (c == '-'))) { // @ specials non-pattern sLen++; isVar = true; } } } if (isVar) { // commit as interpolated variable or normal character if (sc.state < SCE_PL_STRING_VAR) sc.SetState(sc.state + INTERPOLATE_SHIFT); sc.Forward(sLen); maxSeg -= sLen; } else { if (sc.state >= SCE_PL_STRING_VAR) sc.SetState(sc.state - INTERPOLATE_SHIFT); sc.Forward(); maxSeg--; } } if (sc.state >= SCE_PL_STRING_VAR) sc.SetState(sc.state - INTERPOLATE_SHIFT); } void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { LexAccessor styler(pAccess); // keywords that forces /PATTERN/ at all times; should track vim's behaviour WordList reWords; reWords.Set("elsif if split while"); // charset classes CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMAC"); // lexing of "%*,?!.~"); CharacterSet setQDelim(CharacterSet::setNone, "qrwx"); CharacterSet setModifiers(CharacterSet::setAlpha); CharacterSet setPreferRE(CharacterSet::setNone, "*/<%"); // setArray and setHash also accepts chars for special vars like $_, // which are then truncated when the next char does not match setVar CharacterSet setVar(CharacterSet::setAlphaNum, "#$_'", 0x80, true); CharacterSet setArray(CharacterSet::setAlpha, "#$_+-", 0x80, true); CharacterSet setHash(CharacterSet::setAlpha, "#$_!^+-", 0x80, true); CharacterSet &setPOD = setModifiers; CharacterSet setNonHereDoc(CharacterSet::setDigits, "=$@"); CharacterSet setHereDocDelim(CharacterSet::setAlphaNum, "_"); CharacterSet setSubPrototype(CharacterSet::setNone, "\\[$@%&*+];"); // for format identifiers CharacterSet setFormatStart(CharacterSet::setAlpha, "_="); CharacterSet &setFormat = setHereDocDelim; // Lexer for perl often has to backtrack to start of current style to determine // which characters are being used as quotes, how deeply nested is the // start position and what the termination string is for HERE documents. class HereDocCls { // Class to manage HERE doc sequence public: int State; // 0: '<<' encountered // 1: collect the delimiter // 2: here doc text (lines after the delimiter) int Quote; // the char after '<<' bool Quoted; // true if Quote in ('\'','"','`') int DelimiterLength; // strlen(Delimiter) char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf HereDocCls() { State = 0; Quote = 0; Quoted = false; DelimiterLength = 0; Delimiter = new char[HERE_DELIM_MAX]; Delimiter[0] = '\0'; } void Append(int ch) { Delimiter[DelimiterLength++] = static_cast(ch); Delimiter[DelimiterLength] = '\0'; } ~HereDocCls() { delete []Delimiter; } }; HereDocCls HereDoc; // TODO: FIFO for stacked here-docs class QuoteCls { // Class to manage quote pairs public: int Rep; int Count; int Up, Down; QuoteCls() { New(1); } void New(int r = 1) { Rep = r; Count = 0; Up = '\0'; Down = '\0'; } void Open(int u) { Count++; Up = u; Down = opposite(Up); } }; QuoteCls Quote; // additional state for number lexing int numState = PERLNUM_DECIMAL; int dotCount = 0; Sci_PositionU endPos = startPos + length; // Backtrack to beginning of style if required... // If in a long distance lexical state, backtrack to find quote characters. // Includes strings (may be multi-line), numbers (additional state), format // bodies, as well as POD sections. if (initStyle == SCE_PL_HERE_Q || initStyle == SCE_PL_HERE_QQ || initStyle == SCE_PL_HERE_QX || initStyle == SCE_PL_FORMAT || initStyle == SCE_PL_HERE_QQ_VAR || initStyle == SCE_PL_HERE_QX_VAR ) { // backtrack through multiple styles to reach the delimiter start int delim = (initStyle == SCE_PL_FORMAT) ? SCE_PL_FORMAT_IDENT:SCE_PL_HERE_DELIM; while ((startPos > 1) && (styler.StyleAt(startPos) != delim)) { startPos--; } startPos = styler.LineStart(styler.GetLine(startPos)); initStyle = styler.StyleAt(startPos - 1); } if (initStyle == SCE_PL_STRING || initStyle == SCE_PL_STRING_QQ || initStyle == SCE_PL_BACKTICKS || initStyle == SCE_PL_STRING_QX || initStyle == SCE_PL_REGEX || initStyle == SCE_PL_STRING_QR || initStyle == SCE_PL_REGSUBST || initStyle == SCE_PL_STRING_VAR || initStyle == SCE_PL_STRING_QQ_VAR || initStyle == SCE_PL_BACKTICKS_VAR || initStyle == SCE_PL_STRING_QX_VAR || initStyle == SCE_PL_REGEX_VAR || initStyle == SCE_PL_STRING_QR_VAR || initStyle == SCE_PL_REGSUBST_VAR ) { // for interpolation, must backtrack through a mix of two different styles int otherStyle = (initStyle >= SCE_PL_STRING_VAR) ? initStyle - INTERPOLATE_SHIFT : initStyle + INTERPOLATE_SHIFT; while (startPos > 1) { int st = styler.StyleAt(startPos - 1); if ((st != initStyle) && (st != otherStyle)) break; startPos--; } initStyle = SCE_PL_DEFAULT; } else if (initStyle == SCE_PL_STRING_Q || initStyle == SCE_PL_STRING_QW || initStyle == SCE_PL_XLAT || initStyle == SCE_PL_CHARACTER || initStyle == SCE_PL_NUMBER || initStyle == SCE_PL_IDENTIFIER || initStyle == SCE_PL_ERROR || initStyle == SCE_PL_SUB_PROTOTYPE ) { while ((startPos > 1) && (styler.StyleAt(startPos - 1) == initStyle)) { startPos--; } initStyle = SCE_PL_DEFAULT; } else if (initStyle == SCE_PL_POD || initStyle == SCE_PL_POD_VERB ) { // POD backtracking finds preceding blank lines and goes back past them Sci_Position ln = styler.GetLine(startPos); if (ln > 0) { initStyle = styler.StyleAt(styler.LineStart(--ln)); if (initStyle == SCE_PL_POD || initStyle == SCE_PL_POD_VERB) { while (ln > 0 && styler.GetLineState(ln) == SCE_PL_DEFAULT) ln--; } startPos = styler.LineStart(++ln); initStyle = styler.StyleAt(startPos - 1); } else { startPos = 0; initStyle = SCE_PL_DEFAULT; } } // backFlag, backPos are additional state to aid identifier corner cases. // Look backwards past whitespace and comments in order to detect either // operator or keyword. Later updated as we go along. int backFlag = BACK_NONE; Sci_PositionU backPos = startPos; if (backPos > 0) { backPos--; skipWhitespaceComment(styler, backPos); if (styler.StyleAt(backPos) == SCE_PL_OPERATOR) backFlag = BACK_OPERATOR; else if (styler.StyleAt(backPos) == SCE_PL_WORD) backFlag = BACK_KEYWORD; backPos++; } StyleContext sc(startPos, endPos - startPos, initStyle, styler, static_cast(STYLE_MAX)); for (; sc.More(); sc.Forward()) { // Determine if the current state should terminate. switch (sc.state) { case SCE_PL_OPERATOR: sc.SetState(SCE_PL_DEFAULT); backFlag = BACK_OPERATOR; backPos = sc.currentPos; break; case SCE_PL_IDENTIFIER: // identifier, bareword, inputsymbol if ((!setWord.Contains(sc.ch) && sc.ch != '\'') || sc.Match('.', '.') || sc.chPrev == '>') { // end of inputsymbol sc.SetState(SCE_PL_DEFAULT); } break; case SCE_PL_WORD: // keyword, plus special cases if (!setWord.Contains(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); if ((strcmp(s, "__DATA__") == 0) || (strcmp(s, "__END__") == 0)) { sc.ChangeState(SCE_PL_DATASECTION); } else { if ((strcmp(s, "format") == 0)) { sc.SetState(SCE_PL_FORMAT_IDENT); HereDoc.State = 0; } else { sc.SetState(SCE_PL_DEFAULT); } backFlag = BACK_KEYWORD; backPos = sc.currentPos; } } break; case SCE_PL_SCALAR: case SCE_PL_ARRAY: case SCE_PL_HASH: case SCE_PL_SYMBOLTABLE: if (sc.Match(':', ':')) { // skip :: sc.Forward(); } else if (!setVar.Contains(sc.ch)) { if (sc.LengthCurrent() == 1) { // Special variable: $(, $_ etc. sc.Forward(); } sc.SetState(SCE_PL_DEFAULT); } break; case SCE_PL_NUMBER: // if no early break, number style is terminated at "(go through)" if (sc.ch == '.') { if (sc.chNext == '.') { // double dot is always an operator (go through) } else if (numState <= PERLNUM_FLOAT_EXP) { // non-decimal number or float exponent, consume next dot sc.SetState(SCE_PL_OPERATOR); break; } else { // decimal or vectors allows dots dotCount++; if (numState == PERLNUM_DECIMAL) { if (dotCount <= 1) // number with one dot in it break; if (IsADigit(sc.chNext)) { // really a vector numState = PERLNUM_VECTOR; break; } // number then dot (go through) } else if (IsADigit(sc.chNext)) // vectors break; // vector then dot (go through) } } else if (sc.ch == '_') { // permissive underscoring for number and vector literals break; } else if (numState == PERLNUM_DECIMAL) { if (sc.ch == 'E' || sc.ch == 'e') { // exponent, sign numState = PERLNUM_FLOAT_EXP; if (sc.chNext == '+' || sc.chNext == '-') { sc.Forward(); } break; } else if (IsADigit(sc.ch)) break; // number then word (go through) } else if (numState == PERLNUM_HEX) { if (IsADigit(sc.ch, 16)) break; } else if (numState == PERLNUM_VECTOR || numState == PERLNUM_V_VECTOR) { if (IsADigit(sc.ch)) // vector break; if (setWord.Contains(sc.ch) && dotCount == 0) { // change to word sc.ChangeState(SCE_PL_IDENTIFIER); break; } // vector then word (go through) } else if (IsADigit(sc.ch)) { if (numState == PERLNUM_FLOAT_EXP) { break; } else if (numState == PERLNUM_OCTAL) { if (sc.ch <= '7') break; } else if (numState == PERLNUM_BINARY) { if (sc.ch <= '1') break; } // mark invalid octal, binary numbers (go through) numState = PERLNUM_BAD; break; } // complete current number or vector sc.ChangeState(actualNumStyle(numState)); sc.SetState(SCE_PL_DEFAULT); break; case SCE_PL_COMMENTLINE: if (sc.atLineEnd) { sc.SetState(SCE_PL_DEFAULT); } break; case SCE_PL_HERE_DELIM: if (HereDoc.State == 0) { // '<<' encountered int delim_ch = sc.chNext; Sci_Position ws_skip = 0; HereDoc.State = 1; // pre-init HERE doc class HereDoc.Quote = sc.chNext; HereDoc.Quoted = false; HereDoc.DelimiterLength = 0; HereDoc.Delimiter[HereDoc.DelimiterLength] = '\0'; if (IsASpaceOrTab(delim_ch)) { // skip whitespace; legal only for quoted delimiters Sci_PositionU i = sc.currentPos + 1; while ((i < endPos) && IsASpaceOrTab(delim_ch)) { i++; delim_ch = static_cast(styler.SafeGetCharAt(i)); } ws_skip = i - sc.currentPos - 1; } if (delim_ch == '\'' || delim_ch == '"' || delim_ch == '`') { // a quoted here-doc delimiter; skip any whitespace sc.Forward(ws_skip + 1); HereDoc.Quote = delim_ch; HereDoc.Quoted = true; } else if ((ws_skip == 0 && setNonHereDoc.Contains(sc.chNext)) || ws_skip > 0) { // left shift << or <<= operator cases // restore position if operator sc.ChangeState(SCE_PL_OPERATOR); sc.ForwardSetState(SCE_PL_DEFAULT); backFlag = BACK_OPERATOR; backPos = sc.currentPos; HereDoc.State = 0; } else { // specially handle initial '\' for identifier if (ws_skip == 0 && HereDoc.Quote == '\\') sc.Forward(); // an unquoted here-doc delimiter, no special handling // (cannot be prefixed by spaces/tabs), or // symbols terminates; deprecated zero-length delimiter } } else if (HereDoc.State == 1) { // collect the delimiter backFlag = BACK_NONE; if (HereDoc.Quoted) { // a quoted here-doc delimiter if (sc.ch == HereDoc.Quote) { // closing quote => end of delimiter sc.ForwardSetState(SCE_PL_DEFAULT); } else if (!sc.atLineEnd) { if (sc.Match('\\', static_cast(HereDoc.Quote))) { // escaped quote sc.Forward(); } if (sc.ch != '\r') { // skip CR if CRLF int i = 0; // else append char, possibly an extended char while (i < sc.width) { HereDoc.Append(static_cast(styler.SafeGetCharAt(sc.currentPos + i))); i++; } } } } else { // an unquoted here-doc delimiter, no extended charsets if (setHereDocDelim.Contains(sc.ch)) { HereDoc.Append(sc.ch); } else { sc.SetState(SCE_PL_DEFAULT); } } if (HereDoc.DelimiterLength >= HERE_DELIM_MAX - 1) { sc.SetState(SCE_PL_ERROR); HereDoc.State = 0; } } break; case SCE_PL_HERE_Q: case SCE_PL_HERE_QQ: case SCE_PL_HERE_QX: // also implies HereDoc.State == 2 sc.Complete(); if (HereDoc.DelimiterLength == 0 || sc.Match(HereDoc.Delimiter)) { int c = sc.GetRelative(HereDoc.DelimiterLength); if (c == '\r' || c == '\n') { // peek first, do not consume match sc.ForwardBytes(HereDoc.DelimiterLength); sc.SetState(SCE_PL_DEFAULT); backFlag = BACK_NONE; HereDoc.State = 0; if (!sc.atLineEnd) sc.Forward(); break; } } if (sc.state == SCE_PL_HERE_Q) { // \EOF and 'EOF' non-interpolated while (!sc.atLineEnd) sc.Forward(); break; } while (!sc.atLineEnd) { // "EOF" and `EOF` interpolated int c, sLen = 0, endType = 0; while ((c = sc.GetRelativeCharacter(sLen)) != 0) { // scan to break string into segments if (c == '\\') { endType = 1; break; } else if (c == '\r' || c == '\n') { endType = 2; break; } sLen++; } if (sLen > 0) // process non-empty segments InterpolateSegment(sc, sLen); if (endType == 1) { sc.Forward(); // \ at end-of-line does not appear to have any effect, skip if (sc.ch != '\r' && sc.ch != '\n') sc.Forward(); } else if (endType == 2) { if (!sc.atLineEnd) sc.Forward(); } } break; case SCE_PL_POD: case SCE_PL_POD_VERB: { Sci_PositionU fw = sc.currentPos; Sci_Position ln = styler.GetLine(fw); if (sc.atLineStart && sc.Match("=cut")) { // end of POD sc.SetState(SCE_PL_POD); sc.Forward(4); sc.SetState(SCE_PL_DEFAULT); styler.SetLineState(ln, SCE_PL_POD); break; } int pod = podLineScan(styler, fw, endPos); // classify POD line styler.SetLineState(ln, pod); if (pod == SCE_PL_DEFAULT) { if (sc.state == SCE_PL_POD_VERB) { Sci_PositionU fw2 = fw; while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) { fw = fw2++; // penultimate line (last blank line) pod = podLineScan(styler, fw2, endPos); styler.SetLineState(styler.GetLine(fw2), pod); } if (pod == SCE_PL_POD) { // truncate verbatim POD early sc.SetState(SCE_PL_POD); } else fw = fw2; } } else { if (pod == SCE_PL_POD_VERB // still part of current paragraph && (styler.GetLineState(ln - 1) == SCE_PL_POD)) { pod = SCE_PL_POD; styler.SetLineState(ln, pod); } else if (pod == SCE_PL_POD && (styler.GetLineState(ln - 1) == SCE_PL_POD_VERB)) { pod = SCE_PL_POD_VERB; styler.SetLineState(ln, pod); } sc.SetState(pod); } sc.ForwardBytes(fw - sc.currentPos); // commit style } break; case SCE_PL_REGEX: case SCE_PL_STRING_QR: if (Quote.Rep <= 0) { if (!setModifiers.Contains(sc.ch)) sc.SetState(SCE_PL_DEFAULT); } else if (!Quote.Up && !IsASpace(sc.ch)) { Quote.Open(sc.ch); } else { int c, sLen = 0, endType = 0; while ((c = sc.GetRelativeCharacter(sLen)) != 0) { // scan to break string into segments if (IsASpace(c)) { break; } else if (c == '\\' && Quote.Up != '\\') { endType = 1; break; } else if (c == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { Quote.Rep--; break; } } else if (c == Quote.Up) Quote.Count++; sLen++; } if (sLen > 0) { // process non-empty segments if (Quote.Up != '\'') { InterpolateSegment(sc, sLen, true); } else // non-interpolated path sc.Forward(sLen); } if (endType == 1) sc.Forward(); } break; case SCE_PL_REGSUBST: case SCE_PL_XLAT: if (Quote.Rep <= 0) { if (!setModifiers.Contains(sc.ch)) sc.SetState(SCE_PL_DEFAULT); } else if (!Quote.Up && !IsASpace(sc.ch)) { Quote.Open(sc.ch); } else { int c, sLen = 0, endType = 0; bool isPattern = (Quote.Rep == 2); while ((c = sc.GetRelativeCharacter(sLen)) != 0) { // scan to break string into segments if (c == '\\' && Quote.Up != '\\') { endType = 2; break; } else if (Quote.Count == 0 && Quote.Rep == 1) { // We matched something like s(...) or tr{...}, Perl 5.10 // appears to allow almost any character for use as the // next delimiters. Whitespace and comments are accepted in // between, but we'll limit to whitespace here. // For '#', if no whitespace in between, it's a delimiter. if (IsASpace(c)) { // Keep going } else if (c == '#' && IsASpaceOrTab(sc.GetRelativeCharacter(sLen - 1))) { endType = 3; } else Quote.Open(c); break; } else if (c == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { Quote.Rep--; endType = 1; } if (Quote.Up == Quote.Down) Quote.Count++; if (endType == 1) break; } else if (c == Quote.Up) { Quote.Count++; } else if (IsASpace(c)) break; sLen++; } if (sLen > 0) { // process non-empty segments if (sc.state == SCE_PL_REGSUBST && Quote.Up != '\'') { InterpolateSegment(sc, sLen, isPattern); } else // non-interpolated path sc.Forward(sLen); } if (endType == 2) { sc.Forward(); } else if (endType == 3) sc.SetState(SCE_PL_DEFAULT); } break; case SCE_PL_STRING_Q: case SCE_PL_STRING_QQ: case SCE_PL_STRING_QX: case SCE_PL_STRING_QW: case SCE_PL_STRING: case SCE_PL_CHARACTER: case SCE_PL_BACKTICKS: if (!Quote.Down && !IsASpace(sc.ch)) { Quote.Open(sc.ch); } else { int c, sLen = 0, endType = 0; while ((c = sc.GetRelativeCharacter(sLen)) != 0) { // scan to break string into segments if (IsASpace(c)) { break; } else if (c == '\\' && Quote.Up != '\\') { endType = 2; break; } else if (c == Quote.Down) { Quote.Count--; if (Quote.Count == 0) { endType = 3; break; } } else if (c == Quote.Up) Quote.Count++; sLen++; } if (sLen > 0) { // process non-empty segments switch (sc.state) { case SCE_PL_STRING: case SCE_PL_STRING_QQ: case SCE_PL_BACKTICKS: InterpolateSegment(sc, sLen); break; case SCE_PL_STRING_QX: if (Quote.Up != '\'') { InterpolateSegment(sc, sLen); break; } // (continued for ' delim) default: // non-interpolated path sc.Forward(sLen); } } if (endType == 2) { sc.Forward(); } else if (endType == 3) sc.ForwardSetState(SCE_PL_DEFAULT); } break; case SCE_PL_SUB_PROTOTYPE: { int i = 0; // forward scan; must all be valid proto characters while (setSubPrototype.Contains(sc.GetRelative(i))) i++; if (sc.GetRelative(i) == ')') { // valid sub prototype sc.ForwardBytes(i); sc.ForwardSetState(SCE_PL_DEFAULT); } else { // abandon prototype, restart from '(' sc.ChangeState(SCE_PL_OPERATOR); sc.SetState(SCE_PL_DEFAULT); } } break; case SCE_PL_FORMAT: { sc.Complete(); if (sc.Match('.')) { sc.Forward(); if (sc.atLineEnd || ((sc.ch == '\r' && sc.chNext == '\n'))) sc.SetState(SCE_PL_DEFAULT); } while (!sc.atLineEnd) sc.Forward(); } break; case SCE_PL_ERROR: break; } // Needed for specific continuation styles (one follows the other) switch (sc.state) { // continued from SCE_PL_WORD case SCE_PL_FORMAT_IDENT: // occupies HereDoc state 3 to avoid clashing with HERE docs if (IsASpaceOrTab(sc.ch)) { // skip whitespace sc.ChangeState(SCE_PL_DEFAULT); while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd) sc.Forward(); sc.SetState(SCE_PL_FORMAT_IDENT); } if (setFormatStart.Contains(sc.ch)) { // identifier or '=' if (sc.ch != '=') { do { sc.Forward(); } while (setFormat.Contains(sc.ch)); } while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd) sc.Forward(); if (sc.ch == '=') { sc.ForwardSetState(SCE_PL_DEFAULT); HereDoc.State = 3; } else { // invalid identifier; inexact fallback, but hey sc.ChangeState(SCE_PL_IDENTIFIER); sc.SetState(SCE_PL_DEFAULT); } } else { sc.ChangeState(SCE_PL_DEFAULT); // invalid identifier } backFlag = BACK_NONE; break; } // Must check end of HereDoc states here before default state is handled if (HereDoc.State == 1 && sc.atLineEnd) { // Begin of here-doc (the line after the here-doc delimiter): // Lexically, the here-doc starts from the next line after the >>, but the // first line of here-doc seem to follow the style of the last EOL sequence int st_new = SCE_PL_HERE_QQ; HereDoc.State = 2; if (HereDoc.Quoted) { if (sc.state == SCE_PL_HERE_DELIM) { // Missing quote at end of string! We are stricter than perl. // Colour here-doc anyway while marking this bit as an error. sc.ChangeState(SCE_PL_ERROR); } switch (HereDoc.Quote) { case '\'': st_new = SCE_PL_HERE_Q; break; case '"' : st_new = SCE_PL_HERE_QQ; break; case '`' : st_new = SCE_PL_HERE_QX; break; } } else { if (HereDoc.Quote == '\\') st_new = SCE_PL_HERE_Q; } sc.SetState(st_new); } if (HereDoc.State == 3 && sc.atLineEnd) { // Start of format body. HereDoc.State = 0; sc.SetState(SCE_PL_FORMAT); } // Determine if a new state should be entered. if (sc.state == SCE_PL_DEFAULT) { if (IsADigit(sc.ch) || (IsADigit(sc.chNext) && (sc.ch == '.' || sc.ch == 'v'))) { sc.SetState(SCE_PL_NUMBER); backFlag = BACK_NONE; numState = PERLNUM_DECIMAL; dotCount = 0; if (sc.ch == '0') { // hex,bin,octal if (sc.chNext == 'x' || sc.chNext == 'X') { numState = PERLNUM_HEX; } else if (sc.chNext == 'b' || sc.chNext == 'B') { numState = PERLNUM_BINARY; } else if (IsADigit(sc.chNext)) { numState = PERLNUM_OCTAL; } if (numState != PERLNUM_DECIMAL) { sc.Forward(); } } else if (sc.ch == 'v') { // vector numState = PERLNUM_V_VECTOR; } } else if (setWord.Contains(sc.ch)) { // if immediately prefixed by '::', always a bareword sc.SetState(SCE_PL_WORD); if (sc.chPrev == ':' && sc.GetRelative(-2) == ':') { sc.ChangeState(SCE_PL_IDENTIFIER); } Sci_PositionU bk = sc.currentPos; Sci_PositionU fw = sc.currentPos + 1; // first check for possible quote-like delimiter if (sc.ch == 's' && !setWord.Contains(sc.chNext)) { sc.ChangeState(SCE_PL_REGSUBST); Quote.New(2); } else if (sc.ch == 'm' && !setWord.Contains(sc.chNext)) { sc.ChangeState(SCE_PL_REGEX); Quote.New(); } else if (sc.ch == 'q' && !setWord.Contains(sc.chNext)) { sc.ChangeState(SCE_PL_STRING_Q); Quote.New(); } else if (sc.ch == 'y' && !setWord.Contains(sc.chNext)) { sc.ChangeState(SCE_PL_XLAT); Quote.New(2); } else if (sc.Match('t', 'r') && !setWord.Contains(sc.GetRelative(2))) { sc.ChangeState(SCE_PL_XLAT); Quote.New(2); sc.Forward(); fw++; } else if (sc.ch == 'q' && setQDelim.Contains(sc.chNext) && !setWord.Contains(sc.GetRelative(2))) { if (sc.chNext == 'q') sc.ChangeState(SCE_PL_STRING_QQ); else if (sc.chNext == 'x') sc.ChangeState(SCE_PL_STRING_QX); else if (sc.chNext == 'r') sc.ChangeState(SCE_PL_STRING_QR); else sc.ChangeState(SCE_PL_STRING_QW); // sc.chNext == 'w' Quote.New(); sc.Forward(); fw++; } else if (sc.ch == 'x' && (sc.chNext == '=' || // repetition !setWord.Contains(sc.chNext) || (IsADigit(sc.chPrev) && IsADigit(sc.chNext)))) { sc.ChangeState(SCE_PL_OPERATOR); } // if potentially a keyword, scan forward and grab word, then check // if it's really one; if yes, disambiguation test is performed // otherwise it is always a bareword and we skip a lot of scanning if (sc.state == SCE_PL_WORD) { while (setWord.Contains(static_cast(styler.SafeGetCharAt(fw)))) fw++; if (!isPerlKeyword(styler.GetStartSegment(), fw, keywords, styler)) { sc.ChangeState(SCE_PL_IDENTIFIER); } } // if already SCE_PL_IDENTIFIER, then no ambiguity, skip this // for quote-like delimiters/keywords, attempt to disambiguate // to select for bareword, change state -> SCE_PL_IDENTIFIER if (sc.state != SCE_PL_IDENTIFIER && bk > 0) { if (disambiguateBareword(styler, bk, fw, backFlag, backPos, endPos)) sc.ChangeState(SCE_PL_IDENTIFIER); } backFlag = BACK_NONE; } else if (sc.ch == '#') { sc.SetState(SCE_PL_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_PL_STRING); Quote.New(); Quote.Open(sc.ch); backFlag = BACK_NONE; } else if (sc.ch == '\'') { if (sc.chPrev == '&' && setWordStart.Contains(sc.chNext)) { // Archaic call sc.SetState(SCE_PL_IDENTIFIER); } else { sc.SetState(SCE_PL_CHARACTER); Quote.New(); Quote.Open(sc.ch); } backFlag = BACK_NONE; } else if (sc.ch == '`') { sc.SetState(SCE_PL_BACKTICKS); Quote.New(); Quote.Open(sc.ch); backFlag = BACK_NONE; } else if (sc.ch == '$') { sc.SetState(SCE_PL_SCALAR); if (sc.chNext == '{') { sc.ForwardSetState(SCE_PL_OPERATOR); } else if (IsASpace(sc.chNext)) { sc.ForwardSetState(SCE_PL_DEFAULT); } else { sc.Forward(); if (sc.Match('`', '`') || sc.Match(':', ':')) { sc.Forward(); } } backFlag = BACK_NONE; } else if (sc.ch == '@') { sc.SetState(SCE_PL_ARRAY); if (setArray.Contains(sc.chNext)) { // no special treatment } else if (sc.chNext == ':' && sc.GetRelative(2) == ':') { sc.ForwardBytes(2); } else if (sc.chNext == '{' || sc.chNext == '[') { sc.ForwardSetState(SCE_PL_OPERATOR); } else { sc.ChangeState(SCE_PL_OPERATOR); } backFlag = BACK_NONE; } else if (setPreferRE.Contains(sc.ch)) { // Explicit backward peeking to set a consistent preferRE for // any slash found, so no longer need to track preferRE state. // Find first previous significant lexed element and interpret. // A few symbols shares this code for disambiguation. bool preferRE = false; bool isHereDoc = sc.Match('<', '<'); bool hereDocSpace = false; // for: SCALAR [whitespace] '<<' Sci_PositionU bk = (sc.currentPos > 0) ? sc.currentPos - 1: 0; sc.Complete(); styler.Flush(); if (styler.StyleAt(bk) == SCE_PL_DEFAULT) hereDocSpace = true; skipWhitespaceComment(styler, bk); if (bk == 0) { // avoid backward scanning breakage preferRE = true; } else { int bkstyle = styler.StyleAt(bk); int bkch = static_cast(styler.SafeGetCharAt(bk)); switch (bkstyle) { case SCE_PL_OPERATOR: preferRE = true; if (bkch == ')' || bkch == ']') { preferRE = false; } else if (bkch == '}') { // backtrack by counting balanced brace pairs // needed to test for variables like ${}, @{} etc. bkstyle = styleBeforeBracePair(styler, bk); if (bkstyle == SCE_PL_SCALAR || bkstyle == SCE_PL_ARRAY || bkstyle == SCE_PL_HASH || bkstyle == SCE_PL_SYMBOLTABLE || bkstyle == SCE_PL_OPERATOR) { preferRE = false; } } else if (bkch == '+' || bkch == '-') { if (bkch == static_cast(styler.SafeGetCharAt(bk - 1)) && bkch != static_cast(styler.SafeGetCharAt(bk - 2))) // exceptions for operators: unary suffixes ++, -- preferRE = false; } break; case SCE_PL_IDENTIFIER: preferRE = true; bkstyle = styleCheckIdentifier(styler, bk); if ((bkstyle == 1) || (bkstyle == 2)) { // inputsymbol or var with "->" or "::" before identifier preferRE = false; } else if (bkstyle == 3) { // bare identifier, test cases follows: if (sc.ch == '/') { // if '/', /PATTERN/ unless digit/space immediately after '/' // if '//', always expect defined-or operator to follow identifier if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.chNext == '/') preferRE = false; } else if (sc.ch == '*' || sc.ch == '%') { if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.Match('*', '*')) preferRE = false; } else if (sc.ch == '<') { if (IsASpace(sc.chNext) || sc.chNext == '=') preferRE = false; } } break; case SCE_PL_SCALAR: // for $var<< case: if (isHereDoc && hereDocSpace) // if SCALAR whitespace '<<', *always* a HERE doc preferRE = true; break; case SCE_PL_WORD: preferRE = true; // for HERE docs, always true if (sc.ch == '/') { // adopt heuristics similar to vim-style rules: // keywords always forced as /PATTERN/: split, if, elsif, while // everything else /PATTERN/ unless digit/space immediately after '/' // for '//', defined-or favoured unless special keywords Sci_PositionU bkend = bk + 1; while (bk > 0 && styler.StyleAt(bk - 1) == SCE_PL_WORD) { bk--; } if (isPerlKeyword(bk, bkend, reWords, styler)) break; if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.chNext == '/') preferRE = false; } else if (sc.ch == '*' || sc.ch == '%') { if (IsASpace(sc.chNext) || IsADigit(sc.chNext) || sc.Match('*', '*')) preferRE = false; } else if (sc.ch == '<') { if (IsASpace(sc.chNext) || sc.chNext == '=') preferRE = false; } break; // other styles uses the default, preferRE=false case SCE_PL_POD: case SCE_PL_HERE_Q: case SCE_PL_HERE_QQ: case SCE_PL_HERE_QX: preferRE = true; break; } } backFlag = BACK_NONE; if (isHereDoc) { // handle '<<', HERE doc if (preferRE) { sc.SetState(SCE_PL_HERE_DELIM); HereDoc.State = 0; } else { // << operator sc.SetState(SCE_PL_OPERATOR); sc.Forward(); } } else if (sc.ch == '*') { // handle '*', typeglob if (preferRE) { sc.SetState(SCE_PL_SYMBOLTABLE); if (sc.chNext == ':' && sc.GetRelative(2) == ':') { sc.ForwardBytes(2); } else if (sc.chNext == '{') { sc.ForwardSetState(SCE_PL_OPERATOR); } else { sc.Forward(); } } else { sc.SetState(SCE_PL_OPERATOR); if (sc.chNext == '*') // exponentiation sc.Forward(); } } else if (sc.ch == '%') { // handle '%', hash if (preferRE) { sc.SetState(SCE_PL_HASH); if (setHash.Contains(sc.chNext)) { sc.Forward(); } else if (sc.chNext == ':' && sc.GetRelative(2) == ':') { sc.ForwardBytes(2); } else if (sc.chNext == '{') { sc.ForwardSetState(SCE_PL_OPERATOR); } else { sc.ChangeState(SCE_PL_OPERATOR); } } else { sc.SetState(SCE_PL_OPERATOR); } } else if (sc.ch == '<') { // handle '<', inputsymbol if (preferRE) { // forward scan int i = InputSymbolScan(sc); if (i > 0) { sc.SetState(SCE_PL_IDENTIFIER); sc.Forward(i); } else { sc.SetState(SCE_PL_OPERATOR); } } else { sc.SetState(SCE_PL_OPERATOR); } } else { // handle '/', regexp if (preferRE) { sc.SetState(SCE_PL_REGEX); Quote.New(); Quote.Open(sc.ch); } else { // / and // operators sc.SetState(SCE_PL_OPERATOR); if (sc.chNext == '/') { sc.Forward(); } } } } else if (sc.ch == '=' // POD && setPOD.Contains(sc.chNext) && sc.atLineStart) { sc.SetState(SCE_PL_POD); backFlag = BACK_NONE; } else if (sc.ch == '-' && setWordStart.Contains(sc.chNext)) { // extended '-' cases Sci_PositionU bk = sc.currentPos; Sci_PositionU fw = 2; if (setSingleCharOp.Contains(sc.chNext) && // file test operators !setWord.Contains(sc.GetRelative(2))) { sc.SetState(SCE_PL_WORD); } else { // nominally a minus and bareword; find extent of bareword while (setWord.Contains(sc.GetRelative(fw))) fw++; sc.SetState(SCE_PL_OPERATOR); } // force to bareword for hash key => or {variable literal} cases if (disambiguateBareword(styler, bk, bk + fw, backFlag, backPos, endPos) & 2) { sc.ChangeState(SCE_PL_IDENTIFIER); } backFlag = BACK_NONE; } else if (sc.ch == '(' && sc.currentPos > 0) { // '(' or subroutine prototype sc.Complete(); if (styleCheckSubPrototype(styler, sc.currentPos - 1)) { sc.SetState(SCE_PL_SUB_PROTOTYPE); backFlag = BACK_NONE; } else { sc.SetState(SCE_PL_OPERATOR); } } else if (setPerlOperator.Contains(sc.ch)) { // operators sc.SetState(SCE_PL_OPERATOR); if (sc.Match('.', '.')) { // .. and ... sc.Forward(); if (sc.chNext == '.') sc.Forward(); } } else if (sc.ch == 4 || sc.ch == 26) { // ^D and ^Z ends valid perl source sc.SetState(SCE_PL_DATASECTION); } else { // keep colouring defaults sc.Complete(); } } } sc.Complete(); if (sc.state == SCE_PL_HERE_Q || sc.state == SCE_PL_HERE_QQ || sc.state == SCE_PL_HERE_QX || sc.state == SCE_PL_FORMAT) { styler.ChangeLexerState(sc.currentPos, styler.Length()); } sc.Complete(); } #define PERL_HEADFOLD_SHIFT 4 #define PERL_HEADFOLD_MASK 0xF0 void SCI_METHOD LexerPerl::Fold(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, IDocument *pAccess) { if (!options.fold) return; LexAccessor styler(pAccess); Sci_PositionU endPos = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); // Backtrack to previous line in case need to fix its fold status if (startPos > 0) { if (lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } } int levelPrev = SC_FOLDLEVELBASE; if (lineCurrent > 0) levelPrev = styler.LevelAt(lineCurrent - 1) >> 16; int levelCurrent = levelPrev; char chNext = styler[startPos]; char chPrev = styler.SafeGetCharAt(startPos - 1); int styleNext = styler.StyleAt(startPos); // Used at end of line to determine if the line was a package definition bool isPackageLine = false; int podHeading = 0; for (Sci_PositionU i = startPos; i < endPos; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); int stylePrevCh = (i) ? styler.StyleAt(i - 1):SCE_PL_DEFAULT; bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); bool atLineStart = ((chPrev == '\r') || (chPrev == '\n')) || i == 0; // Comment folding if (options.foldComment && atEOL && IsCommentLine(lineCurrent, styler)) { if (!IsCommentLine(lineCurrent - 1, styler) && IsCommentLine(lineCurrent + 1, styler)) levelCurrent++; else if (IsCommentLine(lineCurrent - 1, styler) && !IsCommentLine(lineCurrent + 1, styler)) levelCurrent--; } // {} [] block folding if (style == SCE_PL_OPERATOR) { if (ch == '{') { if (options.foldAtElse && levelCurrent < levelPrev) --levelPrev; levelCurrent++; } else if (ch == '}') { levelCurrent--; } if (ch == '[') { if (options.foldAtElse && levelCurrent < levelPrev) --levelPrev; levelCurrent++; } else if (ch == ']') { levelCurrent--; } } // POD folding if (options.foldPOD && atLineStart) { if (style == SCE_PL_POD) { if (stylePrevCh != SCE_PL_POD && stylePrevCh != SCE_PL_POD_VERB) levelCurrent++; else if (styler.Match(i, "=cut")) levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1; else if (styler.Match(i, "=head")) podHeading = PodHeadingLevel(i, styler); } else if (style == SCE_PL_DATASECTION) { if (ch == '=' && IsASCII(chNext) && isalpha(chNext) && levelCurrent == SC_FOLDLEVELBASE) levelCurrent++; else if (styler.Match(i, "=cut") && levelCurrent > SC_FOLDLEVELBASE) levelCurrent = (levelCurrent & ~PERL_HEADFOLD_MASK) - 1; else if (styler.Match(i, "=head")) podHeading = PodHeadingLevel(i, styler); // if package used or unclosed brace, level > SC_FOLDLEVELBASE! // reset needed as level test is vs. SC_FOLDLEVELBASE else if (stylePrevCh != SCE_PL_DATASECTION) levelCurrent = SC_FOLDLEVELBASE; } } // package folding if (options.foldPackage && atLineStart) { if (IsPackageLine(lineCurrent, styler) && !IsPackageLine(lineCurrent + 1, styler)) isPackageLine = true; } //heredoc folding switch (style) { case SCE_PL_HERE_QQ : case SCE_PL_HERE_Q : case SCE_PL_HERE_QX : switch (stylePrevCh) { case SCE_PL_HERE_QQ : case SCE_PL_HERE_Q : case SCE_PL_HERE_QX : //do nothing; break; default : levelCurrent++; break; } break; default: switch (stylePrevCh) { case SCE_PL_HERE_QQ : case SCE_PL_HERE_Q : case SCE_PL_HERE_QX : levelCurrent--; break; default : //do nothing; break; } break; } //explicit folding if (options.foldCommentExplicit && style == SCE_PL_COMMENTLINE && ch == '#') { if (chNext == '{') { levelCurrent++; } else if (levelCurrent > SC_FOLDLEVELBASE && chNext == '}') { levelCurrent--; } } if (atEOL) { int lev = levelPrev; // POD headings occupy bits 7-4, leaving some breathing room for // non-standard practice -- POD sections stuck in blocks, etc. if (podHeading > 0) { levelCurrent = (lev & ~PERL_HEADFOLD_MASK) | (podHeading << PERL_HEADFOLD_SHIFT); lev = levelCurrent - 1; lev |= SC_FOLDLEVELHEADERFLAG; podHeading = 0; } // Check if line was a package declaration // because packages need "special" treatment if (isPackageLine) { lev = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; levelCurrent = SC_FOLDLEVELBASE + 1; isPackageLine = false; } lev |= levelCurrent << 16; if (visibleChars == 0 && options.foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; chPrev = ch; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc); scintilla/lexers/LexEiffel.cxx0000644000175000017500000001671512557522743015417 0ustar neilneil// Scintilla source code edit control /** @file LexEiffel.cxx ** Lexer for Eiffel. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static inline bool isEiffelOperator(unsigned int ch) { // '.' left out as it is used to make up numbers return ch == '*' || ch == '/' || ch == '\\' || ch == '-' || ch == '+' || ch == '(' || ch == ')' || ch == '=' || ch == '{' || ch == '}' || ch == '~' || ch == '[' || ch == ']' || ch == ';' || ch == '<' || ch == '>' || ch == ',' || ch == '.' || ch == '^' || ch == '%' || ch == ':' || ch == '!' || ch == '@' || ch == '?'; } static inline bool IsAWordChar(unsigned int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static inline bool IsAWordStart(unsigned int ch) { return (ch < 0x80) && (isalnum(ch) || ch == '_'); } static void ColouriseEiffelDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; StyleContext sc(startPos, length, initStyle, styler); for (; sc.More(); sc.Forward()) { if (sc.state == SCE_EIFFEL_STRINGEOL) { if (sc.ch != '\r' && sc.ch != '\n') { sc.SetState(SCE_EIFFEL_DEFAULT); } } else if (sc.state == SCE_EIFFEL_OPERATOR) { sc.SetState(SCE_EIFFEL_DEFAULT); } else if (sc.state == SCE_EIFFEL_WORD) { if (!IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrentLowered(s, sizeof(s)); if (!keywords.InList(s)) { sc.ChangeState(SCE_EIFFEL_IDENTIFIER); } sc.SetState(SCE_EIFFEL_DEFAULT); } } else if (sc.state == SCE_EIFFEL_NUMBER) { if (!IsAWordChar(sc.ch)) { sc.SetState(SCE_EIFFEL_DEFAULT); } } else if (sc.state == SCE_EIFFEL_COMMENTLINE) { if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_EIFFEL_DEFAULT); } } else if (sc.state == SCE_EIFFEL_STRING) { if (sc.ch == '%') { sc.Forward(); } else if (sc.ch == '\"') { sc.Forward(); sc.SetState(SCE_EIFFEL_DEFAULT); } } else if (sc.state == SCE_EIFFEL_CHARACTER) { if (sc.ch == '\r' || sc.ch == '\n') { sc.SetState(SCE_EIFFEL_STRINGEOL); } else if (sc.ch == '%') { sc.Forward(); } else if (sc.ch == '\'') { sc.Forward(); sc.SetState(SCE_EIFFEL_DEFAULT); } } if (sc.state == SCE_EIFFEL_DEFAULT) { if (sc.ch == '-' && sc.chNext == '-') { sc.SetState(SCE_EIFFEL_COMMENTLINE); } else if (sc.ch == '\"') { sc.SetState(SCE_EIFFEL_STRING); } else if (sc.ch == '\'') { sc.SetState(SCE_EIFFEL_CHARACTER); } else if (IsADigit(sc.ch) || (sc.ch == '.')) { sc.SetState(SCE_EIFFEL_NUMBER); } else if (IsAWordStart(sc.ch)) { sc.SetState(SCE_EIFFEL_WORD); } else if (isEiffelOperator(sc.ch)) { sc.SetState(SCE_EIFFEL_OPERATOR); } } } sc.Complete(); } static bool IsEiffelComment(Accessor &styler, Sci_Position pos, Sci_Position len) { return len>1 && styler[pos]=='-' && styler[pos+1]=='-'; } static void FoldEiffelDocIndent(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { Sci_Position lengthDoc = startPos + length; // Backtrack to previous line in case need to fix its fold status Sci_Position lineCurrent = styler.GetLine(startPos); if (startPos > 0) { if (lineCurrent > 0) { lineCurrent--; startPos = styler.LineStart(lineCurrent); } } int spaceFlags = 0; int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsEiffelComment); char chNext = styler[startPos]; for (Sci_Position i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) { int lev = indentCurrent; int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsEiffelComment); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { // Only non whitespace lines can be headers if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { // Line after is blank so check the next - maybe should continue further? int spaceFlags2 = 0; int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsEiffelComment); if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { lev |= SC_FOLDLEVELHEADERFLAG; } } } indentCurrent = indentNext; styler.SetLevel(lineCurrent, lev); lineCurrent++; } } } static void FoldEiffelDocKeyWords(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, WordList *[], Accessor &styler) { Sci_PositionU lengthDoc = startPos + length; int visibleChars = 0; Sci_Position lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; char chNext = styler[startPos]; int stylePrev = 0; int styleNext = styler.StyleAt(startPos); // lastDeferred should be determined by looking back to last keyword in case // the "deferred" is on a line before "class" bool lastDeferred = false; for (Sci_PositionU i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); int style = styleNext; styleNext = styler.StyleAt(i + 1); bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); if ((stylePrev != SCE_EIFFEL_WORD) && (style == SCE_EIFFEL_WORD)) { char s[20]; Sci_PositionU j = 0; while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { s[j] = styler[i + j]; j++; } s[j] = '\0'; if ( (strcmp(s, "check") == 0) || (strcmp(s, "debug") == 0) || (strcmp(s, "deferred") == 0) || (strcmp(s, "do") == 0) || (strcmp(s, "from") == 0) || (strcmp(s, "if") == 0) || (strcmp(s, "inspect") == 0) || (strcmp(s, "once") == 0) ) levelCurrent++; if (!lastDeferred && (strcmp(s, "class") == 0)) levelCurrent++; if (strcmp(s, "end") == 0) levelCurrent--; lastDeferred = strcmp(s, "deferred") == 0; } if (atEOL) { int lev = levelPrev; if (visibleChars == 0) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; stylePrev = style; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const eiffelWordListDesc[] = { "Keywords", 0 }; LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent, eiffelWordListDesc); LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords, eiffelWordListDesc); scintilla/lexers/LexBatch.cxx0000644000175000017500000004174412557522743015246 0ustar neilneil// Scintilla source code edit control /** @file LexBatch.cxx ** Lexer for batch files. **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static bool Is0To9(char ch) { return (ch >= '0') && (ch <= '9'); } static bool IsAlphabetic(int ch) { return IsASCII(ch) && isalpha(ch); } static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators static bool IsBOperator(char ch) { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '?') || (ch == '*'); } // Tests for BATCH Separators static bool IsBSeparator(char ch) { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == '\"') || (ch == '\'') || (ch == '/'); } static void ColouriseBatchLine( char *lineBuffer, Sci_PositionU lengthLine, Sci_PositionU startLine, Sci_PositionU endPos, WordList *keywordlists[], Accessor &styler) { Sci_PositionU offset = 0; // Line Buffer Offset Sci_PositionU cmdLoc; // External Command / Program Location char wordBuffer[81]; // Word Buffer - large to catch long paths Sci_PositionU wbl; // Word Buffer Length Sci_PositionU wbo; // Word Buffer Offset - also Special Keyword Buffer Length WordList &keywords = *keywordlists[0]; // Internal Commands WordList &keywords2 = *keywordlists[1]; // External Commands (optional) // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // Toggling Regular Keyword Checking off improves readability // Other Regular Keywords and External Commands / Programs might also benefit from toggling // Need a more robust algorithm to properly toggle Regular Keyword Checking bool continueProcessing = true; // Used to toggle Regular Keyword Checking // Special Keywords are those that allow certain characters without whitespace after the command // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= // Special Keyword Buffer used to determine if the first n characters is a Keyword char sKeywordBuffer[10]; // Special Keyword Buffer bool sKeywordFound; // Exit Special Keyword for-loop if found // Skip initial spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); // Set External Command / Program Location cmdLoc = offset; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { if (lineBuffer[offset + 1] == ':') { // Colorize Fake Label (Comment) - :: is similar to REM, see http://content.techweb.com/winmag/columns/explorer/2000/21.htm styler.ColourTo(endPos, SCE_BAT_COMMENT); } else { // Colorize Real Label styler.ColourTo(endPos, SCE_BAT_LABEL); } return; // Check for Drive Change (Drive Change is internal command) - return if found } else if ((IsAlphabetic(lineBuffer[offset])) && (lineBuffer[offset + 1] == ':') && ((isspacechar(lineBuffer[offset + 2])) || (((lineBuffer[offset + 2] == '\\')) && (isspacechar(lineBuffer[offset + 3]))))) { // Colorize Regular Keyword styler.ColourTo(endPos, SCE_BAT_WORD); return; } // Check for Hide Command (@ECHO OFF/ON) if (lineBuffer[offset] == '@') { styler.ColourTo(startLine + offset, SCE_BAT_HIDE); offset++; } // Skip next spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Read remainder of line word-at-a-time or remainder-of-word-at-a-time while (offset < lengthLine) { if (offset > startLine) { // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Copy word from Line Buffer into Word Buffer wbl = 0; for (; offset < lengthLine && wbl < 80 && !isspacechar(lineBuffer[offset]); wbl++, offset++) { wordBuffer[wbl] = static_cast(tolower(lineBuffer[offset])); } wordBuffer[wbl] = '\0'; wbo = 0; // Check for Comment - return if found if (CompareCaseInsensitive(wordBuffer, "rem") == 0) { styler.ColourTo(endPos, SCE_BAT_COMMENT); return; } // Check for Separator if (IsBSeparator(wordBuffer[0])) { // Check for External Command / Program if ((cmdLoc == offset - wbl) && ((wordBuffer[0] == ':') || (wordBuffer[0] == '\\') || (wordBuffer[0] == '.'))) { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize External Command / Program if (!keywords2) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else if (keywords2.InList(wordBuffer)) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else { styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Reset External Command / Program Location cmdLoc = offset; } else { // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // Check for Regular Keyword in list } else if ((keywords.InList(wordBuffer)) && (continueProcessing)) { // ECHO, GOTO, PROMPT and SET require no further Regular Keyword Checking if ((CompareCaseInsensitive(wordBuffer, "echo") == 0) || (CompareCaseInsensitive(wordBuffer, "goto") == 0) || (CompareCaseInsensitive(wordBuffer, "prompt") == 0) || (CompareCaseInsensitive(wordBuffer, "set") == 0)) { continueProcessing = false; } // Identify External Command / Program Location for ERRORLEVEL, and EXIST if ((CompareCaseInsensitive(wordBuffer, "errorlevel") == 0) || (CompareCaseInsensitive(wordBuffer, "exist") == 0)) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip comparison while ((cmdLoc < lengthLine) && (!isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Identify External Command / Program Location for CALL, DO, LOADHIGH and LH } else if ((CompareCaseInsensitive(wordBuffer, "call") == 0) || (CompareCaseInsensitive(wordBuffer, "do") == 0) || (CompareCaseInsensitive(wordBuffer, "loadhigh") == 0) || (CompareCaseInsensitive(wordBuffer, "lh") == 0)) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } } // Colorize Regular keyword styler.ColourTo(startLine + offset - 1, SCE_BAT_WORD); // No need to Reset Offset // Check for Special Keyword in list, External Command / Program, or Default Text } else if ((wordBuffer[0] != '%') && (wordBuffer[0] != '!') && (!IsBOperator(wordBuffer[0])) && (continueProcessing)) { // Check for Special Keyword // Affected Commands are in Length range 2-6 // Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected sKeywordFound = false; for (Sci_PositionU keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) { wbo = 0; // Copy Keyword Length from Word Buffer into Special Keyword Buffer for (; wbo < keywordLength; wbo++) { sKeywordBuffer[wbo] = static_cast(wordBuffer[wbo]); } sKeywordBuffer[wbo] = '\0'; // Check for Special Keyword in list if ((keywords.InList(sKeywordBuffer)) && ((IsBOperator(wordBuffer[wbo])) || (IsBSeparator(wordBuffer[wbo])))) { sKeywordFound = true; // ECHO requires no further Regular Keyword Checking if (CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) { continueProcessing = false; } // Colorize Special Keyword as Regular Keyword styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_WORD); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } } // Check for External Command / Program or Default Text if (!sKeywordFound) { wbo = 0; // Check for External Command / Program if (cmdLoc == offset - wbl) { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Reset External Command / Program Location cmdLoc = offset - (wbl - wbo); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // CHOICE requires no further Regular Keyword Checking if (CompareCaseInsensitive(wordBuffer, "choice") == 0) { continueProcessing = false; } // Check for START (and its switches) - What follows is External Command \ Program if (CompareCaseInsensitive(wordBuffer, "start") == 0) { // Reset External Command / Program Location cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Reset External Command / Program Location if command switch detected if (lineBuffer[cmdLoc] == '/') { // Skip command switch while ((cmdLoc < lengthLine) && (!isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } } } // Colorize External Command / Program if (!keywords2) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else if (keywords2.InList(wordBuffer)) { styler.ColourTo(startLine + offset - 1, SCE_BAT_COMMAND); } else { styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } // No need to Reset Offset // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } } // Check for Argument (%n), Environment Variable (%x...%) or Local Variable (%%a) } else if (wordBuffer[0] == '%') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); wbo++; // Search to end of word for second % (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Check for Argument (%n) or (%*) if (((Is0To9(wordBuffer[1])) || (wordBuffer[1] == '*')) && (wordBuffer[wbo] != '%')) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - 2); } // Colorize Argument styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - 2); // Check for Expanded Argument (%~...) / Variable (%%~...) } else if (((wbl > 1) && (wordBuffer[1] == '~')) || ((wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] == '~'))) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Expanded Argument / Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Environment Variable (%x...%) } else if ((wordBuffer[1] != '%') && (wordBuffer[wbo] == '%')) { wbo++; // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); // Check for Local Variable (%%a) } else if ( (wbl > 2) && (wordBuffer[1] == '%') && (wordBuffer[2] != '%') && (!IsBOperator(wordBuffer[2])) && (!IsBSeparator(wordBuffer[2]))) { // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - 3); } // Colorize Local Variable styler.ColourTo(startLine + offset - 1 - (wbl - 3), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - 3); } // Check for Environment Variable (!x...!) } else if (wordBuffer[0] == '!') { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); wbo++; // Search to end of word for second ! (can be a long path) while ((wbo < wbl) && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } if (wordBuffer[wbo] == '!') { wbo++; // Check for External Command / Program if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } // Colorize Environment Variable styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_IDENTIFIER); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Check for Operator } else if (IsBOperator(wordBuffer[0])) { // Colorize Default Text styler.ColourTo(startLine + offset - 1 - wbl, SCE_BAT_DEFAULT); // Check for Comparison Operator if ((wordBuffer[0] == '=') && (wordBuffer[1] == '=')) { // Identify External Command / Program Location for IF cmdLoc = offset; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Colorize Comparison Operator styler.ColourTo(startLine + offset - 1 - (wbl - 2), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 2); // Check for Pipe Operator } else if (wordBuffer[0] == '|') { // Reset External Command / Program Location cmdLoc = offset - wbl + 1; // Skip next spaces while ((cmdLoc < lengthLine) && (isspacechar(lineBuffer[cmdLoc]))) { cmdLoc++; } // Colorize Pipe Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); // Check for Other Operator } else { // Check for > Operator if (wordBuffer[0] == '>') { // Turn Keyword and External Command / Program checking back on continueProcessing = true; } // Colorize Other Operator styler.ColourTo(startLine + offset - 1 - (wbl - 1), SCE_BAT_OPERATOR); // Reset Offset to re-process remainder of word offset -= (wbl - 1); } // Check for Default Text } else { // Read up to %, Operator or Separator while ((wbo < wbl) && (wordBuffer[wbo] != '%') && (wordBuffer[wbo] != '!') && (!IsBOperator(wordBuffer[wbo])) && (!IsBSeparator(wordBuffer[wbo]))) { wbo++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1 - (wbl - wbo), SCE_BAT_DEFAULT); // Reset Offset to re-process remainder of word offset -= (wbl - wbo); } // Skip next spaces - nothing happens if Offset was Reset while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } } // Colorize Default Text for remainder of line - currently not lexed styler.ColourTo(endPos, SCE_BAT_DEFAULT); } static void ColouriseBatchDoc( Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, WordList *keywordlists[], Accessor &styler) { char lineBuffer[1024]; styler.StartAt(startPos); styler.StartSegment(startPos); Sci_PositionU linePos = 0; Sci_PositionU startLine = startPos; for (Sci_PositionU i = startPos; i < startPos + length; i++) { lineBuffer[linePos++] = styler[i]; if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { // End of line (or of line buffer) met, colourise it lineBuffer[linePos] = '\0'; ColouriseBatchLine(lineBuffer, linePos, startLine, i, keywordlists, styler); linePos = 0; startLine = i + 1; } } if (linePos > 0) { // Last line does not have ending characters lineBuffer[linePos] = '\0'; ColouriseBatchLine(lineBuffer, linePos, startLine, startPos + length - 1, keywordlists, styler); } } static const char *const batchWordListDesc[] = { "Internal Commands", "External Commands", 0 }; LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc); scintilla/lexers/LexCrontab.cxx0000644000175000017500000001612112557522743015604 0ustar neilneil// Scintilla source code edit control /** @file LexCrontab.cxx ** Lexer to use with extended crontab files used by a powerful ** Windows scheduler/event monitor/automation manager nnCron. ** (http://nemtsev.eserv.ru/) **/ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif static void ColouriseNncrontabDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) { int state = SCE_NNCRONTAB_DEFAULT; char chNext = styler[startPos]; Sci_Position lengthDoc = startPos + length; // create a buffer large enough to take the largest chunk... char *buffer = new char[length+1]; Sci_Position bufferCount = 0; // used when highliting environment variables inside quoted string: bool insideString = false; // this assumes that we have 3 keyword list in conf.properties WordList §ion = *keywordLists[0]; WordList &keyword = *keywordLists[1]; WordList &modifier = *keywordLists[2]; // go through all provided text segment // using the hand-written state machine shown below styler.StartAt(startPos); styler.StartSegment(startPos); for (Sci_Position i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); if (styler.IsLeadByte(ch)) { chNext = styler.SafeGetCharAt(i + 2); i++; continue; } switch(state) { case SCE_NNCRONTAB_DEFAULT: if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { // whitespace is simply ignored here... styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); break; } else if( ch == '#' && styler.SafeGetCharAt(i+1) == '(') { // signals the start of a task... state = SCE_NNCRONTAB_TASK; styler.ColourTo(i,SCE_NNCRONTAB_TASK); } else if( ch == '\\' && (styler.SafeGetCharAt(i+1) == ' ' || styler.SafeGetCharAt(i+1) == '\t')) { // signals the start of an extended comment... state = SCE_NNCRONTAB_COMMENT; styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } else if( ch == '#' ) { // signals the start of a plain comment... state = SCE_NNCRONTAB_COMMENT; styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } else if( ch == ')' && styler.SafeGetCharAt(i+1) == '#') { // signals the end of a task... state = SCE_NNCRONTAB_TASK; styler.ColourTo(i,SCE_NNCRONTAB_TASK); } else if( ch == '"') { state = SCE_NNCRONTAB_STRING; styler.ColourTo(i,SCE_NNCRONTAB_STRING); } else if( ch == '%') { // signals environment variables state = SCE_NNCRONTAB_ENVIRONMENT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); } else if( ch == '<' && styler.SafeGetCharAt(i+1) == '%') { // signals environment variables state = SCE_NNCRONTAB_ENVIRONMENT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); } else if( ch == '*' ) { // signals an asterisk // no state jump necessary for this simple case... styler.ColourTo(i,SCE_NNCRONTAB_ASTERISK); } else if( (IsASCII(ch) && isalpha(ch)) || ch == '<' ) { // signals the start of an identifier bufferCount = 0; buffer[bufferCount++] = ch; state = SCE_NNCRONTAB_IDENTIFIER; } else if( IsASCII(ch) && isdigit(ch) ) { // signals the start of a number bufferCount = 0; buffer[bufferCount++] = ch; state = SCE_NNCRONTAB_NUMBER; } else { // style it the default style.. styler.ColourTo(i,SCE_NNCRONTAB_DEFAULT); } break; case SCE_NNCRONTAB_COMMENT: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_NNCRONTAB_DEFAULT; } else { styler.ColourTo(i,SCE_NNCRONTAB_COMMENT); } break; case SCE_NNCRONTAB_TASK: // if we find a newline here, // we simply go to default state // else continue to work on it... if( ch == '\n' || ch == '\r' ) { state = SCE_NNCRONTAB_DEFAULT; } else { styler.ColourTo(i,SCE_NNCRONTAB_TASK); } break; case SCE_NNCRONTAB_STRING: if( ch == '%' ) { state = SCE_NNCRONTAB_ENVIRONMENT; insideString = true; styler.ColourTo(i-1,SCE_NNCRONTAB_STRING); break; } // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) { state = SCE_NNCRONTAB_DEFAULT; } styler.ColourTo(i,SCE_NNCRONTAB_STRING); break; case SCE_NNCRONTAB_ENVIRONMENT: // if we find the end of a string char, we simply go to default state // else we're still dealing with an string... if( ch == '%' && insideString ) { state = SCE_NNCRONTAB_STRING; insideString = false; break; } if( (ch == '%' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') || (ch == '>') ) { state = SCE_NNCRONTAB_DEFAULT; styler.ColourTo(i,SCE_NNCRONTAB_ENVIRONMENT); break; } styler.ColourTo(i+1,SCE_NNCRONTAB_ENVIRONMENT); break; case SCE_NNCRONTAB_IDENTIFIER: // stay in CONF_IDENTIFIER state until we find a non-alphanumeric if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '<') || (ch == '>') || (ch == '@') ) { buffer[bufferCount++] = ch; } else { state = SCE_NNCRONTAB_DEFAULT; buffer[bufferCount] = '\0'; // check if the buffer contains a keyword, // and highlight it if it is a keyword... if(section.InList(buffer)) { styler.ColourTo(i,SCE_NNCRONTAB_SECTION ); } else if(keyword.InList(buffer)) { styler.ColourTo(i-1,SCE_NNCRONTAB_KEYWORD ); } // else if(strchr(buffer,'/') || strchr(buffer,'.')) { // styler.ColourTo(i-1,SCE_NNCRONTAB_EXTENSION); // } else if(modifier.InList(buffer)) { styler.ColourTo(i-1,SCE_NNCRONTAB_MODIFIER ); } else { styler.ColourTo(i-1,SCE_NNCRONTAB_DEFAULT); } // push back the faulty character chNext = styler[i--]; } break; case SCE_NNCRONTAB_NUMBER: // stay in CONF_NUMBER state until we find a non-numeric if( IsASCII(ch) && isdigit(ch) /* || ch == '.' */ ) { buffer[bufferCount++] = ch; } else { state = SCE_NNCRONTAB_DEFAULT; buffer[bufferCount] = '\0'; // Colourize here... (normal number) styler.ColourTo(i-1,SCE_NNCRONTAB_NUMBER); // push back a character chNext = styler[i--]; } break; } } delete []buffer; } static const char * const cronWordListDesc[] = { "Section keywords and Forth words", "nnCrontab keywords", "Modifiers", 0 }; LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab", 0, cronWordListDesc); scintilla/lexers/LexTeX.cxx0000644000175000017500000003330212557522743014714 0ustar neilneil// Scintilla source code edit control // File: LexTeX.cxx - general context conformant tex coloring scheme // Author: Hans Hagen - PRAGMA ADE - Hasselt NL - www.pragma-ade.com // Version: September 28, 2003 // Copyright: 1998-2003 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // This lexer is derived from the one written for the texwork environment (1999++) which in // turn is inspired on texedit (1991++) which finds its roots in wdt (1986). // If you run into strange boundary cases, just tell me and I'll look into it. // TeX Folding code added by instanton (soft_share@126.com) with borrowed code from VisualTeX source by Alex Romanenko. // Version: June 22, 2007 #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // val SCE_TEX_DEFAULT = 0 // val SCE_TEX_SPECIAL = 1 // val SCE_TEX_GROUP = 2 // val SCE_TEX_SYMBOL = 3 // val SCE_TEX_COMMAND = 4 // val SCE_TEX_TEXT = 5 // Definitions in SciTEGlobal.properties: // // TeX Highlighting // // # Default // style.tex.0=fore:#7F7F00 // # Special // style.tex.1=fore:#007F7F // # Group // style.tex.2=fore:#880000 // # Symbol // style.tex.3=fore:#7F7F00 // # Command // style.tex.4=fore:#008800 // # Text // style.tex.5=fore:#000000 // lexer.tex.interface.default=0 // lexer.tex.comment.process=0 // todo: lexer.tex.auto.if // Auxiliary functions: static inline bool endOfLine(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')) ; } static inline bool isTeXzero(int ch) { return (ch == '%') ; } static inline bool isTeXone(int ch) { return (ch == '[') || (ch == ']') || (ch == '=') || (ch == '#') || (ch == '(') || (ch == ')') || (ch == '<') || (ch == '>') || (ch == '"') ; } static inline bool isTeXtwo(int ch) { return (ch == '{') || (ch == '}') || (ch == '$') ; } static inline bool isTeXthree(int ch) { return (ch == '~') || (ch == '^') || (ch == '_') || (ch == '&') || (ch == '-') || (ch == '+') || (ch == '\"') || (ch == '`') || (ch == '/') || (ch == '|') || (ch == '%') ; } static inline bool isTeXfour(int ch) { return (ch == '\\') ; } static inline bool isTeXfive(int ch) { return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) || (ch == '@') || (ch == '!') || (ch == '?') ; } static inline bool isTeXsix(int ch) { return (ch == ' ') ; } static inline bool isTeXseven(int ch) { return (ch == '^') ; } // Interface determination static int CheckTeXInterface( Sci_PositionU startPos, Sci_Position length, Accessor &styler, int defaultInterface) { char lineBuffer[1024] ; Sci_PositionU linePos = 0 ; // some day we can make something lexer.tex.mapping=(all,0)(nl,1)(en,2)... if (styler.SafeGetCharAt(0) == '%') { for (Sci_PositionU i = 0; i < startPos + length; i++) { lineBuffer[linePos++] = styler.SafeGetCharAt(i) ; if (endOfLine(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) { lineBuffer[linePos] = '\0'; if (strstr(lineBuffer, "interface=all")) { return 0 ; } else if (strstr(lineBuffer, "interface=tex")) { return 1 ; } else if (strstr(lineBuffer, "interface=nl")) { return 2 ; } else if (strstr(lineBuffer, "interface=en")) { return 3 ; } else if (strstr(lineBuffer, "interface=de")) { return 4 ; } else if (strstr(lineBuffer, "interface=cz")) { return 5 ; } else if (strstr(lineBuffer, "interface=it")) { return 6 ; } else if (strstr(lineBuffer, "interface=ro")) { return 7 ; } else if (strstr(lineBuffer, "interface=latex")) { // we will move latex cum suis up to 91+ when more keyword lists are supported return 8 ; } else if (styler.SafeGetCharAt(1) == 'D' && strstr(lineBuffer, "%D \\module")) { // better would be to limit the search to just one line return 3 ; } else { return defaultInterface ; } } } } return defaultInterface ; } static void ColouriseTeXDoc( Sci_PositionU startPos, Sci_Position length, int, WordList *keywordlists[], Accessor &styler) { styler.StartAt(startPos) ; styler.StartSegment(startPos) ; bool processComment = styler.GetPropertyInt("lexer.tex.comment.process", 0) == 1 ; bool useKeywords = styler.GetPropertyInt("lexer.tex.use.keywords", 1) == 1 ; bool autoIf = styler.GetPropertyInt("lexer.tex.auto.if", 1) == 1 ; int defaultInterface = styler.GetPropertyInt("lexer.tex.interface.default", 1) ; char key[100] ; int k ; bool newifDone = false ; bool inComment = false ; int currentInterface = CheckTeXInterface(startPos,length,styler,defaultInterface) ; if (currentInterface == 0) { useKeywords = false ; currentInterface = 1 ; } WordList &keywords = *keywordlists[currentInterface-1] ; StyleContext sc(startPos, length, SCE_TEX_TEXT, styler); bool going = sc.More() ; // needed because of a fuzzy end of file state for (; going; sc.Forward()) { if (! sc.More()) { going = false ; } // we need to go one behind the end of text if (inComment) { if (sc.atLineEnd) { sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; inComment = false ; } } else { if (! isTeXfive(sc.ch)) { if (sc.state == SCE_TEX_COMMAND) { if (sc.LengthCurrent() == 1) { // \ if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) { sc.Forward(2) ; // \^^ and \^^ } sc.ForwardSetState(SCE_TEX_TEXT) ; } else { sc.GetCurrent(key, sizeof(key)-1) ; k = static_cast(strlen(key)) ; memmove(key,key+1,k) ; // shift left over escape token key[k] = '\0' ; k-- ; if (! keywords || ! useKeywords) { sc.SetState(SCE_TEX_COMMAND) ; newifDone = false ; } else if (k == 1) { //\ sc.SetState(SCE_TEX_COMMAND) ; newifDone = false ; } else if (keywords.InList(key)) { sc.SetState(SCE_TEX_COMMAND) ; newifDone = autoIf && (strcmp(key,"newif") == 0) ; } else if (autoIf && ! newifDone && (key[0] == 'i') && (key[1] == 'f') && keywords.InList("if")) { sc.SetState(SCE_TEX_COMMAND) ; } else { sc.ChangeState(SCE_TEX_TEXT) ; sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; } } } if (isTeXzero(sc.ch)) { sc.SetState(SCE_TEX_SYMBOL); if (!endOfLine(styler,sc.currentPos + 1)) sc.ForwardSetState(SCE_TEX_DEFAULT) ; inComment = ! processComment ; newifDone = false ; } else if (isTeXseven(sc.ch) && isTeXseven(sc.chNext)) { sc.SetState(SCE_TEX_TEXT) ; sc.ForwardSetState(SCE_TEX_TEXT) ; } else if (isTeXone(sc.ch)) { sc.SetState(SCE_TEX_SPECIAL) ; newifDone = false ; } else if (isTeXtwo(sc.ch)) { sc.SetState(SCE_TEX_GROUP) ; newifDone = false ; } else if (isTeXthree(sc.ch)) { sc.SetState(SCE_TEX_SYMBOL) ; newifDone = false ; } else if (isTeXfour(sc.ch)) { sc.SetState(SCE_TEX_COMMAND) ; } else if (isTeXsix(sc.ch)) { sc.SetState(SCE_TEX_TEXT) ; } else if (sc.atLineEnd) { sc.SetState(SCE_TEX_TEXT) ; newifDone = false ; inComment = false ; } else { sc.SetState(SCE_TEX_TEXT) ; } } else if (sc.state != SCE_TEX_COMMAND) { sc.SetState(SCE_TEX_TEXT) ; } } } sc.ChangeState(SCE_TEX_TEXT) ; sc.Complete(); } static inline bool isNumber(int ch) { return (ch == '0') || (ch == '1') || (ch == '2') || (ch == '3') || (ch == '4') || (ch == '5') || (ch == '6') || (ch == '7') || (ch == '8') || (ch == '9'); } static inline bool isWordChar(int ch) { return ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')); } static int ParseTeXCommand(Sci_PositionU pos, Accessor &styler, char *command) { Sci_Position length=0; char ch=styler.SafeGetCharAt(pos+1); if(ch==',' || ch==':' || ch==';' || ch=='%'){ command[0]=ch; command[1]=0; return 1; } // find end while(isWordChar(ch) && !isNumber(ch) && ch!='_' && ch!='.' && length<100){ command[length]=ch; length++; ch=styler.SafeGetCharAt(pos+length+1); } command[length]='\0'; if(!length) return 0; return length+1; } static int classifyFoldPointTeXPaired(const char* s) { int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s, "begin")==0||strcmp(s,"FoldStart")==0|| strcmp(s,"abstract")==0||strcmp(s,"unprotect")==0|| strcmp(s,"title")==0||strncmp(s,"start",5)==0||strncmp(s,"Start",5)==0|| strcmp(s,"documentclass")==0||strncmp(s,"if",2)==0 ) lev=1; if (strcmp(s, "end")==0||strcmp(s,"FoldStop")==0|| strcmp(s,"maketitle")==0||strcmp(s,"protect")==0|| strncmp(s,"stop",4)==0||strncmp(s,"Stop",4)==0|| strcmp(s,"fi")==0 ) lev=-1; } return lev; } static int classifyFoldPointTeXUnpaired(const char* s) { int lev=0; if (!(isdigit(s[0]) || (s[0] == '.'))){ if (strcmp(s,"part")==0|| strcmp(s,"chapter")==0|| strcmp(s,"section")==0|| strcmp(s,"subsection")==0|| strcmp(s,"subsubsection")==0|| strcmp(s,"CJKfamily")==0|| strcmp(s,"appendix")==0|| strcmp(s,"Topic")==0||strcmp(s,"topic")==0|| strcmp(s,"subject")==0||strcmp(s,"subsubject")==0|| strcmp(s,"def")==0||strcmp(s,"gdef")==0||strcmp(s,"edef")==0|| strcmp(s,"xdef")==0||strcmp(s,"framed")==0|| strcmp(s,"frame")==0|| strcmp(s,"foilhead")==0||strcmp(s,"overlays")==0||strcmp(s,"slide")==0 ){ lev=1; } } return lev; } static bool IsTeXCommentLine(Sci_Position line, Accessor &styler) { Sci_Position pos = styler.LineStart(line); Sci_Position eol_pos = styler.LineStart(line + 1) - 1; Sci_Position startpos = pos; while (startpos SC_FOLDLEVELBASE && ((ch == '\r' || ch=='\n') && (chNext == '\\'))) { ParseTeXCommand(i+1, styler, buffer); levelCurrent -= classifyFoldPointTeXUnpaired(buffer); } char chNext2; char chNext3; char chNext4; char chNext5; chNext2=styler.SafeGetCharAt(i+2); chNext3=styler.SafeGetCharAt(i+3); chNext4=styler.SafeGetCharAt(i+4); chNext5=styler.SafeGetCharAt(i+5); bool atEOfold = (ch == '%') && (chNext == '%') && (chNext2=='}') && (chNext3=='}')&& (chNext4=='-')&& (chNext5=='-'); bool atBOfold = (ch == '%') && (chNext == '%') && (chNext2=='-') && (chNext3=='-')&& (chNext4=='{')&& (chNext5=='{'); if(atBOfold){ levelCurrent+=1; } if(atEOfold){ levelCurrent-=1; } if(ch=='\\' && chNext=='['){ levelCurrent+=1; } if(ch=='\\' && chNext==']'){ levelCurrent-=1; } bool foldComment = styler.GetPropertyInt("fold.comment") != 0; if (foldComment && atEOL && IsTeXCommentLine(lineCurrent, styler)) { if (lineCurrent==0 && IsTeXCommentLine(lineCurrent + 1, styler) ) levelCurrent++; else if (lineCurrent!=0 && !IsTeXCommentLine(lineCurrent - 1, styler) && IsTeXCommentLine(lineCurrent + 1, styler) ) levelCurrent++; else if (lineCurrent!=0 && IsTeXCommentLine(lineCurrent - 1, styler) && !IsTeXCommentLine(lineCurrent+1, styler)) levelCurrent--; } //--------------------------------------------------------------------------------------------- if (atEOL) { int lev = levelPrev; if (visibleChars == 0 && foldCompact) lev |= SC_FOLDLEVELWHITEFLAG; if ((levelCurrent > levelPrev) && (visibleChars > 0)) lev |= SC_FOLDLEVELHEADERFLAG; if (lev != styler.LevelAt(lineCurrent)) { styler.SetLevel(lineCurrent, lev); } lineCurrent++; levelPrev = levelCurrent; visibleChars = 0; } if (!isspacechar(ch)) visibleChars++; } // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; styler.SetLevel(lineCurrent, levelPrev | flagsNext); } static const char * const texWordListDesc[] = { "TeX, eTeX, pdfTeX, Omega", "ConTeXt Dutch", "ConTeXt English", "ConTeXt German", "ConTeXt Czech", "ConTeXt Italian", "ConTeXt Romanian", 0, } ; LexerModule lmTeX(SCLEX_TEX, ColouriseTeXDoc, "tex", FoldTexDoc, texWordListDesc); scintilla/lexers/LexHaskell.cxx0000644000175000017500000010662312557522743015606 0ustar neilneil/****************************************************************** * LexHaskell.cxx * * A haskell lexer for the scintilla code control. * Some stuff "lended" from LexPython.cxx and LexCPP.cxx. * External lexer stuff inspired from the caml external lexer. * Folder copied from Python's. * * Written by Tobias Engvall - tumm at dtek dot chalmers dot se * * Several bug fixes by Krasimir Angelov - kr.angelov at gmail.com * * Improved by kudah * * TODO: * * A proper lexical folder to fold group declarations, comments, pragmas, * #ifdefs, explicit layout, lists, tuples, quasi-quotes, splces, etc, etc, * etc. * *****************************************************************/ #include #include #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "PropSetSimple.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "CharacterCategory.h" #include "LexerModule.h" #include "OptionSet.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // See https://github.com/ghc/ghc/blob/master/compiler/parser/Lexer.x#L1682 // Note, letter modifiers are prohibited. static int u_iswupper (int ch) { CharacterCategory c = CategoriseCharacter(ch); return c == ccLu || c == ccLt; } static int u_iswalpha (int ch) { CharacterCategory c = CategoriseCharacter(ch); return c == ccLl || c == ccLu || c == ccLt || c == ccLo; } static int u_iswalnum (int ch) { CharacterCategory c = CategoriseCharacter(ch); return c == ccLl || c == ccLu || c == ccLt || c == ccLo || c == ccNd || c == ccNo; } static int u_IsHaskellSymbol(int ch) { CharacterCategory c = CategoriseCharacter(ch); return c == ccPc || c == ccPd || c == ccPo || c == ccSm || c == ccSc || c == ccSk || c == ccSo; } static inline bool IsHaskellLetter(const int ch) { if (IsASCII(ch)) { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'); } else { return u_iswalpha(ch) != 0; } } static inline bool IsHaskellAlphaNumeric(const int ch) { if (IsASCII(ch)) { return IsAlphaNumeric(ch); } else { return u_iswalnum(ch) != 0; } } static inline bool IsHaskellUpperCase(const int ch) { if (IsASCII(ch)) { return ch >= 'A' && ch <= 'Z'; } else { return u_iswupper(ch) != 0; } } static inline bool IsAnHaskellOperatorChar(const int ch) { if (IsASCII(ch)) { return ( ch == '!' || ch == '#' || ch == '$' || ch == '%' || ch == '&' || ch == '*' || ch == '+' || ch == '-' || ch == '.' || ch == '/' || ch == ':' || ch == '<' || ch == '=' || ch == '>' || ch == '?' || ch == '@' || ch == '^' || ch == '|' || ch == '~' || ch == '\\'); } else { return u_IsHaskellSymbol(ch) != 0; } } static inline bool IsAHaskellWordStart(const int ch) { return IsHaskellLetter(ch) || ch == '_'; } static inline bool IsAHaskellWordChar(const int ch) { return ( IsHaskellAlphaNumeric(ch) || ch == '_' || ch == '\''); } static inline bool IsCommentBlockStyle(int style) { return (style >= SCE_HA_COMMENTBLOCK && style <= SCE_HA_COMMENTBLOCK3); } static inline bool IsCommentStyle(int style) { return (style >= SCE_HA_COMMENTLINE && style <= SCE_HA_COMMENTBLOCK3) || ( style == SCE_HA_LITERATE_COMMENT || style == SCE_HA_LITERATE_CODEDELIM); } // styles which do not belong to Haskell, but to external tools static inline bool IsExternalStyle(int style) { return ( style == SCE_HA_PREPROCESSOR || style == SCE_HA_LITERATE_COMMENT || style == SCE_HA_LITERATE_CODEDELIM); } static inline int CommentBlockStyleFromNestLevel(const unsigned int nestLevel) { return SCE_HA_COMMENTBLOCK + (nestLevel % 3); } // Mangled version of lexlib/Accessor.cxx IndentAmount. // Modified to treat comment blocks as whitespace // plus special case for commentline/preprocessor. static int HaskellIndentAmount(Accessor &styler, const Sci_Position line) { // Determines the indentation level of the current line // Comment blocks are treated as whitespace Sci_Position pos = styler.LineStart(line); Sci_Position eol_pos = styler.LineStart(line + 1) - 1; char ch = styler[pos]; int style = styler.StyleAt(pos); int indent = 0; bool inPrevPrefix = line > 0; Sci_Position posPrev = inPrevPrefix ? styler.LineStart(line-1) : 0; while (( ch == ' ' || ch == '\t' || IsCommentBlockStyle(style) || style == SCE_HA_LITERATE_CODEDELIM) && (pos < eol_pos)) { if (inPrevPrefix) { char chPrev = styler[posPrev++]; if (chPrev != ' ' && chPrev != '\t') { inPrevPrefix = false; } } if (ch == '\t') { indent = (indent / 8 + 1) * 8; } else { // Space or comment block indent++; } pos++; ch = styler[pos]; style = styler.StyleAt(pos); } indent += SC_FOLDLEVELBASE; // if completely empty line or the start of a comment or preprocessor... if ( styler.LineStart(line) == styler.Length() || ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' || IsCommentStyle(style) || style == SCE_HA_PREPROCESSOR) return indent | SC_FOLDLEVELWHITEFLAG; else return indent; } struct OptionsHaskell { bool magicHash; bool allowQuotes; bool implicitParams; bool highlightSafe; bool cpp; bool stylingWithinPreprocessor; bool fold; bool foldComment; bool foldCompact; bool foldImports; OptionsHaskell() { magicHash = true; // Widespread use, enabled by default. allowQuotes = true; // Widespread use, enabled by default. implicitParams = false; // Fell out of favor, seldom used, disabled. highlightSafe = true; // Moderately used, doesn't hurt to enable. cpp = true; // Widespread use, enabled by default; stylingWithinPreprocessor = false; fold = false; foldComment = false; foldCompact = false; foldImports = false; } }; static const char * const haskellWordListDesc[] = { "Keywords", "FFI", "Reserved operators", 0 }; struct OptionSetHaskell : public OptionSet { OptionSetHaskell() { DefineProperty("lexer.haskell.allow.hash", &OptionsHaskell::magicHash, "Set to 0 to disallow the '#' character at the end of identifiers and " "literals with the haskell lexer " "(GHC -XMagicHash extension)"); DefineProperty("lexer.haskell.allow.quotes", &OptionsHaskell::allowQuotes, "Set to 0 to disable highlighting of Template Haskell name quotations " "and promoted constructors " "(GHC -XTemplateHaskell and -XDataKinds extensions)"); DefineProperty("lexer.haskell.allow.questionmark", &OptionsHaskell::implicitParams, "Set to 1 to allow the '?' character at the start of identifiers " "with the haskell lexer " "(GHC & Hugs -XImplicitParams extension)"); DefineProperty("lexer.haskell.import.safe", &OptionsHaskell::highlightSafe, "Set to 0 to disallow \"safe\" keyword in imports " "(GHC -XSafe, -XTrustworthy, -XUnsafe extensions)"); DefineProperty("lexer.haskell.cpp", &OptionsHaskell::cpp, "Set to 0 to disable C-preprocessor highlighting " "(-XCPP extension)"); DefineProperty("styling.within.preprocessor", &OptionsHaskell::stylingWithinPreprocessor, "For Haskell code, determines whether all preprocessor code is styled in the " "preprocessor style (0, the default) or only from the initial # to the end " "of the command word(1)." ); DefineProperty("fold", &OptionsHaskell::fold); DefineProperty("fold.comment", &OptionsHaskell::foldComment); DefineProperty("fold.compact", &OptionsHaskell::foldCompact); DefineProperty("fold.haskell.imports", &OptionsHaskell::foldImports, "Set to 1 to enable folding of import declarations"); DefineWordListSets(haskellWordListDesc); } }; class LexerHaskell : public ILexer { bool literate; Sci_Position firstImportLine; int firstImportIndent; WordList keywords; WordList ffi; WordList reserved_operators; OptionsHaskell options; OptionSetHaskell osHaskell; enum HashCount { oneHash ,twoHashes ,unlimitedHashes }; enum KeywordMode { HA_MODE_DEFAULT = 0 ,HA_MODE_IMPORT1 = 1 // after "import", before "qualified" or "safe" or package name or module name. ,HA_MODE_IMPORT2 = 2 // after module name, before "as" or "hiding". ,HA_MODE_IMPORT3 = 3 // after "as", before "hiding" ,HA_MODE_MODULE = 4 // after "module", before module name. ,HA_MODE_FFI = 5 // after "foreign", before FFI keywords ,HA_MODE_TYPE = 6 // after "type" or "data", before "family" }; enum LiterateMode { LITERATE_BIRD = 0 // if '>' is the first character on the line, // color '>' as a codedelim and the rest of // the line as code. // else if "\begin{code}" is the only word on the // line except whitespace, switch to LITERATE_BLOCK // otherwise color the line as a literate comment. ,LITERATE_BLOCK = 1 // if the string "\end{code}" is encountered at column // 0 ignoring all later characters, color the line // as a codedelim and switch to LITERATE_BIRD // otherwise color the line as code. }; struct HaskellLineInfo { unsigned int nestLevel; // 22 bits ought to be enough for anybody unsigned int nonexternalStyle; // 5 bits, widen if number of styles goes // beyond 31. bool pragma; LiterateMode lmode; KeywordMode mode; HaskellLineInfo(int state) : nestLevel (state >> 10) , nonexternalStyle ((state >> 5) & 0x1F) , pragma ((state >> 4) & 0x1) , lmode (static_cast((state >> 3) & 0x1)) , mode (static_cast(state & 0x7)) {} int ToLineState() { return (nestLevel << 10) | (nonexternalStyle << 5) | (pragma << 4) | (lmode << 3) | mode; } }; inline void skipMagicHash(StyleContext &sc, const HashCount hashes) const { if (options.magicHash && sc.ch == '#') { sc.Forward(); if (hashes == twoHashes && sc.ch == '#') { sc.Forward(); } else if (hashes == unlimitedHashes) { while (sc.ch == '#') { sc.Forward(); } } } } bool LineContainsImport(const Sci_Position line, Accessor &styler) const { if (options.foldImports) { Sci_Position currentPos = styler.LineStart(line); int style = styler.StyleAt(currentPos); Sci_Position eol_pos = styler.LineStart(line + 1) - 1; while (currentPos < eol_pos) { int ch = styler[currentPos]; style = styler.StyleAt(currentPos); if (ch == ' ' || ch == '\t' || IsCommentBlockStyle(style) || style == SCE_HA_LITERATE_CODEDELIM) { currentPos++; } else { break; } } return (style == SCE_HA_KEYWORD && styler.Match(currentPos, "import")); } else { return false; } } inline int IndentAmountWithOffset(Accessor &styler, const Sci_Position line) const { const int indent = HaskellIndentAmount(styler, line); const int indentLevel = indent & SC_FOLDLEVELNUMBERMASK; return indentLevel <= ((firstImportIndent - 1) + SC_FOLDLEVELBASE) ? indent : (indentLevel + firstImportIndent) | (indent & ~SC_FOLDLEVELNUMBERMASK); } inline int IndentLevelRemoveIndentOffset(const int indentLevel) const { return indentLevel <= ((firstImportIndent - 1) + SC_FOLDLEVELBASE) ? indentLevel : indentLevel - firstImportIndent; } public: LexerHaskell(bool literate_) : literate(literate_) , firstImportLine(-1) , firstImportIndent(0) {} virtual ~LexerHaskell() {} void SCI_METHOD Release() { delete this; } int SCI_METHOD Version() const { return lvOriginal; } const char * SCI_METHOD PropertyNames() { return osHaskell.PropertyNames(); } int SCI_METHOD PropertyType(const char *name) { return osHaskell.PropertyType(name); } const char * SCI_METHOD DescribeProperty(const char *name) { return osHaskell.DescribeProperty(name); } Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); const char * SCI_METHOD DescribeWordListSets() { return osHaskell.DescribeWordListSets(); } Sci_Position SCI_METHOD WordListSet(int n, const char *wl); void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess); void * SCI_METHOD PrivateCall(int, void *) { return 0; } static ILexer *LexerFactoryHaskell() { return new LexerHaskell(false); } static ILexer *LexerFactoryLiterateHaskell() { return new LexerHaskell(true); } }; Sci_Position SCI_METHOD LexerHaskell::PropertySet(const char *key, const char *val) { if (osHaskell.PropertySet(&options, key, val)) { return 0; } return -1; } Sci_Position SCI_METHOD LexerHaskell::WordListSet(int n, const char *wl) { WordList *wordListN = 0; switch (n) { case 0: wordListN = &keywords; break; case 1: wordListN = &ffi; break; case 2: wordListN = &reserved_operators; break; } Sci_Position firstModification = -1; if (wordListN) { WordList wlNew; wlNew.Set(wl); if (*wordListN != wlNew) { wordListN->Set(wl); firstModification = 0; } } return firstModification; } void SCI_METHOD LexerHaskell::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle ,IDocument *pAccess) { LexAccessor styler(pAccess); Sci_Position lineCurrent = styler.GetLine(startPos); HaskellLineInfo hs = HaskellLineInfo(lineCurrent ? styler.GetLineState(lineCurrent-1) : 0); // Do not leak onto next line if (initStyle == SCE_HA_STRINGEOL) initStyle = SCE_HA_DEFAULT; else if (initStyle == SCE_HA_LITERATE_CODEDELIM) initStyle = hs.nonexternalStyle; StyleContext sc(startPos, length, initStyle, styler); int base = 10; bool dot = false; bool inDashes = false; bool alreadyInTheMiddleOfOperator = false; assert(!(IsCommentBlockStyle(initStyle) && hs.nestLevel == 0)); while (sc.More()) { // Check for state end if (!IsExternalStyle(sc.state)) { hs.nonexternalStyle = sc.state; } // For lexer to work, states should unconditionally forward at least one // character. // If they don't, they should still check if they are at line end and // forward if so. // If a state forwards more than one character, it should check every time // that it is not a line end and cease forwarding otherwise. if (sc.atLineEnd) { // Remember the line state for future incremental lexing styler.SetLineState(lineCurrent, hs.ToLineState()); lineCurrent++; } // Handle line continuation generically. if (sc.ch == '\\' && (sc.chNext == '\n' || sc.chNext == '\r') && ( sc.state == SCE_HA_STRING || sc.state == SCE_HA_PREPROCESSOR)) { // Remember the line state for future incremental lexing styler.SetLineState(lineCurrent, hs.ToLineState()); lineCurrent++; sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } sc.Forward(); continue; } if (sc.atLineStart) { if (sc.state == SCE_HA_STRING || sc.state == SCE_HA_CHARACTER) { // Prevent SCE_HA_STRINGEOL from leaking back to previous line sc.SetState(sc.state); } if (literate && hs.lmode == LITERATE_BIRD) { if (!IsExternalStyle(sc.state)) { sc.SetState(SCE_HA_LITERATE_COMMENT); } } } // External // Literate if ( literate && hs.lmode == LITERATE_BIRD && sc.atLineStart && sc.ch == '>') { sc.SetState(SCE_HA_LITERATE_CODEDELIM); sc.ForwardSetState(hs.nonexternalStyle); } else if (literate && hs.lmode == LITERATE_BIRD && sc.atLineStart && ( sc.ch == ' ' || sc.ch == '\t' || sc.Match("\\begin{code}"))) { sc.SetState(sc.state); while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()) sc.Forward(); if (sc.Match("\\begin{code}")) { sc.Forward(static_cast(strlen("\\begin{code}"))); bool correct = true; while (!sc.atLineEnd && sc.More()) { if (sc.ch != ' ' && sc.ch != '\t') { correct = false; } sc.Forward(); } if (correct) { sc.ChangeState(SCE_HA_LITERATE_CODEDELIM); // color the line end hs.lmode = LITERATE_BLOCK; } } } else if (literate && hs.lmode == LITERATE_BLOCK && sc.atLineStart && sc.Match("\\end{code}")) { sc.SetState(SCE_HA_LITERATE_CODEDELIM); sc.Forward(static_cast(strlen("\\end{code}"))); while (!sc.atLineEnd && sc.More()) { sc.Forward(); } sc.SetState(SCE_HA_LITERATE_COMMENT); hs.lmode = LITERATE_BIRD; } // Preprocessor else if (sc.atLineStart && sc.ch == '#' && options.cpp && (!options.stylingWithinPreprocessor || sc.state == SCE_HA_DEFAULT)) { sc.SetState(SCE_HA_PREPROCESSOR); sc.Forward(); } // Literate else if (sc.state == SCE_HA_LITERATE_COMMENT) { sc.Forward(); } else if (sc.state == SCE_HA_LITERATE_CODEDELIM) { sc.ForwardSetState(hs.nonexternalStyle); } // Preprocessor else if (sc.state == SCE_HA_PREPROCESSOR) { if (sc.atLineEnd) { sc.SetState(options.stylingWithinPreprocessor ? SCE_HA_DEFAULT : hs.nonexternalStyle); sc.Forward(); // prevent double counting a line } else if (options.stylingWithinPreprocessor && !IsHaskellLetter(sc.ch)) { sc.SetState(SCE_HA_DEFAULT); } else { sc.Forward(); } } // Haskell // Operator else if (sc.state == SCE_HA_OPERATOR) { int style = SCE_HA_OPERATOR; if ( sc.ch == ':' && !alreadyInTheMiddleOfOperator // except "::" && !( sc.chNext == ':' && !IsAnHaskellOperatorChar(sc.GetRelative(2)))) { style = SCE_HA_CAPITAL; } alreadyInTheMiddleOfOperator = false; while (IsAnHaskellOperatorChar(sc.ch)) sc.Forward(); char s[100]; sc.GetCurrent(s, sizeof(s)); if (reserved_operators.InList(s)) style = SCE_HA_RESERVED_OPERATOR; sc.ChangeState(style); sc.SetState(SCE_HA_DEFAULT); } // String else if (sc.state == SCE_HA_STRING) { if (sc.atLineEnd) { sc.ChangeState(SCE_HA_STRINGEOL); sc.ForwardSetState(SCE_HA_DEFAULT); } else if (sc.ch == '\"') { sc.Forward(); skipMagicHash(sc, oneHash); sc.SetState(SCE_HA_DEFAULT); } else if (sc.ch == '\\') { sc.Forward(2); } else { sc.Forward(); } } // Char else if (sc.state == SCE_HA_CHARACTER) { if (sc.atLineEnd) { sc.ChangeState(SCE_HA_STRINGEOL); sc.ForwardSetState(SCE_HA_DEFAULT); } else if (sc.ch == '\'') { sc.Forward(); skipMagicHash(sc, oneHash); sc.SetState(SCE_HA_DEFAULT); } else if (sc.ch == '\\') { sc.Forward(2); } else { sc.Forward(); } } // Number else if (sc.state == SCE_HA_NUMBER) { if (sc.atLineEnd) { sc.SetState(SCE_HA_DEFAULT); sc.Forward(); // prevent double counting a line } else if (IsADigit(sc.ch, base)) { sc.Forward(); } else if (sc.ch=='.' && dot && IsADigit(sc.chNext, base)) { sc.Forward(2); dot = false; } else if ((base == 10) && (sc.ch == 'e' || sc.ch == 'E') && (IsADigit(sc.chNext) || sc.chNext == '+' || sc.chNext == '-')) { sc.Forward(); if (sc.ch == '+' || sc.ch == '-') sc.Forward(); } else { skipMagicHash(sc, twoHashes); sc.SetState(SCE_HA_DEFAULT); } } // Keyword or Identifier else if (sc.state == SCE_HA_IDENTIFIER) { int style = IsHaskellUpperCase(sc.ch) ? SCE_HA_CAPITAL : SCE_HA_IDENTIFIER; assert(IsAHaskellWordStart(sc.ch)); sc.Forward(); while (sc.More()) { if (IsAHaskellWordChar(sc.ch)) { sc.Forward(); } else if (sc.ch == '.' && style == SCE_HA_CAPITAL) { if (IsHaskellUpperCase(sc.chNext)) { sc.Forward(); style = SCE_HA_CAPITAL; } else if (IsAHaskellWordStart(sc.chNext)) { sc.Forward(); style = SCE_HA_IDENTIFIER; } else if (IsAnHaskellOperatorChar(sc.chNext)) { sc.Forward(); style = sc.ch == ':' ? SCE_HA_CAPITAL : SCE_HA_OPERATOR; while (IsAnHaskellOperatorChar(sc.ch)) sc.Forward(); break; } else { break; } } else { break; } } skipMagicHash(sc, unlimitedHashes); char s[100]; sc.GetCurrent(s, sizeof(s)); KeywordMode new_mode = HA_MODE_DEFAULT; if (keywords.InList(s)) { style = SCE_HA_KEYWORD; } else if (style == SCE_HA_CAPITAL) { if (hs.mode == HA_MODE_IMPORT1 || hs.mode == HA_MODE_IMPORT3) { style = SCE_HA_MODULE; new_mode = HA_MODE_IMPORT2; } else if (hs.mode == HA_MODE_MODULE) { style = SCE_HA_MODULE; } } else if (hs.mode == HA_MODE_IMPORT1 && strcmp(s,"qualified") == 0) { style = SCE_HA_KEYWORD; new_mode = HA_MODE_IMPORT1; } else if (options.highlightSafe && hs.mode == HA_MODE_IMPORT1 && strcmp(s,"safe") == 0) { style = SCE_HA_KEYWORD; new_mode = HA_MODE_IMPORT1; } else if (hs.mode == HA_MODE_IMPORT2) { if (strcmp(s,"as") == 0) { style = SCE_HA_KEYWORD; new_mode = HA_MODE_IMPORT3; } else if (strcmp(s,"hiding") == 0) { style = SCE_HA_KEYWORD; } } else if (hs.mode == HA_MODE_TYPE) { if (strcmp(s,"family") == 0) style = SCE_HA_KEYWORD; } if (hs.mode == HA_MODE_FFI) { if (ffi.InList(s)) { style = SCE_HA_KEYWORD; new_mode = HA_MODE_FFI; } } sc.ChangeState(style); sc.SetState(SCE_HA_DEFAULT); if (strcmp(s,"import") == 0 && hs.mode != HA_MODE_FFI) new_mode = HA_MODE_IMPORT1; else if (strcmp(s,"module") == 0) new_mode = HA_MODE_MODULE; else if (strcmp(s,"foreign") == 0) new_mode = HA_MODE_FFI; else if (strcmp(s,"type") == 0 || strcmp(s,"data") == 0) new_mode = HA_MODE_TYPE; hs.mode = new_mode; } // Comments // Oneliner else if (sc.state == SCE_HA_COMMENTLINE) { if (sc.atLineEnd) { sc.SetState(hs.pragma ? SCE_HA_PRAGMA : SCE_HA_DEFAULT); sc.Forward(); // prevent double counting a line } else if (inDashes && sc.ch != '-' && !hs.pragma) { inDashes = false; if (IsAnHaskellOperatorChar(sc.ch)) { alreadyInTheMiddleOfOperator = true; sc.ChangeState(SCE_HA_OPERATOR); } } else { sc.Forward(); } } // Nested else if (IsCommentBlockStyle(sc.state)) { if (sc.Match('{','-')) { sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel)); sc.Forward(2); hs.nestLevel++; } else if (sc.Match('-','}')) { sc.Forward(2); assert(hs.nestLevel > 0); if (hs.nestLevel > 0) hs.nestLevel--; sc.SetState( hs.nestLevel == 0 ? (hs.pragma ? SCE_HA_PRAGMA : SCE_HA_DEFAULT) : CommentBlockStyleFromNestLevel(hs.nestLevel - 1)); } else { sc.Forward(); } } // Pragma else if (sc.state == SCE_HA_PRAGMA) { if (sc.Match("#-}")) { hs.pragma = false; sc.Forward(3); sc.SetState(SCE_HA_DEFAULT); } else if (sc.Match('-','-')) { sc.SetState(SCE_HA_COMMENTLINE); sc.Forward(2); inDashes = false; } else if (sc.Match('{','-')) { sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel)); sc.Forward(2); hs.nestLevel = 1; } else { sc.Forward(); } } // New state? else if (sc.state == SCE_HA_DEFAULT) { // Digit if (IsADigit(sc.ch)) { hs.mode = HA_MODE_DEFAULT; sc.SetState(SCE_HA_NUMBER); if (sc.ch == '0' && (sc.chNext == 'X' || sc.chNext == 'x')) { // Match anything starting with "0x" or "0X", too sc.Forward(2); base = 16; dot = false; } else if (sc.ch == '0' && (sc.chNext == 'O' || sc.chNext == 'o')) { // Match anything starting with "0o" or "0O", too sc.Forward(2); base = 8; dot = false; } else { sc.Forward(); base = 10; dot = true; } } // Pragma else if (sc.Match("{-#")) { hs.pragma = true; sc.SetState(SCE_HA_PRAGMA); sc.Forward(3); } // Comment line else if (sc.Match('-','-')) { sc.SetState(SCE_HA_COMMENTLINE); sc.Forward(2); inDashes = true; } // Comment block else if (sc.Match('{','-')) { sc.SetState(CommentBlockStyleFromNestLevel(hs.nestLevel)); sc.Forward(2); hs.nestLevel = 1; } // String else if (sc.ch == '\"') { sc.SetState(SCE_HA_STRING); sc.Forward(); } // Character or quoted name or promoted term else if (sc.ch == '\'') { hs.mode = HA_MODE_DEFAULT; sc.SetState(SCE_HA_CHARACTER); sc.Forward(); if (options.allowQuotes) { // Quoted type ''T if (sc.ch=='\'' && IsAHaskellWordStart(sc.chNext)) { sc.Forward(); sc.ChangeState(SCE_HA_IDENTIFIER); } else if (sc.chNext != '\'') { // Quoted name 'n or promoted constructor 'N if (IsAHaskellWordStart(sc.ch)) { sc.ChangeState(SCE_HA_IDENTIFIER); // Promoted constructor operator ':~> } else if (sc.ch == ':') { alreadyInTheMiddleOfOperator = false; sc.ChangeState(SCE_HA_OPERATOR); // Promoted list or tuple '[T] } else if (sc.ch == '[' || sc.ch== '(') { sc.ChangeState(SCE_HA_OPERATOR); sc.ForwardSetState(SCE_HA_DEFAULT); } } } } // Operator starting with '?' or an implicit parameter else if (sc.ch == '?') { hs.mode = HA_MODE_DEFAULT; alreadyInTheMiddleOfOperator = false; sc.SetState(SCE_HA_OPERATOR); if ( options.implicitParams && IsAHaskellWordStart(sc.chNext) && !IsHaskellUpperCase(sc.chNext)) { sc.Forward(); sc.ChangeState(SCE_HA_IDENTIFIER); } } // Operator else if (IsAnHaskellOperatorChar(sc.ch)) { hs.mode = HA_MODE_DEFAULT; sc.SetState(SCE_HA_OPERATOR); } // Braces and punctuation else if (sc.ch == ',' || sc.ch == ';' || sc.ch == '(' || sc.ch == ')' || sc.ch == '[' || sc.ch == ']' || sc.ch == '{' || sc.ch == '}') { sc.SetState(SCE_HA_OPERATOR); sc.ForwardSetState(SCE_HA_DEFAULT); } // Keyword or Identifier else if (IsAHaskellWordStart(sc.ch)) { sc.SetState(SCE_HA_IDENTIFIER); // Something we don't care about } else { sc.Forward(); } } // This branch should never be reached. else { assert(false); sc.Forward(); } } sc.Complete(); } void SCI_METHOD LexerHaskell::Fold(Sci_PositionU startPos, Sci_Position length, int // initStyle ,IDocument *pAccess) { if (!options.fold) return; Accessor styler(pAccess, NULL); Sci_Position lineCurrent = styler.GetLine(startPos); if (lineCurrent <= firstImportLine) { firstImportLine = -1; // readjust first import position firstImportIndent = 0; } const Sci_Position maxPos = startPos + length; const Sci_Position maxLines = maxPos == styler.Length() ? styler.GetLine(maxPos) : styler.GetLine(maxPos - 1); // Requested last line const Sci_Position docLines = styler.GetLine(styler.Length()); // Available last line // Backtrack to previous non-blank line so we can determine indent level // for any white space lines // and so we can fix any preceding fold level (which is why we go back // at least one line in all cases) bool importHere = LineContainsImport(lineCurrent, styler); int indentCurrent = IndentAmountWithOffset(styler, lineCurrent); while (lineCurrent > 0) { lineCurrent--; importHere = LineContainsImport(lineCurrent, styler); indentCurrent = IndentAmountWithOffset(styler, lineCurrent); if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) break; } int indentCurrentLevel = indentCurrent & SC_FOLDLEVELNUMBERMASK; if (importHere) { indentCurrentLevel = IndentLevelRemoveIndentOffset(indentCurrentLevel); if (firstImportLine == -1) { firstImportLine = lineCurrent; firstImportIndent = (1 + indentCurrentLevel) - SC_FOLDLEVELBASE; } if (firstImportLine != lineCurrent) { indentCurrentLevel++; } } indentCurrent = indentCurrentLevel | (indentCurrent & ~SC_FOLDLEVELNUMBERMASK); // Process all characters to end of requested range //that hangs over the end of the range. Cap processing in all cases // to end of document. while (lineCurrent <= docLines && lineCurrent <= maxLines) { // Gather info Sci_Position lineNext = lineCurrent + 1; importHere = false; int indentNext = indentCurrent; if (lineNext <= docLines) { // Information about next line is only available if not at end of document importHere = LineContainsImport(lineNext, styler); indentNext = IndentAmountWithOffset(styler, lineNext); } if (indentNext & SC_FOLDLEVELWHITEFLAG) indentNext = SC_FOLDLEVELWHITEFLAG | indentCurrentLevel; // Skip past any blank lines for next indent level info; we skip also // comments (all comments, not just those starting in column 0) // which effectively folds them into surrounding code rather // than screwing up folding. while (lineNext < docLines && (indentNext & SC_FOLDLEVELWHITEFLAG)) { lineNext++; importHere = LineContainsImport(lineNext, styler); indentNext = IndentAmountWithOffset(styler, lineNext); } int indentNextLevel = indentNext & SC_FOLDLEVELNUMBERMASK; if (importHere) { indentNextLevel = IndentLevelRemoveIndentOffset(indentNextLevel); if (firstImportLine == -1) { firstImportLine = lineNext; firstImportIndent = (1 + indentNextLevel) - SC_FOLDLEVELBASE; } if (firstImportLine != lineNext) { indentNextLevel++; } } indentNext = indentNextLevel | (indentNext & ~SC_FOLDLEVELNUMBERMASK); const int levelBeforeComments = Maximum(indentCurrentLevel,indentNextLevel); // Now set all the indent levels on the lines we skipped // Do this from end to start. Once we encounter one line // which is indented more than the line after the end of // the comment-block, use the level of the block before Sci_Position skipLine = lineNext; int skipLevel = indentNextLevel; while (--skipLine > lineCurrent) { int skipLineIndent = IndentAmountWithOffset(styler, skipLine); if (options.foldCompact) { if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > indentNextLevel) { skipLevel = levelBeforeComments; } int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; styler.SetLevel(skipLine, skipLevel | whiteFlag); } else { if ( (skipLineIndent & SC_FOLDLEVELNUMBERMASK) > indentNextLevel && !(skipLineIndent & SC_FOLDLEVELWHITEFLAG)) { skipLevel = levelBeforeComments; } styler.SetLevel(skipLine, skipLevel); } } int lev = indentCurrent; if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) lev |= SC_FOLDLEVELHEADERFLAG; } // Set fold level for this line and move to next line styler.SetLevel(lineCurrent, options.foldCompact ? lev : lev & ~SC_FOLDLEVELWHITEFLAG); indentCurrent = indentNext; indentCurrentLevel = indentNextLevel; lineCurrent = lineNext; } // NOTE: Cannot set level of last line here because indentCurrent doesn't have // header flag set; the loop above is crafted to take care of this case! //styler.SetLevel(lineCurrent, indentCurrent); } LexerModule lmHaskell(SCLEX_HASKELL, LexerHaskell::LexerFactoryHaskell, "haskell", haskellWordListDesc); LexerModule lmLiterateHaskell(SCLEX_LITERATEHASKELL, LexerHaskell::LexerFactoryLiterateHaskell, "literatehaskell", haskellWordListDesc); scintilla/lexers/LexLua.cxx0000644000175000017500000003211512557522743014736 0ustar neilneil// Scintilla source code edit control /** @file LexLua.cxx ** Lexer for Lua language. ** ** Written by Paul Winwood. ** Folder by Alexey Yutkin. ** Modified by Marcos E. Wurzius & Philippe Lhoste **/ #include #include #include #include #include #include #include "ILexer.h" #include "Scintilla.h" #include "SciLexer.h" #include "WordList.h" #include "LexAccessor.h" #include "Accessor.h" #include "StyleContext.h" #include "CharacterSet.h" #include "LexerModule.h" #ifdef SCI_NAMESPACE using namespace Scintilla; #endif // Test for [=[ ... ]=] delimiters, returns 0 if it's only a [ or ], // return 1 for [[ or ]], returns >=2 for [=[ or ]=] and so on. // The maximum number of '=' characters allowed is 254. static int LongDelimCheck(StyleContext &sc) { int sep = 1; while (sc.GetRelative(sep) == '=' && sep < 0xFF) sep++; if (sc.GetRelative(sep) == sc.ch) return sep; return 0; } static void ColouriseLuaDoc( Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; WordList &keywords4 = *keywordlists[3]; WordList &keywords5 = *keywordlists[4]; WordList &keywords6 = *keywordlists[5]; WordList &keywords7 = *keywordlists[6]; WordList &keywords8 = *keywordlists[7]; // Accepts accented characters CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); CharacterSet setWord(CharacterSet::setAlphaNum, "_", 0x80, true); // Not exactly following number definition (several dots are seen as OK, etc.) // but probably enough in most cases. [pP] is for hex floats. CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP"); CharacterSet setExponent(CharacterSet::setNone, "eEpP"); CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#"); CharacterSet setEscapeSkip(CharacterSet::setNone, "\"'\\"); Sci_Position currentLine = styler.GetLine(startPos); // Initialize long string [[ ... ]] or block comment --[[ ... ]] nesting level, // if we are inside such a string. Block comment was introduced in Lua 5.0, // blocks with separators [=[ ... ]=] in Lua 5.1. // Continuation of a string (\z whitespace escaping) is controlled by stringWs. int nestLevel = 0; int sepCount = 0; int stringWs = 0; if (initStyle == SCE_LUA_LITERALSTRING || initStyle == SCE_LUA_COMMENT || initStyle == SCE_LUA_STRING || initStyle == SCE_LUA_CHARACTER) { int lineState = styler.GetLineState(currentLine - 1); nestLevel = lineState >> 9; sepCount = lineState & 0xFF; stringWs = lineState & 0x100; } // Do not leak onto next line if (initStyle == SCE_LUA_STRINGEOL || initStyle == SCE_LUA_COMMENTLINE || initStyle == SCE_LUA_PREPROCESSOR) { initStyle = SCE_LUA_DEFAULT; } StyleContext sc(startPos, length, initStyle, styler); if (startPos == 0 && sc.ch == '#') { // shbang line: # is a comment only if first char of the script sc.SetState(SCE_LUA_COMMENTLINE); } for (; sc.More(); sc.Forward()) { if (sc.atLineEnd) { // Update the line state, so it can be seen by next line currentLine = styler.GetLine(sc.currentPos); switch (sc.state) { case SCE_LUA_LITERALSTRING: case SCE_LUA_COMMENT: case SCE_LUA_STRING: case SCE_LUA_CHARACTER: // Inside a literal string, block comment or string, we set the line state styler.SetLineState(currentLine, (nestLevel << 9) | stringWs | sepCount); break; default: // Reset the line state styler.SetLineState(currentLine, 0); break; } } if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) { // Prevent SCE_LUA_STRINGEOL from leaking back to previous line sc.SetState(SCE_LUA_STRING); } // Handle string line continuation if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) && sc.ch == '\\') { if (sc.chNext == '\n' || sc.chNext == '\r') { sc.Forward(); if (sc.ch == '\r' && sc.chNext == '\n') { sc.Forward(); } continue; } } // Determine if the current state should terminate. if (sc.state == SCE_LUA_OPERATOR) { if (sc.ch == ':' && sc.chPrev == ':') { // ::