diff --git a/scintilla/.hg_archival.txt b/scintilla/.hg_archival.txt deleted file mode 100644 index 32a2d844..00000000 --- a/scintilla/.hg_archival.txt +++ /dev/null @@ -1,6 +0,0 @@ -repo: bdf8c3ef2fb01ea24578e726337888e706d10b92 -node: a3050823d2e8dcbc2714eadcc367c5d970deedb2 -branch: default -latesttag: rel-3-7-0 -latesttagdistance: 1 -changessincelatesttag: 1 diff --git a/scintilla/.hgeol b/scintilla/.hgeol deleted file mode 100644 index 45aa5e0b..00000000 --- a/scintilla/.hgeol +++ /dev/null @@ -1,42 +0,0 @@ -[patterns] -**.cxx = native -**.cpp = native -**.c = native -**.h = native -**.m = native -**.mm = native -**.iface = native -**.template = native -**.mk = native -**.py = native -**.rc = native -**.html = native -**.bat = native -**.mak = native -**.def = native -**.manifest = native -**.properties = native -**.styled = native -**.asp = native -**.php = native -**.vb = native -**.d = native -**.lua = native -**.rb = native -**.pl = native -**.txt = native -**.pch = native -**.hgeol = native -**.dsp = native -**.sln = native -**.vcproj = native -**.pro = native -**.gen = native -**makefile = native -README = native -**.bmp = BIN -**.cur = BIN -**.ico = BIN -**.jpg = BIN -**.png = BIN -tgzsrc = LF diff --git a/scintilla/.hgignore b/scintilla/.hgignore deleted file mode 100644 index 8ebfd2e3..00000000 --- a/scintilla/.hgignore +++ /dev/null @@ -1,59 +0,0 @@ -syntax: glob -*.o -*.a -*.lib -*.obj -*.pyc -*.dll -*.dylib -*.framework -*.pyd -*.exp -*.lib -*.pdb -*.res -*.bak -*.sbr -*.suo -*.idb -*.bsc -*.intermediate.manifest -*.lastbuildstate -*.cache -*.ilk -*.ncb -*.tlog -*.sdf -gtk/*.plist -win32/*.plist -*.opt -*.plg -*.pbxbtree -*.mode1v3 -*.pbxuser -*.pbproj -*.log -*.xcbkptlist -*.xcuserstate -xcuserdata/ -*.xcsettings -xcschememanagement.plist -.DS_Store -Debug -cocoa/build -cocoa/ScintillaFramework/build -cocoa/ScintillaTest/build -macosx/SciTest/build -*.cppcheck -Makefile.Debug -Makefile.Release -*_resource.rc -moc_* -*.pro.user -ScintillaEdit.cpp -ScintillaEdit.h -ScintillaConstants.py -ScintillaEditBase.intermediate.manifest -ScintillaEdit.intermediate.manifest -qt/*/Makefile -cov-int diff --git a/scintilla/.hgtags b/scintilla/.hgtags deleted file mode 100644 index 11561bad..00000000 --- a/scintilla/.hgtags +++ /dev/null @@ -1,123 +0,0 @@ -01f406ccdce315e9870c44036e18ebf0fa74df22 rel-1-64 -038d4e745187fddd764fda49b12b878ece14c0bd rel-1-63 -03dff61592cf2abbabd9e383f1c8417af3e9d87b rel-1-34 -11a62bd24819d0044dcf4b8621f79924cab781bd rel-1-56 -1804bf43c2443fb8db7468a36e8022891dfc32c5 rel-1-73 -1c4055eaf77fb0e2730adcba2b04a9c40318bdf1 rel-1-74 -2abff14b87854b56df577a96d6d87e06bbb44251 rel-1-27 -3a80173ef6320433ac4ab05ff97774f186d878ba rel-1-75 -4107ec8a3a14b68b832dd12ce568d6517da063f1 rel-2-03 -4479fb32e7238069d4ed81d7e586b6bcbc2a94ce rel-1-39 -4af05ea4430505d34c9832313c1e5aaac7a54237 rel-1-61 -4b0ff01c39b7b9c7aa65d1965bd49daaffe05ea8 rel-1-40 -4ec090359e447b59d24c3e970fc9faede13ec187 rel-1-45 -4f3e52891003743da45d4464020f59849240d278 rel-1-37 -4f77dabcfbab1de33dc2ef89029a4536a1c6c697 rel-1-25 -4ff6778c456258929c6f9074bdc03d90c28968bf rel-2-00 -58c51367e4127167fe7be54681b788618732d65b rel-1-51 -668816d0fd5d75dee228bca98b183969c4b1de53 rel-1-52 -67a79ce06212780dc0592bbcf3a3172244cf18c8 rel-1-76 -67aaa980e972a75e9aa11e1fbfe66b4b9c1d78fe rel-1-48 -6a3e91c35d19e241621c10b2a37c6233e33c1c0a rel-1-66 -6a3e91c35d19e241621c10b2a37c6233e33c1c0a rel-1-66-carbon -6aa816d746280a68821eb90efad0fb5f2d3b751e rel-1-35 -6b44857e410f45ad5c9e9b48a481fb902c20a2dc rel-1-26 -6b9c7f104c6160507212e5412ba79ecffc6f9057 initial -7681410bf25abb8fa8f51552fd61ec83bdf1a8b0 rel-1-65 -7c87fe602c2c1fd973eb89675813192723f7f368 rel-1-30 -85fbbc9b421bdc97a34bead08cdd34cf4c6271f3 rel-1-58 -86d8875ed69c96026e9ec4b77fff3f9d369bfcb6 rel-1-60 -87f60a6fb558871ef85a781e5d03321f77e1d11a rel-1-38 -89b230d9f013855747841b3b3bc8b229259e0c81 rel-1-79 -8af30946bc0ad1196ddf51b51545929cab3fa2e6 rel-1-69 -8c2d64c399e5d823e2b2ef547a260357be0428c0 rel-1-54 -8d11fc4c543f6228d73fa385ec9fca5723f8c832 rel-2-11 -94801bf860900c9dde428db66c5e01a63e521c05 rel-1-44 -988c66dff88ed44913d8d6303f7e136c19f5d6ea rel-2-02 -9d268dfb34560f2aeb817148ca746814fd85115d rel-1-46 -9e813ff6f15778dd6c6d2f6ab20f9aa8e91b2e47 rel-1-47 -9eda4d6efdd657f2ce8ad1034bdd20998f573a40 rel-1-49 -a313740fe8b8ee9df5cfc6f4bae7c665d160f4dd rel-1-78 -a5905b21afdbee56912e039eeb2e2f7fdcf155df rel-1-42 -ade751c9a7e7945e48428e32cdf41d6f7d189f08 rel-1-62 -ae7bd57a9dcedb67467a4b43a27bdf802479bc9e rel-1-33 -af2def618260df6bde2fdb3fd1f22ad532b18270 rel-1-77 -b618c255982d76d4d554c456888cd705b1a52d33 rel-1-68 -b6b5e68dd21fa2f5015e1b45f5b1880aa1c9ecef rel-1-55 -bd0f312842328a1118c43ebd54899916f1009b86 rel-1-57 -c019d05d7131f21ccf7abedb979ca29f2ff5fe32 rel-1-71 -c2c0575d28f000d925d4c0ec689df9b1e572af2d rel-1-43 -c6733869c489c4e39aeb84ffe5d28378e9fb121d rel-1-31 -cc4d999c38f16be78e8ba54749bd4e3711b66882 rel-1-41 -d125f70deea4580ead7cb72814bdb17ad9c16258 rel-1-36 -d2316766e67ea2a10effe85e6e27ea7b520df409 rel-1-70 -d940969f5c6f78c252ac110884aa89014c7d1349 rel-2-10 -ed67316cd7395abf840d8c9d10eb6a23f693d4fc rel-1-28 -ee4e67b4a9fe76e85230216340dc7eff3978fbf8 rel-1-59 -f04248111a542b559402f0e08253b613d7dec849 rel-1-32 -f394f7465aa354dfdea57599f8c7d0e424313144 rel-1-53 -f4d4bb4d5fd70e9affe63460161cf2779f9dfdb3 rel-1-24 -f6af29ca9c6e9ffd457d9f6b9477d03f2d944f64 rel-1-67 -f99c7dfc2bffb16cd478633526b4cba883e266ab rel-2-12 -fd3e6bb269b1c38e003202dc5856cf120667ed88 rel-1-72 -fdf95390299493c05c0e11c3c2ef98293c552908 rel-1-50 -fe112bae056a00c5e0b7218dd3903b16e3d43d24 rel-1-23 -ffde119d297ecdce968737c68f0e21410a0c36c4 rel-2-20 -bae0795bc8950108a5265dd3a1b231dbb1c0a92f rel-2-21 -91d53a344450102a73387dd591cecc4294574891 rel-2-22 -338e9c43eb8339b293aa5cb069aa84c60bbac6ba rel-2-23 -3a0d1edb7ae5478426346dab2219e10606238bd0 rel-2-24 -930e2f7d36165066fffd5cef6225c7774a2d7996 rel-2-25 -221dae018a0dd86d4adc91370dfc507ca078b452 rel-2-26 -02d0b25c22c3a4d672aca5fa37b3e5bffc30fa32 rel-2-27 -265b4ffceb4a356fd7917ce938051e8a206bac3e rel-2-28 -6f590a14726334be3256c55e8bab9119c71f3160 rel-2-29 -7a59b936e02452b66dff32264e5bc72c038ade19 rel-3-0-0 -ad485b918c5a81dbf591eab1916afa3d600b0639 rel-3-0-1 -16f620503ab2e3ae463e39c36f897385fd73b9d1 rel-3-0-2 -d147d5b894708a5c7d3e7b81513fe02f0075e62c rel-3-0-3 -2faf55888eeb76e40d5b286cd45f4f40c331b1c2 rel-3-0-4 -a9219577729080874f5f46e0a634d5d117cc2eed rel-3-1-0 -ae4d2f897a8fd92294f61d4d56e90e7700a912df rel-3-2-0 -41bdec833d4a9bb108bd3e4890371b22d1132f1a rel-3-2-1 -183c117293e78c4264dca7afac9f66cb5d585ddc rel-3-2-2 -7d54d6d61ace06828cb0850b53a8008672d67f33 rel-3-2-3 -1092d3d2495955cfe1a227e360e14d5358b5136f rel-3-2-4 -74f6ed8c5737db179f791d6fe6cab2dc119f65fb rel-3-2-5 -04c9afc26342f4c1b9492c4b27efb33585d6a56d rel-3-3-0 -5f9c0934513bf8d9dfe64127ad19cb95800415e9 scitex-3-3-0 -d2022a5e4948379ab0aa89b510b850209d6cbb01 rel-3-3-1 -d887fce163757c50ec95ed204d50b02675db830c rel-3-3-2 -1cd0ebd585926933259e776ac380ef17a20e2d5d rel-3-3-3 -e1c3afb1c5d42c664558839b1d68ed4dcc50e5d1 rel-3-3-4 -c343e43079c4458fae69f82ff3b6569b7bba0821 rel-3-3-5 -da3cbb774e02f626fd9ee5446608f0f63665042a rel-3-3-6 -5693714a8b0b30e481ba4f089f2ecc93fc80c80d rel-3-3-7 -61cdae165698c4b904349094f596ae519c5be6a0 rel-3-3-8 -d086394244f486c3f628518db177c265d694b8e7 rel-3-3-9 -eea0ac7e5c8ff58e3145ddbb8b271c51965780bf rel-3-4-0 -e73e34b23c598ab42e44e77141f6138555ed9d62 rel-3-4-1 -a4286bbf7081a4eb570bc62a9e5f7beef51e83a1 rel-3-4-2 -a3c10db89cc33783cf5a0c8d76d482bb1434af89 rel-3-4-3 -0df282b2c489231eb4fdc2cdaa6dfb7f6283a9c0 rel-3-4-4 -a431f85e13c9499923b79d4890e8642604863a27 rel-3-5-0 -01c4696a39a913866f9852e06aff66d48ff39722 rel-3-5-1 -a797ff255bdf2085f0475b9202527da6a16d507a rel-3-5-2 -8b21bf82adac0a3fe9923b7148d183b7a6792dde rel-3-5-3 -16ffc2a3ae1554d2c49513a44188224f8235f13c rel-3-5-4 -1916c3602692d06f410df15b100b55ee79ae46f9 rel-3-5-5 -1916c3602692d06f410df15b100b55ee79ae46f9 rel-3-5-5 -0000000000000000000000000000000000000000 rel-3-5-5 -0000000000000000000000000000000000000000 rel-3-5-5 -dea417bad80a9225d72b4f839ab04b1f7ffd936f rel-3-5-5 -e9bfc7a0cb83a972e8bfa5dbaa8aabd359549b57 rel-3-5-6 -49ce1d4c2dea737f1e4c92858921dd403a61cb20 rel-3-5-7 -87a4e0fa293ec1dc47d9d4d4288a139a5e240c6f rel-3-6-0 -59165fbb6b9d51efae82d13ce1c4471310b90bde rel-3-6-1 -d906ba5d62cbb79a3b25d29aa4dae3f3d1fdf22a rel-3-6-2 -e575024931f89fbc70e06d1faaf73a2e8721a2da rel-3-6-3 -d2d4928e3e6a3e79ed7dbfd949968d5fc9818424 rel-3-6-4 -afd67be6f0b141ba23be25ea1f472258bb4d976f rel-3-6-5 -bfdfb44eb77717778c7a3ac2c3726903e66c81b8 rel-3-6-6 -f9ff5b9b1a485d742fb7bfae14ba323a3f990663 rel-3-6-7 -13cdacbbe2515620b0f582c4c274b17cae06180c rel-3-7-0 diff --git a/scintilla/CONTRIBUTING b/scintilla/CONTRIBUTING deleted file mode 100644 index cf70eafa..00000000 --- a/scintilla/CONTRIBUTING +++ /dev/null @@ -1,20 +0,0 @@ -Fixes should be posted to the Bug Tracker -http://sourceforge.net/p/scintilla/bugs/ - -Features should be posted to the Feature Request Tracker -http://sourceforge.net/p/scintilla/feature-requests/ - -Either send unified diffs (or patch files) or zip archives with whole files. -Mercurial patch files are best as they include author information and commit -messages. - -Questions should go to the scintilla-interest mailing list -https://groups.google.com/forum/#!forum/scintilla-interest - -Code should follow the guidelines at -http://www.scintilla.org/SciCoding.html - -Do not use SourceForge's Merge Request mechanism or message sending -feature as no one is monitoring these. -The neilh @ scintilla.org account receives much spam and is only checked -occasionally. Almost all Scintilla mail should go to the mailing list. \ No newline at end of file diff --git a/scintilla/License.txt b/scintilla/License.txt deleted file mode 100644 index 8d286121..00000000 --- a/scintilla/License.txt +++ /dev/null @@ -1,20 +0,0 @@ -License 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. \ No newline at end of file diff --git a/scintilla/README b/scintilla/README deleted file mode 100644 index b4f84d94..00000000 --- a/scintilla/README +++ /dev/null @@ -1,83 +0,0 @@ -README 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.18 or later and GCC (4.8 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 - sudo 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 - sudo 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, with C++11 required for building SciTE. -Visual Studio 2015 is the development system used for most development -although Mingw32 4.8 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 - -*** OS X Cocoa version *** - -Xcode 6 or 7 may be used to build Scintilla on OS X. - -There is no open source version of SciTE for OS X but there is a commercial -version available through the App Store. - -To build Scintilla, run xcodebuild in the scintilla/cocoa/ScintillaFramework directory - cd cocoa/ScintillaFramework - xcodebuild - -*** Qt version *** - -See the qt/README file to build Scintilla with Qt. diff --git a/scintilla/bin/__init__.py b/scintilla/bin/__init__.py deleted file mode 100644 index d3f5a12f..00000000 --- a/scintilla/bin/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/scintilla/bin/empty.txt b/scintilla/bin/empty.txt deleted file mode 100644 index 66183855..00000000 --- a/scintilla/bin/empty.txt +++ /dev/null @@ -1 +0,0 @@ -This empty files ensures that the directory is created. \ No newline at end of file diff --git a/scintilla/cocoa/InfoBar.h b/scintilla/cocoa/InfoBar.h deleted file mode 100644 index bc30ca28..00000000 --- a/scintilla/cocoa/InfoBar.h +++ /dev/null @@ -1,55 +0,0 @@ - -/** - * 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 diff --git a/scintilla/cocoa/InfoBar.mm b/scintilla/cocoa/InfoBar.mm deleted file mode 100644 index 2ae1ed5a..00000000 --- a/scintilla/cocoa/InfoBar.mm +++ /dev/null @@ -1,448 +0,0 @@ - -/** - * 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 diff --git a/scintilla/cocoa/InfoBarCommunicator.h b/scintilla/cocoa/InfoBarCommunicator.h deleted file mode 100644 index 5727c3a1..00000000 --- a/scintilla/cocoa/InfoBarCommunicator.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 - diff --git a/scintilla/cocoa/PlatCocoa.h b/scintilla/cocoa/PlatCocoa.h deleted file mode 100644 index ac1090a3..00000000 --- a/scintilla/cocoa/PlatCocoa.h +++ /dev/null @@ -1,124 +0,0 @@ - -/** - * 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 "Platform.h" -#include "Scintilla.h" - -#include "QuartzTextLayout.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 diff --git a/scintilla/cocoa/PlatCocoa.mm b/scintilla/cocoa/PlatCocoa.mm deleted file mode 100644 index 7e68bcc1..00000000 --- a/scintilla/cocoa/PlatCocoa.mm +++ /dev/null @@ -1,2276 +0,0 @@ -/** - * 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" - -#include "StringCopy.h" -#include "XPM.h" - -#import "ScintillaView.h" -#import "ScintillaCocoa.h" -#import "PlatCocoa.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); - } -} - -//-------------------------------------------------------------------------------------------------- - -static void drawImageRefCallback(CGImageRef pattern, CGContextRef gc) -{ - CGContextDrawImage(gc, CGRectMake(0, 0, CGImageGetWidth(pattern), CGImageGetHeight(pattern)), pattern); -} - -//-------------------------------------------------------------------------------------------------- - -static 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() -{ - 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(); - // 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(); - 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 isKindOfClass: [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 setDataSource:nil]; - [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; -} - -//-------------------------------------------------------------------------------------------------- - diff --git a/scintilla/cocoa/QuartzTextLayout.h b/scintilla/cocoa/QuartzTextLayout.h deleted file mode 100644 index 102e4fed..00000000 --- a/scintilla/cocoa/QuartzTextLayout.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 diff --git a/scintilla/cocoa/QuartzTextStyle.h b/scintilla/cocoa/QuartzTextStyle.h deleted file mode 100644 index 0e1210b0..00000000 --- a/scintilla/cocoa/QuartzTextStyle.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 - diff --git a/scintilla/cocoa/QuartzTextStyleAttribute.h b/scintilla/cocoa/QuartzTextStyleAttribute.h deleted file mode 100644 index 7f389b41..00000000 --- a/scintilla/cocoa/QuartzTextStyleAttribute.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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 - diff --git a/scintilla/cocoa/ScintillaCocoa.h b/scintilla/cocoa/ScintillaCocoa.h deleted file mode 100644 index 82144461..00000000 --- a/scintilla/cocoa/ScintillaCocoa.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - * ScintillaCocoa.h - * - * Mike Lischke - * - * 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; - 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(); -}; - - -} - - diff --git a/scintilla/cocoa/ScintillaCocoa.mm b/scintilla/cocoa/ScintillaCocoa.mm deleted file mode 100644 index 0c58d6d2..00000000 --- a/scintilla/cocoa/ScintillaCocoa.mm +++ /dev/null @@ -1,2573 +0,0 @@ - -/** - * 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 owning ScintillaCocoa object when it is destroyed. - */ -- (void) ownerDestroyed -{ - mTarget = NULL; - [notificationQueue release]; - notificationQueue = nil; -} - -//-------------------------------------------------------------------------------------------------- - -/** - * 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: @[NSDefaultRunLoopMode, NSModalPanelRunLoopMode]]; -} - -//-------------------------------------------------------------------------------------------------- - -/** - * 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; - 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 ownerDestroyed]; - [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); - } - } -} - - -//-------------------------------------------------------------------------------------------------- - -/** - * 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 timerWithTimeInterval: 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; - [NSRunLoop.currentRunLoop addTimer: fineTimer forMode: NSDefaultRunLoopMode]; - [NSRunLoop.currentRunLoop addTimer: fineTimer forMode: NSModalPanelRunLoopMode]; -} - -//-------------------------------------------------------------------------------------------------- - -/** - * 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 - NSTimer *idleTimer = [NSTimer scheduledTimerWithTimeInterval: timer.tickSize / 1000.0 - target: timerTarget - selector: @selector(idleTimerFired:) - userInfo: nil - repeats: YES]; - [NSRunLoop.currentRunLoop addTimer: idleTimer forMode: NSModalPanelRunLoopMode]; - 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 -{ -#pragma unused(item) - 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; - sw.InitPixMap(static_cast(client.Width()), static_cast(client.Height()), NULL, NULL); - - const bool lastHideSelection = view.hideSelection; - view.hideSelection = true; - PRectangle imageRect = rcSel; - paintState = painting; - paintingAllText = true; - CGContextRef gcsw = sw.GetContext(); - CGContextTranslateCTM(gcsw, -client.left, -client.top); - Paint(&sw, client); - paintState = notPainting; - view.hideSelection = lastHideSelection; - - SurfaceImpl pixmap; - 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. - - NSBitmapImageRep* bitmap = NULL; - CGImageRef imagePixmap = pixmap.GetImage(); - if (imagePixmap) - bitmap = [[[NSBitmapImageRep alloc] initWithCGImage: imagePixmap] autorelease]; - CGImageRelease(imagePixmap); - - 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 static_cast(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 : static_cast(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 static_cast(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); - const int posAfterArea = PositionAfterArea(rcWillDraw); - const int posAfterMax = PositionAfterMaxStyling(posAfterArea, true); - pdoc->StyleToAdjustingLineDuration(posAfterMax); - StartIdleStyling(posAfterMax < posAfterArea); - NotifyUpdateUI(); - if (WrapLines(wsVisible)) { - // Wrap may have reduced number of lines so more lines may need to be styled - const int posAfterAreaWrapped = PositionAfterArea(rcWillDraw); - pdoc->EnsureStyledTo(posAfterAreaWrapped); - // 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, NSEventModifierFlags modifierFlags) -{ - 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 '+': - if (modifierFlags & NSNumericPadKeyMask) - return SCK_ADD; - else - return unicodeChar; - case '-': - if (modifierFlags & NSNumericPadKeyMask) - return SCK_SUBTRACT; - else - return unicodeChar; - case '/': - if (modifierFlags & NSNumericPadKeyMask) - return SCK_DIVIDE; - else - return unicodeChar; - 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 charactersIgnoringModifiers]; - - 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]; - NSEventModifierFlags modifierFlags = [event modifierFlags]; - - UniChar key = KeyTranslate(originalKey, modifierFlags); - - bool consumed = false; // Consumed as command? - - if (KeyDownWithModifiers(key, TranslateModifierFlags(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, static_cast(range.location)); - if (start == INVALID_POSITION) - start = pdoc->Length(); - long end = pdoc->GetRelativePositionUTF16(static_cast(start), static_cast(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, static_cast(range.location)); - const long len = pdoc->CountUTF16(static_cast(range.location), static_cast(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() -{ - ClearBeforeTentativeStart(); -} - -//-------------------------------------------------------------------------------------------------- - -/** - * 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 -} - - diff --git a/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings b/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings deleted file mode 100644 index 5e45963c..00000000 Binary files a/scintilla/cocoa/ScintillaFramework/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/scintilla/cocoa/ScintillaFramework/Info.plist b/scintilla/cocoa/ScintillaFramework/Info.plist deleted file mode 100644 index 1d315e86..00000000 --- a/scintilla/cocoa/ScintillaFramework/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.7.0 - CFBundleSignature - ???? - CFBundleVersion - 3.7.0 - NSPrincipalClass - - - diff --git a/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj b/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj deleted file mode 100644 index 96520a90..00000000 --- a/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj +++ /dev/null @@ -1,1264 +0,0 @@ -// !$*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 */; settings = {ATTRIBUTES = (Public, ); }; }; - 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 */; }; - 28BC38EC1B74C6AD008BF9EB /* Sci_Position.h in Headers */ = {isa = PBXBuildFile; fileRef = 28BC38EB1B74C6AD008BF9EB /* Sci_Position.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 28C40CA81CB7321200B089F2 /* LexJSON.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 28C40CA71CB7321200B089F2 /* LexJSON.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 = ""; }; - 28BC38EB1B74C6AD008BF9EB /* Sci_Position.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sci_Position.h; path = ../../include/Sci_Position.h; sourceTree = ""; }; - 28C40CA71CB7321200B089F2 /* LexJSON.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexJSON.cxx; path = ../../lexers/LexJSON.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 */, - 28C40CA71CB7321200B089F2 /* LexJSON.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 */, - 28BC38EB1B74C6AD008BF9EB /* Sci_Position.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 = ( - 28BC38EC1B74C6AD008BF9EB /* Sci_Position.h in Headers */, - 114B6FA111FA75DB004FB6AB /* ILexer.h in Headers */, - 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 */, - 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 = 0800; - }; - 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 */, - 28C40CA81CB7321200B089F2 /* LexJSON.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_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}"; - 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_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}"; - PRODUCT_NAME = Scintilla; - SKIP_INSTALL = YES; - WRAPPER_EXTENSION = framework; - }; - name = Release; - }; - 1DEB91B208733DA50010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 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; - 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_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = 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_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; - 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 */; -} diff --git a/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index acc8e3f9..00000000 --- a/scintilla/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch b/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch deleted file mode 100644 index d14300bd..00000000 --- a/scintilla/cocoa/ScintillaFramework/Scintilla_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'Scintilla' target in the 'Scintilla' project. -// - -#ifdef __OBJC__ - #import -#endif diff --git a/scintilla/cocoa/ScintillaTest/AppController.h b/scintilla/cocoa/ScintillaTest/AppController.h deleted file mode 100644 index 5374a52a..00000000 --- a/scintilla/cocoa/ScintillaTest/AppController.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * 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; - ScintillaView* sciExtra; // For testing Scintilla tear-down - NSString* sql; -} - -- (void) awakeFromNib; -- (void) setupEditor; -- (IBAction) searchText: (id) sender; -- (IBAction) addRemoveExtra: (id) sender; - -@end diff --git a/scintilla/cocoa/ScintillaTest/AppController.mm b/scintilla/cocoa/ScintillaTest/AppController.mm deleted file mode 100644 index f209a9af..00000000 --- a/scintilla/cocoa/ScintillaTest/AppController.mm +++ /dev/null @@ -1,306 +0,0 @@ -/** - * 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]; - - sql = [NSString stringWithContentsOfFile: path - encoding: NSUTF8StringEncoding - error: &error]; - - [sql retain]; - - if (error && [[error domain] isEqual: NSCocoaErrorDomain]) - NSLog(@"%@", error); - - [mEditor setString: sql]; - - [self setupEditor]; - - sciExtra = nil; -} - -//-------------------------------------------------------------------------------------------------- - -/** - * 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) addRemoveExtra: (id) sender -{ - if (sciExtra) { - [sciExtra removeFromSuperview]; - sciExtra = nil; - } else { - NSRect newFrame = mEditHost.frame; - newFrame.origin.x += newFrame.size.width + 5; - newFrame.origin.y += 46; - newFrame.size.width = 96; - newFrame.size.height -= 60; - - sciExtra = [[[ScintillaView alloc] initWithFrame: newFrame] autorelease]; - [[[mEditHost window]contentView] addSubview: sciExtra]; - [sciExtra setGeneralProperty: SCI_SETWRAPMODE parameter: SC_WRAP_WORD value: 1]; - [sciExtra setString: sql]; - } -} - --(IBAction) setFontQuality: (id) sender -{ - [ScintillaView directCall:mEditor message:SCI_SETFONTQUALITY wParam:[sender tag] lParam:0]; -} - -@end - -//-------------------------------------------------------------------------------------------------- - diff --git a/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings b/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings deleted file mode 100644 index 5e45963c..00000000 Binary files a/scintilla/cocoa/ScintillaTest/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib b/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib deleted file mode 100644 index efe9bc5b..00000000 --- a/scintilla/cocoa/ScintillaTest/English.lproj/MainMenu.xib +++ /dev/null @@ -1,615 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scintilla/cocoa/ScintillaTest/Info.plist b/scintilla/cocoa/ScintillaTest/Info.plist deleted file mode 100644 index ef71339a..00000000 --- a/scintilla/cocoa/ScintillaTest/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist b/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist deleted file mode 100644 index 2c67ffbf..00000000 --- a/scintilla/cocoa/ScintillaTest/Scintilla-Info.plist +++ /dev/null @@ -1,20 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.sun.${PRODUCT_NAME:identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleVersion - 1.0 - - diff --git a/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj b/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj deleted file mode 100644 index f2a8aaa0..00000000 --- a/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.pbxproj +++ /dev/null @@ -1,415 +0,0 @@ -// !$*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 = 0700; - }; - 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_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}"; - 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_BUNDLE_IDENTIFIER = "com.sun.${PRODUCT_NAME:identifier}"; - 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; - ENABLE_TESTABILITY = 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 */; -} diff --git a/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index b3258829..00000000 --- a/scintilla/cocoa/ScintillaTest/ScintillaTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch b/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch deleted file mode 100644 index b3d5ee7e..00000000 --- a/scintilla/cocoa/ScintillaTest/ScintillaTest_Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'ScintillaTest' target in the 'ScintillaTest' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/scintilla/cocoa/ScintillaTest/TestData.sql b/scintilla/cocoa/ScintillaTest/TestData.sql deleted file mode 100644 index 2e2ebfc8..00000000 --- a/scintilla/cocoa/ScintillaTest/TestData.sql +++ /dev/null @@ -1,215 +0,0 @@ --- 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 ; - diff --git a/scintilla/cocoa/ScintillaTest/main.m b/scintilla/cocoa/ScintillaTest/main.m deleted file mode 100644 index 59ff6b2e..00000000 --- a/scintilla/cocoa/ScintillaTest/main.m +++ /dev/null @@ -1,15 +0,0 @@ -/** - * 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); -} diff --git a/scintilla/cocoa/ScintillaView.h b/scintilla/cocoa/ScintillaView.h deleted file mode 100644 index a70399fa..00000000 --- a/scintilla/cocoa/ScintillaView.h +++ /dev/null @@ -1,204 +0,0 @@ - -/** - * 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 diff --git a/scintilla/cocoa/ScintillaView.mm b/scintilla/cocoa/ScintillaView.mm deleted file mode 100644 index f8978519..00000000 --- a/scintilla/cocoa/ScintillaView.mm +++ /dev/null @@ -1,1991 +0,0 @@ - -/** - * 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 -{ - if (!mOwner) { - [super viewWillDraw]; - return; - } - - 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 -{ - if (mOwner) - 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 -{ -#pragma unused(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 -{ - if (!mOwner) - return 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 -{ -#pragma unused(session) - switch(context) - { - case NSDraggingContextOutsideApplication: - return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete; - - case NSDraggingContextWithinApplication: - default: - return NSDragOperationCopy | NSDragOperationMove | NSDragOperationDelete; - } -} - -- (void)draggingSession:(NSDraggingSession *)session - movedToPoint:(NSPoint)screenPoint -{ -#pragma unused(session, screenPoint) -} - -- (void)draggingSession:(NSDraggingSession *)session - endedAtPoint:(NSPoint)screenPoint - operation:(NSDragOperation)operation -{ -#pragma unused(session, screenPoint) - 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; - mBackend = NULL; - mContent.owner = nil; - [scrollView removeFromSuperview]; - [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 -{ -#pragma unused(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 - diff --git a/scintilla/cocoa/checkbuildosx.sh b/scintilla/cocoa/checkbuildosx.sh deleted file mode 100644 index bdc6054f..00000000 --- a/scintilla/cocoa/checkbuildosx.sh +++ /dev/null @@ -1,66 +0,0 @@ -# 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 ../.. diff --git a/scintilla/cocoa/res/info_bar_bg.png b/scintilla/cocoa/res/info_bar_bg.png deleted file mode 100644 index 79010fa7..00000000 Binary files a/scintilla/cocoa/res/info_bar_bg.png and /dev/null differ diff --git a/scintilla/cocoa/res/info_bar_bg@2x.png b/scintilla/cocoa/res/info_bar_bg@2x.png deleted file mode 100644 index 486646a8..00000000 Binary files a/scintilla/cocoa/res/info_bar_bg@2x.png and /dev/null differ diff --git a/scintilla/cocoa/res/mac_cursor_busy.png b/scintilla/cocoa/res/mac_cursor_busy.png deleted file mode 100644 index 93b2a496..00000000 Binary files a/scintilla/cocoa/res/mac_cursor_busy.png and /dev/null differ diff --git a/scintilla/cocoa/res/mac_cursor_busy@2x.png b/scintilla/cocoa/res/mac_cursor_busy@2x.png deleted file mode 100644 index 7a0e12e8..00000000 Binary files a/scintilla/cocoa/res/mac_cursor_busy@2x.png and /dev/null differ diff --git a/scintilla/cocoa/res/mac_cursor_flipped.png b/scintilla/cocoa/res/mac_cursor_flipped.png deleted file mode 100644 index e1ee6863..00000000 Binary files a/scintilla/cocoa/res/mac_cursor_flipped.png and /dev/null differ diff --git a/scintilla/cocoa/res/mac_cursor_flipped@2x.png b/scintilla/cocoa/res/mac_cursor_flipped@2x.png deleted file mode 100644 index 6fedb33d..00000000 Binary files a/scintilla/cocoa/res/mac_cursor_flipped@2x.png and /dev/null differ diff --git a/scintilla/cppcheck.suppress b/scintilla/cppcheck.suppress deleted file mode 100644 index 095af77b..00000000 --- a/scintilla/cppcheck.suppress +++ /dev/null @@ -1,48 +0,0 @@ -// 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 - -// cppcheck does not understand private methods can be called from static methods -unusedPrivateFunction:scintilla/win32/PlatWin.cxx - -// The performance cost of by-value passing is often small and using a reference decreases -// code legibility. -passedByValue - -// Suppress most lexer warnings since the lexers are maintained by others -redundantCondition:scintilla/lexers/LexA68k.cxx -useInitializationList:scintilla/lexers/LexAsm.cxx -useInitializationList:scintilla/lexers/LexBasic.cxx -uninitMemberVar: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 -variableScope:scintilla/lexers/LexProgress.cxx -variableScope:scintilla/lexers/LexRuby.cxx -uninitMemberVar:scintilla/lexers/LexRuby.cxx -variableScope:scintilla/lexers/LexSpecman.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 diff --git a/scintilla/delbin.bat b/scintilla/delbin.bat deleted file mode 100644 index 3636b987..00000000 --- a/scintilla/delbin.bat +++ /dev/null @@ -1 +0,0 @@ -del /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: diff --git a/scintilla/delcvs.bat b/scintilla/delcvs.bat deleted file mode 100644 index d3ed21ce..00000000 --- a/scintilla/delcvs.bat +++ /dev/null @@ -1 +0,0 @@ -del /S /Q .cvsignore diff --git a/scintilla/doc/Design.html b/scintilla/doc/Design.html deleted file mode 100644 index 22e1fd98..00000000 --- a/scintilla/doc/Design.html +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - 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. -

-

- ColourDesired -

-

- This is a simple class holding an expected colour. It is internally represented as a single - 32 bit integer in BGR format with 8 bits per colour, but also provides a convenient API to fetch - each component separately. - As a platform might not be able to represent the exact desired colour if it doesn't have 24 bit - depth available, it might not actually represent the exact desired colour but select a best fit - that it can actually render. -

-

- Font -

-

- Font holds a platform specific font identifier - HFONT for Windows, PangoFontDescription* 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 cairo_surface_t*. - 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, GtkMenu* 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. -

- - - diff --git a/scintilla/doc/Icons.html b/scintilla/doc/Icons.html deleted file mode 100644 index e8aae1cc..00000000 --- a/scintilla/doc/Icons.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - 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 listsFor margin markers
12x1216x1624x2432x32
- - diff --git a/scintilla/doc/Indicators.png b/scintilla/doc/Indicators.png deleted file mode 100644 index b67566ea..00000000 Binary files a/scintilla/doc/Indicators.png and /dev/null differ diff --git a/scintilla/doc/Lexer.txt b/scintilla/doc/Lexer.txt deleted file mode 100644 index 5c20d364..00000000 --- a/scintilla/doc/Lexer.txt +++ /dev/null @@ -1,226 +0,0 @@ -How 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. Ream \ No newline at end of file diff --git a/scintilla/doc/Markers.png b/scintilla/doc/Markers.png deleted file mode 100644 index 2ad37b10..00000000 Binary files a/scintilla/doc/Markers.png and /dev/null differ diff --git a/scintilla/doc/Privacy.html b/scintilla/doc/Privacy.html deleted file mode 100644 index 0a854f01..00000000 --- a/scintilla/doc/Privacy.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - 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. -

- - diff --git a/scintilla/doc/SciBreak.jpg b/scintilla/doc/SciBreak.jpg deleted file mode 100644 index b63b09f9..00000000 Binary files a/scintilla/doc/SciBreak.jpg and /dev/null differ diff --git a/scintilla/doc/SciCoding.html b/scintilla/doc/SciCoding.html deleted file mode 100644 index a2262400..00000000 --- a/scintilla/doc/SciCoding.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - 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. - Scintilla code must build with C++03 which can be checked with "g++ --std=gnu++03". - SciTE can use C++11 features that are widely available from g++ 4.6, MSVC 2012 and clang 3.4 compilers. -

-

- 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. -

-

- The SCI_METHOD preprocessor definition should be used when implementing - interfaces which include it like ILexer and only there. -

-

- Headers should always be included in the same order as given by the - scripts/HeaderOrder.txt file. -

-

- 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. -

-

- 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.

-

The ctype functions like isalnum and isdigit only work on ASCII (0..127) and may cause - undefined behaviour including crashes if used on other values. Check with IsASCII before calling is*.

-

Functions, structs and classes in lexers should be in an unnamed namespace (see LexCPP) - or be marked "static" so they will not leak into other lexers.

-

If you copy from an existing lexer, remove any code that is not needed since it makes it - more difficult to maintain and review.

-

When modifying an existing lexer, try to maintain as much compatibility as possible. - Do not renumber lexical styles as current client code may be built against the earlier values.

-

- Properties -

-

- Properties provided by a new lexer should follow the naming conventions - and should include a comment suitable for showing to end users. - The convention is for properties that control styling to be named - lexer.<lexername>.* and those that control folding to be named - fold.<lexername>.*. - Examples are "lexer.python.literals.binary" and "fold.haskell.imports". -

-

- The properties "fold" and "fold.comment" are generic and can be used by - any lexer. -

-

- See LexPython for examples of properties in an object lexer and LexHTML for a functional lexer. -

- - diff --git a/scintilla/doc/SciRest.jpg b/scintilla/doc/SciRest.jpg deleted file mode 100644 index 4b052239..00000000 Binary files a/scintilla/doc/SciRest.jpg and /dev/null differ diff --git a/scintilla/doc/SciTEIco.png b/scintilla/doc/SciTEIco.png deleted file mode 100644 index 90ab9ff7..00000000 Binary files a/scintilla/doc/SciTEIco.png and /dev/null differ diff --git a/scintilla/doc/SciWord.jpg b/scintilla/doc/SciWord.jpg deleted file mode 100644 index 60e70e89..00000000 Binary files a/scintilla/doc/SciWord.jpg and /dev/null differ diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html deleted file mode 100644 index 580afc80..00000000 --- a/scintilla/doc/ScintillaDoc.html +++ /dev/null @@ -1,7921 +0,0 @@ - - - - - - - - - - Scintilla Documentation - - - - - - - - - - - -
Scintilla iconScintilla
- -

Scintilla Documentation

- -

Last edited 29 September 2016 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
boolArguments expect the values 0 for false and 1 for - true.
intArguments 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.
colourColours 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.
alphaTranslucency 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 - modificationo Searching and replacingo Overtype
o Cut, copy and pasteo Error handlingo Undo and Redo
o Selection and informationo Multiple Selection and Virtual Spaceo Scrolling and automatic - scrolling
o White spaceo Cursoro Mouse capture
o Line endingso Wordso Styling
o Style definitiono Caret, selection, and hotspot styleso Character representations
o Marginso Annotationso Other settings
o Brace highlightingo Tabs and Indentation - Guideso Markers
o Indicatorso Autocompletiono User lists
o Call tipso Keyboard commandso Key bindings
o Popup edit menuo Macro recordingo Printing
o Direct accesso Multiple viewso Background loading and saving
o Foldingo Line wrappingo Zooming
o Long lineso Lexero Lexer objects
o Notificationso Imageso GTK+
o Provisional messageso Deprecated messageso 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) → int
- SCI_SETTEXT(<unused>, const char *text)
- SCI_SETSAVEPOINT
- SCI_GETLINE(int line, char *text) → int
- SCI_REPLACESEL(<unused>, const char - *text)
- SCI_SETREADONLY(bool readOnly)
- SCI_GETREADONLY → bool
- SCI_GETTEXTRANGE(<unused>, Sci_TextRange *tr) → int
- SCI_ALLOCATE(int bytes)
- SCI_ADDTEXT(int length, const char *text)
- SCI_ADDSTYLEDTEXT(int length, cell *c)
- SCI_APPENDTEXT(int length, const char *text)
- SCI_INSERTTEXT(int pos, const char *text)
- SCI_CHANGEINSERTION(int length, const char *text)
- SCI_CLEARALL
- SCI_DELETERANGE(int start, int lengthDelete)
- SCI_CLEARDOCUMENTSTYLE
- SCI_GETCHARAT(int pos) → int
- SCI_GETSTYLEAT(int pos) → int
- SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr) → int
- SCI_RELEASEALLEXTENDEDSTYLES
- SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles) → int
- SCI_TARGETASUTF8(<unused>, char *s) → int
- SCI_ENCODEDFROMUTF8(const char *utf8, char *encoded) → int
- SCI_SETLENGTHFORENCODE(int bytes)
-
- -

SCI_GETTEXT(int length, char *text NUL-terminated) → int
- 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) → int
- 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 → bool
- 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) → int
- 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) → int
- 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)
- 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 *text)
- This inserts the first length characters from the string - text - 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 *c)
- This behaves just like SCI_ADDTEXT, but inserts styled text.

- -

SCI_APPENDTEXT(int length, const char *text)
- This adds the first length characters from the string - text 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 start, int lengthDelete)
- 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) → int
- 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) → int
- 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) → int
- 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) → int
- 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) → int
- 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. - The C++ runtime <regex> library may be used by setting the SCFIND_CXX11REGEX search flag. - When using an older C++ compiler that does not support C++11, this may be turned off by - compiling Scintilla with NO_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 start)
- SCI_GETTARGETSTART → position
- SCI_SETTARGETEND(int end)
- SCI_GETTARGETEND → position
- SCI_SETTARGETRANGE(int start, int end)
- SCI_TARGETFROMSELECTION
- SCI_TARGETWHOLEDOCUMENT
- SCI_SETSEARCHFLAGS(int searchFlags)
- SCI_GETSEARCHFLAGS → int
- SCI_SEARCHINTARGET(int length, const char *text) → int
- SCI_GETTARGETTEXT(<unused>, char *text) → int
- SCI_REPLACETARGET(int length, const char *text) → int
- SCI_REPLACETARGETRE(int length, const char *text) → int
- SCI_GETTAG(int tagNumber, char *tagValue) → int
-
- -

SCI_SETTARGETSTART(int start)
- SCI_GETTARGETSTART → position
- SCI_SETTARGETEND(int end)
- SCI_GETTARGETEND → position
- 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 → int
- 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) → int
- 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) → int
- Retrieve the value in the target.

- -

SCI_REPLACETARGET(int length, const char *text) → int
- 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) → int
- 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) → int
- 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_MATCHCASEA match only occurs with text that matches the case of the search string.
SCFIND_WHOLEWORDA match only occurs if the characters before and after are not word characters as defined - by SCI_SETWORDCHARS.
SCFIND_WORDSTARTA match only occurs if the character before is not a word character as defined - by SCI_SETWORDCHARS.
SCFIND_REGEXPThe search string should be interpreted as a regular expression. - Uses Scintilla's base implementation unless combined with SCFIND_CXX11REGEX.
SCFIND_POSIXTreat regular expression in a more POSIX compatible manner - by interpreting bare ( and ) for tagged sections rather than \( and \). - Has no effect when SCFIND_CXX11REGEX is set.
SCFIND_CXX11REGEXThis flag may be set to use C++11 <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. - Must also have SCFIND_REGEXP set.
- -

In a regular expression, using Scintilla's base implementation, - 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.
\nWhere 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.
\xThis 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.

- -

When using SCFIND_CXX11REGEX more features are available, - generally similar to regular expression support in JavaScript. - See the documentation of your C++ runtime for details on what is supported.

- - SCI_FINDTEXT(int searchFlags, Sci_TextToFind *ft) → position
- SCI_SEARCHANCHOR
- SCI_SEARCHNEXT(int searchFlags, const char *text) → int
- SCI_SEARCHPREV(int searchFlags, const char *text) → int
-
- -

SCI_FINDTEXT(int searchFlags, Sci_TextToFind *ft) → position
- 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) → int
- SCI_SEARCHPREV(int searchFlags, const char *text) → int
- 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 → bool
-
- -

SCI_SETOVERTYPE(bool overType)
- SCI_GETOVERTYPE → bool
- 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 → bool
- SCI_COPYRANGE(int start, int end)
- SCI_COPYTEXT(int length, const char *text)
- SCI_COPYALLOWLINE
- SCI_SETPASTECONVERTENDINGS(bool convert)
- SCI_GETPASTECONVERTENDINGS → bool
-
- -

SCI_CUT
- SCI_COPY
- SCI_PASTE
- SCI_CLEAR
- SCI_CANPASTE → bool
- 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 → bool
- 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 → int
-
- -

SCI_SETSTATUS(int status)
- SCI_GETSTATUS → int
- 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_OK0No failures
SC_STATUS_FAILURE1Generic failure
SC_STATUS_BADALLOC2Memory is exhausted
SC_STATUS_WARN_REGEX1001Regular 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 → bool
- SCI_EMPTYUNDOBUFFER
- SCI_REDO
- SCI_CANREDO → bool
- SCI_SETUNDOCOLLECTION(bool collectUndo)
- SCI_GETUNDOCOLLECTION → bool
- SCI_BEGINUNDOACTION
- SCI_ENDUNDOACTION
- SCI_ADDUNDOACTION(int token, int flags)
-
- -

SCI_UNDO
- SCI_CANUNDO → bool
- 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 → bool
- 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 → bool
- 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 → int
- SCI_GETLENGTH → int
- SCI_GETLINECOUNT → int
- SCI_LINESONSCREEN → int
- SCI_GETMODIFY → bool
- SCI_SETSEL(int anchor, int caret)
- SCI_GOTOPOS(int caret)
- SCI_GOTOLINE(int line)
- SCI_SETCURRENTPOS(int caret)
- SCI_GETCURRENTPOS → position
- SCI_SETANCHOR(int anchor)
- SCI_GETANCHOR → position
- SCI_SETSELECTIONSTART(int anchor)
- SCI_GETSELECTIONSTART → position
- SCI_SETSELECTIONEND(int caret)
- SCI_GETSELECTIONEND → position
- SCI_SETEMPTYSELECTION(int caret)
- SCI_SELECTALL
- SCI_LINEFROMPOSITION(int pos) → int
- SCI_POSITIONFROMLINE(int line) → position
- SCI_GETLINEENDPOSITION(int line) → position
- SCI_LINELENGTH(int line) → int
- SCI_GETCOLUMN(int pos) → int
- SCI_FINDCOLUMN(int line, int column) → int
- SCI_POSITIONFROMPOINT(int x, int y) → position
- SCI_POSITIONFROMPOINTCLOSE(int x, int y) → position
- SCI_CHARPOSITIONFROMPOINT(int x, int y) → position
- SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y) → position
- SCI_POINTXFROMPOSITION(<unused>, int pos) → int
- SCI_POINTYFROMPOSITION(<unused>, int pos) → int
- SCI_HIDESELECTION(bool hide)
- SCI_GETSELTEXT(<unused>, char *text) → int
- SCI_GETCURLINE(int length, char *text) → int
- SCI_SELECTIONISRECTANGLE → bool
- SCI_SETSELECTIONMODE(int selectionMode)
- SCI_GETSELECTIONMODE → int
- SCI_GETLINESELSTARTPOSITION(int line) → position
- SCI_GETLINESELENDPOSITION(int line) → position
- SCI_MOVECARETINSIDEVIEW
- SCI_POSITIONBEFORE(int pos) → position
- SCI_POSITIONAFTER(int pos) → position
- SCI_POSITIONRELATIVE(int pos, int relative) → position
- SCI_COUNTCHARACTERS(int start, int end) → int
- SCI_TEXTWIDTH(int style, const char *text) → int
- SCI_TEXTHEIGHT(int line) → int
- SCI_CHOOSECARETX
- SCI_MOVESELECTEDLINESUP
- SCI_MOVESELECTEDLINESDOWN
- SCI_SETMOUSESELECTIONRECTANGULARSWITCH(bool mouseSelectionRectangularSwitch)
- SCI_GETMOUSESELECTIONRECTANGULARSWITCH → bool
-
- -

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

- -

SCI_GETLINECOUNT → int
- 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_LINESONSCREEN → int
- 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 → bool
- 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 anchor, int caret)
- This message sets both the anchor and the current position. If caret is - negative, it means the end of the document. If anchor is negative, it means - remove any selection (i.e. set the anchor to the same position as caret). The - caret is scrolled into view after this operation.

- -

SCI_GOTOPOS(int caret)
- This removes any selection, sets the caret at caret and scrolls the view to make - the caret visible, if necessary. It is equivalent to - SCI_SETSEL(caret, caret). 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 caret)
- 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 → position
- This returns the current position.

- -

SCI_SETANCHOR(int anchor)
- 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 → position
- This returns the current anchor position.

- -

SCI_SETSELECTIONSTART(int anchor)
- SCI_SETSELECTIONEND(int caret)
- 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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- New value for - anchorcaret
SCI_SETSELECTIONSTARTanchorMax(anchor, current)
SCI_SETSELECTIONENDMin(anchor, caret)caret
- -

See also: SCI_SCROLLCARET

- -

SCI_GETSELECTIONSTART → position
- SCI_GETSELECTIONEND → position
- 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 caret)
- This removes any selection and sets the caret at caret. 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) → int
- 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) → position
- 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) → position
- 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) → int
- 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) → int
- 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 length, char *text NUL-terminated) → int
- 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 length 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 → bool
- This returns 1 if the current selection is in rectangle mode, 0 if not.

- -

SCI_SETSELECTIONMODE(int selectionMode)
- SCI_GETSELECTIONMODE → int
- 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) → position
- SCI_GETLINESELENDPOSITION(int line) → position
- 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_POSITIONBEFORE(int pos) → position
- SCI_POSITIONAFTER(int pos) → 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 pos, int relative) → position
- 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. - If the position goes past the document end then 0 is returned. -

- -

SCI_COUNTCHARACTERS(int start, int end) → int
- Returns the number of whole characters between two positions..

- -

SCI_TEXTWIDTH(int style, const char *text) → int
- This returns the pixel width of a string drawn in the given style 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) → int
- This returns the height in pixels of a particular line. Currently all lines are the same - height.

- -

SCI_GETCOLUMN(int pos) → int
- 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) → int
- 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) → position
- SCI_POSITIONFROMPOINTCLOSE(int x, int y) → position
- 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) → position
- SCI_CHARPOSITIONFROMPOINTCLOSE(int x, int y) → position
- 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) → int
- SCI_POINTYFROMPOSITION(<unused>, int pos) → int
- 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 → bool
- 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 → bool
- SCI_SETADDITIONALSELECTIONTYPING(bool additionalSelectionTyping)
- SCI_GETADDITIONALSELECTIONTYPING → bool
- SCI_SETMULTIPASTE(int multiPaste)
- SCI_GETMULTIPASTE → int
- SCI_SETVIRTUALSPACEOPTIONS(int virtualSpaceOptions)
- SCI_GETVIRTUALSPACEOPTIONS → int
- SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)
- SCI_GETRECTANGULARSELECTIONMODIFIER → int
-
- - SCI_GETSELECTIONS → int
- SCI_GETSELECTIONEMPTY → bool
- SCI_CLEARSELECTIONS
- SCI_SETSELECTION(int caret, int anchor) → int
- SCI_ADDSELECTION(int caret, int anchor) → int
- SCI_DROPSELECTIONN(int selection)
- SCI_SETMAINSELECTION(int selection)
- SCI_GETMAINSELECTION → int
-
- - SCI_SETSELECTIONNCARET(int selection, int caret)
- SCI_GETSELECTIONNCARET(int selection) → position
- SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)
- SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection) → int
- SCI_SETSELECTIONNANCHOR(int selection, int anchor)
- SCI_GETSELECTIONNANCHOR(int selection) → position
- SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)
- SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection) → int
- SCI_SETSELECTIONNSTART(int selection, int anchor)
- SCI_GETSELECTIONNSTART(int selection) → position
- SCI_SETSELECTIONNEND(int selection, int caret)
- SCI_GETSELECTIONNEND(int selection) → position
-
- - SCI_SETRECTANGULARSELECTIONCARET(int caret)
- SCI_GETRECTANGULARSELECTIONCARET → position
- SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)
- SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE → int
- SCI_SETRECTANGULARSELECTIONANCHOR(int anchor)
- SCI_GETRECTANGULARSELECTIONANCHOR → position
- SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)
- SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE → int
-
- - SCI_SETADDITIONALSELALPHA(alpha alpha)
- SCI_GETADDITIONALSELALPHA → int
- SCI_SETADDITIONALSELFORE(colour fore)
- SCI_SETADDITIONALSELBACK(colour back)
- SCI_SETADDITIONALCARETFORE(colour fore)
- SCI_GETADDITIONALCARETFORE → colour
- SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)
- SCI_GETADDITIONALCARETSBLINK → bool
- SCI_SETADDITIONALCARETSVISIBLE(bool additionalCaretsVisible)
- SCI_GETADDITIONALCARETSVISIBLE → bool
-
- - 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 → bool
- 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 → bool
- 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 → int
- 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 virtualSpaceOptions)
- SCI_GETVIRTUALSPACEOPTIONS → int
- Virtual space can be enabled or disabled for rectangular selections or in other circumstances or in both. - There are three bit flags SCVS_RECTANGULARSELECTION=1, - SCVS_USERACCESSIBLE=2, and - SCVS_NOWRAPLINESTART=4 which can be set independently. - SCVS_NONE=0, the default, disables all use of virtual space.

-

SCVS_NOWRAPLINESTART prevents left arrow movement and selection - from wrapping to the previous line. - This is most commonly desired in conjunction with virtual space but is an independent - setting so works without virtual space.

- -

- SCI_SETRECTANGULARSELECTIONMODIFIER(int modifier)
- SCI_GETRECTANGULARSELECTIONMODIFIER → int
- 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 → int
- Return the number of selections currently active. There is always at least one selection.

- -

- SCI_GETSELECTIONEMPTY → bool
- 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) → int
- Set a single selection from anchor to caret as the only selection.

- -

- SCI_ADDSELECTION(int caret, int anchor) → int
- 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 → int
- 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 caret)
- SCI_GETSELECTIONNCARET(int selection) → position
- SCI_SETSELECTIONNCARETVIRTUALSPACE(int selection, int space)
- SCI_GETSELECTIONNCARETVIRTUALSPACE(int selection) → int
- SCI_SETSELECTIONNANCHOR(int selection, int anchor)
- SCI_GETSELECTIONNANCHOR(int selection) → position
- SCI_SETSELECTIONNANCHORVIRTUALSPACE(int selection, int space)
- SCI_GETSELECTIONNANCHORVIRTUALSPACE(int selection) → int
- 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 anchor)
- SCI_GETSELECTIONNSTART(int selection) → position
- SCI_SETSELECTIONNEND(int selection, int caret)
- SCI_GETSELECTIONNEND(int selection) → position
- 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 caret)
- SCI_GETRECTANGULARSELECTIONCARET → position
- SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE(int space)
- SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE → int
- SCI_SETRECTANGULARSELECTIONANCHOR(int anchor)
- SCI_GETRECTANGULARSELECTIONANCHOR → position
- SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE(int space)
- SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE → int
- 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(alpha alpha)
- SCI_GETADDITIONALSELALPHA → int
- SCI_SETADDITIONALSELFORE(colour fore)
- SCI_SETADDITIONALSELBACK(colour back)
- 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(colour fore)
- SCI_GETADDITIONALCARETFORE → colour
- SCI_SETADDITIONALCARETSBLINK(bool additionalCaretsBlink)
- SCI_GETADDITIONALCARETSBLINK → bool
- 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 → bool
- 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_SETFIRSTVISIBLELINE(int displayLine)
- SCI_GETFIRSTVISIBLELINE → int
- SCI_SETXOFFSET(int xOffset)
- SCI_GETXOFFSET → int
- SCI_LINESCROLL(int columns, int lines)
- SCI_SCROLLCARET
- SCI_SCROLLRANGE(int secondary, int primary)
- SCI_SETXCARETPOLICY(int caretPolicy, int - caretSlop)
- SCI_SETYCARETPOLICY(int caretPolicy, int - caretSlop)
- SCI_SETVISIBLEPOLICY(int visiblePolicy, int - visibleSlop)
- SCI_SETHSCROLLBAR(bool visible)
- SCI_GETHSCROLLBAR → bool
- SCI_SETVSCROLLBAR(bool visible)
- SCI_GETVSCROLLBAR → bool
- SCI_SETSCROLLWIDTH(int pixelWidth)
- SCI_GETSCROLLWIDTH → int
- SCI_SETSCROLLWIDTHTRACKING(bool tracking)
- SCI_GETSCROLLWIDTHTRACKING → bool
- SCI_SETENDATLASTLINE(bool - endAtLastLine)
- SCI_GETENDATLASTLINE → bool
-
- -

SCI_SETFIRSTVISIBLELINE(int displayLine)
- SCI_GETFIRSTVISIBLELINE → int
- 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_SETXOFFSET(int xOffset)
- SCI_GETXOFFSET → int
- 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.

- -

SCI_LINESCROLL(int columns, int lines)
- 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_SLOPIf 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_STRICTIf 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_JUMPSIf 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_EVENIf 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.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
slopstrictjumpsevenCaret can go to the marginOn reaching limit (going out of visibility
- or going into the UZ) display is...
0000Yesmoved to put caret on top/on right
0001Yesmoved by one position
0010Yesmoved to put caret on top/on right
0011Yescentred on the caret
01-0Caret is always on top/on right of display-
01-1No, caret is always centred-
1000Yesmoved to put caret out of the asymmetrical UZ
1001Yesmoved to put caret out of the UZ
1010Yesmoved to put caret at 3UZ of the top or right margin
1011Yesmoved to put caret at 3UZ of the margin
11-0Caret is always at UZ of top/right margin-
1101No, kept out of UZmoved by one position
1110No, kept out of UZmoved to put caret at 3UZ of the margin
- -

SCI_SETVISIBLEPOLICY(int visiblePolicy, int visibleSlop)
- 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 → bool
- 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 → bool
- 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.

- -

See also: SCI_LINESCROLL

- -

SCI_SETSCROLLWIDTH(int pixelWidth)
- SCI_GETSCROLLWIDTH → int
- 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 → bool
- 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 → bool
- 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 viewWS)
- SCI_GETVIEWWS → int
- SCI_SETWHITESPACEFORE(bool - useSetting, colour fore)
- SCI_SETWHITESPACEBACK(bool - useSetting, colour back)
- SCI_SETWHITESPACESIZE(int - size)
- SCI_GETWHITESPACESIZE → int
- SCI_SETEXTRAASCENT(int extraAscent)
- SCI_GETEXTRAASCENT → int
- SCI_SETEXTRADESCENT(int extraDescent)
- SCI_GETEXTRADESCENT → int
-
- -

SCI_SETVIEWWS(int viewWS)
- SCI_GETVIEWWS → int
- 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 viewWS argument can be one of:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SCWS_INVISIBLE0The normal display mode with white space displayed as an empty background - colour.
SCWS_VISIBLEALWAYS1White space characters are drawn as dots and arrows,
SCWS_VISIBLEAFTERINDENT2White space used for indentation is displayed normally but after the first visible - character, it is shown as dots and arrows.
SCWS_VISIBLEONLYININDENT3White space used for indentation is displayed as dots and arrows.
- -

The effect of using any other viewWS value is undefined.

- -

SCI_SETWHITESPACEFORE(bool useSetting, colour fore)
- SCI_SETWHITESPACEBACK(bool useSetting, colour back)
- 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 → int
- 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 → int
- SCI_SETEXTRADESCENT(int extraDescent)
- SCI_GETEXTRADESCENT → int
- 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 cursorType)
- SCI_GETCURSOR → int
- -

SCI_SETCURSOR(int cursorType)
- SCI_GETCURSOR → int
- 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 cursorType - argument can be:

- - - - - - - - - - - - - - - - - - - -
SC_CURSORNORMAL-1The normal cursor is displayed.
SC_CURSORWAIT 4The 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 cursorType 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 → bool
- SCI_SETMOUSEWHEELCAPTURES(bool captures)
- SCI_GETMOUSEWHEELCAPTURES → bool
- -

SCI_SETMOUSEDOWNCAPTURES(bool captures)
- SCI_GETMOUSEDOWNCAPTURES → bool
- 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).

- -

SCI_SETMOUSEWHEELCAPTURES(bool captures)
- SCI_GETMOUSEWHEELCAPTURES → bool
- On Windows, Scintilla captures all WM_MOUSEWHEEL messages if it has the - focus, even if the mouse pointer is nowhere near the Scintilla editor window. This - behavior can be changed with SCI_SETMOUSEWHEELCAPTURES(0) so that - Scintilla passes the WM_MOUSEWHEEL messages to its parent window. - Scintilla will still react to the mouse wheel if the mouse pointer is over - the editor window.

- -

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 → int
- SCI_CONVERTEOLS(int eolMode)
- SCI_SETVIEWEOL(bool visible)
- SCI_GETVIEWEOL → bool
- - SCI_GETLINEENDTYPESSUPPORTED → int
- SCI_SETLINEENDTYPESALLOWED(int lineEndBitSet)
- SCI_GETLINEENDTYPESALLOWED → int
- SCI_GETLINEENDTYPESACTIVE → int
- -

SCI_SETEOLMODE(int eolMode)
- SCI_GETEOLMODE → int
- 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 → bool
- 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 → int
- 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 → int
- 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 → int
- SCI_GETLINEENDTYPESACTIVE reports the set of line ends currently interpreted - by Scintilla. It is SCI_GETLINEENDTYPESSUPPORTED & SCI_GETLINEENDTYPESALLOWED.

- -

Words

- -

There is support for selecting, navigating by, and searching for words.

- -

- Words are contiguous sequences of characters from a particular set of characters. - 4 categories define words: word, whitespace, punctuation, and line ends with each category - having a role in word functions. - Double clicking selects the word at that point, which may be a sequence of word, punctuation, - or whitespace bytes. - Line ends are not selected by double clicking but do act as word separators. -

- -

Words are defined in terms of characters and the sets of characters in each category can be customized to an extent. - The NUL character (0) is always a space as the APIs to set categories use NUL-terminated strings. - For single-byte encodings a category may be assigned to any character (1 to 0xFF). - For multi-byte encodings a category may be assigned to characters from 1 to 0x7F with static behaviour from 0x80. - For UTF-8, characters from 0x80 will use a category based on their Unicode general category. - For Asian encodings, code pages 932, 936, 949, 950, and 1361, characters from 0x80 are treated as word characters. -

- -

Identifiers in programming languages are often sequences of words with capitalisation - (aCamelCaseIdentifier) or underscores (an_under_bar_ident) used to mark word boundaries. - The SCI_WORDPART* commands are used for moving between word parts: - SCI_WORDPARTLEFT, - SCI_WORDPARTLEFTEXTEND, - SCI_WORDPARTRIGHT, and - SCI_WORDPARTRIGHTEXTEND. -

- - SCI_WORDENDPOSITION(int pos, bool onlyWordCharacters) → int
- SCI_WORDSTARTPOSITION(int pos, bool onlyWordCharacters) → int
- SCI_ISRANGEWORD(int start, int end) → bool
- - SCI_SETWORDCHARS(<unused>, const char *characters)
- SCI_GETWORDCHARS(<unused>, char *characters) → int
- SCI_SETWHITESPACECHARS(<unused>, const char *characters)
- SCI_GETWHITESPACECHARS(<unused>, char *characters) → int
- SCI_SETPUNCTUATIONCHARS(<unused>, const char *characters)
- SCI_GETPUNCTUATIONCHARS(<unused>, char *characters) → int
- SCI_SETCHARSDEFAULT
- -

SCI_WORDENDPOSITION(int pos, bool onlyWordCharacters) → int
- SCI_WORDSTARTPOSITION(int pos, bool onlyWordCharacters) → int
- 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) → bool
- 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) → bool
- -

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 stateend, trueend, falsestart, truestart, 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_SETWORDCHARS(<unused>, const char *characters)
- This message defines which characters are members of the word category. - The character categories 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) → int
- 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.

- -

For multi-byte encodings, this API will not return meaningful values for 0x80 and above.

- -

SCI_SETWHITESPACECHARS(<unused>, const char *characters)
- SCI_GETWHITESPACECHARS(<unused>, char *characters) → int
- 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) → int
- 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 '_'. -

- -

Word keyboard commands are:

-
    -
  • 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_DELWORDLEFT
  • -
  • SCI_DELWORDRIGHT
  • -
  • SCI_DELWORDRIGHTEND
  • -
- -

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 → position
- SCI_STARTSTYLING(int start, int unused)
- SCI_SETSTYLING(int length, int style)
- SCI_SETSTYLINGEX(int length, const char - *styles)
- SCI_SETIDLESTYLING(int idleStyling)
- SCI_GETIDLESTYLING → int
- SCI_SETLINESTATE(int line, int state)
- SCI_GETLINESTATE(int line) → int
- SCI_GETMAXLINESTATE → int
-
- -

SCI_GETENDSTYLED → position
- 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 start, int unused)
- This prepares for styling by setting the styling position start 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_SETIDLESTYLING(int idleStyling)
- SCI_GETIDLESTYLING → int
- By default, SC_IDLESTYLING_NONE (0), - syntax styling is performed for all the currently visible text before displaying it. - On very large files, this may make scrolling down slow. - With SC_IDLESTYLING_TOVISIBLE (1), - a small amount of styling is performed before display and then - further styling is performed incrementally in the background as an idle-time task. - This may result in the text initially appearing uncoloured and then, some time later, it is coloured. - Text after the currently visible portion may be styled in the background with SC_IDLESTYLING_AFTERVISIBLE (2). - To style both before and after the visible text in the background use SC_IDLESTYLING_ALL (3). -

-

- Since wrapping also needs to perform styling and also uses idle time, this setting has no effect when - the document is displayed wrapped. -

- -

SCI_SETLINESTATE(int line, int state)
- SCI_GETLINESTATE(int line) → int
- 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 → int
- 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_DEFAULT32This style defines the attributes that all styles receive when the - SCI_STYLECLEARALL message is used.
STYLE_LINENUMBER33This 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_BRACELIGHT34This style sets the attributes used when highlighting braces with the SCI_BRACEHIGHLIGHT message and - when highlighting the corresponding indentation with SCI_SETHIGHLIGHTGUIDE.
STYLE_BRACEBAD35This style sets the display attributes used when marking an unmatched brace with the - SCI_BRACEBADLIGHT - message.
STYLE_CONTROLCHAR36This 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_INDENTGUIDE37This style sets the foreground and background colours used when drawing the - indentation guides.
STYLE_CALLTIP38 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_LASTPREDEFINED39To 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_MAX255This 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 style, const char - *fontName)
- SCI_STYLEGETFONT(int style, char *fontName) → int
- SCI_STYLESETSIZE(int style, int - sizePoints)
- SCI_STYLEGETSIZE(int style) → int
- SCI_STYLESETSIZEFRACTIONAL(int style, int - sizeHundredthPoints)
- SCI_STYLEGETSIZEFRACTIONAL(int style) → int
- SCI_STYLESETBOLD(int style, bool - bold)
- SCI_STYLEGETBOLD(int style) → bool
- SCI_STYLESETWEIGHT(int style, int - weight)
- SCI_STYLEGETWEIGHT(int style) → int
- SCI_STYLESETITALIC(int style, bool - italic)
- SCI_STYLEGETITALIC(int style) → bool
- SCI_STYLESETUNDERLINE(int style, bool - underline)
- SCI_STYLEGETUNDERLINE(int style) → bool
- SCI_STYLESETFORE(int style, colour fore)
- SCI_STYLEGETFORE(int style) → colour
- SCI_STYLESETBACK(int style, colour back)
- SCI_STYLEGETBACK(int style) → colour
- SCI_STYLESETEOLFILLED(int style, bool - eolFilled)
- SCI_STYLEGETEOLFILLED(int style) → bool
- SCI_STYLESETCHARACTERSET(int style, - int characterSet)
- SCI_STYLEGETCHARACTERSET(int style) → int
- SCI_STYLESETCASE(int style, int - caseVisible)
- SCI_STYLEGETCASE(int style) → int
- SCI_STYLESETVISIBLE(int style, bool - visible)
- SCI_STYLEGETVISIBLE(int style) → bool
- SCI_STYLESETCHANGEABLE(int style, bool - changeable)
- SCI_STYLEGETCHANGEABLE(int style) → bool
- SCI_STYLESETHOTSPOT(int style, bool - hotspot)
- SCI_STYLEGETHOTSPOT(int style) → bool
-
- -

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 style, const char *fontName)
- SCI_STYLEGETFONT(int style, char *fontName NUL-terminated) → int
- SCI_STYLESETSIZE(int style, int sizePoints)
- SCI_STYLEGETSIZE(int style) → int
- SCI_STYLESETSIZEFRACTIONAL(int style, int sizeHundredthPoints)
- SCI_STYLEGETSIZEFRACTIONAL(int style) → int
- SCI_STYLESETBOLD(int style, bool bold)
- SCI_STYLEGETBOLD(int style) → bool
- SCI_STYLESETWEIGHT(int style, int weight)
- SCI_STYLEGETWEIGHT(int style) → int
- SCI_STYLESETITALIC(int style, bool italic)
- SCI_STYLEGETITALIC(int style) → bool
- 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 style, bool - underline)
- SCI_STYLEGETUNDERLINE(int style) → bool
- 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 style, colour fore)
- SCI_STYLEGETFORE(int style) → colour
- SCI_STYLESETBACK(int style, colour back)
- SCI_STYLEGETBACK(int style) → colour
- 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 style, bool - eolFilled)
- SCI_STYLEGETEOLFILLED(int style) → bool
- 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 style, int - characterSet)
- SCI_STYLEGETCHARACTERSET(int style) → int
- 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 default character set is SC_CHARSET_DEFAULT.

- -

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.
- SC_CHARSET_ANSI and SC_CHARSET_DEFAULT specify European Windows - code page 1252 unless the code page is set.

- -

The character sets supported on GTK+ are:
- SC_CHARSET_ANSI, - SC_CHARSET_DEFAULT (8859-1), - SC_CHARSET_OEM866 (code page 866), - 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.

- -

The character sets supported on Cocoa are:
- SC_CHARSET_8859_15, - SC_CHARSET_ANSI (8859-1), - SC_CHARSET_ARABIC, - SC_CHARSET_BALTIC, - SC_CHARSET_CHINESEBIG5, - SC_CHARSET_CYRILLIC (code page 1251), - SC_CHARSET_DEFAULT (8859-1), - 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, - SC_CHARSET_VIETNAMESE.

- -

SCI_STYLESETCASE(int style, int caseVisible)
- SCI_STYLEGETCASE(int style) → int
- The value of caseVisible 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 style, bool visible)
- SCI_STYLEGETVISIBLE(int style) → bool
- 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 style, bool - changeable)
- SCI_STYLEGETCHANGEABLE(int style) → bool
- 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 style, bool - hotspot)
- SCI_STYLEGETHOTSPOT(int style) → bool
- 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 useSetting, colour fore)
- SCI_SETSELBACK(bool useSetting, colour back)
- SCI_SETSELALPHA(alpha alpha)
- SCI_GETSELALPHA → int
- SCI_SETSELEOLFILLED(bool filled)
- SCI_GETSELEOLFILLED → bool
- SCI_SETCARETFORE(colour fore)
- SCI_GETCARETFORE → colour
- SCI_SETCARETLINEVISIBLE(bool show)
- SCI_GETCARETLINEVISIBLE → bool
- SCI_SETCARETLINEBACK(colour back)
- SCI_GETCARETLINEBACK → colour
- SCI_SETCARETLINEBACKALPHA(alpha alpha)
- SCI_GETCARETLINEBACKALPHA → int
- SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)
- SCI_GETCARETLINEVISIBLEALWAYS → bool
- SCI_SETCARETPERIOD(int periodMilliseconds)
- SCI_GETCARETPERIOD → int
- SCI_SETCARETSTYLE(int caretStyle)
- SCI_GETCARETSTYLE → int
- SCI_SETCARETWIDTH(int pixelWidth)
- SCI_GETCARETWIDTH → int
- SCI_SETHOTSPOTACTIVEFORE(bool useSetting, colour fore)
- SCI_GETHOTSPOTACTIVEFORE → colour
- SCI_SETHOTSPOTACTIVEBACK(bool useSetting, colour back)
- SCI_GETHOTSPOTACTIVEBACK → colour
- SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)
- SCI_GETHOTSPOTACTIVEUNDERLINE → bool
- SCI_SETHOTSPOTSINGLELINE(bool singleLine)
- SCI_GETHOTSPOTSINGLELINE → bool
- SCI_SETCARETSTICKY(int useCaretStickyBehaviour)
- SCI_GETCARETSTICKY → int
- SCI_TOGGLECARETSTICKY
-
- -

SCI_SETSELFORE(bool useSetting, colour fore)
- SCI_SETSELBACK(bool useSetting, colour back)
- 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 - fore or back - argument has no effect.

-

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

- -

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

- -

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

- -

SCI_SETCARETLINEVISIBLE(bool show)
- SCI_GETCARETLINEVISIBLE → bool
- SCI_SETCARETLINEBACK(colour back)
- SCI_GETCARETLINEBACK → colour
- SCI_SETCARETLINEBACKALPHA(alpha alpha)
- SCI_GETCARETLINEBACKALPHA → int
- 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 → bool
- 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 periodMilliseconds)
- SCI_GETCARETPERIOD → int
- 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 caretStyle)
- SCI_GETCARETSTYLE → int
- 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 pixelWidth)
- SCI_GETCARETWIDTH → int
- 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 useSetting, colour fore)
- SCI_GETHOTSPOTACTIVEFORE → colour
- SCI_SETHOTSPOTACTIVEBACK(bool useSetting, - colour back)
- SCI_GETHOTSPOTACTIVEBACK → colour
- SCI_SETHOTSPOTACTIVEUNDERLINE(bool underline)
- SCI_GETHOTSPOTACTIVEUNDERLINE → bool
- SCI_SETHOTSPOTSINGLELINE(bool singleLine)
- SCI_GETHOTSPOTSINGLELINE → bool
- 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 → int
- 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) → int
- SCI_CLEARREPRESENTATION(const char *encodedCharacter)
- SCI_SETCONTROLCHARSYMBOL(int symbol)
- SCI_GETCONTROLCHARSYMBOL → int
-
- -

SCI_SETREPRESENTATION(const char *encodedCharacter, const char *representation)
- SCI_GETREPRESENTATION(const char *encodedCharacter, char *representation NUL-terminated) → int
- 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 → int
- 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 multiple margins to the left of the text display plus a gap either side of the text. - 5 margins are allocated initially numbered from 0 to SC_MAX_MARGIN (4) - but this may be changed by calling - SCI_SETMARGINS. - 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.

- -

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_SETMARGINS(int margins)
- SCI_GETMARGINS → int
- SCI_SETMARGINTYPEN(int margin, int marginType)
- SCI_GETMARGINTYPEN(int margin) → int
- SCI_SETMARGINWIDTHN(int margin, int - pixelWidth)
- SCI_GETMARGINWIDTHN(int margin) → int
- SCI_SETMARGINMASKN(int margin, int - mask)
- SCI_GETMARGINMASKN(int margin) → int
- SCI_SETMARGINSENSITIVEN(int margin, bool - sensitive)
- SCI_GETMARGINSENSITIVEN(int margin) → bool
- SCI_SETMARGINCURSORN(int margin, int - cursor)
- SCI_GETMARGINCURSORN(int margin) → int
- SCI_SETMARGINBACKN(int margin, colour back)
- SCI_GETMARGINBACKN(int margin) → colour
- SCI_SETMARGINLEFT(<unused>, int - pixelWidth)
- SCI_GETMARGINLEFT → int
- SCI_SETMARGINRIGHT(<unused>, int - pixelWidth)
- SCI_GETMARGINRIGHT → int
- SCI_SETFOLDMARGINCOLOUR(bool useSetting, colour back)
- SCI_SETFOLDMARGINHICOLOUR(bool useSetting, colour fore)
- SCI_MARGINSETTEXT(int line, const char *text)
- SCI_MARGINGETTEXT(int line, char *text) → int
- SCI_MARGINSETSTYLE(int line, int style)
- SCI_MARGINGETSTYLE(int line) → int
- SCI_MARGINSETSTYLES(int line, const char *styles)
- SCI_MARGINGETSTYLES(int line, char *styles) → int
- SCI_MARGINTEXTCLEARALL
- SCI_MARGINSETSTYLEOFFSET(int style)
- SCI_MARGINGETSTYLEOFFSET → int
- SCI_SETMARGINOPTIONS(int marginOptions)
- SCI_GETMARGINOPTIONS → int
-
- -

SCI_SETMARGINS(int margins)
- SCI_GETMARGINS → int
- Allocate the number of margins or find the number of margins currently allocated.

- -

SCI_SETMARGINTYPEN(int margin, int marginType)
- SCI_GETMARGINTYPEN(int margin) → int
- 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), SC_MARGIN_FORE (3), - and SC_MARGIN_COLOUR (6) for - symbol margins that set their background colour to match the STYLE_DEFAULT background and - foreground colours or a specified colour.

- -

SCI_SETMARGINWIDTHN(int margin, int pixelWidth)
- SCI_GETMARGINWIDTHN(int margin) → int
- 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) → int
- 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) → bool
- 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) → int
- 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_SETMARGINBACKN(int margin, colour back)
- SCI_GETMARGINBACKN(int margin) → colour
- A margin of type SC_MARGIN_COLOUR - may have its colour set with SCI_SETMARGINBACKN.

- -

SCI_SETMARGINLEFT(<unused>, int pixelWidth)
- SCI_GETMARGINLEFT → int
- SCI_SETMARGINRIGHT(<unused>, int pixelWidth)
- SCI_GETMARGINRIGHT → int
- 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, colour back)
- SCI_SETFOLDMARGINHICOLOUR(bool useSetting, colour fore)
- 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, const char *text)
- SCI_MARGINGETTEXT(int line, char *text) → int
- SCI_MARGINSETSTYLE(int line, int style)
- SCI_MARGINGETSTYLE(int line) → int
- SCI_MARGINSETSTYLES(int line, const char *styles)
- SCI_MARGINGETSTYLES(int line, char *styles) → int
- 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 → int
- 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 → int
- 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, const char *text)
- SCI_ANNOTATIONGETTEXT(int line, char *text) → int
- SCI_ANNOTATIONSETSTYLE(int line, int style)
- SCI_ANNOTATIONGETSTYLE(int line) → int
- SCI_ANNOTATIONSETSTYLES(int line, const char *styles)
- SCI_ANNOTATIONGETSTYLES(int line, char *styles) → int
- SCI_ANNOTATIONGETLINES(int line) → int
- SCI_ANNOTATIONCLEARALL
- SCI_ANNOTATIONSETVISIBLE(int visible)
- SCI_ANNOTATIONGETVISIBLE → int
- SCI_ANNOTATIONSETSTYLEOFFSET(int style)
- SCI_ANNOTATIONGETSTYLEOFFSET → int
-
- -

- SCI_ANNOTATIONSETTEXT(int line, const char *text)
- SCI_ANNOTATIONGETTEXT(int line, char *text) → int
- SCI_ANNOTATIONSETSTYLE(int line, int style)
- SCI_ANNOTATIONGETSTYLE(int line) → int
- SCI_ANNOTATIONSETSTYLES(int line, const char *styles)
- SCI_ANNOTATIONGETSTYLES(int line, char *styles) → int
- SCI_ANNOTATIONGETLINES(int line) → int
- 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 → int
- 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_HIDDEN0Annotations are not displayed.
ANNOTATION_STANDARD1Annotations are drawn left justified with no adornment.
ANNOTATION_BOXED2Annotations are indented to match the text and are surrounded by a box.
ANNOTATION_INDENTED3Annotations are indented to match the text.
- -

- SCI_ANNOTATIONSETSTYLEOFFSET(int style)
- SCI_ANNOTATIONGETSTYLEOFFSET → int
- 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 buffered)
- SCI_GETBUFFEREDDRAW → bool
- SCI_SETPHASESDRAW(int phases)
- SCI_GETPHASESDRAW → int
- SCI_SETTWOPHASEDRAW(bool twoPhase)
- SCI_GETTWOPHASEDRAW → bool
- SCI_SETTECHNOLOGY(int technology)
- SCI_GETTECHNOLOGY → int
- SCI_SETFONTQUALITY(int fontQuality)
- SCI_GETFONTQUALITY → int
- SCI_SETCODEPAGE(int codePage)
- SCI_GETCODEPAGE → int
- SCI_SETIMEINTERACTION(int imeInteraction)
- SCI_GETIMEINTERACTION → int
- SCI_GRABFOCUS
- SCI_SETFOCUS(bool focus)
- SCI_GETFOCUS → bool
-
- -

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 buffered)
- SCI_GETBUFFEREDDRAW → bool
- 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 on Win32 and GTK+ and to not be buffered on Cocoa and Qt. - Buffered drawing is not supported on Cocoa. -

- -

Current platforms perform window buffering so it is almost always better for this option to be turned off. - For Win32 and GTK+, client code should turn off buffering at initialisation. - There are some older platforms and unusual modes where buffering may still be useful. -

- -

SCI_SETPHASESDRAW(int phases)
- SCI_GETPHASESDRAW → int
- 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 with - - SCI_SETLAYOUTCACHE(SC_CACHE_PAGE) - or higher can ensure that multiple phase drawing is not significantly slower.

- -

SCI_SETTWOPHASEDRAW(bool twoPhase)
- SCI_GETTWOPHASEDRAW → bool
- 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 → int
- 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 → int
- 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 → int
- 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 → int
- 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_GRABFOCUS
- SCI_SETFOCUS(bool focus)
- SCI_GETFOCUS → bool
- 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 posA, int - posB)
- SCI_BRACEBADLIGHT(int pos)
- SCI_BRACEHIGHLIGHTINDICATOR(bool useSetting, int indicator)
- SCI_BRACEBADLIGHTINDICATOR(bool useSetting, int indicator)
- SCI_BRACEMATCH(int pos, int maxReStyle) → position
-
- -

SCI_BRACEHIGHLIGHT(int posA, int posB)
- 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 pos)
- 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 useSetting, int indicator)
- Use specified indicator to highlight matching braces instead of changing their style.

- -

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

- -

SCI_BRACEMATCH(int pos, int maxReStyle) → position
- 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 tabWidth)
- SCI_GETTABWIDTH → int
- SCI_CLEARTABSTOPS(int line)
- SCI_ADDTABSTOP(int line, int x)
- SCI_GETNEXTTABSTOP(int line, int x) → int
- SCI_SETUSETABS(bool useTabs)
- SCI_GETUSETABS → bool
- SCI_SETINDENT(int indentSize)
- SCI_GETINDENT → int
- SCI_SETTABINDENTS(bool tabIndents)
- SCI_GETTABINDENTS → bool
- SCI_SETBACKSPACEUNINDENTS(bool - bsUnIndents)
- SCI_GETBACKSPACEUNINDENTS → bool
- SCI_SETLINEINDENTATION(int line, int - indentation)
- SCI_GETLINEINDENTATION(int line) → int
- SCI_GETLINEINDENTPOSITION(int line) → position
- SCI_SETINDENTATIONGUIDES(int indentView)
- SCI_GETINDENTATIONGUIDES → int
- SCI_SETHIGHLIGHTGUIDE(int column)
- SCI_GETHIGHLIGHTGUIDE → int
-
- -

SCI_SETTABWIDTH(int tabWidth)
- SCI_GETTABWIDTH → int
- 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) → int
- 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 → bool
- 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 indentSize)
- SCI_GETINDENT → int
- 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 → bool
- SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents)
- SCI_GETBACKSPACEUNINDENTS → bool
-

- -

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) → int
- 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) → position
- This returns the position at the end of indentation of a line.

- -

SCI_SETINDENTATIONGUIDES(int indentView)
- SCI_GETINDENTATIONGUIDES → int
- 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_NONENo indentation guides are shown.
SC_IV_REALIndentation guides are shown inside real indentation white space.
SC_IV_LOOKFORWARDIndentation 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_LOOKBOTHIndentation 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 → int
- 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 - markerSymbol)
- SCI_MARKERDEFINEPIXMAP(int markerNumber, - const char *pixmap)
- SCI_RGBAIMAGESETWIDTH(int width)
- SCI_RGBAIMAGESETHEIGHT(int height)
- SCI_RGBAIMAGESETSCALE(int scalePercent)
- SCI_MARKERDEFINERGBAIMAGE(int markerNumber, - const char *pixels)
- SCI_MARKERSYMBOLDEFINED(int markerNumber) → int
- SCI_MARKERSETFORE(int markerNumber, colour - fore)
- SCI_MARKERSETBACK(int markerNumber, colour - back)
- SCI_MARKERSETBACKSELECTED(int markerNumber, colour - back)
- SCI_MARKERENABLEHIGHLIGHT(bool enabled)
- SCI_MARKERSETALPHA(int markerNumber, alpha alpha)
- SCI_MARKERADD(int line, int markerNumber) → int
- SCI_MARKERADDSET(int line, int markerSet)
- SCI_MARKERDELETE(int line, int - markerNumber)
- SCI_MARKERDELETEALL(int markerNumber)
- SCI_MARKERGET(int line) → int
- SCI_MARKERNEXT(int lineStart, int markerMask) → int
- SCI_MARKERPREVIOUS(int lineStart, int markerMask) → int
- SCI_MARKERLINEFROMHANDLE(int markerHandle) → int
- SCI_MARKERDELETEHANDLE(int markerHandle)
-
- -

SCI_MARKERDEFINE(int markerNumber, int markerSymbol)
- 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_*ArrowPlus/minusCircle treeBox tree
FOLDEROPENARROWDOWNMINUSCIRCLEMINUSBOXMINUS
FOLDERARROWPLUSCIRCLEPLUSBOXPLUS
FOLDERSUBEMPTYEMPTYVLINEVLINE
FOLDERTAILEMPTYEMPTYLCORNERCURVELCORNER
FOLDERENDEMPTYEMPTYCIRCLEPLUSCONNECTEDBOXPLUSCONNECTED
FOLDEROPENMIDEMPTYEMPTYCIRCLEMINUSCONNECTEDBOXMINUSCONNECTED
FOLDERMIDTAILEMPTYEMPTYTCORNERCURVETCORNER
-

Marker samples

- -

SCI_MARKERDEFINEPIXMAP(int markerNumber, const char - *pixmap)
- 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) → int
- 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, colour fore)
- SCI_MARKERSETBACK(int markerNumber, colour back)
- These two messages set the foreground and background colour of a marker number.
- SCI_MARKERSETBACKSELECTED(int markerNumber, colour back)
- 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, - alpha 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) → int
- 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 markerSet)
- 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) → int
- 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) → int
- SCI_MARKERPREVIOUS(int lineStart, int markerMask) → int
- 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) → int
- 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 indicator 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 normally all values are drawn the same. - The SCI_INDICSETFLAGS - API may be used to display different colours for different values.

- -

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 indicator, int - indicatorStyle)
- SCI_INDICGETSTYLE(int indicator) → int
- SCI_INDICSETFORE(int indicator, colour - fore)
- SCI_INDICGETFORE(int indicator) → colour
- SCI_INDICSETALPHA(int indicator, alpha alpha)
- SCI_INDICGETALPHA(int indicator) → int
- SCI_INDICSETOUTLINEALPHA(int indicator, alpha alpha)
- SCI_INDICGETOUTLINEALPHA(int indicator) → int
- SCI_INDICSETUNDER(int indicator, bool under)
- SCI_INDICGETUNDER(int indicator) → bool
- SCI_INDICSETHOVERSTYLE(int indicator, int - indicatorStyle)
- SCI_INDICGETHOVERSTYLE(int indicator) → int
- SCI_INDICSETHOVERFORE(int indicator, colour - fore)
- SCI_INDICGETHOVERFORE(int indicator) → colour
- SCI_INDICSETFLAGS(int indicator, int flags)
- SCI_INDICGETFLAGS(int indicator) → int
-
- - SCI_SETINDICATORCURRENT(int indicator)
- SCI_GETINDICATORCURRENT → int
- SCI_SETINDICATORVALUE(int value)
- SCI_GETINDICATORVALUE → int
- SCI_INDICATORFILLRANGE(int start, int lengthFill)
- SCI_INDICATORCLEARRANGE(int start, int lengthClear)
- SCI_INDICATORALLONFOR(int pos) → int
- SCI_INDICATORVALUEAT(int indicator, int pos) → int
- SCI_INDICATORSTART(int indicator, int pos) → int
- SCI_INDICATOREND(int indicator, int pos) → int
- - SCI_FINDINDICATORSHOW(int start, int end)
- SCI_FINDINDICATORFLASH(int start, int end)
- SCI_FINDINDICATORHIDE
-
- -

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueVisual effect
INDIC_PLAIN0Underlined with a single, straight line.
INDIC_SQUIGGLE1A squiggly underline. Requires 3 pixels of descender space.
INDIC_TT2A line of small T shapes.
INDIC_DIAGONAL3Diagonal hatching.
INDIC_STRIKE4Strike out.
INDIC_HIDDEN5An indicator with no visual effect.
INDIC_BOX6A rectangle around the text.
INDIC_ROUNDBOX7A 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_STRAIGHTBOX8A 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_FULLBOX16A rectangle around the text using translucent drawing similar to INDIC_STRAIGHTBOX - but covering the entire character area.
INDIC_DASH9A dashed underline.
INDIC_DOTS10A dotted underline.
INDIC_SQUIGGLELOW11Similar to INDIC_SQUIGGLE but only using 2 vertical pixels - so will fit under small fonts.
INDIC_DOTBOX12A 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_SQUIGGLEPIXMAP13A 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_COMPOSITIONTHICK14A 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_COMPOSITIONTHIN15A 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_TEXTFORE17Change 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 indicator, colour fore)
- SCI_INDICGETFORE(int indicator) → colour
- 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 indicator, alpha alpha)
- SCI_INDICGETALPHA(int indicator) → int
- 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 indicator, alpha alpha)
- SCI_INDICGETOUTLINEALPHA(int indicator) → int
- 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 indicator, bool under)
- SCI_INDICGETUNDER(int indicator) → bool
- 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 indicator, int - indicatorStyle)
- SCI_INDICGETHOVERSTYLE(int indicator) → int
- SCI_INDICSETHOVERFORE(int indicator, colour fore)
- SCI_INDICGETHOVERFORE(int indicator) → colour
- 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 indicator, int flags)
- SCI_INDICGETFLAGS(int indicator) → int
- 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 → int
- These two messages set and get the indicator that will be affected by calls to - SCI_INDICATORFILLRANGE(int start, int lengthFill) and - SCI_INDICATORCLEARRANGE(int start, int lengthClear). -

- -

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

- -

- SCI_INDICATORFILLRANGE(int start, int lengthFill)
- SCI_INDICATORCLEARRANGE(int start, int lengthClear)
- These two messages fill or clear a range for the current indicator. - SCI_INDICATORFILLRANGE fills with the - the current value. -

- -

- SCI_INDICATORALLONFOR(int pos) → int
- 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 pos) → int
- Retrieve the value of a particular indicator at a position. -

- -

- SCI_INDICATORSTART(int indicator, int pos) → int
- SCI_INDICATOREND(int indicator, int pos) → int
- 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 lengthEntered, const char - *itemList)
- SCI_AUTOCCANCEL
- SCI_AUTOCACTIVE → bool
- SCI_AUTOCPOSSTART → position
- SCI_AUTOCCOMPLETE
- SCI_AUTOCSTOPS(<unused>, const char - *characterSet)
- SCI_AUTOCSETSEPARATOR(int - separatorCharacter)
- SCI_AUTOCGETSEPARATOR → int
- SCI_AUTOCSELECT(<unused>, const char - *select)
- SCI_AUTOCGETCURRENT → int
- SCI_AUTOCGETCURRENTTEXT(<unused>, char *text) → int
- SCI_AUTOCSETCANCELATSTART(bool - cancel)
- SCI_AUTOCGETCANCELATSTART → bool
- SCI_AUTOCSETFILLUPS(<unused>, const char - *characterSet)
- SCI_AUTOCSETCHOOSESINGLE(bool - chooseSingle)
- SCI_AUTOCGETCHOOSESINGLE → bool
- SCI_AUTOCSETIGNORECASE(bool - ignoreCase)
- SCI_AUTOCGETIGNORECASE → bool
- SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR(int behaviour)
- SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR → int
- SCI_AUTOCSETMULTI(int multi)
- SCI_AUTOCGETMULTI → int
- SCI_AUTOCSETORDER(int order)
- SCI_AUTOCGETORDER → int
- SCI_AUTOCSETAUTOHIDE(bool autoHide)
- SCI_AUTOCGETAUTOHIDE → bool
- SCI_AUTOCSETDROPRESTOFWORD(bool - dropRestOfWord)
- SCI_AUTOCGETDROPRESTOFWORD → bool
- SCI_REGISTERIMAGE(int type, const char *xpmData)
- SCI_REGISTERRGBAIMAGE(int type, const char *pixels)
- SCI_CLEARREGISTEREDIMAGES
- SCI_AUTOCSETTYPESEPARATOR(int separatorCharacter)
- SCI_AUTOCGETTYPESEPARATOR → int
- SCI_AUTOCSETMAXHEIGHT(int rowCount)
- SCI_AUTOCGETMAXHEIGHT → int
- SCI_AUTOCSETMAXWIDTH(int characterCount)
- SCI_AUTOCGETMAXWIDTH → int
-
- -

SCI_AUTOCSHOW(int lengthEntered, const char *itemList)
- This message causes a list to be displayed. lengthEntered is the number of - characters of the word already entered and itemList 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 → bool
- This message returns non-zero if there is an active autocompletion list and zero if there is - not.

- -

SCI_AUTOCPOSSTART → position
- 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 *characterSet)
- The characterSet 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(int separatorCharacter)
- SCI_AUTOCGETSEPARATOR → int
- 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 → int
- 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) → int
- 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 → bool
- 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 *characterSet)
- 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 → bool
- 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 → bool
- 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 → int
- 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 → int
- 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 → int
- 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 → bool
- 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 → bool
- 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(int separatorCharacter)
- SCI_AUTOCGETTYPESEPARATOR → int
- - 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 → int
- - 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 → int
- - 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:

- - SCI_USERLISTSHOW(int listType, const char *itemList)
- -

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 *itemList)
- 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 pos, const char - *definition)
- SCI_CALLTIPCANCEL
- SCI_CALLTIPACTIVE → bool
- SCI_CALLTIPPOSSTART → position
- SCI_CALLTIPSETPOSSTART(int posStart)
- SCI_CALLTIPSETHLT(int highlightStart, int - highlightEnd)
- SCI_CALLTIPSETBACK(colour back)
- SCI_CALLTIPSETFORE(colour fore)
- SCI_CALLTIPSETFOREHLT(colour fore)
- SCI_CALLTIPUSESTYLE(int tabSize)
- SCI_CALLTIPSETPOSITION(bool above)
-
- -

SCI_CALLTIPSHOW(int pos, 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.
- pos 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 → bool
- This returns 1 if a call tip is active and 0 if it is not active.

- -

SCI_CALLTIPPOSSTART → position
- 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 highlightStart, int highlightEnd)
- This sets the region of the call tips text to display in a highlighted style. - highlightStart is the zero-based index into the string of the first character to - highlight and highlightEnd is the index of the first character after the highlight. - highlightEnd must be greater than highlightStart; - highlightEnd-highlightStart 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(colour back)
- 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(colour fore)
- 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(colour fore)
- 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_LINEDOWNSCI_LINEDOWNEXTENDSCI_LINEDOWNRECTEXTENDSCI_LINESCROLLDOWN
SCI_LINEUPSCI_LINEUPEXTENDSCI_LINEUPRECTEXTENDSCI_LINESCROLLUP
SCI_PARADOWNSCI_PARADOWNEXTENDSCI_PARAUPSCI_PARAUPEXTEND
SCI_CHARLEFTSCI_CHARLEFTEXTENDSCI_CHARLEFTRECTEXTEND
SCI_CHARRIGHTSCI_CHARRIGHTEXTENDSCI_CHARRIGHTRECTEXTEND
SCI_WORDLEFTSCI_WORDLEFTEXTENDSCI_WORDRIGHTSCI_WORDRIGHTEXTEND
SCI_WORDLEFTENDSCI_WORDLEFTENDEXTENDSCI_WORDRIGHTENDSCI_WORDRIGHTENDEXTEND
SCI_WORDPARTLEFTSCI_WORDPARTLEFTEXTENDSCI_WORDPARTRIGHTSCI_WORDPARTRIGHTEXTEND
SCI_HOMESCI_HOMEEXTENDSCI_HOMERECTEXTEND
SCI_HOMEDISPLAYSCI_HOMEDISPLAYEXTENDSCI_HOMEWRAPSCI_HOMEWRAPEXTEND
SCI_VCHOMESCI_VCHOMEEXTENDSCI_VCHOMERECTEXTEND
SCI_VCHOMEWRAPSCI_VCHOMEWRAPEXTENDSCI_VCHOMEDISPLAYSCI_VCHOMEDISPLAYEXTEND
SCI_LINEENDSCI_LINEENDEXTENDSCI_LINEENDRECTEXTEND
SCI_LINEENDDISPLAYSCI_LINEENDDISPLAYEXTENDSCI_LINEENDWRAPSCI_LINEENDWRAPEXTEND
SCI_DOCUMENTSTARTSCI_DOCUMENTSTARTEXTENDSCI_DOCUMENTENDSCI_DOCUMENTENDEXTEND
SCI_PAGEUPSCI_PAGEUPEXTENDSCI_PAGEUPRECTEXTEND
SCI_PAGEDOWNSCI_PAGEDOWNEXTENDSCI_PAGEDOWNRECTEXTEND
SCI_STUTTEREDPAGEUPSCI_STUTTEREDPAGEUPEXTEND
SCI_STUTTEREDPAGEDOWNSCI_STUTTEREDPAGEDOWNEXTEND
SCI_DELETEBACKSCI_DELETEBACKNOTLINE
SCI_DELWORDLEFTSCI_DELWORDRIGHTSCI_DELWORDRIGHTEND
SCI_DELLINELEFTSCI_DELLINERIGHTSCI_LINEDELETE
SCI_LINECUTSCI_LINECOPYSCI_LINETRANSPOSESCI_LINEDUPLICATE
SCI_LOWERCASESCI_UPPERCASESCI_CANCELSCI_EDITTOGGLEOVERTYPE
SCI_NEWLINESCI_FORMFEEDSCI_TABSCI_BACKTAB
SCI_SELECTIONDUPLICATESCI_VERTICALCENTRECARET
SCI_MOVESELECTEDLINESUPSCI_MOVESELECTEDLINESDOWN
SCI_SCROLLTOSTARTSCI_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_WORD[LEFT|RIGHT]END* commands are - similar to SCI_WORD[LEFT|RIGHT]* but move between word ends instead of word starts.

- -

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, - SCMOD_META, and SCMOD_SUPER. - On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to - SCMOD_META. - SCMOD_SUPER is only available on GTK+ which is commonly the Windows key. - 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 allowPopUp)
-
- -

SCI_USEPOPUP(bool allowPopUp)
- 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
-
- -

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 draw, Sci_RangeToFormat *fr) → position
- SCI_SETPRINTMAGNIFICATION(int - magnification)
- SCI_GETPRINTMAGNIFICATION → int
- SCI_SETPRINTCOLOURMODE(int mode)
- SCI_GETPRINTCOLOURMODE → int
- SCI_SETPRINTWRAPMODE(int wrapMode)
- SCI_GETPRINTWRAPMODE → int
-
- -

SCI_FORMATRANGE(bool draw, Sci_RangeToFormat *fr) → position
- 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.

- -

draw 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 (draw=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 (draw=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 → int
- 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 → int
- 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValuePurpose
SC_PRINT_NORMAL0Print using the current screen colours. This is the default.
SC_PRINT_INVERTLIGHT1If 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_BLACKONWHITE2Print all text as black on a white background.
SC_PRINT_COLOURONWHITE3Everything prints in its own colour on a white background.
SC_PRINT_COLOURONWHITEDEFAULTBG4Everything prints in its own colour on a white background except that line numbers - use their own background colour.
- -

SCI_SETPRINTWRAPMODE(int wrapMode)
- SCI_GETPRINTWRAPMODE → int
- 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 → int
- SCI_GETDIRECTPOINTER → int
- SCI_GETCHARACTERPOINTER → int
- SCI_GETRANGEPOINTER(int start, int lengthRange) → int
- SCI_GETGAPPOSITION → position
-
- -

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 → int
- 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 → int
- 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 → int
- SCI_GETRANGEPOINTER(int start, int lengthRange) → int
- SCI_GETGAPPOSITION → position
- 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 *doc, to ensure compatibility with future - releases of Scintilla you should treat doc 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 → document *
- SCI_SETDOCPOINTER(<unused>, document - *doc)
- SCI_CREATEDOCUMENT → document *
- SCI_ADDREFDOCUMENT(<unused>, document - *doc)
- SCI_RELEASEDOCUMENT(<unused>, document - *doc)
-
- -

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

- -

SCI_SETDOCPOINTER(<unused>, document *doc)
- 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. doc is set as the new document for the window.
- 5. If doc was 0, a new, empty document is created and attached to the - window.
- 6. If doc was not 0, its reference count is increased by 1.

- -

SCI_CREATEDOCUMENT → document *
- 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 *doc)
- 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, - doc.
- 2. Use SCI_ADDREFDOCUMENT(0, doc) to increment the reference count.
- 3. Use SCI_SETDOCPOINTER(0, docNew) to set a different document or - SCI_SETDOCPOINTER(0, 0) to set a new, empty document.

- -

SCI_RELEASEDOCUMENT(<unused>, document *doc)
- This message reduces the reference count of the document identified by doc. doc - 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

- - SCI_CREATELOADER(int bytes) → int
-
- -

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) → int
- 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) → int
- SCI_DOCLINEFROMVISIBLE(int displayLine) → int
- SCI_SHOWLINES(int lineStart, int lineEnd)
- SCI_HIDELINES(int lineStart, int lineEnd)
- SCI_GETLINEVISIBLE(int line) → bool
- SCI_GETALLLINESVISIBLE → bool
- SCI_SETFOLDLEVEL(int line, int level)
- SCI_GETFOLDLEVEL(int line) → int
- SCI_SETAUTOMATICFOLD(int automaticFold)
- SCI_GETAUTOMATICFOLD → int
- SCI_SETFOLDFLAGS(int flags)
- SCI_GETLASTCHILD(int line, int level) → int
- SCI_GETFOLDPARENT(int line) → int
- SCI_SETFOLDEXPANDED(int line, bool - expanded)
- SCI_GETFOLDEXPANDED(int line) → bool
- SCI_CONTRACTEDFOLDNEXT(int lineStart) → int
- 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) → int
- 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) → int
- 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) → bool
- SCI_GETALLLINESVISIBLE → bool
- 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) → int
- 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 (0x0FFF). However, the initial fold level is set to - SC_FOLDLEVELBASE (0x400) 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:
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
1Experimental feature that has been removed.
SC_FOLDFLAG_LINEBEFORE_EXPANDED2Draw above if expanded
SC_FOLDFLAG_LINEBEFORE_CONTRACTED4Draw above if not expanded
SC_FOLDFLAG_LINEAFTER_EXPANDED8Draw below if expanded
SC_FOLDFLAG_LINEAFTER_CONTRACTED16Draw below if not expanded
SC_FOLDFLAG_LEVELNUMBERS64display hexadecimal fold levels in line margin to aid debugging of - folding. The appearance of this feature may change in the future.
SC_FOLDFLAG_LINESTATE128display 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 line, int level) → int
- This message searches for the next line after line, 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 - line. 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 line) → int
- This message returns the line number of the first line before line that is - marked as a fold point with SC_FOLDLEVELHEADERFLAG and has a fold level less than - the line. 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) → bool
- 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. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
SC_FOLDACTION_CONTRACT0Contract.
SC_FOLDACTION_EXPAND1Expand.
SC_FOLDACTION_TOGGLE2Toggle 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 → int
- 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. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
SC_AUTOMATICFOLD_SHOW1Automatically show lines as needed. - This avoids sending the SCN_NEEDSHOWN notification.
SC_AUTOMATICFOLD_CLICK2Handle clicks in fold margin automatically. - This avoids sending the SCN_MARGINCLICK notification for folding margins.
SC_AUTOMATICFOLD_CHANGE4Show 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) → int
- 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 → int
- SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
- SCI_GETWRAPVISUALFLAGS → int
- SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
- SCI_GETWRAPVISUALFLAGSLOCATION → int
- SCI_SETWRAPINDENTMODE(int wrapIndentMode)
- SCI_GETWRAPINDENTMODE → int
- SCI_SETWRAPSTARTINDENT(int indent)
- SCI_GETWRAPSTARTINDENT → int
- SCI_SETLAYOUTCACHE(int cacheMode)
- SCI_GETLAYOUTCACHE → int
- SCI_SETPOSITIONCACHE(int size)
- SCI_GETPOSITIONCACHE → int
- SCI_LINESSPLIT(int pixelWidth)
- SCI_LINESJOIN
- SCI_WRAPCOUNT(int docLine) → int
-
- -

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 → int
- 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 → int
- You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in - wrapVisualFlags determine which visual flags are drawn. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
SC_WRAPVISUALFLAG_NONE0No visual flags
SC_WRAPVISUALFLAG_END1Visual flag at end of subline of a wrapped line.
SC_WRAPVISUALFLAG_START2Visual flag at begin of subline of a wrapped line.
- Subline is indented by at least 1 to make room for the flag.
-
SC_WRAPVISUALFLAG_MARGIN4Visual flag in line number margin.
- -

SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
- SCI_GETWRAPVISUALFLAGSLOCATION → int
- 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. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
SC_WRAPVISUALFLAGLOC_DEFAULT0Visual flags drawn near border
SC_WRAPVISUALFLAGLOC_END_BY_TEXT1Visual flag at end of subline drawn near text
SC_WRAPVISUALFLAGLOC_START_BY_TEXT2Visual flag at beginning of subline drawn near text
- -

SCI_SETWRAPINDENTMODE(int wrapIndentMode)
- SCI_GETWRAPINDENTMODE → int
- 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: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueEffect
SC_WRAPINDENT_FIXED0Wrapped sublines aligned to left of window plus amount set by - SCI_SETWRAPSTARTINDENT
SC_WRAPINDENT_SAME1Wrapped sublines are aligned to first subline indent
SC_WRAPINDENT_INDENT2Wrapped sublines are aligned to first subline indent plus one more level of indentation
- -

SCI_SETWRAPSTARTINDENT(int indent)
- SCI_GETWRAPSTARTINDENT → int
- 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 → int
- You can set cacheMode to one of the symbols in the table:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueLayout cached for these lines
SC_CACHE_NONE0No lines are cached.
SC_CACHE_CARET1The line containing the text caret. This is the default.
SC_CACHE_PAGE2Visible lines plus the line containing the caret.
SC_CACHE_DOCUMENT3All lines in the document.
- -

SCI_SETPOSITIONCACHE(int size)
- SCI_GETPOSITIONCACHE → int
- 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) → int
- 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 → int
-
- -

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 → int
- 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 edgeMode)
- SCI_GETEDGEMODE → int
- SCI_SETEDGECOLUMN(int column)
- SCI_GETEDGECOLUMN → int
- SCI_SETEDGECOLOUR(colour edgeColour)
- SCI_GETEDGECOLOUR → colour
-
- SCI_MULTIEDGEADDLINE(int column, colour edgeColour)
- SCI_MULTIEDGECLEARALL
-
- -

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueLong line display mode
EDGE_NONE0Long lines are not marked. This is the default state.
EDGE_LINE1A 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_BACKGROUND2The background colour of characters after the column limit is changed to the colour - set by SCI_SETEDGECOLOUR. This is recommended for proportional fonts.
EDGE_MULTILINE3This is similar to EDGE_LINE but in contrary to showing only one single - line a configurable set of vertical lines can be shown simultaneously. This edgeMode - uses a completely independent dataset that can only be configured by using the - SCI_MULTIEDGE* messages.
- -

SCI_SETEDGECOLUMN(int column)
- SCI_GETEDGECOLUMN → int
- 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(colour edgeColour)
- SCI_GETEDGECOLOUR → colour
- These messages set and get the colour of the marker used to show that a line has exceeded the - length set by SCI_SETEDGECOLUMN.

- -

SCI_MULTIEDGEADDLINE(int column, - colour edgeColour)
- SCI_MULTIEDGECLEARALL
- SCI_MULTIEDGEADDLINE adds a new vertical edge to the view. The edge will be - displayed at the given column number. The resulting edge position depends on the metric - of a space character in STYLE_DEFAULT. All the edges can be cleared with - SCI_MULTIEDGECLEARALL.

- -

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 → int
- SCI_SETLEXERLANGUAGE(<unused>, const char - *language)
- SCI_GETLEXERLANGUAGE(<unused>, char *language) → int
- SCI_LOADLEXERLIBRARY(<unused>, const char - *path)
- SCI_COLOURISE(int start, int end)
- SCI_CHANGELEXERSTATE(int start, int end) → int
- SCI_PROPERTYNAMES(<unused>, char *names) → int
- SCI_PROPERTYTYPE(const char *name) → int
- SCI_DESCRIBEPROPERTY(const char *name, char *description) → int
- SCI_SETPROPERTY(const char *key, const char *value)
- SCI_GETPROPERTY(const char *key, char *value) → int
- SCI_GETPROPERTYEXPANDED(const char *key, char *value) → int
- SCI_GETPROPERTYINT(const char *key, int defaultValue) → int
- SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions) → int
- SCI_SETKEYWORDS(int keyWordSet, const char - *keyWords)
- - SCI_GETSUBSTYLEBASES(<unused>, char *styles) → int
- SCI_DISTANCETOSECONDARYSTYLES → int
- SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles) → int
- SCI_FREESUBSTYLES
- SCI_GETSUBSTYLESSTART(int styleBase) → int
- SCI_GETSUBSTYLESLENGTH(int styleBase) → int
- SCI_GETSTYLEFROMSUBSTYLE(int subStyle) → int
- SCI_GETPRIMARYSTYLEFROMSTYLE(int style) → int
- SCI_SETIDENTIFIERS(int style, const char *identifiers)
- SCI_PRIVATELEXERCALL(int operation, int pointer) → int
- -

SCI_SETLEXER(int lexer)
- SCI_GETLEXER → int
- 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 *language)
- SCI_GETLEXERLANGUAGE(<unused>, char *language NUL-terminated) → int
- 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 language 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 start, int end)
- This requests the current lexer or the container (if the lexer is set to - SCLEX_CONTAINER) to style the document between start and - end. If end is -1, the document is styled from - start 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 start, int end) → int
- 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) → int
- SCI_PROPERTYTYPE(const char *name) → int
- SCI_DESCRIBEPROPERTY(const char *name, char *description NUL-terminated) → int
- 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) → int
- 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) → int
- 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 defaultValue) → int
- 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 *keyWords)
- 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. keyWords 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) → int
- 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) → int
- Fill styles with a byte for each style that can be split into substyles.

- -

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

- -

SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles) → int
- 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) → int
- SCI_GETSUBSTYLESLENGTH(int styleBase) → int
- Return the start and length of the substyles allocated for a base style.

- -

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

- -

SCI_GETPRIMARYSTYLEFROMSTYLE(int style) → int
- 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.

- -

SCI_PRIVATELEXERCALL(int operation, int pointer) → int
- Call into a lexer in a way not understood by Scintilla.

- -

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 → int
- SCI_SETMOUSEDWELLTIME(int periodMilliseconds)
- SCI_GETMOUSEDWELLTIME → int
- SCI_SETIDENTIFIER(int identifier)
- SCI_GETIDENTIFIER → int
-
- -

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 → int
- 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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueMeaning
SC_UPDATE_CONTENT0x01Contents, styling or markers have been changed.
SC_UPDATE_SELECTION0x02Selection has been changed.
SC_UPDATE_V_SCROLL0x04Scrolled vertically.
SC_UPDATE_H_SCROLL0x08Scrolled 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
modificationTypeA set of flags that identify the change(s) made. See the next - table.
positionStart position of a text or styling change. Set to 0 if not used.
lengthLength of the change in bytes when the text or styling - changes. Set to 0 if not used.
linesAddedNumber of added lines. If negative, the number of deleted lines. Set to - 0 if not used or no lines added or deleted.
textValid 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.
lineThe 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.
foldLevelNowThe new fold level applied to the line or 0 if this field is - unused.
foldLevelPrevThe 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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueMeaningSCNotification fields
SC_MOD_INSERTTEXT0x01Text has been inserted into the document.position, length, text, linesAdded
SC_MOD_DELETETEXT0x02Text has been removed from the document.position, length, text, linesAdded
SC_MOD_CHANGESTYLE0x04A style change has occurred.position, length
SC_MOD_CHANGEFOLD0x08A folding change has occurred.line, foldLevelNow, foldLevelPrev
SC_PERFORMED_USER0x10Information: the operation was done by the user.None
SC_PERFORMED_UNDO0x20Information: this was the result of an Undo.None
SC_PERFORMED_REDO0x40Information: this was the result of a Redo.None
SC_MULTISTEPUNDOREDO0x80This is part of a multi-step Undo or Redo transaction.None
SC_LASTSTEPINUNDOREDO0x100This is the final step in an Undo or Redo transaction.None
SC_MOD_CHANGEMARKER0x200One or more markers has changed in a line.line
SC_MOD_BEFOREINSERT0x400Text is about to be inserted into the document.position, if performed by user then text in bytes, length in bytes
SC_MOD_BEFOREDELETE0x800Text is about to be deleted from the document.position, length
SC_MOD_CHANGEINDICATOR0x4000An indicator has been added or removed from a range of text.position, length
SC_MOD_CHANGELINESTATE0x8000A line state has changed because SCI_SETLINESTATE - was called.line
SC_MOD_CHANGETABSTOPS0x200000The explicit tab stops on a line have changed because SCI_CLEARTABSTOPS or - SCI_ADDTABSTOP was called.line
SC_MOD_LEXERSTATE0x80000The internal state of a lexer has changed over a range.position, length
SC_MOD_CHANGEMARGIN0x10000A text margin has changed.line
SC_MOD_CHANGEANNOTATION0x20000An annotation has changed.line
SC_MOD_INSERTCHECK0x100000Text 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_MULTILINEUNDOREDO0x1000This is part of an Undo or Redo with multi-line changes.None
SC_STARTACTION0x2000This 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_CONTAINER0x40000This is set on for actions that the container stored into the undo stack with - SCI_ADDUNDOACTION. - token
SC_MODEVENTMASKALL0x1FFFFFThis 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 → int
- 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
messageThe SCI_* message that caused the notification.
wParamThe value of wParam in the SCI_* message.
lParamThe 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
modifiersThe 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.
positionThe position of the start of the line in the document that corresponds - to the margin click.
marginThe 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
listTypeThis is set to the listType parameter from the SCI_USERLISTSHOW message that - initiated the list.
textThe text of the selection.
positionThe position the list was displayed at.
chIf a fillup character was the method of selection, the used - character, otherwise 0.
listCompletionMethodA 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:

- - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
positionThis is the nearest position in the document to the position where the - mouse pointer was lingering.
x, yWhere the pointer lingered. The position field is set to - SCI_POSITIONFROMPOINTCLOSE(x, y).
-
- -

SCI_SETMOUSEDWELLTIME(int periodMilliseconds)
- SCI_GETMOUSEDWELLTIME → int
- 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:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldUsage
positionThe start position of the word being completed.
textThe text of the selection.
chIf a fillup character was the method of selection, the used - character, otherwise 0.
listCompletionMethodA value indicating the way in which the completion - occurred. See the table below.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SymbolValueMeaning
SC_AC_FILLUP1A fillup character triggered the completion. The character used is - in ch.
SC_AC_DOUBLECLICK2A double-click triggered the completion. ch is 0.
SC_AC_TAB3The tab key or SCI_TAB triggered the completion. ch is 0.
SC_AC_NEWLINE4A new line or SCI_NEWLINE triggered the completion. ch is 0.
SC_AC_COMMAND5The - - 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.

- -

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.

- - SCI_SETUSEPALETTE(bool usePalette)
- SCI_GETUSEPALETTE → bool
- SCI_SETKEYSUNICODE(bool keysUnicode)
- SCI_GETKEYSUNICODE → bool
- SCI_SETSTYLEBITS(int bits)
- SCI_GETSTYLEBITS → int
- SCI_GETSTYLEBITSNEEDED → int
-
- -

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 usePalette) Deprecated
- SCI_GETUSEPALETTE → bool 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 → bool 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 → int Deprecated
- SCI_GETSTYLEBITSNEEDED → int 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.4 or newer should be used. GTK+ 2.18+ and 3.x are - supported with glib 2.22+. 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.

- - - - diff --git a/scintilla/doc/ScintillaDownload.html b/scintilla/doc/ScintillaDownload.html deleted file mode 100644 index 7d14eee9..00000000 --- a/scintilla/doc/ScintillaDownload.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - 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.7.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. -

- - diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html deleted file mode 100644 index 595d2929..00000000 --- a/scintilla/doc/ScintillaHistory.html +++ /dev/null @@ -1,11273 +0,0 @@ - - - - - - - - - - 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 IshimotoMark HammondFrancois Le CoguiecDale Nagata
Ralf ReinhardtPhilippe LhosteAndrew McKinlayStephan R. A. Deibel
Hans EckardtVassili BourdoMaksim LinRobin Dunn
John EhresmanSteffen GoeldnerDeepak S.DevelopMentor
Yann GaillardAubin PaulJason DiamondAhmad Baitalmal
Paul WinwoodMaxim BaranovRagnar HøjlandChristian Obrecht
Andreas NeukoetterAdam GatesSteve LhommeFerdinand Prantl
Jan DriesMarkus GritschTahir KaracaAhmad Zawawi
Laurent le TynevezWalter BraeuAshley CambrellGarrett Serack
Holger SchmidtActiveStateJames LarcombeAlexey Yutkin
Jan HercekRichard PeclEdward K. ReamValery Kondakoff
Smári McCarthyClemens WyssSimon SteeleSerge A. Baranov
Xavier NodetWilly DevauxDavid ClainBrendon Yenson
Vamsi PotluruPraveen AmbekarAlan KnowlesKengo Jinno
Valentin ValchevMarcos E. WurziusMartin AldersonRobert Gustavsson
José FonsecaHolger KiemesFrancis IrvingScott Kirkwood
Brian QuinlanUbiMichael R. DuerigDeepak T
Don Paul BeletskyGerhard KalabOlivier DagenaisJosh Wingstrom
Bruce DodsonSergey KoshcheyevChuan-jian ShenShane Caraveo
Alexander ScripnikRyan ChristiansonMartin SteffensenJakub Vrána
The Black HorusBernd KreussThomas LauerMike Lansdaal
Yukihiro NakaiJochen TuchtGreg SmithSteve Schoettler
Mauritius ThinnesDarren SchroederPedro GuerreiroSteven te Brinke
Dan PetittBiswapesh ChattopadhyayKein-Hong ManPatrizio Bekerle
Nigel HathawayHrishikesh DesaiSergey PuljajevMathias Rauen
Angelo MandatoDenis SureauKaspar SchiessChristoph Hösler
João Paulo F FariasRon SchofieldStefan WosnikMarius Gheorghe
Naba KumarSean O'DellStefanos TogoulidisHans Hagen
Jim CapeRoland WalterBrian MosherNicholas Nemtsev
Roy WoodPeter-Henry ManderRobert BoucherChristoph Dalitz
April WhiteS. UmarTrent MickFilip Yaghob
Avi YegudinVivi OrunitiaManfred BeckerDimitris Keletsekis
YuigaDavide ScolaJason BoggsReinhold Niesner
Jos van der ZandePescumaPavol BosikJohannes Schmid
Blair McGlashanMikael HultgrenFlorian BalmerHadar Raz
Herr PfarrerBen KeyGene BarryNiki Spahiev
Carsten SperberPhil ReidIago RubioRégis Vaquette
Massimo CoràElias PschernigChris JonesJosiah Reynolds
Robert Roessler rftp.comSteve DonovanJan Martin PettersenSergey Philippov
BorujoaMichael OwensFranck MarciaMassimo Maria Ghisalberti
Frank WunderlichJosepmaria RocaTobias EngvallSuzumizaki Kimitaka
Michael CartmellPascal HurniAndreRandy Butler
Georg RitterMichael GoffioulBen HarperAdam Strzelecki
Kamen StanevSteve MenardOliver YeohEric Promislow
Joseph GalbraithJeffrey RenArmel AsselinJim Pattee
Friedrich VedderSebastian PippingAndre ArpinStanislav Maslovski
Martin StoneFabien ProriolmimirNicola Civran
SnowMitchell ForalPieter HoltzhausenWaldemar Augustyn
Jason HaslamSebastian SteinlechnerChris RickardRob McMullen
Stefan SchwendelerCristian AdamNicolas ChachereauIstvan Szollosi
Xie RenhuiEnrico TrögerTodd WhitemanYuval Papish
instantonSergio LucatoVladVRODmitry Maslov
chupakabraJuan Carlos Arevalo BaezaNick TreleavenStephen Stagg
Jean-Paul IribarrenTim GerundtSam HarwellBoris
Jason OsterGertjan KloostermanalexbodnSergiu Dotenco
Anders KarlssonozlooperMarko NjezicEugen Bitter
Christoph BaumannChristopher BeanSergey KishchenkoKai Liu
Andreas RumpfJames MoffattYuzhou XinNic Jansma
Evan JonesMike LischkeEric KiddmaXmo
David SeverwrightJon StraitOliver KiddleEtienne Girondel
Haimag RenAndrey MoskalyovXaviToby Inkster
Eric ForgeotColomban WendlingNeoJordan Russell
Farshid LashkariSam RawlinsMichael MullinCarlos SS
vimMartial DemolinsTino WeinkaufJérôme Laforge
Udo LechnerMarco FaldaDariusz KnocińskiBen Fisher
Don GobinJohn YeungAdobeElizabeth A. Irizarry
Mike SchroederMorten MacFlyJaime GimenoThomas Linder Puls
Artyom ZuikovGerritOccam's RazorBen Bluemel
David WolfendaleChris AngelicoMarat DukhanStefan Weil
Rex ConnRoss McKayBruno BarbieriGordon Smith
dimitarSébastien GranjouxzenikoJames Ribe
Markus NißlMartin PanterMark YenPhilippe Elsass
Dimitar ZhekovFan YangDenis Shelomovskijdarmar
John VellaChinh NguyenSakshi VermaJoel B. Mohler
IsiledhelVidya WasiG. HuByron Hawkins
AlphaJohn DonoghuekudahIgor Shaula
Pavel BulochkinYosef Or BoczkoBrian GriffinÖzgür Emir
NeomiOmegaPhilSiegeLordErik
TJFMark RobinsonThomas Martitzfelix
Christian WaltherEbbenRobert GiesekeMike M
nkmathewAndreas TscharnerLee Wilmottjohnsonj
VicenteNick GravgaardIan GoldbyHolger Stenger
danselmiMat BerchtoldMichael StaszewskiBaurzhan Muftakhidinov
Erik AngelinYusuf Ramazan KaragözMarkus HeidelbergJoe Mueller
Mika AttilaJoMazMMarkus MoserStefan Küng
Jiří TechetJonathan HuntSerg StetsukJordan Jueckstock
Yury DubinskySam HocevarLuyomiMatt Gilarde
Mark CJohannes SasongkofstirlitzRobin Haberkorn
Pavel SountsovDirk LorenzenKasper B. GraversenChris Mayo
Van de BuggerTse Kit YamSmartShare SystemsMorten Brørup
Alexey DenisovjedaileyoirfeodentA-R-C-A
Roberto Rossi
-

- Images used in GTK+ version -

-
    -
  • - - Icons Copyright(C) 1998 by Dean S. Jones
    -
  • -
-

- Release 3.7.0 -

-
    -
  • - Released 16 October 2016. -
  • -
  • - Word selection, navigation, and manipulation is now performed on characters instead of bytes - leading to more natural behaviour for multi-byte encodings like UTF-8. - For UTF-8 characters 0x80 and above, classification into word; punctuation; space; or line-end - is based on the Unicode general category of the character and is not customizable. - Bug #1832. -
  • -
  • - Two enums changed in Scintilla.iface which may lead to changed bindings. - There were 2 FontQuality enums and the first is now PhasesDraw. - The prefix for FoldAction was SC_FOLDACTION and is now SC_FOLDACTION_ - which is similar to other enums. - These changes do not affect the standard C/C++ binding. -
  • -
  • - EDGE_MULTILINE and SCI_MULTIEDGEADDLINE added to allow displaying multiple - vertical edges simultaneously. -
  • -
  • - The number of margins can be changed with SCI_SETMARGINS. -
  • -
  • - Margin type SC_MARGIN_COLOUR added so that the application may - choose any colour for a margin with SCI_SETMARGINBACKN. -
  • -
  • - On Win32, mouse wheel scrolling can be restricted to only occur when the mouse is - within the window. -
  • -
  • - The WordList class in lexlib used by lexers adds an InListAbridged method for - matching keywords that have particular prefixes and/or suffixes. -
  • -
  • - The Baan lexer was changed significantly with more lexical states, keyword sets, - and support for abridged keywords. -
  • -
  • - The CoffeeScript lexer styles interpolated code in strings. - Bug #1865. -
  • -
  • - The Progress lexer "progress" has been replaced with a new lexer "abl" - (Advanced Business Language) - with a different set of lexical states and more functionality. - The lexical state prefix has changed from SCE_4GL_ to SCE_ABL_. - Feature #1143. -
  • -
  • - The PowerShell lexer understands the grave accent escape character. - Bug #1868. -
  • -
  • - The YAML lexer recognizes inline comments. - Bug #1660. -
  • -
  • - SciTE on Windows can retain coloured selection when inactive with - selection.always.visible property. -
  • -
  • - SciTE on Windows adds a state to close.on.find to close the find strip when - a match is found. -
  • -
  • - Fix caret position after left or right movement with rectangular selection. - Bug #1861. -
  • -
  • - In SciTE, optional prefix argument added to scite.ConstantName method. - Bug #1860. -
  • -
  • - On Cocoa, include ILexer.h in the public headers of the framework. - Bug #1855. -
  • -
  • - On Cocoa, allow subclass of SCIContentView to set cursor. - Bug #1863. -
  • -
  • - On Cocoa, recognize the numeric keypad '+', '-', and '/' keys as - SCK_ADD, SCK_SUBTRACT, and SCK_DIVIDE. - Bug #1867. -
  • -
  • - On GTK+ 3.21+ fix incorrect font size in auto-completion list. - Bug #1859. -
  • -
  • - Fix SciTE crash when command.mode ends with comma. - Bug #1857. -
  • -
  • - SciTE on Windows has a full size toolbar icon for "Close". -
  • -
-

- Release 3.6.7 -

-
    -
  • - Released 4 September 2016. -
  • -
  • - C++11 range-based for loops used in SciTE so GCC 4.6 is now the minimum supported version. -
  • -
  • - SC_CHARSET_DEFAULT now means code page 1252 on Windows unless a code page is set. - This prevents unexpected behaviour and crashes on East Asian systems where default locales are commonly DBCS. - Projects which want to default to DBCS code pages in East Asian locales should set the code page and - character set explicitly. -
  • -
  • - SCVS_NOWRAPLINESTART option stops left arrow from wrapping to the previous line. - Most commonly wanted when virtual space is used. - Bug #1648. -
  • -
  • - The C++ lexer can fold on #else and #elif with the fold.cpp.preprocessor.at.else property. - Bug #210. -
  • -
  • - The errorlist lexer detects warnings from Visual C++ which do not contain line numbers. -
  • -
  • - The HTML lexer no longer treats "<?" inside a string in a script as potentially starting an XML document. - Bug #767. -
  • -
  • - The HTML lexer fixes a problem resuming at a script start where the starting state continued - past where it should. - Bug #1849. -
  • -
  • - When inserting spaces for virtual space and the position is in indentation and tabs are enabled - for indentation then use tabs. - Bug #1850. -
  • -
  • - Fix fold expand when some child text not styled. - Caused by fixes for Bug #1799. - Bug #1842. -
  • -
  • - Fix key binding bug on Cocoa for control+. - Bug #1854. -
  • -
  • - Fix scroll bar size warnings on GTK+ caused by #1831. - Bug #1851. -
  • -
  • - Small fixes for GTK+ makefile. - Bug #1844. - Bug #1845. - Bug #1846. -
  • -
  • - Fix SciTE indentation after code like "void function () {}". -
  • -
  • - Fix SciTE global regex replace of "^" with something which missed the line after empty - lines with LF line ends. - Bug #1839. -
  • -
  • - Fix SciTE on GTK+ 3.20 bug where toggle buttons on find and replace strips - did not show active state. - Bug #1853. -
  • -
-

- Release 3.6.6 -

-
    -
  • - Released 24 May 2016. -
  • -
  • - C++ 11 <regex> support built by default. Can be disabled by defining NO_CXX11_REGEX. -
  • -
  • - SciTE_USERHOME environment variable allows separate location for writeable properties files. - Feature #965. -
  • -
  • - GObject introspection supports notify and command events. -
  • -
  • - The Progress lexer now allows comments preceded by a tab. -
  • -
  • - Scripts reading Scintilla.iface file include comments for enu and lex definitions. - Bug #1829. -
  • -
  • - Fix crashes on GTK+ if idle work active when destroyed. - Bug #1827. -
  • -
  • - Fixed bugs when used on GTK+ 3.20. - Bug #1825. - Bug #1831. -
  • -
  • - Fix SciTE search field background with dark theme on GTK+ 2.x. - Bug #1826. -
  • -
  • - Fixed bug on Win32 that allowed resizing autocompletion from bottom when it was - located above the caret. -
  • -
  • - On Win32, when using a screen reader and selecting text using Shift+Arrow, - fix bug when scrolling made the caret stay at the same screen location - so the screen reader did not speak the added or removed selection. -
  • -
-

- Release 3.6.5 -

-
    -
  • - Released 26 April 2016. -
  • -
  • - JSON lexer added. - Feature #1140. -
  • -
  • - The C++ lexer fixes a bug with multi-line strings with line continuation where the string style - overflowed after an edit. - Bug #1824. -
  • -
  • - The Python lexer treats '@' as an operator except when it is the first visible character on a line. - This is for Python 3.5. -
  • -
  • - The Rust lexer allows '?' as an operator. - Feature #1146. -
  • -
  • - Doubled size of compiled regex buffer. - Bug #1822. -
  • -
  • - For GTK+, the Super modifier key can be used in key bindings. - Feature #1142. -
  • -
  • - For GTK+, fix some crashes when using multiple threads. -
  • -
  • - Platform layer font cache removed on GTK+ as platform-independent caches are used. - This avoids the use of thread locking and initialisation of threads so any GTK+ - applications that rely on Scintilla initialising threads will have to do that themselves. -
  • -
  • - SciTE bug fixed with exported HTML where extra line shown. - Bug #1816. -
  • -
  • - SciTE on Windows fixes bugs with pop-up menus in the find and replace strips. - For the replace strip, menu choices change the state. - For the find strip, menu choices are reflected in the appearance of their corresponding buttons. -
  • -
  • - SciTE on Windows on high DPI displays fixes the height of edit boxes in user strips. -
  • -
-

- Release 3.6.4 -

-
    -
  • - Released 13 March 2016. -
  • -
  • - SciTE allows setting the autocompletion type separator character. -
  • -
  • - The C++ folder folds code on '(' and ')' to allow multi-line calls to be folded. - Feature #1138. -
  • -
  • - For the HTML lexer, limit the extent of Mako line comments to finish before - the line end characters. -
  • -
  • - Folds unfolded when two fold regions are merged by either deleting an intervening line - or changing its fold level by adding characters. - This was fixed both in Scintilla and in SciTE's equivalent code. - Bug #1799.
    -
  • -
  • - The Progress lexer supports hexadecimal numeric literals, - single-line comments, abbreviated keywords and - extends nested comments to unlimited levels. -
  • -
  • - Ruby lexer treats alternate hash key syntax "key:" as a symbol. - Bug #1810. -
  • -
  • - Rust lexer handles bracketed Unicode string escapes like "\u{123abc}". - Bug #1809. -
  • -
  • - For GTK+ on Windows fix 64-bit build which was broken in 3.6.3. -
  • -
  • - For Qt, release builds have assertions turned off. -
  • -
  • - For Qt on Windows, fix compilation failure for Qt 4.x. -
  • -
  • - IME target range displayed on Qt for OS X. -
  • -
  • - On Windows, make clipboard operations more robust by retrying OpenClipboard if it fails - as this may occur when another application has opened the clipboard. -
  • -
  • - On Windows back out change that removed use of def file to ensure - Scintilla_DirectFunction exported without name mangling. - Bug #1813. -
  • -
  • - On GTK+ and Qt over Win32 in Korean fix bug caused by last release's word input change. -
  • -
  • - For SciTE, more descriptive error messages are displayed when there are problems loading the - Lua startup script. - Feature #1139. -
  • -
-

- Release 3.6.3 -

-
    -
  • - Released 18 January 2016. -
  • -
  • - Allow painting without first styling all visible text then styling in the background - using idle-time. This helps performance when scrolling down in very large documents. - Can also incrementally style after the visible area to the end of the document so that - the document is already styled when the user scrolls to it. -
  • -
  • - Support GObject introspection on GTK+. -
  • -
  • - SciTE supports pasting to each selection with the selection.multipaste setting. - Feature #1123. -
  • -
  • - SciTE can optionally display a read-only indicator on tabs and in the Buffers menu. -
  • -
  • - Bash lexer flags incomplete here doc delimiters as syntax errors. - Bug #1789.
    - Support added for using '#' in non-comment ways as is possible with zsh. - Bug #1794.
    - Recognize more characters as here-doc delimiters. - Bug #1778. -
  • -
  • - Errorlist lexer highlights warning messages from the Microsoft linker. -
  • -
  • - Errorlist lexer fixes bug with final line in escape sequence recognition mode. -
  • -
  • - Lua lexer includes '&' and '|' bitwise operators for Lua 5.3. - Bug #1790. -
  • -
  • - Perl lexer updated for Perl 5.20 and 5.22.
    - Allow '_' for subroutine prototypes. - Bug #1791.
    - Double-diamond operator <<>>.
    - Hexadecimal floating point literals.
    - Repetition in list assignment. - Bug #1793.
    - Highlight changed subroutine prototype syntax for Perl 5.20. - Bug #1797.
    - Fix module ::-syntax when special characters such as 'x' are used.
    - Added ' and " detection as prefix chars for x repetition operator. - Bug #1800. -
  • -
  • - Visual Prolog lexer recognizes numbers more accurately and allows non-ASCII verbatim - quoting characters. - Feature #1130. -
  • -
  • - Send SCN_UPDATEUI with SC_UPDATE_SELECTION when the application changes multiple - selection. -
  • -
  • - Expand folded areas before deleting fold header line. - Bug #1796. -
  • -
  • - Treat Unicode line ends like common line ends when maintaining fold state. -
  • -
  • - Highlight whole run for hover indicator when wrapped. - Bug #1784. -
  • -
  • - On Cocoa, fix crash when autocompletion list closed during scroll bounce-back. - Bug #1788. -
  • -
  • - On Windows, fix non-BMP input through WM_CHAR and allow WM_UNICHAR to work - with non-BMP characters and on non-Unicode documents. - Bug #1779. -
  • -
  • - On Windows using DirectWrite, for ligatures and other character clusters, - display caret and selections part-way through clusters so that the caret doesn't stick - to the end of the cluster making it easier to understand editing actions. -
  • -
  • - On Windows, Scintilla no longer uses a .DEF file during linking as it duplicates - source code directives. -
  • -
  • - On GTK+ and Qt, Korean input by word fixed. -
  • -
  • - On GTK+, Qt, and Win32 block IME input when document is read-only or any selected text - is protected. -
  • -
  • - On GTK+ on OS X, fix warning during destruction. - Bug #1777. -
  • -
  • - Fix SciTE crashes when using LPEG lexers. -
  • -
-

- Release 3.6.2 -

-
    -
  • - Released 6 November 2015. -
  • -
  • - Whitespace may be made visible just in indentation. -
  • -
  • - Whitespace dots are centred when larger than 1 pixel. -
  • -
  • - The Scintilla framework on Cocoa now contains version numbers. -
  • -
  • - SciTE's standard properties collect values from all active .properties file to produce the Language menu - and the file types pull-down in the File open dialog. -
  • -
  • - The single executable version of SciTE, Sc1, uses 'module' statements within its embedded - properties. This makes it act more like the full distribution allowing languages to be turned on - and off by setting imports.include and imports.exclude. - The default imports.exclude property adds eiffel, erlang, ps, and pov so these languages are - turned off by default. -
  • -
  • - SciTE adds an output.blank.margin.left property to allow setting the output pane - margin to a different width than the edit pane. -
  • -
  • - CoffeeScript lexer highlights ranges correctly. - Bug #1765. -
  • -
  • - Markdown lexer treats line starts consistently to always highlight *foo* or similar at line start. - Bug #1766. -
  • -
  • - Optimise marker redrawing by only drawing affected lines when markers shown in the text. -
  • -
  • - On Cocoa, timers and idling now work in modal dialogs. This also stops some crashes. -
  • -
  • - On Cocoa, fix crashes when deleting a ScintillaView. These crashes could occur when scrolling - at the time the ScintillaView was deleted although there may have been other cases. -
  • -
  • - On GTK+ 2.x, fix height of lines in autocompletion lists. - Bug #1774. -
  • -
  • - Fix bug with SCI_LINEENDDISPLAY where the caret moved to the next document line instead of the - end of the display line. - Bug #1772. -
  • -
  • - Report error (SC_STATUS_FAILURE) when negative length passed to SCI_SETSTYLING. - Bug #1768. -
  • -
  • - When SC_MARK_UNDERLINE is not assigned to a margin, stop drawing the whole line. -
  • -
  • - When reverting an untitled document in SciTE, just clear it with no message about a file. - Bug #1764. -
  • -
  • - SciTE on GTK+ allows use of Ctrl+A (Select All) inside find and replace strips. - Bug #1769. -
  • -
-

- Release 3.6.1 -

-
    -
  • - Released 15 September 2015. -
  • -
  • - The oldest version of GTK+ supported now is 2.18 and for glib it is 2.22. -
  • -
  • - On GTK+, SC_CHARSET_OEM866 added to allow editing Russian files encoded in code page 866. - Feature #1019. -
  • -
  • - On Windows, reconversion is performed when requested by the IME. -
  • -
  • - CoffeeScript lexer adds lexical class for instance properties and fixes some cases of regex highlighting. - Bug #1749. -
  • -
  • - The errorlist lexer understands some ANSI escape sequences to change foreground colour and intensity. - This is sufficient to colour diagnostic output from gcc and clang when -fdiagnostics-color set. -
  • -
  • - The errorlist lexer allows the line number to be 0 in GCC errors as some tools report whole file - errors as line 0. -
  • -
  • - MySql lexer fixes empty comments /**/ so the comment state does not continue. -
  • -
  • - VHDL folder supports "protected" keyword. -
  • -
  • - Treat CRLF line end as two characters in SCI_COUNTCHARACTERS. - Bug #1757. -
  • -
  • - On GTK+ 3.x, fix height of lines in autocompletion lists to match the font. - Switch from deprecated style calls to CSS styling. - Removed setting list colours on GTK+ 3.16+ as no longer appears needed. -
  • -
  • - On GTK+, avoid "Invalid rectangle passed" warning messages by never reporting the client - rectangle with a negative width or height. - Bug #1743. -
  • -
  • - On Cocoa, copy Sci_Position.h into the framework so clients can build. -
  • -
  • - On Cocoa fix bug with drag and drop that could lead to crashes. - Bug #1751. -
  • -
  • - Fix SciTE disk exhaustion bug by reporting failures when writing files. - Bug #1760. -
  • -
  • - Fix find strip in SciTE on Windows XP to be visible. -
  • -
  • - SciTE on Windows changes the way it detects that a tool has finished executing to ensure all output data - from the process is read. -
  • -
  • - SciTE on Windows improves the time taken to read output from tools that produce a large amount - of output by a factor of around 10. -
  • -
  • - On GTK+ the keyboard command for View | End of Line was changed to Ctrl+Shift+N - to avoid clash with Search | Selection Add Next. - Bug #1750. -
  • -
-

- 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 platforms 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 -

- - diff --git a/scintilla/doc/ScintillaRelated.html b/scintilla/doc/ScintillaRelated.html deleted file mode 100644 index dea00ef0..00000000 --- a/scintilla/doc/ScintillaRelated.html +++ /dev/null @@ -1,529 +0,0 @@ - - - - - - - - - - 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 -

-

- ZeroBrane Studio Lua IDE - is a lightweight Lua IDE with code completion, syntax highlighting, live - coding, remote debugger, and code analyzer (Windows, OSX, and Linux). -

-

- XML Validator Buddy - is an XML/JSON editor and XML validator for Windows. -

-

- 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 source code editor for MacOSX, Windows, and GTK/Linux. -

-

- 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. -

-

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

-

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

-

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

-

- 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. -

-

- 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. -

-

- 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. -

-

- 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. -

-

- PyCrust is an interactive - Python shell based on wxPython. -

-

- 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. -

-

- 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. -

- - - diff --git a/scintilla/doc/ScintillaToDo.html b/scintilla/doc/ScintillaToDo.html deleted file mode 100644 index c8c1fa22..00000000 --- a/scintilla/doc/ScintillaToDo.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - - - - 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. -

- - diff --git a/scintilla/doc/ScintillaUsage.html b/scintilla/doc/ScintillaUsage.html deleted file mode 100644 index da850f92..00000000 --- a/scintilla/doc/ScintillaUsage.html +++ /dev/null @@ -1,376 +0,0 @@ - - - - - - - - - - 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. -

- - - diff --git a/scintilla/doc/Steps.html b/scintilla/doc/Steps.html deleted file mode 100644 index 765268da..00000000 --- a/scintilla/doc/Steps.html +++ /dev/null @@ -1,142 +0,0 @@ - -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. -

- - diff --git a/scintilla/doc/annotations.png b/scintilla/doc/annotations.png deleted file mode 100644 index 23e5feb2..00000000 Binary files a/scintilla/doc/annotations.png and /dev/null differ diff --git a/scintilla/doc/index.html b/scintilla/doc/index.html deleted file mode 100644 index 4048458c..00000000 --- a/scintilla/doc/index.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - Scintilla and SciTE - - - - - - - - - - -
- Scintilla - - A free source code editing component for Win32, - GTK+, and OS X - - Release version 3.7.0
- Site last modified October 16 2016
-
-   -
- - - - -
-   -
-
    -
  • Version 3.7.0 improves word selection, navigation, and manipulation for UTF-8 documents.
  • -
  • Version 3.6.7 changes SC_CHARSET_DEFAULT on Windows to mean European code page 1252 unless a code page is set.
  • -
  • Version 3.6.6 enables C++11 <regex> by default.
  • -
  • Version 3.6.5 adds a JSON lexer and removes the font cache on GTK+. - Type definitions Sci_Position, Sci_PositionU, and Sci_PositionCR allow client - code to prepare for a future change allowing larger than 2 GB documents.
  • -
- - -

- 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 - - - - - diff --git a/scintilla/doc/styledmargin.png b/scintilla/doc/styledmargin.png deleted file mode 100644 index 30ccbfde..00000000 Binary files a/scintilla/doc/styledmargin.png and /dev/null differ diff --git a/scintilla/gtk/Converter.h b/scintilla/gtk/Converter.h deleted file mode 100644 index 9ba16a30..00000000 --- a/scintilla/gtk/Converter.h +++ /dev/null @@ -1,74 +0,0 @@ -// 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 - -const GIConv iconvhBad = (GIConv)(-1); -const gsize sizeFailure = static_cast(-1); -/** - * Encapsulate g_iconv safely. - */ -class Converter { - GIConv 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) { - Close(); - if (*charSetSource) { - // Try allowing approximate transliterations - if (transliterations) { - std::string fullDest(charSetDestination); - fullDest.append("//TRANSLIT"); - OpenHandle(fullDest.c_str(), charSetSource); - } - if (!Succeeded()) { - // Transliterations failed so try basic name - OpenHandle(charSetDestination, charSetSource); - } - } - } - void Close() { - if (Succeeded()) { - g_iconv_close(iconvh); - iconvh = iconvhBad; - } - } - gsize Convert(char** src, gsize *srcleft, char **dst, gsize *dstleft) const { - if (!Succeeded()) { - return sizeFailure; - } else { - return g_iconv(iconvh, src, srcleft, dst, dstleft); - } - } -}; - -#ifdef SCI_NAMESPACE -} -#endif - -#endif diff --git a/scintilla/gtk/PlatGTK.cxx b/scintilla/gtk/PlatGTK.cxx deleted file mode 100644 index e2afe40a..00000000 --- a/scintilla/gtk/PlatGTK.cxx +++ /dev/null @@ -1,2125 +0,0 @@ -// 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 - -#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 - -#include "Converter.h" - -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) { - return gtk_widget_get_window(w); -} - -#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}; - -// Holds a PangoFontDescription*. -class FontHandle { -public: - PangoFontDescription *pfd; - int characterSet; - FontHandle() : pfd(0), characterSet(-1) { - } - FontHandle(PangoFontDescription *pfd_, int characterSet_) { - pfd = pfd_; - characterSet = characterSet_; - } - ~FontHandle() { - if (pfd) - pango_font_description_free(pfd); - pfd = 0; - } - static FontHandle *CreateNewFont(const FontParameters &fp); -}; - -FontHandle *FontHandle::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 NULL; -} - -// 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 static_cast(f.GetID()); -} - -static GtkWidget *PWidget(WindowID wid) { - return static_cast(wid); -} - -Point Point::FromLong(long lpoint) { - return Point( - Platform::LowShortFromLong(lpoint), - Platform::HighShortFromLong(lpoint)); -} - -Font::Font() : fid(0) {} - -Font::~Font() {} - -void Font::Create(const FontParameters &fp) { - Release(); - fid = FontHandle::CreateNewFont(fp); -} - -void Font::Release() { - if (fid) - delete static_cast(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_OEM866: - return "CP866"; - 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(static_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); - gsize inLeft = len; - char *putf = &utfForm[0]; - char *pout = putf; - gsize outLeft = len*3+1; - gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions != sizeFailure) { - *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); - gsize inLeft = lenMB; - char *pout = wcForm; - gsize outLeft = 2; - gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions != sizeFailure) { - 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) { - 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; charInLigpfd) { - 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; - int ascent = 0; - if (PFont(font_)->pfd) { - PangoFontMetrics *metrics = pango_context_get_metrics(pcontext, - PFont(font_)->pfd, pango_context_get_language(pcontext)); - ascent = - doubleFromPangoUnits(pango_font_metrics_get_ascent(metrics)); - pango_font_metrics_unref(metrics); - } - if (ascent == 0) { - ascent = 1; - } - 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 gtk_widget_has_focus(GTK_WIDGET(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; - gtk_widget_get_allocation(PWidget(wid), &allocation); - 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; - GtkCellRenderer* renderer; - RGBAImageSet images; - int desiredVisibleRows; - unsigned int maxItemCharacters; - unsigned int aveCharWidth; -#if GTK_CHECK_VERSION(3,0,0) - GtkCssProvider *cssProvider; -#endif -public: - CallBackAction doubleClickAction; - void *doubleClickActionData; - - ListBoxX() : widCached(0), frame(0), list(0), scroller(0), pixhash(NULL), pixbuf_renderer(0), - renderer(0), - desiredVisibleRows(5), maxItemCharacters(0), - aveCharWidth(1), -#if GTK_CHECK_VERSION(3,0,0) - cssProvider(NULL), -#endif - 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; - } -#if GTK_CHECK_VERSION(3,0,0) - if (cssProvider) { - g_object_unref(cssProvider); - cssProvider = NULL; - } -#endif - } - 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; -} - -static int treeViewGetRowHeight(GtkTreeView *view) { -#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(view, path, NULL, &rect); - gtk_tree_path_free(path); - return rect.height; -#else - int row_height=0; - int vertical_separator=0; - int expander_size=0; - GtkTreeViewColumn *column = gtk_tree_view_get_column(view, 0); - gtk_tree_view_column_cell_get_size(column, NULL, NULL, NULL, NULL, &row_height); - gtk_widget_style_get(GTK_WIDGET(view), - "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 -} - -// 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) { - GtkWidget *child = gtk_bin_get_child(GTK_BIN(widget)); - if (GTK_IS_TREE_VIEW(child)) { - GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(child)); - int n_rows = gtk_tree_model_iter_n_children(model, NULL); - int row_height = treeViewGetRowHeight(GTK_TREE_VIEW(child)); - - *min = MAX(1, row_height); - *nat = MAX(*min, n_rows * row_height); - } else { - 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 = static_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,16,0) - // On recent releases of GTK+, it does not appear necessary to set the list box colours. - // This may be because of common themes and may be needed with other themes. - // The *override* calls are deprecated now, so only call them for older versions of GTK+. -#elif 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; - } - -#if GTK_CHECK_VERSION(3,0,0) - if (!cssProvider) { - cssProvider = gtk_css_provider_new(); - } -#endif - - 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); - -#if GTK_CHECK_VERSION(3,0,0) - GtkStyleContext *styleContext = gtk_widget_get_style_context(GTK_WIDGET(list)); - if (styleContext) { - gtk_style_context_add_provider(styleContext, GTK_STYLE_PROVIDER(cssProvider), - GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); - } -#endif - - 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); - - 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) - if (cssProvider) { - PangoFontDescription *pfd = PFont(scint_font)->pfd; - std::ostringstream ssFontSetting; - ssFontSetting << "GtkTreeView, treeview { "; - ssFontSetting << "font-family: " << pango_font_description_get_family(pfd) << "; "; - ssFontSetting << "font-size:"; - ssFontSetting << static_cast(pango_font_description_get_size(pfd)) / PANGO_SCALE; - // On GTK < 3.21.0 the units are incorrectly parsed, so a font size in points - // need to use the "px" unit. Normally we only get fonts in points here, so - // don't bother to handle the case the font is actually in pixels on < 3.21.0. - if (gtk_check_version(3, 21, 0) != NULL || // on < 3.21.0 - pango_font_description_get_size_is_absolute(pfd)) { - ssFontSetting << "px; "; - } else { - ssFontSetting << "pt; "; - } - ssFontSetting << "font-weight:"<< pango_font_description_get_weight(pfd) << "; "; - ssFontSetting << "}"; - gtk_css_provider_load_from_data(GTK_CSS_PROVIDER(cssProvider), - ssFontSetting.str().c_str(), -1, NULL); - } -#else - gtk_widget_modify_font(PWidget(list), PFont(scint_font)->pfd); -#endif - gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), -1); - gtk_cell_renderer_text_set_fixed_height_from_font(GTK_CELL_RENDERER_TEXT(renderer), 1); - } -} - -void ListBoxX::SetAverageCharWidth(int width) { - aveCharWidth = width; -} - -void ListBoxX::SetVisibleRows(int rows) { - desiredVisibleRows = rows; -} - -int ListBoxX::GetVisibleRows() const { - return desiredVisibleRows; -} - -int ListBoxX::GetRowHeight() { - return treeViewGetRowHeight(GTK_TREE_VIEW(list)); -} - -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)); - GtkStateFlags stateFlagsFrame = gtk_style_context_get_state(styleContextFrame); - GtkBorder padding, border, border_border = { 0, 0, 0, 0 }; - gtk_style_context_get_padding(styleContextFrame, stateFlagsFrame, &padding); - gtk_style_context_get_border(styleContextFrame, stateFlagsFrame, &border); - -# if GTK_CHECK_VERSION(3,20,0) - // on GTK 3.20 the frame border is in a sub-node "border". - // Unfortunately we need to be built against 3.20 to be able to support this, as it requires - // new API. - GtkStyleContext *styleContextFrameBorder = gtk_style_context_new(); - GtkWidgetPath *widget_path = gtk_widget_path_copy(gtk_style_context_get_path(styleContextFrame)); - gtk_widget_path_append_type(widget_path, GTK_TYPE_BORDER); // dummy type - gtk_widget_path_iter_set_object_name(widget_path, -1, "border"); - gtk_style_context_set_path(styleContextFrameBorder, widget_path); - gtk_widget_path_free(widget_path); - gtk_style_context_get_border(styleContextFrameBorder, stateFlagsFrame, &border_border); - g_object_unref(styleContextFrameBorder); -# else // < 3.20 - if (gtk_check_version(3, 20, 0) == NULL) { - // default to 1px all around as it's likely what it is, and so we don't miss 2px height - // on GTK 3.20 when built against an earlier version. - border_border.top = border_border.bottom = border_border.left = border_border.right = 1; - } -# endif - - height = (rows * row_height - + padding.top + padding.bottom - + border.top + border.bottom - + border_border.top + border_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 - + border_border.left + border_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)); -#else - GtkAdjustment *adj = - gtk_tree_view_get_vadjustment(GTK_TREE_VIEW(list)); -#endif - 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; - // 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; - 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; - - // 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(); - g_object_ref_sink(G_OBJECT(mid)); -} - -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 = GPOINTER_TO_INT(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 = static_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, - GINT_TO_POINTER((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() { -} - -void Platform_Finalise() { -} diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx deleted file mode 100644 index 06c3fe06..00000000 --- a/scintilla/gtk/ScintillaGTK.cxx +++ /dev/null @@ -1,3257 +0,0 @@ -// 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 -#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))) -#else -#define IS_WIDGET_REALIZED(w) (GTK_WIDGET_REALIZED(w)) -#define IS_WIDGET_MAPPED(w) (GTK_WIDGET_MAPPED(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) { - return gtk_widget_get_window(w); -} - -#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 = static_cast(w.GetID()); - return gtk_widget_get_window(widget); -} - -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; - - guint styleIdleID; - - // 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); - void SetCandidateWindowPos(); - - static void StyleSetText(GtkWidget *widget, GtkStyle *previous, void*); - static void RealizeText(GtkWidget *widget, void*); - static void Dispose(GObject *object); - 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(gpointer ptt); - static gboolean IdleCallback(gpointer pSci); - static gboolean StyleIdle(gpointer pSci); - virtual void IdleWork(); - 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 static_cast(w.GetID()); -} - -static ScintillaGTK *ScintillaFromWidget(GtkWidget *widget) { - ScintillaObject *scio = SCINTILLA(widget); - return static_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), - styleIdleID(0) { - 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() { - if (styleIdleID) { - g_source_remove(styleIdleID); - styleIdleID = 0; - } - 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; - gtk_widget_get_allocation(widget, &allocation); - 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 -#if !GTK_CHECK_VERSION(3,18,0) - gtk_style_context_set_background(gtk_widget_get_style_context(widget), - gtk_widget_get_window(widget)); -#endif - 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 && - gtk_widget_get_visible(GTK_WIDGET(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); - if (PWidget(scrollbarv)) - (*callback) (PWidget(scrollbarv), callback_data); - if (PWidget(scrollbarh)) - (*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 { - gtk_widget_set_allocation(widget, allocation); - 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())); - - gtk_widget_set_can_focus(PWidget(wMain), TRUE); - gtk_widget_set_sensitive(PWidget(wMain), TRUE); - 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 - gtk_widget_set_can_focus(PWidget(scrollbarv), FALSE); - 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 - gtk_widget_set_can_focus(PWidget(scrollbarh), FALSE); - 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) { - gsize 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); - gsize inLeft = len; - char *putf = &destForm[0]; - char *pout = putf; - gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions == sizeFailure) { - 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 = gdk_threads_add_timeout(millis, 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( - gdk_threads_add_idle_full(G_PRIORITY_DEFAULT_IDLE, 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 = 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; - if (rc.bottom < 0) - rc.bottom = 0; - if (rc.right < 0) - rc.right = 0; - 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_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); -#if !GTK_CHECK_VERSION(3,18,0) - gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmentv)); -#endif - modified = true; - } - - 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_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); -#if !GTK_CHECK_VERSION(3,18,0) - gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth)); -#endif - modified = true; - } - 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", GINT_TO_POINTER(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(); - } -} - -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); } - -// 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); - - // GTK+ 3 warns when we allocate smaller than the minimum allocation, - // so we use these variables to store the minimum scrollbar lengths. - int minVScrollBarHeight, minHScrollBarWidth; - - // Not always needed, but some themes can have different sizes of scrollbars -#if GTK_CHECK_VERSION(3,0,0) - GtkRequisition minimum, requisition; - gtk_widget_get_preferred_size(PWidget(scrollbarv), &minimum, &requisition); - minVScrollBarHeight = minimum.height; - verticalScrollBarWidth = requisition.width; - gtk_widget_get_preferred_size(PWidget(scrollbarh), &minimum, &requisition); - minHScrollBarWidth = minimum.width; - horizontalScrollBarHeight = requisition.height; -#else - minVScrollBarHeight = minHScrollBarWidth = 1; - 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(minHScrollBarWidth, 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(minVScrollBarHeight, 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 = 1; - alloc.height = 1; -#if GTK_CHECK_VERSION(3, 0, 0) - // please GTK 3.20 and ask wText what size it wants, although we know it doesn't really need - // anything special as it's ours. - gtk_widget_get_preferred_size(PWidget(wText), &requisition, NULL); - alloc.width = requisition.width; - alloc.height = requisition.height; -#endif - alloc.width = Platform::Maximum(alloc.width, width - verticalScrollBarWidth); - alloc.height = Platform::Maximum(alloc.height, height - horizontalScrollBarHeight); - gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc); -} - -static void SetAdjustmentValue(GtkAdjustment *object, int value) { - GtkAdjustment *adjustment = GTK_ADJUSTMENT(object); - int maxValue = static_cast( - gtk_adjustment_get_upper(adjustment) - gtk_adjustment_get_page_size(adjustment)); - - 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; - bool super = (event->state & GDK_MOD4_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 meta = false; -#else - bool meta = ctrl; - ctrl = (event->state & GDK_META_MASK) != 0; -#endif - bool added = KeyDownWithModifiers(key, ModifierFlags(shift, ctrl, alt, meta, super), &consumed) != 0; - 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); - } -} - -static std::vector MapImeIndicators(PangoAttrList *attrs, const char *u8Str) { - // Map input style to scintilla ime indicator. - // Attrs position points between UTF-8 bytes. - // Indicator index to be returned is character based though. - glong charactersLen = g_utf8_strlen(u8Str, strlen(u8Str)); - std::vector indicator(charactersLen, SC_INDICATOR_UNKNOWN); - - 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 = g_utf8_strlen(u8Str, attrunderline->start_index); - glong end = g_utf8_strlen(u8Str, attrunderline->end_index); - PangoUnderline uline = (PangoUnderline)((PangoAttrInt *)attrunderline)->value; - for (glong i=start; i < end; ++i) { - switch (uline) { - case PANGO_UNDERLINE_NONE: - indicator[i] = SC_INDICATOR_UNKNOWN; - break; - case PANGO_UNDERLINE_SINGLE: // normal input - indicator[i] = SC_INDICATOR_INPUT; - 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); - } - - 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 = g_utf8_strlen(u8Str, backcolor->start_index); - glong end = g_utf8_strlen(u8Str, backcolor->end_index); - for (glong i=start; i < end; ++i) { - indicator[i] = SC_INDICATOR_TARGET; // target converted - } - } - } while (pango_attr_iterator_next(itercolor)); - pango_attr_iterator_destroy(itercolor); - } - return indicator; -} - -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++) { - gchar u8Char[UTF8MaxBytes+2] = {0}; - gint u8CharLen = g_unichar_to_utf8(uniStr[i], u8Char); - std::string docChar = u8Char; - if (!IsUnicodeMode()) - docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true); - - AddCharUTF(docChar.c_str(), docChar.size()); - } - 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 { - if (pdoc->IsReadOnly() || SelectionContainsProtected()) { - gtk_im_context_reset(im_context); - return; - } - - 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. - ClearBeforeTentativeStart(); - } - - 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 - - std::vector indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str); - - bool tmpRecordingMacro = recordingMacro; - recordingMacro = false; - for (glong i = 0; i < preeditStr.uniStrLen; i++) { - gchar u8Char[UTF8MaxBytes+2] = {0}; - gint u8CharLen = g_unichar_to_utf8(preeditStr.uniStr[i], u8Char); - std::string docChar = u8Char; - if (!IsUnicodeMode()) - docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true); - - AddCharUTF(docChar.c_str(), docChar.size()); - - DrawImeIndicator(indicator[i], docChar.size()); - } - recordingMacro = tmpRecordingMacro; - - // Move caret to ime cursor position. - int imeEndToImeCaretU32 = preeditStr.cursor_pos - preeditStr.uniStrLen; - int imeCaretPosDoc = pdoc->GetRelativePosition(CurrentPosition(), imeEndToImeCaretU32); - - MoveImeCarets(- CurrentPosition() + imeCaretPosDoc); - - if (KoreanIME()) { -#if !PLAT_GTK_WIN32 - if (preeditStr.cursor_pos > 0) { - int oneCharBefore = pdoc->GetRelativePosition(CurrentPosition(), -1); - MoveImeCarets(- CurrentPosition() + oneCharBefore); - } -#endif - view.imeCaretBlockOverride = true; - } - - 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::Dispose(GObject *object) { - try { - ScintillaObject *scio = reinterpret_cast(object); - ScintillaGTK *sciThis = reinterpret_cast(scio->pscin); - - if (PWidget(sciThis->scrollbarv)) { - gtk_widget_unparent(PWidget(sciThis->scrollbarv)); - sciThis->scrollbarv = NULL; - } - - if (PWidget(sciThis->scrollbarh)) { - gtk_widget_unparent(PWidget(sciThis->scrollbarh)); - sciThis->scrollbarh = NULL; - } - - scintilla_class_parent_class->dispose(object); - } catch (...) { - // Its dying so nowhere to save the status - } -} - -void ScintillaGTK::Destroy(GObject *object) { - try { - ScintillaObject *scio = SCINTILLA(object); - - // This avoids a double destruction - if (!scio->pscin) - return; - ScintillaGTK *sciThis = static_cast(scio->pscin); - //Platform::DebugPrintf("Destroying %x %x\n", sciThis, object); - sciThis->Finalise(); - - 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 { - sciThis->ScrollTo(static_cast(gtk_adjustment_get_value(adj)), false); - } catch (...) { - sciThis->errorStatus = SC_STATUS_FAILURE; - } -} - -void ScintillaGTK::ScrollHSignal(GtkAdjustment *adj, ScintillaGTK *sciThis) { - try { - sciThis->HorizontalScrollTo(static_cast(gtk_adjustment_get_value(adj))); - } 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(2,22,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(2,22,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(gpointer ptt) { - TimeThunk *tt = static_cast(ptt); - tt->scintilla->TickFor(tt->reason); - return 1; -} - -gboolean ScintillaGTK::IdleCallback(gpointer pSci) { - ScintillaGTK *sciThis = static_cast(pSci); - // Idler will be automatically stopped, if there is nothing - // to do while idle. - 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); - } - return ret; -} - -gboolean ScintillaGTK::StyleIdle(gpointer pSci) { - ScintillaGTK *sciThis = static_cast(pSci); - sciThis->IdleWork(); - // Idler will be automatically stopped - return FALSE; -} - -void ScintillaGTK::IdleWork() { - Editor::IdleWork(); - styleIdleID = 0; -} - -void ScintillaGTK::QueueIdleWork(WorkNeeded::workItems items, int upTo) { - Editor::QueueIdleWork(items, upTo); - if (!styleIdleID) { - // Only allow one style needed to be queued - styleIdleID = gdk_threads_add_idle_full(G_PRIORITY_HIGH_IDLE, StyleIdle, this, NULL); - } -} - -void ScintillaGTK::PopUpCB(GtkMenuItem *menuItem, ScintillaGTK *sciThis) { - guint action = GPOINTER_TO_UINT(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); -} - -/* legacy name for scintilla_object_send_message */ -sptr_t scintilla_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { - ScintillaGTK *psci = static_cast(sci->pscin); - return psci->WndProc(iMessage, wParam, lParam); -} - -gintptr scintilla_object_send_message(ScintillaObject *sci, unsigned int iMessage, uptr_t wParam, sptr_t lParam) { - return scintilla_send_message(sci, iMessage, wParam, lParam); -} - -static void scintilla_class_init(ScintillaClass *klass); -static void scintilla_init(ScintillaObject *sci); - -extern void Platform_Initialise(); -extern void Platform_Finalise(); - -/* legacy name for scintilla_object_get_type */ -GType scintilla_get_type() { - static GType scintilla_type = 0; - try { - - if (!scintilla_type) { - scintilla_type = g_type_from_name("ScintillaObject"); - if (!scintilla_type) { - static GTypeInfo scintilla_info = { - (guint16) sizeof (ScintillaObjectClass), - 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, "ScintillaObject", &scintilla_info, (GTypeFlags) 0); - } - } - - } catch (...) { - } - return scintilla_type; -} - -GType scintilla_object_get_type() { - return scintilla_get_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->dispose = Dispose; - 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; -} - -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) - scintilla_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, - 2, G_TYPE_INT, GTK_TYPE_WIDGET); - - scintilla_signals[NOTIFY_SIGNAL] = g_signal_new( - SCINTILLA_NOTIFY, - G_TYPE_FROM_CLASS(object_class), - sigflags, - G_STRUCT_OFFSET(ScintillaClass, notify), - NULL, //(GSignalAccumulator) - NULL, //(gpointer) - scintilla_marshal_VOID__INT_BOXED, - G_TYPE_NONE, - 2, G_TYPE_INT, SCINTILLA_TYPE_NOTIFICATION); - - 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 { - gtk_widget_set_can_focus(GTK_WIDGET(sci), TRUE); - sci->pscin = new ScintillaGTK(sci); - } catch (...) { - } -} - -/* legacy name for scintilla_object_new */ -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; -} - -GtkWidget *scintilla_object_new() { - return scintilla_new(); -} - -void scintilla_set_id(ScintillaObject *sci, uptr_t id) { - ScintillaGTK *psci = static_cast(sci->pscin); - psci->ctrlID = id; -} - -void scintilla_release_resources(void) { - try { - Platform_Finalise(); - } catch (...) { - } -} - -/* Define a dummy boxed type because g-ir-scanner is unable to - * recognize gpointer-derived types. Note that SCNotificaiton - * is always allocated on stack so copying is not appropriate. */ -static void *copy_(void *src) { return src; } -static void free_(void *doc) { } - -GType scnotification_get_type(void) { - static gsize type_id = 0; - if (g_once_init_enter(&type_id)) { - gsize id = (gsize) g_boxed_type_register_static( - g_intern_static_string("SCNotification"), - (GBoxedCopyFunc) copy_, - (GBoxedFreeFunc) free_); - g_once_init_leave(&type_id, id); - } - return (GType) type_id; -} diff --git a/scintilla/gtk/deps.mak b/scintilla/gtk/deps.mak deleted file mode 100644 index e408df96..00000000 --- a/scintilla/gtk/deps.mak +++ /dev/null @@ -1,683 +0,0 @@ -PlatGTK.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 -LexJSON.o: ../lexers/LexJSON.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 -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 diff --git a/scintilla/gtk/makefile b/scintilla/gtk/makefile deleted file mode 100644 index 024caafe..00000000 --- a/scintilla/gtk/makefile +++ /dev/null @@ -1,124 +0,0 @@ -# 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. - -srcdir ?= . - -.SUFFIXES: .cxx .c .o .h .a .list -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 -ARFLAGS = rc -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 - -# Enable Position Independent Code except on Windows where it is the default so the flag produces a warning -ifndef windir -PICFLAGS = -fPIC -endif - -ifdef windir -CC = gcc -DEL = del /q -COMPLIB=$(srcdir)\..\bin\scintilla.a -else -DEL = rm -f -COMPLIB=$(srcdir)/../bin/scintilla.a -endif - -vpath %.h $(srcdir) $(srcdir)/../src $(srcdir)/../include $(srcdir)/../lexlib -vpath %.c $(srcdir) -vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers - -INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib -ifdef CHECK_DEPRECATED -DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT -endif -CXXBASEFLAGS=-Wall -pedantic $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED) - -ifdef NOTHREADS -THREADFLAGS=-DG_THREADS_IMPL_NONE -else -THREADFLAGS= -endif - -ifdef NO_CXX11_REGEX -REFLAGS=-DNO_CXX11_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 - -CXXTFLAGS:=--std=gnu++0x $(CTFLAGS) $(REFLAGS) - -CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION)) -MARSHALLER=scintilla-marshal.o - -.cxx.o: - $(CXX) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $< -.c.o: - $(CC) $(CONFIGFLAGS) $(CTFLAGS) $(CFLAGS) -w -c $< - -GLIB_GENMARSHAL = glib-genmarshal -GLIB_GENMARSHAL_FLAGS = --prefix=scintilla_marshal - -.list.h: - $(GLIB_GENMARSHAL) --header $(GLIB_GENMARSHAL_FLAGS) $< > $@ -.list.c: - $(GLIB_GENMARSHAL) --body $(GLIB_GENMARSHAL_FLAGS) $< > $@ - -LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard $(srcdir)/../lexers/Lex*.cxx)))) - -all: $(COMPLIB) - -clean: - $(DEL) *.o $(COMPLIB) *.plist - -analyze: - clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) $(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(srcdir)/../lexers/*.cxx - -deps: deps.mak -deps.mak: - $(CXX) -MM $(CONFIGFLAGS) $(CXXTFLAGS) $(srcdir)/*.cxx $(srcdir)/../src/*.cxx $(srcdir)/../lexlib/*.cxx $(srcdir)/../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] > $@ - -$(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) $(ARFLAGS) $@ $^ - $(RANLIB) $@ - -# Automatically generate header dependencies with "make deps" -include deps.mak diff --git a/scintilla/gtk/scintilla-marshal.c b/scintilla/gtk/scintilla-marshal.c deleted file mode 100644 index ba54ffc3..00000000 --- a/scintilla/gtk/scintilla-marshal.c +++ /dev/null @@ -1,125 +0,0 @@ - -#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_schar (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) -#define g_marshal_value_peek_variant(v) g_value_get_variant (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_long -#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong -#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 -#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer -#endif /* !G_ENABLE_DEBUG */ - - -/* NONE:INT,OBJECT (scintilla-marshal.list:1) */ -void -scintilla_marshal_VOID__INT_OBJECT (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__INT_OBJECT) (gpointer data1, - gint arg_1, - gpointer arg_2, - gpointer data2); - GMarshalFunc_VOID__INT_OBJECT callback; - GCClosure *cc = (GCClosure*) closure; - 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_OBJECT) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_int (param_values + 1), - g_marshal_value_peek_object (param_values + 2), - data2); -} - -/* NONE:INT,BOXED (scintilla-marshal.list:2) */ -void -scintilla_marshal_VOID__INT_BOXED (GClosure *closure, - GValue *return_value G_GNUC_UNUSED, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint G_GNUC_UNUSED, - gpointer marshal_data) -{ - typedef void (*GMarshalFunc_VOID__INT_BOXED) (gpointer data1, - gint arg_1, - gpointer arg_2, - gpointer data2); - GMarshalFunc_VOID__INT_BOXED callback; - GCClosure *cc = (GCClosure*) closure; - 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_BOXED) (marshal_data ? marshal_data : cc->callback); - - callback (data1, - g_marshal_value_peek_int (param_values + 1), - g_marshal_value_peek_boxed (param_values + 2), - data2); -} - diff --git a/scintilla/gtk/scintilla-marshal.h b/scintilla/gtk/scintilla-marshal.h deleted file mode 100644 index 5af74d4e..00000000 --- a/scintilla/gtk/scintilla-marshal.h +++ /dev/null @@ -1,30 +0,0 @@ - -#ifndef __scintilla_marshal_MARSHAL_H__ -#define __scintilla_marshal_MARSHAL_H__ - -#include - -G_BEGIN_DECLS - -/* NONE:INT,OBJECT (scintilla-marshal.list:1) */ -extern void scintilla_marshal_VOID__INT_OBJECT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -#define scintilla_marshal_NONE__INT_OBJECT scintilla_marshal_VOID__INT_OBJECT - -/* NONE:INT,BOXED (scintilla-marshal.list:2) */ -extern void scintilla_marshal_VOID__INT_BOXED (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); -#define scintilla_marshal_NONE__INT_BOXED scintilla_marshal_VOID__INT_BOXED - -G_END_DECLS - -#endif /* __scintilla_marshal_MARSHAL_H__ */ - diff --git a/scintilla/gtk/scintilla-marshal.list b/scintilla/gtk/scintilla-marshal.list deleted file mode 100644 index ddc8ae87..00000000 --- a/scintilla/gtk/scintilla-marshal.list +++ /dev/null @@ -1,2 +0,0 @@ -NONE:INT,OBJECT -NONE:INT,BOXED diff --git a/scintilla/include/ILexer.h b/scintilla/include/ILexer.h deleted file mode 100644 index 4d131cda..00000000 --- a/scintilla/include/ILexer.h +++ /dev/null @@ -1,100 +0,0 @@ -// 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 diff --git a/scintilla/include/Platform.h b/scintilla/include/Platform.h deleted file mode 100644 index 28d34f45..00000000 --- a/scintilla/include/Platform.h +++ /dev/null @@ -1,533 +0,0 @@ -// 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 diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h deleted file mode 100644 index 354d4da4..00000000 --- a/scintilla/include/SciLexer.h +++ /dev/null @@ -1,1802 +0,0 @@ -/* 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_JSON 120 -#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_ERR_ESCSEQ 23 -#define SCE_ERR_ESCSEQ_UNKNOWN 24 -#define SCE_ERR_ES_BLACK 40 -#define SCE_ERR_ES_RED 41 -#define SCE_ERR_ES_GREEN 42 -#define SCE_ERR_ES_BROWN 43 -#define SCE_ERR_ES_BLUE 44 -#define SCE_ERR_ES_MAGENTA 45 -#define SCE_ERR_ES_CYAN 46 -#define SCE_ERR_ES_GRAY 47 -#define SCE_ERR_ES_DARK_GRAY 48 -#define SCE_ERR_ES_BRIGHT_RED 49 -#define SCE_ERR_ES_BRIGHT_GREEN 50 -#define SCE_ERR_ES_YELLOW 51 -#define SCE_ERR_ES_BRIGHT_BLUE 52 -#define SCE_ERR_ES_BRIGHT_MAGENTA 53 -#define SCE_ERR_ES_BRIGHT_CYAN 54 -#define SCE_ERR_ES_WHITE 55 -#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_BAAN_WORD3 11 -#define SCE_BAAN_WORD4 12 -#define SCE_BAAN_WORD5 13 -#define SCE_BAAN_WORD6 14 -#define SCE_BAAN_WORD7 15 -#define SCE_BAAN_WORD8 16 -#define SCE_BAAN_WORD9 17 -#define SCE_BAAN_TABLEDEF 18 -#define SCE_BAAN_TABLESQL 19 -#define SCE_BAAN_FUNCTION 20 -#define SCE_BAAN_DOMDEF 21 -#define SCE_BAAN_FUNCDEF 22 -#define SCE_BAAN_OBJECTDEF 23 -#define SCE_BAAN_DEFINEDEF 24 -#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_ABL_DEFAULT 0 -#define SCE_ABL_NUMBER 1 -#define SCE_ABL_WORD 2 -#define SCE_ABL_STRING 3 -#define SCE_ABL_CHARACTER 4 -#define SCE_ABL_PREPROCESSOR 5 -#define SCE_ABL_OPERATOR 6 -#define SCE_ABL_IDENTIFIER 7 -#define SCE_ABL_BLOCK 8 -#define SCE_ABL_END 9 -#define SCE_ABL_COMMENT 10 -#define SCE_ABL_TASKMARKER 11 -#define SCE_ABL_LINECOMMENT 12 -#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_COFFEESCRIPT_INSTANCEPROPERTY 25 -#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 -#define SCE_JSON_DEFAULT 0 -#define SCE_JSON_NUMBER 1 -#define SCE_JSON_STRING 2 -#define SCE_JSON_STRINGEOL 3 -#define SCE_JSON_PROPERTYNAME 4 -#define SCE_JSON_ESCAPESEQUENCE 5 -#define SCE_JSON_LINECOMMENT 6 -#define SCE_JSON_BLOCKCOMMENT 7 -#define SCE_JSON_OPERATOR 8 -#define SCE_JSON_URI 9 -#define SCE_JSON_COMPACTIRI 10 -#define SCE_JSON_KEYWORD 11 -#define SCE_JSON_LDKEYWORD 12 -#define SCE_JSON_ERROR 13 -/* --Autogenerated -- end of section automatically generated from Scintilla.iface */ - -#endif diff --git a/scintilla/include/Sci_Position.h b/scintilla/include/Sci_Position.h deleted file mode 100644 index 504d601c..00000000 --- a/scintilla/include/Sci_Position.h +++ /dev/null @@ -1,21 +0,0 @@ -// 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 diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h deleted file mode 100644 index c0c05068..00000000 --- a/scintilla/include/Scintilla.h +++ /dev/null @@ -1,1206 +0,0 @@ -/* 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 SCWS_VISIBLEONLYININDENT 3 -#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 SC_MARGIN_COLOUR 6 -#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 SCI_SETMARGINBACKN 2250 -#define SCI_GETMARGINBACKN 2251 -#define SCI_SETMARGINS 2252 -#define SCI_GETMARGINS 2253 -#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_OEM866 866 -#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_IDLESTYLING_NONE 0 -#define SC_IDLESTYLING_TOVISIBLE 1 -#define SC_IDLESTYLING_AFTERVISIBLE 2 -#define SC_IDLESTYLING_ALL 3 -#define SCI_SETIDLESTYLING 2692 -#define SCI_GETIDLESTYLING 2693 -#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 EDGE_MULTILINE 3 -#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_MULTIEDGEADDLINE 2694 -#define SCI_MULTIEDGECLEARALL 2695 -#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 SCI_SETMOUSEWHEELCAPTURES 2696 -#define SCI_GETMOUSEWHEELCAPTURES 2697 -#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 SCVS_NOWRAPLINESTART 4 -#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 - -#ifndef __cplusplus -/* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This - * is not required in C++ code and actually seems to break ScintillaEditPy */ -typedef struct Sci_NotifyHeader Sci_NotifyHeader; -typedef struct SCNotification SCNotification; -#endif - -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 { - 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 diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface deleted file mode 100644 index 92cd8d04..00000000 --- a/scintilla/include/Scintilla.iface +++ /dev/null @@ -1,4812 +0,0 @@ -## 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 start, int lengthDelete) - -# 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 markerHandle,) - -# Delete a marker. -fun void MarkerDeleteHandle=2018(int markerHandle,) - -# Is undo history being collected? -get bool GetUndoCollection=2019(,) - -enu WhiteSpace=SCWS_ -val SCWS_INVISIBLE=0 -val SCWS_VISIBLEALWAYS=1 -val SCWS_VISIBLEAFTERINDENT=2 -val SCWS_VISIBLEONLYININDENT=3 - -# 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 caret,) - -# Set the selection anchor to a position. The anchor is the opposite -# end of the selection from the caret. -set void SetAnchor=2026(position anchor,) - -# 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 start. -# The unused parameter is no longer used and should be set to 0. -fun void StartStyling=2032(position start, int unused) - -# 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 window 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 markerSet) - -# 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 -val SC_MARGIN_COLOUR=6 - -# 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,) - -# Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. -set void SetMarginBackN=2250(int margin, colour back) - -# Retrieve the background colour of a margin -get colour GetMarginBackN=2251(int margin,) - -# Allocate a non-standard number of margins. -set void SetMargins=2252(int margins,) - -# How many margins are there?. -get int GetMargins=2253(,) - -# 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_OEM866=866 -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 eolFilled) - -# 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 caseVisible) - -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 sizeHundredthPoints) - -# 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 keyDefinition is pressed perform sciCommand. -fun void AssignCmdKey=2070(keymod keyDefinition, int sciCommand) - -# When key+modifier combination keyDefinition is pressed do nothing. -fun void ClearCmdKey=2071(keymod keyDefinition,) - -# 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 indicator, int indicatorStyle) - -# Retrieve the style of an indicator. -get int IndicGetStyle=2081(int indicator,) - -# Set the foreground colour of an indicator. -set void IndicSetFore=2082(int indicator, colour fore) - -# Retrieve the foreground colour of an indicator. -get colour IndicGetFore=2083(int indicator,) - -# Set an indicator to draw under text or over(default). -set void IndicSetUnder=2510(int indicator, bool under) - -# Retrieve whether indicator drawn under or over text. -get bool IndicGetUnder=2511(int indicator,) - -# Set a hover indicator to plain, squiggle or TT. -set void IndicSetHoverStyle=2680(int indicator, int indicatorStyle) - -# Retrieve the hover style of an indicator. -get int IndicGetHoverStyle=2681(int indicator,) - -# Set the foreground hover colour of an indicator. -set void IndicSetHoverFore=2682(int indicator, colour fore) - -# Retrieve the foreground hover colour of an indicator. -get colour IndicGetHoverFore=2683(int indicator,) - -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 indicator, int flags) - -# Retrieve the attributes of an indicator. -get int IndicGetFlags=2685(int indicator,) - -# 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 lengthEntered parameter indicates how many characters before -# the caret should be used to provide context. -fun void AutoCShow=2100(int lengthEntered, 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 select) - -# 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 indentation) - -# 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(position start, position end) - -# Show or hide the horizontal scroll bar. -set void SetHScrollBar=2130(bool visible,) -# 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 caret,) - -# Sets the position that starts the selection - this becomes the anchor. -set void SetSelectionStart=2142(position anchor,) - -# Returns the position at the start of the selection. -get position GetSelectionStart=2143(,) - -# Sets the position that ends the selection - this becomes the caret. -set void SetSelectionEnd=2144(position caret,) - -# 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 caret,) - -# 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 searchFlags, 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 anchor, position caret) - -# 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 hide,) - -# 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 start,) - -# 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 end,) - -# 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 text) - -# 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 searchFlags,) - -# 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 highlightStart, int highlightEnd) - -# 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 docLine,) - -# Find the document line of a display line taking hidden lines into account. -fun int DocLineFromVisible=2221(int displayLine,) - -# The number of display lines needed to wrap a document line -fun int WrapCount=2235(int docLine,) - -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 IdleStyling=SC_IDLESTYLING_ -val SC_IDLESTYLING_NONE=0 -val SC_IDLESTYLING_TOVISIBLE=1 -val SC_IDLESTYLING_AFTERVISIBLE=2 -val SC_IDLESTYLING_ALL=3 - -# Sets limits to idle styling. -set void SetIdleStyling=2692(int idleStyling,) - -# Retrieve the limits to idle styling. -get int GetIdleStyling=2693(,) - -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 wrapMode,) - -# 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 wrapIndentMode,) - -# 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 cacheMode,) - -# 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 visible,) - -# 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 PhasesDraw=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 displayLine,) - -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 one of the colours used as a chequerboard pattern in the fold margin -fun void SetFoldMarginColour=2290(bool useSetting, colour back) -# Set the other colour used as a chequerboard pattern in the fold margin -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(,) - -# Like Home but when word-wrap is enabled goes first to start of display line -# HomeDisplay, then to start of document line Home. -fun void HomeWrap=2349(,) - -# Like HomeExtend but when word-wrap is enabled extends first to start of display line -# HomeDisplayExtend, then to start of document line HomeExtend. -fun void HomeWrapExtend=2450(,) - -# Like LineEnd but when word-wrap is enabled goes first to end of display line -# LineEndDisplay, then to start of document line LineEnd. -fun void LineEndWrap=2451(,) - -# Like LineEndExtend but when word-wrap is enabled extends first to end of display line -# LineEndDisplayExtend, then to start of document line LineEndExtend. -fun void LineEndWrapExtend=2452(,) - -# Like VCHome but when word-wrap is enabled goes first to start of display line -# VCHomeDisplay, then behaves like VCHome. -fun void VCHomeWrap=2453(,) - -# Like VCHomeExtend but when word-wrap is enabled extends first to start of display line -# VCHomeDisplayExtend, then behaves like VCHomeExtend. -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 posA, position posB) - -# Use specified indicator to highlight matching braces instead of changing their style. -fun void BraceHighlightIndicator=2498(bool useSetting, 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 useSetting, int indicator) - -# Find the position of a matching brace or INVALID_POSITION if no match. -# The maxReStyle must be 0 for now. It may be defined in a future release. -fun position BraceMatch=2353(position pos, int maxReStyle) - -# 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 doc) - -# Set which document modification events are sent to the container. -set void SetModEventMask=2359(int eventMask,) - -enu EdgeVisualStyle=EDGE_ -val EDGE_NONE=0 -val EDGE_LINE=1 -val EDGE_BACKGROUND=2 -val EDGE_MULTILINE=3 - -# 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/EDGE_MULTILINE) or by highlighting text that -# goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). -set void SetEdgeMode=2363(int edgeMode,) - -# Retrieve the colour used in edge indication. -get colour GetEdgeColour=2364(,) - -# Change the colour used in edge indication. -set void SetEdgeColour=2365(colour edgeColour,) - -# Add a new vertical edge to the view. -fun void MultiEdgeAddLine=2694(int column, colour edgeColour) - -# Clear all vertical edges. -fun void MultiEdgeClearAll=2695(,) - -# 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 searchFlags, 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 searchFlags, 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 zoomInPoints,) -# 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 status,) -# 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(,) - -# Set whether the mouse wheel can be active outside the window. -set void SetMouseWheelCaptures=2696(bool captures,) -# Get whether mouse wheel can be active outside the window. -get bool GetMouseWheelCaptures=2697(,) - -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 xOffset,) -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 wrapMode,) - -# 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 down one paragraph (delimited by empty lines). -fun void ParaDown=2413(,) -# Extend selection down one paragraph (delimited by empty lines). -fun void ParaDownExtend=2414(,) -# Move caret up one paragraph (delimited by empty lines). -fun void ParaUp=2415(,) -# Extend selection up one paragraph (delimited by empty lines). -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 selectionMode,) - -# 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 text) - -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(position start, int lengthFill) - -# Turn a indicator off over a range. -fun void IndicatorClearRange=2505(position start, int lengthClear) - -# Are any indicators present at pos? -fun int IndicatorAllOnFor=2506(position pos,) - -# What value does a particular indicator have at a position? -fun int IndicatorValueAt=2507(int indicator, position pos) - -# Where does a particular indicator start? -fun int IndicatorStart=2508(int indicator, position pos) - -# Where does a particular indicator end? -fun int IndicatorEnd=2509(int indicator, position pos) - -# 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 lengthRange bytes. -get int GetRangePointer=2643(position start, int lengthRange) - -# 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 additionalCaretsVisible,) - -# 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(position caret, position anchor) - -# Add a selection -fun int AddSelection=2573(position caret, position 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 the caret position of the nth selection. -set void SetSelectionNCaret=2576(int selection, position caret) -# Return the caret position of the nth selection. -get position GetSelectionNCaret=2577(int selection,) -# Set the anchor position of the nth selection. -set void SetSelectionNAnchor=2578(int selection, position anchor) -# Return the anchor position of the nth selection. -get position GetSelectionNAnchor=2579(int selection,) -# Set the virtual space of the caret of the nth selection. -set void SetSelectionNCaretVirtualSpace=2580(int selection, int space) -# Return the virtual space of the caret of the nth selection. -get int GetSelectionNCaretVirtualSpace=2581(int selection,) -# Set the virtual space of the anchor of the nth selection. -set void SetSelectionNAnchorVirtualSpace=2582(int selection, int space) -# Return the virtual space of the anchor of the nth selection. -get int GetSelectionNAnchorVirtualSpace=2583(int selection,) - -# Sets the position that starts the selection - this becomes the anchor. -set void SetSelectionNStart=2584(int selection, position anchor) - -# 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 caret) - -# Returns the position at the end of the selection. -get position GetSelectionNEnd=2587(int selection,) - -# Set the caret position of the rectangular selection. -set void SetRectangularSelectionCaret=2588(position caret,) -# Return the caret position of the rectangular selection. -get position GetRectangularSelectionCaret=2589(,) -# Set the anchor position of the rectangular selection. -set void SetRectangularSelectionAnchor=2590(position anchor,) -# Return the anchor position of the rectangular selection. -get position GetRectangularSelectionAnchor=2591(,) -# Set the virtual space of the caret of the rectangular selection. -set void SetRectangularSelectionCaretVirtualSpace=2592(int space,) -# Return the virtual space of the caret of the rectangular selection. -get int GetRectangularSelectionCaretVirtualSpace=2593(,) -# Set the virtual space of the anchor of the rectangular selection. -set void SetRectangularSelectionAnchorVirtualSpace=2594(int space,) -# Return the virtual space of the anchor of the rectangular selection. -get int GetRectangularSelectionAnchorVirtualSpace=2595(,) - -enu VirtualSpace=SCVS_ -val SCVS_NONE=0 -val SCVS_RECTANGULARSELECTION=1 -val SCVS_USERACCESSIBLE=2 -val SCVS_NOWRAPLINESTART=4 - -# Set options for virtual space behaviour. -set void SetVirtualSpaceOptions=2596(int virtualSpaceOptions,) -# Return options for virtual space behaviour. -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 value) - -# 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 value) - -# Retrieve a "property" value previously set with SetProperty, -# interpreted as an int AFTER any "$()" variable replacement. -get int GetPropertyInt=4010(string key, int defaultValue) - -# 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 language) - -# 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 -val SCLEX_JSON=120 - -# 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, SCLEX_BULLANT, SCLEX_COBOL, SCLEX_TACL, SCLEX_TAL -lex Cpp=SCLEX_CPP SCE_C_ -lex BullAnt=SCLEX_BULLANT SCE_C_ -lex COBOL=SCLEX_COBOL SCE_C_ -lex TACL=SCLEX_TACL SCE_C_ -lex TAL=SCLEX_TAL 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, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC -lex VB=SCLEX_VB SCE_B_ -lex VBScript=SCLEX_VBSCRIPT SCE_B_ -lex PowerBasic=SCLEX_POWERBASIC SCE_B_ -lex BlitzBasic=SCLEX_BLITZBASIC SCE_B_ -lex PureBasic=SCLEX_PUREBASIC SCE_B_ -lex FreeBasic=SCLEX_FREEBASIC 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 -val SCE_ERR_ESCSEQ=23 -val SCE_ERR_ESCSEQ_UNKNOWN=24 -val SCE_ERR_ES_BLACK=40 -val SCE_ERR_ES_RED=41 -val SCE_ERR_ES_GREEN=42 -val SCE_ERR_ES_BROWN=43 -val SCE_ERR_ES_BLUE=44 -val SCE_ERR_ES_MAGENTA=45 -val SCE_ERR_ES_CYAN=46 -val SCE_ERR_ES_GRAY=47 -val SCE_ERR_ES_DARK_GRAY=48 -val SCE_ERR_ES_BRIGHT_RED=49 -val SCE_ERR_ES_BRIGHT_GREEN=50 -val SCE_ERR_ES_YELLOW=51 -val SCE_ERR_ES_BRIGHT_BLUE=52 -val SCE_ERR_ES_BRIGHT_MAGENTA=53 -val SCE_ERR_ES_BRIGHT_CYAN=54 -val SCE_ERR_ES_WHITE=55 -# 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 -val SCE_BAAN_WORD3=11 -val SCE_BAAN_WORD4=12 -val SCE_BAAN_WORD5=13 -val SCE_BAAN_WORD6=14 -val SCE_BAAN_WORD7=15 -val SCE_BAAN_WORD8=16 -val SCE_BAAN_WORD9=17 -val SCE_BAAN_TABLEDEF=18 -val SCE_BAAN_TABLESQL=19 -val SCE_BAAN_FUNCTION=20 -val SCE_BAAN_DOMDEF=21 -val SCE_BAAN_FUNCDEF=22 -val SCE_BAAN_OBJECTDEF=23 -val SCE_BAAN_DEFINEDEF=24 -# 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_ABL_ -val SCE_ABL_DEFAULT=0 -val SCE_ABL_NUMBER=1 -val SCE_ABL_WORD=2 -val SCE_ABL_STRING=3 -val SCE_ABL_CHARACTER=4 -val SCE_ABL_PREPROCESSOR=5 -val SCE_ABL_OPERATOR=6 -val SCE_ABL_IDENTIFIER=7 -val SCE_ABL_BLOCK=8 -val SCE_ABL_END=9 -val SCE_ABL_COMMENT=10 -val SCE_ABL_TASKMARKER=11 -val SCE_ABL_LINECOMMENT=12 -# 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 -val SCE_COFFEESCRIPT_INSTANCEPROPERTY=25 -# 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_ -# Lexical states for SCLEX_JSON -lex JSON=SCLEX_JSON SCE_JSON_ -val SCE_JSON_DEFAULT=0 -val SCE_JSON_NUMBER=1 -val SCE_JSON_STRING=2 -val SCE_JSON_STRINGEOL=3 -val SCE_JSON_PROPERTYNAME=4 -val SCE_JSON_ESCAPESEQUENCE=5 -val SCE_JSON_LINECOMMENT=6 -val SCE_JSON_BLOCKCOMMENT=7 -val SCE_JSON_OPERATOR=8 -val SCE_JSON_URI=9 -val SCE_JSON_COMPACTIRI=10 -val SCE_JSON_KEYWORD=11 -val SCE_JSON_LDKEYWORD=12 -val SCE_JSON_ERROR=13 - -# 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 APIs currently, but some arguments to SCI_SETTECHNOLOGY are provisional. - -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(,) diff --git a/scintilla/include/ScintillaWidget.h b/scintilla/include/ScintillaWidget.h deleted file mode 100644 index 88b1223c..00000000 --- a/scintilla/include/ScintillaWidget.h +++ /dev/null @@ -1,72 +0,0 @@ -/* 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. - * This comment is not a doc-comment as that causes warnings from g-ir-scanner. - */ -/* 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 ()) - -#define SCINTILLA_TYPE_OBJECT (scintilla_object_get_type()) -#define SCINTILLA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SCINTILLA_TYPE_OBJECT, ScintillaObject)) -#define SCINTILLA_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCINTILLA_TYPE_OBJECT)) -#define SCINTILLA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SCINTILLA_TYPE_OBJECT, ScintillaObjectClass)) -#define SCINTILLA_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SCINTILLA_TYPE_OBJECT)) -#define SCINTILLA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), SCINTILLA_TYPE_OBJECT, ScintillaObjectClass)) - -typedef struct _ScintillaObject ScintillaObject; -typedef struct _ScintillaClass ScintillaObjectClass; - -struct _ScintillaObject { - GtkContainer cont; - void *pscin; -}; - -struct _ScintillaClass { - GtkContainerClass parent_class; - - void (* command) (ScintillaObject *sci, int cmd, GtkWidget *window); - void (* notify) (ScintillaObject *sci, int id, SCNotification *scn); -}; - -GType scintilla_object_get_type (void); -GtkWidget* scintilla_object_new (void); -gintptr scintilla_object_send_message (ScintillaObject *sci, unsigned int iMessage, guintptr wParam, gintptr lParam); - - -GType scnotification_get_type (void); -#define SCINTILLA_TYPE_NOTIFICATION (scnotification_get_type()) - -#ifndef G_IR_SCANNING -/* The legacy names confuse the g-ir-scanner program */ -typedef struct _ScintillaClass ScintillaClass; - -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); -#endif - -#define SCINTILLA_NOTIFY "sci-notify" - -#ifdef __cplusplus -} -#endif - -#endif - -#endif diff --git a/scintilla/lexers/LexA68k.cxx b/scintilla/lexers/LexA68k.cxx deleted file mode 100644 index aa403e22..00000000 --- a/scintilla/lexers/LexA68k.cxx +++ /dev/null @@ -1,347 +0,0 @@ -// Scintilla source code edit control -/** @file LexA68k.cxx - ** Lexer for Assembler, just for the MASM syntax - ** Written by Martial Demolins AKA Folco - **/ -// Copyright 2010 Martial Demolins -// 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 - - -// Return values for GetOperatorType -#define NO_OPERATOR 0 -#define OPERATOR_1CHAR 1 -#define OPERATOR_2CHAR 2 - - -/** - * IsIdentifierStart - * - * Return true if the given char is a valid identifier first char - */ - -static inline bool IsIdentifierStart (const int ch) -{ - return (isalpha(ch) || (ch == '_') || (ch == '\\')); -} - - -/** - * IsIdentifierChar - * - * Return true if the given char is a valid identifier char - */ - -static inline bool IsIdentifierChar (const int ch) -{ - return (isalnum(ch) || (ch == '_') || (ch == '@') || (ch == ':') || (ch == '.')); -} - - -/** - * GetOperatorType - * - * Return: - * NO_OPERATOR if char is not an operator - * OPERATOR_1CHAR if the operator is one char long - * OPERATOR_2CHAR if the operator is two chars long - */ - -static inline int GetOperatorType (const int ch1, const int ch2) -{ - int OpType = NO_OPERATOR; - - if ((ch1 == '+') || (ch1 == '-') || (ch1 == '*') || (ch1 == '/') || (ch1 == '#') || - (ch1 == '(') || (ch1 == ')') || (ch1 == '~') || (ch1 == '&') || (ch1 == '|') || (ch1 == ',')) - OpType = OPERATOR_1CHAR; - - else if ((ch1 == ch2) && (ch1 == '<' || ch1 == '>')) - OpType = OPERATOR_2CHAR; - - return OpType; -} - - -/** - * IsBin - * - * Return true if the given char is 0 or 1 - */ - -static inline bool IsBin (const int ch) -{ - return (ch == '0') || (ch == '1'); -} - - -/** - * IsDoxygenChar - * - * Return true if the char may be part of a Doxygen keyword - */ - -static inline bool IsDoxygenChar (const int ch) -{ - return isalpha(ch) || (ch == '$') || (ch == '[') || (ch == ']') || (ch == '{') || (ch == '}'); -} - - -/** - * ColouriseA68kDoc - * - * Main function, which colourises a 68k source - */ - -static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) -{ - // Used to buffer a string, to be able to compare it using built-in functions - char Buffer[100]; - - - // Used to know the length of an operator - int OpType; - - - // Get references to keywords lists - WordList &cpuInstruction = *keywordlists[0]; - WordList ®isters = *keywordlists[1]; - WordList &directive = *keywordlists[2]; - WordList &extInstruction = *keywordlists[3]; - WordList &alert = *keywordlists[4]; - WordList &doxygenKeyword = *keywordlists[5]; - - - // Instanciate a context for our source - StyleContext sc(startPos, length, initStyle, styler); - - - /************************************************************ - * - * Parse the source - * - ************************************************************/ - - for ( ; sc.More(); sc.Forward()) - { - /************************************************************ - * - * A style always terminates at the end of a line, even for - * comments (no multi-lines comments) - * - ************************************************************/ - if (sc.atLineStart) { - sc.SetState(SCE_A68K_DEFAULT); - } - - - /************************************************************ - * - * If we are not in "default style", check if the style continues - * In this case, we just have to loop - * - ************************************************************/ - - if (sc.state != SCE_A68K_DEFAULT) - { - if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number - || ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number - || ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number - || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument - || ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted - || ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted - || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point) - || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier - || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local) - || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword - || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert - || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment - { - continue; - } - - /************************************************************ - * - * Check if current state terminates - * - ************************************************************/ - - // Strings: include terminal ' or " in the current string by skipping it - if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) { - sc.Forward(); - } - - - // If a macro declaration was terminated with ':', it was a label - else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) { - sc.ChangeState(SCE_A68K_LABEL); - } - - - // If it wasn't a Doxygen keyword, change it to normal comment - else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) { - sc.GetCurrent(Buffer, sizeof(Buffer)); - if (!doxygenKeyword.InList(Buffer)) { - sc.ChangeState(SCE_A68K_COMMENT); - } - sc.SetState(SCE_A68K_COMMENT); - continue; - } - - - // If it wasn't an Alert, change it to normal comment - else if (sc.state == SCE_A68K_COMMENT_SPECIAL) { - sc.GetCurrent(Buffer, sizeof(Buffer)); - if (!alert.InList(Buffer)) { - sc.ChangeState(SCE_A68K_COMMENT); - } - // Reset style to normal comment, or to Doxygen keyword if it begins with '\' - if (sc.ch == '\\') { - sc.SetState(SCE_A68K_COMMENT_DOXYGEN); - } - else { - sc.SetState(SCE_A68K_COMMENT); - } - continue; - } - - - // If we are in a comment, it's a Doxygen keyword or an Alert - else if (sc.state == SCE_A68K_COMMENT) { - if (sc.ch == '\\') { - sc.SetState(SCE_A68K_COMMENT_DOXYGEN); - } - else { - sc.SetState(SCE_A68K_COMMENT_SPECIAL); - } - continue; - } - - - // Check if we are at the end of an identifier - // In this case, colourise it if was a keyword. - else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) { - sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context - if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list - sc.ChangeState(SCE_A68K_CPUINSTRUCTION); - } - else if (extInstruction.InList(Buffer)) { - sc.ChangeState(SCE_A68K_EXTINSTRUCTION); - } - else if (registers.InList(Buffer)) { - sc.ChangeState(SCE_A68K_REGISTER); - } - else if (directive.InList(Buffer)) { - sc.ChangeState(SCE_A68K_DIRECTIVE); - } - } - - // All special contexts are now handled.Come back to default style - sc.SetState(SCE_A68K_DEFAULT); - } - - - /************************************************************ - * - * Check if we must enter a new state - * - ************************************************************/ - - // Something which begins at the beginning of a line, and with - // - '\' + an identifier start char, or - // - '\\@' + an identifier start char - // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration - if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) { - sc.SetState(SCE_A68K_LABEL); - } - - if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) { - sc.Forward(2); - if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) { - sc.ChangeState(SCE_A68K_LABEL); - sc.SetState(SCE_A68K_LABEL); - } - } - - // Label and macro identifiers start at the beginning of a line - // We set both as a macro id, but if it wasn't one (':' at the end), - // it will be changed as a label. - if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { - sc.SetState(SCE_A68K_MACRO_DECLARATION); - } - else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match - sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment - } - else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix - sc.SetState(SCE_A68K_NUMBER_DEC); - } - else if ((sc.ch < 0x80) && (sc.ch == '%')) { // Binary numbers are prefixed with '%' - sc.SetState(SCE_A68K_NUMBER_BIN); - } - else if ((sc.ch < 0x80) && (sc.ch == '$')) { // Hexadecimal numbers are prefixed with '$' - sc.SetState(SCE_A68K_NUMBER_HEX); - } - else if ((sc.ch < 0x80) && (sc.ch == '\'')) { // String (single-quoted) - sc.SetState(SCE_A68K_STRING1); - } - else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted) - sc.SetState(SCE_A68K_STRING2); - } - else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\' - sc.SetState(SCE_A68K_MACRO_ARG); - } - else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc... - sc.SetState(SCE_A68K_IDENTIFIER); - } - else { - if (sc.ch < 0x80) { - OpType = GetOperatorType(sc.ch, sc.chNext); // Check if current char is an operator - if (OpType != NO_OPERATOR) { - sc.SetState(SCE_A68K_OPERATOR); - if (OpType == OPERATOR_2CHAR) { // Check if the operator is 2 bytes long - sc.ForwardSetState(SCE_A68K_OPERATOR); // (>> or <<) - } - } - } - } - } // End of for() - sc.Complete(); -} - - -// Names of the keyword lists - -static const char * const a68kWordListDesc[] = -{ - "CPU instructions", - "Registers", - "Directives", - "Extended instructions", - "Comment special words", - "Doxygen keywords", - 0 -}; - -LexerModule lmA68k(SCLEX_A68K, ColouriseA68kDoc, "a68k", 0, a68kWordListDesc); diff --git a/scintilla/lexers/LexAPDL.cxx b/scintilla/lexers/LexAPDL.cxx deleted file mode 100644 index a37dcff5..00000000 --- a/scintilla/lexers/LexAPDL.cxx +++ /dev/null @@ -1,259 +0,0 @@ -// Scintilla source code edit control -/** @file LexAPDL.cxx - ** Lexer for APDL. Based on the lexer for Assembler by The Black Horus. - ** By Hadar Raz. - **/ -// Copyright 1998-2003 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(const int ch) { - return (ch < 0x80 && (isalnum(ch) || ch == '_')); -} - -static inline bool IsAnOperator(char ch) { - // '.' left out as it is used to make up numbers - 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 ColouriseAPDLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - - int stringStart = ' '; - - WordList &processors = *keywordlists[0]; - WordList &commands = *keywordlists[1]; - WordList &slashcommands = *keywordlists[2]; - WordList &starcommands = *keywordlists[3]; - WordList &arguments = *keywordlists[4]; - WordList &functions = *keywordlists[5]; - - // Do not leak onto next line - initStyle = SCE_APDL_DEFAULT; - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - // Determine if the current state should terminate. - if (sc.state == SCE_APDL_NUMBER) { - if (!(IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || - ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) { - sc.SetState(SCE_APDL_DEFAULT); - } - } else if (sc.state == SCE_APDL_COMMENT) { - if (sc.atLineEnd) { - sc.SetState(SCE_APDL_DEFAULT); - } - } else if (sc.state == SCE_APDL_COMMENTBLOCK) { - if (sc.atLineEnd) { - if (sc.ch == '\r') { - sc.Forward(); - } - sc.ForwardSetState(SCE_APDL_DEFAULT); - } - } else if (sc.state == SCE_APDL_STRING) { - if (sc.atLineEnd) { - sc.SetState(SCE_APDL_DEFAULT); - } else if ((sc.ch == '\'' && stringStart == '\'') || (sc.ch == '\"' && stringStart == '\"')) { - sc.ForwardSetState(SCE_APDL_DEFAULT); - } - } else if (sc.state == SCE_APDL_WORD) { - if (!IsAWordChar(sc.ch)) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - if (processors.InList(s)) { - sc.ChangeState(SCE_APDL_PROCESSOR); - } else if (slashcommands.InList(s)) { - sc.ChangeState(SCE_APDL_SLASHCOMMAND); - } else if (starcommands.InList(s)) { - sc.ChangeState(SCE_APDL_STARCOMMAND); - } else if (commands.InList(s)) { - sc.ChangeState(SCE_APDL_COMMAND); - } else if (arguments.InList(s)) { - sc.ChangeState(SCE_APDL_ARGUMENT); - } else if (functions.InList(s)) { - sc.ChangeState(SCE_APDL_FUNCTION); - } - sc.SetState(SCE_APDL_DEFAULT); - } - } else if (sc.state == SCE_APDL_OPERATOR) { - if (!IsAnOperator(static_cast(sc.ch))) { - sc.SetState(SCE_APDL_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_APDL_DEFAULT) { - if (sc.ch == '!' && sc.chNext == '!') { - sc.SetState(SCE_APDL_COMMENTBLOCK); - } else if (sc.ch == '!') { - sc.SetState(SCE_APDL_COMMENT); - } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_APDL_NUMBER); - } else if (sc.ch == '\'' || sc.ch == '\"') { - sc.SetState(SCE_APDL_STRING); - stringStart = sc.ch; - } else if (IsAWordChar(sc.ch) || ((sc.ch == '*' || sc.ch == '/') && !isgraph(sc.chPrev))) { - sc.SetState(SCE_APDL_WORD); - } else if (IsAnOperator(static_cast(sc.ch))) { - sc.SetState(SCE_APDL_OPERATOR); - } - } - } - sc.Complete(); -} - -//------------------------------------------------------------------------------ -// 06-27-07 Sergio Lucato -// - Included code folding for Ansys APDL lexer -// - Copyied from LexBasic.cxx and modified for APDL -//------------------------------------------------------------------------------ - -/* Bits: - * 1 - whitespace - * 2 - operator - * 4 - identifier - * 8 - decimal digit - * 16 - hex digit - * 32 - bin digit - */ -static int character_classification[128] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 10, 6, - 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, - 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, - 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0 -}; - -static bool IsSpace(int c) { - return c < 128 && (character_classification[c] & 1); -} - -static bool IsIdentifier(int c) { - return c < 128 && (character_classification[c] & 4); -} - -static int LowerCase(int c) -{ - if (c >= 'A' && c <= 'Z') - return 'a' + c - 'A'; - return c; -} - -static int CheckAPDLFoldPoint(char const *token, int &level) { - if (!strcmp(token, "*if") || - !strcmp(token, "*do") || - !strcmp(token, "*dowhile") ) { - level |= SC_FOLDLEVELHEADERFLAG; - return 1; - } - if (!strcmp(token, "*endif") || - !strcmp(token, "*enddo") ) { - return -1; - } - return 0; -} - -static void FoldAPDLDoc(Sci_PositionU startPos, Sci_Position length, int, - WordList *[], Accessor &styler) { - - Sci_Position line = styler.GetLine(startPos); - int level = styler.LevelAt(line); - int go = 0, done = 0; - Sci_Position endPos = startPos + length; - char word[256]; - int wordlen = 0; - Sci_Position i; - bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - // Scan for tokens at the start of the line (they may include - // whitespace, for tokens like "End Function" - for (i = startPos; i < endPos; i++) { - int c = styler.SafeGetCharAt(i); - if (!done && !go) { - if (wordlen) { // are we scanning a token already? - word[wordlen] = static_cast(LowerCase(c)); - if (!IsIdentifier(c)) { // done with token - word[wordlen] = '\0'; - go = CheckAPDLFoldPoint(word, level); - if (!go) { - // Treat any whitespace as single blank, for - // things like "End Function". - if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) { - word[wordlen] = ' '; - if (wordlen < 255) - wordlen++; - } - else // done with this line - done = 1; - } - } else if (wordlen < 255) { - wordlen++; - } - } else { // start scanning at first non-whitespace character - if (!IsSpace(c)) { - if (IsIdentifier(c)) { - word[0] = static_cast(LowerCase(c)); - wordlen = 1; - } else // done with this line - done = 1; - } - } - } - if (c == '\n') { // line end - if (!done && wordlen == 0 && foldCompact) // line was only space - level |= SC_FOLDLEVELWHITEFLAG; - if (level != styler.LevelAt(line)) - styler.SetLevel(line, level); - level += go; - line++; - // reset state - wordlen = 0; - level &= ~SC_FOLDLEVELHEADERFLAG; - level &= ~SC_FOLDLEVELWHITEFLAG; - go = 0; - done = 0; - } - } -} - -static const char * const apdlWordListDesc[] = { - "processors", - "commands", - "slashommands", - "starcommands", - "arguments", - "functions", - 0 -}; - -LexerModule lmAPDL(SCLEX_APDL, ColouriseAPDLDoc, "apdl", FoldAPDLDoc, apdlWordListDesc); diff --git a/scintilla/lexers/LexASY.cxx b/scintilla/lexers/LexASY.cxx deleted file mode 100644 index fbbccf44..00000000 --- a/scintilla/lexers/LexASY.cxx +++ /dev/null @@ -1,271 +0,0 @@ -// Scintilla source code edit control -//Author: instanton (email: soft_share126com) -// 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 - -static void ColouriseAsyDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *keywordlists[], Accessor &styler) { - - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - - CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); - CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); - - int visibleChars = 0; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - - if (sc.atLineStart) { - if (sc.state == SCE_ASY_STRING) { - sc.SetState(SCE_ASY_STRING); - } - visibleChars = 0; - } - - if (sc.ch == '\\') { - if (sc.chNext == '\n' || sc.chNext == '\r') { - sc.Forward(); - if (sc.ch == '\r' && sc.chNext == '\n') { - sc.Forward(); - } -// continuationLine = true; - continue; - } - } - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_ASY_OPERATOR: - sc.SetState(SCE_ASY_DEFAULT); - break; - case SCE_ASY_NUMBER: - if (!setWord.Contains(sc.ch)) { - sc.SetState(SCE_ASY_DEFAULT); - } - break; - case SCE_ASY_IDENTIFIER: - if (!setWord.Contains(sc.ch) || (sc.ch == '.')) { - char s[1000]; - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(SCE_ASY_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_ASY_WORD2); - } - sc.SetState(SCE_ASY_DEFAULT); - } - break; - case SCE_ASY_COMMENT: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_ASY_DEFAULT); - } - break; - case SCE_ASY_COMMENTLINE: - if (sc.atLineStart) { - sc.SetState(SCE_ASY_DEFAULT); - } - break; - case SCE_ASY_STRING: - if (sc.atLineEnd) { - sc.ChangeState(SCE_ASY_STRINGEOL); - } else if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_ASY_DEFAULT); - } - break; - case SCE_ASY_CHARACTER: - if (sc.atLineEnd) { - sc.ChangeState(SCE_ASY_STRINGEOL); - } else if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\'') { - sc.ForwardSetState(SCE_ASY_DEFAULT); - } - break; - } - - // Determine if a new state should be entered. - if (sc.state == SCE_ASY_DEFAULT) { - if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) { - sc.SetState(SCE_ASY_IDENTIFIER); - } else if (sc.Match('/', '*')) { - sc.SetState(SCE_ASY_COMMENT); - sc.Forward(); // - } else if (sc.Match('/', '/')) { - sc.SetState(SCE_ASY_COMMENTLINE); - } else if (sc.ch == '\"') { - sc.SetState(SCE_ASY_STRING); - } else if (sc.ch == '\'') { - sc.SetState(SCE_ASY_CHARACTER); - } else if (sc.ch == '#' && visibleChars == 0) { - do { - sc.Forward(); - } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); - if (sc.atLineEnd) { - sc.SetState(SCE_ASY_DEFAULT); - } - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_ASY_OPERATOR); - } - } - - } - sc.Complete(); -} - -static bool IsAsyCommentStyle(int style) { - return style == SCE_ASY_COMMENT; -} - - -static inline bool isASYidentifier(int ch) { - return - ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ; -} - -static int ParseASYWord(Sci_PositionU pos, Accessor &styler, char *word) -{ - int length=0; - char ch=styler.SafeGetCharAt(pos); - *word=0; - - while(isASYidentifier(ch) && length<100){ - word[length]=ch; - length++; - ch=styler.SafeGetCharAt(pos+length); - } - word[length]=0; - return length; -} - -static bool IsASYDrawingLine(Sci_Position line, Accessor &styler) { - Sci_Position pos = styler.LineStart(line); - Sci_Position eol_pos = styler.LineStart(line + 1) - 1; - - Sci_Position startpos = pos; - char buffer[100]=""; - - while (startpos 0) - levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; - int levelMinCurrent = levelCurrent; - int levelNext = levelCurrent; - char chNext = styler[startPos]; - int styleNext = styler.StyleAt(startPos); - int style = initStyle; - 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 && IsAsyCommentStyle(style)) { - if (!IsAsyCommentStyle(stylePrev) && (stylePrev != SCE_ASY_COMMENTLINEDOC)) { - levelNext++; - } else if (!IsAsyCommentStyle(styleNext) && (styleNext != SCE_ASY_COMMENTLINEDOC) && !atEOL) { - levelNext--; - } - } - if (style == SCE_ASY_OPERATOR) { - if (ch == '{') { - if (levelMinCurrent > levelNext) { - levelMinCurrent = levelNext; - } - levelNext++; - } else if (ch == '}') { - levelNext--; - } - } - - if (atEOL && IsASYDrawingLine(lineCurrent, styler)){ - if (lineCurrent==0 && IsASYDrawingLine(lineCurrent + 1, styler)) - levelNext++; - else if (lineCurrent!=0 && !IsASYDrawingLine(lineCurrent - 1, styler) - && IsASYDrawingLine(lineCurrent + 1, styler) - ) - levelNext++; - else if (lineCurrent!=0 && IsASYDrawingLine(lineCurrent - 1, styler) && - !IsASYDrawingLine(lineCurrent+1, styler)) - levelNext--; - } - - if (atEOL) { - int levelUse = levelCurrent; - if (foldAtElse) { - levelUse = levelMinCurrent; - } - 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; - levelMinCurrent = levelCurrent; - visibleChars = 0; - } - if (!IsASpace(ch)) - visibleChars++; - } -} - -static const char * const asyWordLists[] = { - "Primary keywords and identifiers", - "Secondary keywords and identifiers", - 0, - }; - -LexerModule lmASY(SCLEX_ASYMPTOTE, ColouriseAsyDoc, "asy", FoldAsyDoc, asyWordLists); diff --git a/scintilla/lexers/LexAU3.cxx b/scintilla/lexers/LexAU3.cxx deleted file mode 100644 index 529946d6..00000000 --- a/scintilla/lexers/LexAU3.cxx +++ /dev/null @@ -1,910 +0,0 @@ -// Scintilla source code edit control -// @file LexAU3.cxx -// Lexer for AutoIt3 http://www.hiddensoft.com/autoit3 -// by Jos van der Zande, jvdzande@yahoo.com -// -// Changes: -// March 28, 2004 - Added the standard Folding code -// April 21, 2004 - Added Preprosessor Table + Syntax Highlighting -// Fixed Number highlighting -// Changed default isoperator to IsAOperator to have a better match to AutoIt3 -// Fixed "#comments_start" -> "#comments-start" -// Fixed "#comments_end" -> "#comments-end" -// Fixed Sendkeys in Strings when not terminated with } -// Added support for Sendkey strings that have second parameter e.g. {UP 5} or {a down} -// April 26, 2004 - Fixed # pre-processor statement inside of comment block would invalidly change the color. -// Added logic for #include to treat the <> as string -// Added underscore to IsAOperator. -// May 17, 2004 - Changed the folding logic from indent to keyword folding. -// Added Folding logic for blocks of single-commentlines or commentblock. -// triggered by: fold.comment=1 -// Added Folding logic for preprocessor blocks triggered by fold.preprocessor=1 -// Added Special for #region - #endregion syntax highlight and folding. -// May 30, 2004 - Fixed issue with continuation lines on If statements. -// June 5, 2004 - Added comma to Operators for better readability. -// Added fold.compact support set with fold.compact=1 -// Changed folding inside of #cs-#ce. Default is no keyword folding inside comment blocks when fold.comment=1 -// it will now only happen when fold.comment=2. -// Sep 5, 2004 - Added logic to handle colourizing words on the last line. -// Typed Characters now show as "default" till they match any table. -// Oct 10, 2004 - Added logic to show Comments in "Special" directives. -// Nov 1, 2004 - Added better testing for Numbers supporting x and e notation. -// Nov 28, 2004 - Added logic to handle continuation lines for syntax highlighting. -// Jan 10, 2005 - Added Abbreviations Keyword used for expansion -// Mar 24, 2005 - Updated Abbreviations Keywords to fix when followed by Operator. -// Apr 18, 2005 - Updated #CE/#Comment-End logic to take a linecomment ";" into account -// - Added folding support for With...EndWith -// - Added support for a DOT in variable names -// - Fixed Underscore in CommentBlock -// May 23, 2005 - Fixed the SentKey lexing in case of a missing } -// Aug 11, 2005 - Fixed possible bug with s_save length > 100. -// Aug 23, 2005 - Added Switch/endswitch support to the folding logic. -// Sep 27, 2005 - Fixed the SentKey lexing logic in case of multiple sentkeys. -// Mar 12, 2006 - Fixed issue with <> coloring as String in stead of Operator in rare occasions. -// Apr 8, 2006 - Added support for AutoIt3 Standard UDF library (SCE_AU3_UDF) -// Mar 9, 2007 - Fixed bug with + following a String getting the wrong Color. -// Jun 20, 2007 - Fixed Commentblock issue when LF's are used as EOL. -// Jul 26, 2007 - Fixed #endregion undetected bug. -// -// Copyright for Scintilla: 1998-2001 by Neil Hodgson -// The License.txt file describes the conditions under which this software may be distributed. -// Scintilla source code edit control - -#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 == '$'; -} -static inline bool IsAWordChar(const int ch) -{ - return (ch < 0x80) && (isalnum(ch) || ch == '_'); -} - -static inline bool IsAWordStart(const int ch) -{ - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '@' || ch == '#' || ch == '$' || ch == '.'); -} - -static inline bool IsAOperator(char ch) { - if (IsASCII(ch) && isalnum(ch)) - return false; - if (ch == '+' || ch == '-' || ch == '*' || ch == '/' || - ch == '&' || ch == '^' || ch == '=' || ch == '<' || ch == '>' || - ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == ',' ) - return true; - return false; -} - -/////////////////////////////////////////////////////////////////////////////// -// GetSendKey() filters the portion before and after a/multiple space(s) -// and return the first portion to be looked-up in the table -// also check if the second portion is valid... (up,down.on.off,toggle or a number) -/////////////////////////////////////////////////////////////////////////////// - -static int GetSendKey(const char *szLine, char *szKey) -{ - int nFlag = 0; - int nStartFound = 0; - int nKeyPos = 0; - int nSpecPos= 0; - int nSpecNum= 1; - int nPos = 0; - char cTemp; - char szSpecial[100]; - - // split the portion of the sendkey in the part before and after the spaces - while ( ( (cTemp = szLine[nPos]) != '\0')) - { - // skip leading Ctrl/Shift/Alt state - if (cTemp == '{') { - nStartFound = 1; - } - // - if (nStartFound == 1) { - if ((cTemp == ' ') && (nFlag == 0) ) // get the stuff till first space - { - nFlag = 1; - // Add } to the end of the first bit for table lookup later. - szKey[nKeyPos++] = '}'; - } - else if (cTemp == ' ') - { - // skip other spaces - } - else if (nFlag == 0) - { - // save first portion into var till space or } is hit - szKey[nKeyPos++] = cTemp; - } - else if ((nFlag == 1) && (cTemp != '}')) - { - // Save second portion into var... - szSpecial[nSpecPos++] = cTemp; - // check if Second portion is all numbers for repeat fuction - if (isdigit(cTemp) == false) {nSpecNum = 0;} - } - } - nPos++; // skip to next char - - } // End While - - - // Check if the second portion is either a number or one of these keywords - szKey[nKeyPos] = '\0'; - szSpecial[nSpecPos] = '\0'; - if (strcmp(szSpecial,"down")== 0 || strcmp(szSpecial,"up")== 0 || - strcmp(szSpecial,"on")== 0 || strcmp(szSpecial,"off")== 0 || - strcmp(szSpecial,"toggle")== 0 || nSpecNum == 1 ) - { - nFlag = 0; - } - else - { - nFlag = 1; - } - return nFlag; // 1 is bad, 0 is good - -} // GetSendKey() - -// -// Routine to check the last "none comment" character on a line to see if its a continuation -// -static bool IsContinuationLine(Sci_PositionU szLine, Accessor &styler) -{ - Sci_Position nsPos = styler.LineStart(szLine); - Sci_Position nePos = styler.LineStart(szLine+1) - 2; - //int stylech = styler.StyleAt(nsPos); - while (nsPos < nePos) - { - //stylech = styler.StyleAt(nePos); - int stylech = styler.StyleAt(nsPos); - if (!(stylech == SCE_AU3_COMMENT)) { - char ch = styler.SafeGetCharAt(nePos); - if (!isspacechar(ch)) { - if (ch == '_') - return true; - else - return false; - } - } - nePos--; // skip to next char - } // End While - return false; -} // IsContinuationLine() - -// -// syntax highlighting logic -static void ColouriseAU3Doc(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]; - // find the first previous line without continuation character at the end - Sci_Position lineCurrent = styler.GetLine(startPos); - Sci_Position s_startPos = startPos; - // When not inside a Block comment: find First line without _ - if (!(initStyle==SCE_AU3_COMMENTBLOCK)) { - while ((lineCurrent > 0 && IsContinuationLine(lineCurrent,styler)) || - (lineCurrent > 1 && IsContinuationLine(lineCurrent-1,styler))) { - lineCurrent--; - startPos = styler.LineStart(lineCurrent); // get start position - initStyle = 0; // reset the start style to 0 - } - } - // Set the new length to include it from the start and set the start position - length = length + s_startPos - startPos; // correct the total length to process - styler.StartAt(startPos); - - StyleContext sc(startPos, length, initStyle, styler); - char si; // string indicator "=1 '=2 - char ni; // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 Enot=3 - char ci; // comment indicator 0=not linecomment(;) - char s_save[100] = ""; - si=0; - ni=0; - ci=0; - //$$$ - for (; sc.More(); sc.Forward()) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - // ********************************************** - // save the total current word for eof processing - if (IsAWordChar(sc.ch) || 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'; - } - } - // ********************************************** - // - switch (sc.state) - { - case SCE_AU3_COMMENTBLOCK: - { - //Reset at line end - if (sc.atLineEnd) { - ci=0; - if (strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0) { - if (sc.atLineEnd) - sc.SetState(SCE_AU3_DEFAULT); - else - sc.SetState(SCE_AU3_COMMENTBLOCK); - } - break; - } - //skip rest of line when a ; is encountered - if (sc.chPrev == ';') { - ci=2; - sc.SetState(SCE_AU3_COMMENTBLOCK); - } - // skip rest of the line - if (ci==2) - break; - // check when first character is detected on the line - if (ci==0) { - if (IsAWordStart(static_cast(sc.ch)) || IsAOperator(static_cast(sc.ch))) { - ci=1; - sc.SetState(SCE_AU3_COMMENTBLOCK); - } - break; - } - if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && strcmp(s, "#comments") == 0))) { - if ((strcmp(s, "#ce")== 0 || strcmp(s, "#comments-end")== 0)) - sc.SetState(SCE_AU3_COMMENT); // set to comment line for the rest of the line - else - ci=2; // line doesn't begin with #CE so skip the rest of the line - } - break; - } - case SCE_AU3_COMMENT: - { - if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} - break; - } - case SCE_AU3_OPERATOR: - { - // check if its a COMobject - if (sc.chPrev == '.' && IsAWordChar(sc.ch)) { - sc.SetState(SCE_AU3_COMOBJ); - } - else { - sc.SetState(SCE_AU3_DEFAULT); - } - break; - } - case SCE_AU3_SPECIAL: - { - if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} - if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} - break; - } - case SCE_AU3_KEYWORD: - { - if (!(IsAWordChar(sc.ch) || (sc.ch == '-' && (strcmp(s, "#comments") == 0 || strcmp(s, "#include") == 0)))) - { - if (!IsTypeCharacter(sc.ch)) - { - if (strcmp(s, "#cs")== 0 || strcmp(s, "#comments-start")== 0 ) - { - sc.ChangeState(SCE_AU3_COMMENTBLOCK); - sc.SetState(SCE_AU3_COMMENTBLOCK); - break; - } - else if (keywords.InList(s)) { - sc.ChangeState(SCE_AU3_KEYWORD); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (keywords2.InList(s)) { - sc.ChangeState(SCE_AU3_FUNCTION); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (keywords3.InList(s)) { - sc.ChangeState(SCE_AU3_MACRO); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (keywords5.InList(s)) { - sc.ChangeState(SCE_AU3_PREPROCESSOR); - sc.SetState(SCE_AU3_DEFAULT); - if (strcmp(s, "#include")== 0) - { - si = 3; // use to determine string start for #inlude <> - } - } - else if (keywords6.InList(s)) { - sc.ChangeState(SCE_AU3_SPECIAL); - sc.SetState(SCE_AU3_SPECIAL); - } - else if ((keywords7.InList(s)) && (!IsAOperator(static_cast(sc.ch)))) { - sc.ChangeState(SCE_AU3_EXPAND); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (keywords8.InList(s)) { - sc.ChangeState(SCE_AU3_UDF); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (strcmp(s, "_") == 0) { - sc.ChangeState(SCE_AU3_OPERATOR); - sc.SetState(SCE_AU3_DEFAULT); - } - else if (!IsAWordChar(sc.ch)) { - sc.ChangeState(SCE_AU3_DEFAULT); - sc.SetState(SCE_AU3_DEFAULT); - } - } - } - if (sc.atLineEnd) { - sc.SetState(SCE_AU3_DEFAULT);} - break; - } - case SCE_AU3_NUMBER: - { - // Numeric indicator error=9 normal=0 normal+dec=1 hex=2 E-not=3 - // - // test for Hex notation - if (strcmp(s, "0") == 0 && (sc.ch == 'x' || sc.ch == 'X') && ni == 0) - { - ni = 2; - break; - } - // test for E notation - if (IsADigit(sc.chPrev) && (sc.ch == 'e' || sc.ch == 'E') && ni <= 1) - { - ni = 3; - break; - } - // Allow Hex characters inside hex numeric strings - if ((ni == 2) && - (sc.ch == 'a' || sc.ch == 'b' || sc.ch == 'c' || sc.ch == 'd' || sc.ch == 'e' || sc.ch == 'f' || - sc.ch == 'A' || sc.ch == 'B' || sc.ch == 'C' || sc.ch == 'D' || sc.ch == 'E' || sc.ch == 'F' )) - { - break; - } - // test for 1 dec point only - if (sc.ch == '.') - { - if (ni==0) - { - ni=1; - } - else - { - ni=9; - } - break; - } - // end of numeric string ? - if (!(IsADigit(sc.ch))) - { - if (ni==9) - { - sc.ChangeState(SCE_AU3_DEFAULT); - } - sc.SetState(SCE_AU3_DEFAULT); - } - break; - } - case SCE_AU3_VARIABLE: - { - // Check if its a COMObject - if (sc.ch == '.' && !IsADigit(sc.chNext)) { - sc.SetState(SCE_AU3_OPERATOR); - } - else if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_AU3_DEFAULT); - } - break; - } - case SCE_AU3_COMOBJ: - { - if (!(IsAWordChar(sc.ch))) { - sc.SetState(SCE_AU3_DEFAULT); - } - break; - } - case SCE_AU3_STRING: - { - // check for " to end a double qouted string or - // check for ' to end a single qouted string - if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'') || (si == 3 && sc.ch == '>')) - { - sc.ForwardSetState(SCE_AU3_DEFAULT); - si=0; - break; - } - if (sc.atLineEnd) - { - si=0; - // at line end and not found a continuation char then reset to default - Sci_Position lineCurrent = styler.GetLine(sc.currentPos); - if (!IsContinuationLine(lineCurrent,styler)) - { - sc.SetState(SCE_AU3_DEFAULT); - break; - } - } - // find Sendkeys in a STRING - if (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ) { - sc.SetState(SCE_AU3_SENT);} - break; - } - - case SCE_AU3_SENT: - { - // Send key string ended - if (sc.chPrev == '}' && sc.ch != '}') - { - // set color to SENDKEY when valid sendkey .. else set back to regular string - char sk[100]; - // split {111 222} and return {111} and check if 222 is valid. - // if return code = 1 then invalid 222 so must be string - if (GetSendKey(s,sk)) - { - sc.ChangeState(SCE_AU3_STRING); - } - // if single char between {?} then its ok as sendkey for a single character - else if (strlen(sk) == 3) - { - sc.ChangeState(SCE_AU3_SENT); - } - // if sendkey {111} is in table then ok as sendkey - else if (keywords4.InList(sk)) - { - sc.ChangeState(SCE_AU3_SENT); - } - else - { - sc.ChangeState(SCE_AU3_STRING); - } - sc.SetState(SCE_AU3_STRING); - } - else - { - // check if the start is a valid SendKey start - Sci_Position nPos = 0; - int nState = 1; - char cTemp; - while (!(nState == 2) && ((cTemp = s[nPos]) != '\0')) - { - if (cTemp == '{' && nState == 1) - { - nState = 2; - } - if (nState == 1 && !(cTemp == '+' || cTemp == '!' || cTemp == '^' || cTemp == '#' )) - { - nState = 0; - } - nPos++; - } - //Verify characters infront of { ... if not assume regular string - if (nState == 1 && (!(sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' ))) { - sc.ChangeState(SCE_AU3_STRING); - sc.SetState(SCE_AU3_STRING); - } - // If invalid character found then assume its a regular string - if (nState == 0) { - sc.ChangeState(SCE_AU3_STRING); - sc.SetState(SCE_AU3_STRING); - } - } - // check if next portion is again a sendkey - if (sc.atLineEnd) - { - sc.ChangeState(SCE_AU3_STRING); - sc.SetState(SCE_AU3_DEFAULT); - si = 0; // reset string indicator - } - //* check in next characters following a sentkey are again a sent key - // Need this test incase of 2 sentkeys like {F1}{ENTER} but not detect {{} - if (sc.state == SCE_AU3_STRING && (sc.ch == '{' || sc.ch == '+' || sc.ch == '!' || sc.ch == '^' || sc.ch == '#' )) { - sc.SetState(SCE_AU3_SENT);} - // check to see if the string ended... - // Sendkey string isn't complete but the string ended.... - if ((si == 1 && sc.ch == '\"') || (si == 2 && sc.ch == '\'')) - { - sc.ChangeState(SCE_AU3_STRING); - sc.ForwardSetState(SCE_AU3_DEFAULT); - } - break; - } - } //switch (sc.state) - - // Determine if a new state should be entered: - - if (sc.state == SCE_AU3_DEFAULT) - { - if (sc.ch == ';') {sc.SetState(SCE_AU3_COMMENT);} - else if (sc.ch == '#') {sc.SetState(SCE_AU3_KEYWORD);} - else if (sc.ch == '$') {sc.SetState(SCE_AU3_VARIABLE);} - else if (sc.ch == '.' && !IsADigit(sc.chNext)) {sc.SetState(SCE_AU3_OPERATOR);} - else if (sc.ch == '@') {sc.SetState(SCE_AU3_KEYWORD);} - //else if (sc.ch == '_') {sc.SetState(SCE_AU3_KEYWORD);} - else if (sc.ch == '<' && si==3) {sc.SetState(SCE_AU3_STRING);} // string after #include - else if (sc.ch == '\"') { - sc.SetState(SCE_AU3_STRING); - si = 1; } - else if (sc.ch == '\'') { - sc.SetState(SCE_AU3_STRING); - si = 2; } - else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) - { - sc.SetState(SCE_AU3_NUMBER); - ni = 0; - } - else if (IsAWordStart(sc.ch)) {sc.SetState(SCE_AU3_KEYWORD);} - else if (IsAOperator(static_cast(sc.ch))) {sc.SetState(SCE_AU3_OPERATOR);} - else if (sc.atLineEnd) {sc.SetState(SCE_AU3_DEFAULT);} - } - } //for (; sc.More(); sc.Forward()) - - //************************************* - // Colourize the last word correctly - //************************************* - if (sc.state == SCE_AU3_KEYWORD) - { - if (strcmp(s_save, "#cs")== 0 || strcmp(s_save, "#comments-start")== 0 ) - { - sc.ChangeState(SCE_AU3_COMMENTBLOCK); - sc.SetState(SCE_AU3_COMMENTBLOCK); - } - else if (keywords.InList(s_save)) { - sc.ChangeState(SCE_AU3_KEYWORD); - sc.SetState(SCE_AU3_KEYWORD); - } - else if (keywords2.InList(s_save)) { - sc.ChangeState(SCE_AU3_FUNCTION); - sc.SetState(SCE_AU3_FUNCTION); - } - else if (keywords3.InList(s_save)) { - sc.ChangeState(SCE_AU3_MACRO); - sc.SetState(SCE_AU3_MACRO); - } - else if (keywords5.InList(s_save)) { - sc.ChangeState(SCE_AU3_PREPROCESSOR); - sc.SetState(SCE_AU3_PREPROCESSOR); - } - else if (keywords6.InList(s_save)) { - sc.ChangeState(SCE_AU3_SPECIAL); - sc.SetState(SCE_AU3_SPECIAL); - } - else if (keywords7.InList(s_save) && sc.atLineEnd) { - sc.ChangeState(SCE_AU3_EXPAND); - sc.SetState(SCE_AU3_EXPAND); - } - else if (keywords8.InList(s_save)) { - sc.ChangeState(SCE_AU3_UDF); - sc.SetState(SCE_AU3_UDF); - } - else { - sc.ChangeState(SCE_AU3_DEFAULT); - sc.SetState(SCE_AU3_DEFAULT); - } - } - if (sc.state == SCE_AU3_SENT) - { - // Send key string ended - if (sc.chPrev == '}' && sc.ch != '}') - { - // set color to SENDKEY when valid sendkey .. else set back to regular string - char sk[100]; - // split {111 222} and return {111} and check if 222 is valid. - // if return code = 1 then invalid 222 so must be string - if (GetSendKey(s_save,sk)) - { - sc.ChangeState(SCE_AU3_STRING); - } - // if single char between {?} then its ok as sendkey for a single character - else if (strlen(sk) == 3) - { - sc.ChangeState(SCE_AU3_SENT); - } - // if sendkey {111} is in table then ok as sendkey - else if (keywords4.InList(sk)) - { - sc.ChangeState(SCE_AU3_SENT); - } - else - { - sc.ChangeState(SCE_AU3_STRING); - } - sc.SetState(SCE_AU3_STRING); - } - // check if next portion is again a sendkey - if (sc.atLineEnd) - { - sc.ChangeState(SCE_AU3_STRING); - sc.SetState(SCE_AU3_DEFAULT); - } - } - //************************************* - sc.Complete(); -} - -// -static bool IsStreamCommentStyle(int style) { - return style == SCE_AU3_COMMENT || style == SCE_AU3_COMMENTBLOCK; -} - -// -// 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_PositionU szLine, Accessor &styler) -{ - Sci_Position nsPos = styler.LineStart(szLine); - Sci_Position nePos = styler.LineStart(szLine+1) - 1; - while (isspacechar(styler.SafeGetCharAt(nsPos)) && nsPos < nePos) - { - nsPos++; // skip to next char - - } // End While - return styler.StyleAt(nsPos); - -} // GetStyleFirstWord() - - -// -static void FoldAU3Doc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) -{ - Sci_Position endPos = startPos + length; - // 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 = styler.GetPropertyInt("fold.compact", 1) != 0; - bool foldpreprocessor = styler.GetPropertyInt("fold.preprocessor") != 0; - // 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); - } - } - // 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 FirstWordStart = false; - bool FirstWordEnd = false; - char szKeyword[11]=""; - int szKeywordlen = 0; - char szThen[5]=""; - int szThenlen = 0; - bool ThenFoundLast = false; - // var for indentlevel - int levelCurrent = SC_FOLDLEVELBASE; - if (lineCurrent > 0) - levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; - int levelNext = levelCurrent; - // - int visibleChars = 0; - char chNext = styler.SafeGetCharAt(startPos); - char chPrev = ' '; - // - for (Sci_Position i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - if (IsAWordChar(ch)) { - visibleChars++; - } - // get the syle for the current character neede to check in comment - int stylech = styler.StyleAt(i); - // get first word for the line for indent check max 9 characters - if (FirstWordStart && (!(FirstWordEnd))) { - if (!IsAWordChar(ch)) { - FirstWordEnd = true; - szKeyword[szKeywordlen] = '\0'; - } - else { - if (szKeywordlen < 10) { - szKeyword[szKeywordlen++] = static_cast(tolower(ch)); - } - } - } - // start the capture of the first word - if (!(FirstWordStart)) { - if (IsAWordChar(ch) || IsAWordStart(ch) || ch == ';') { - FirstWordStart = true; - szKeyword[szKeywordlen++] = static_cast(tolower(ch)); - } - } - // only process this logic when not in comment section - if (!(stylech == SCE_AU3_COMMENT)) { - if (ThenFoundLast) { - if (IsAWordChar(ch)) { - ThenFoundLast = false; - } - } - // find out if the word "then" is the last on a "if" line - if (FirstWordEnd && strcmp(szKeyword,"if") == 0) { - if (szThenlen == 4) { - szThen[0] = szThen[1]; - szThen[1] = szThen[2]; - szThen[2] = szThen[3]; - szThen[3] = static_cast(tolower(ch)); - if (strcmp(szThen,"then") == 0 ) { - ThenFoundLast = true; - } - } - else { - szThen[szThenlen++] = static_cast(tolower(ch)); - if (szThenlen == 5) { - szThen[4] = '\0'; - } - } - } - } - // End of Line found so process the information - if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) { - // ************************** - // 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 (szKeywordlen > 0 && (!(chPrev == '_')) && - ((!(IsStreamCommentStyle(style)) || foldInComment)) ) { - szKeyword[szKeywordlen] = '\0'; - // only fold "if" last keyword is "then" (else its a one line if) - if (strcmp(szKeyword,"if") == 0 && ThenFoundLast) { - levelNext++; - } - // create new fold for these words - if (strcmp(szKeyword,"do") == 0 || strcmp(szKeyword,"for") == 0 || - strcmp(szKeyword,"func") == 0 || strcmp(szKeyword,"while") == 0|| - strcmp(szKeyword,"with") == 0 || strcmp(szKeyword,"#region") == 0 ) { - levelNext++; - } - // create double Fold for select&switch because Case will subtract one of the current level - if (strcmp(szKeyword,"select") == 0 || strcmp(szKeyword,"switch") == 0) { - levelNext++; - levelNext++; - } - // end the fold for these words before the current line - if (strcmp(szKeyword,"endfunc") == 0 || strcmp(szKeyword,"endif") == 0 || - strcmp(szKeyword,"next") == 0 || strcmp(szKeyword,"until") == 0 || - strcmp(szKeyword,"endwith") == 0 ||strcmp(szKeyword,"wend") == 0){ - levelNext--; - levelCurrent--; - } - // end the fold for these words before the current line and Start new fold - if (strcmp(szKeyword,"case") == 0 || strcmp(szKeyword,"else") == 0 || - strcmp(szKeyword,"elseif") == 0 ) { - levelCurrent--; - } - // end the double fold for this word before the current line - if (strcmp(szKeyword,"endselect") == 0 || strcmp(szKeyword,"endswitch") == 0 ) { - levelNext--; - levelNext--; - levelCurrent--; - levelCurrent--; - } - // end the fold for these words on the current line - if (strcmp(szKeyword,"#endregion") == 0 ) { - levelNext--; - } - } - // Preprocessor and Comment folding - int styleNext = GetStyleFirstWord(lineCurrent + 1,styler); - // ************************************* - // Folding logic for preprocessor blocks - // ************************************* - // process preprosessor line - if (foldpreprocessor && style == SCE_AU3_PREPROCESSOR) { - if (!(stylePrev == SCE_AU3_PREPROCESSOR) && (styleNext == SCE_AU3_PREPROCESSOR)) { - levelNext++; - } - // fold till the last line for normal comment lines - else if (stylePrev == SCE_AU3_PREPROCESSOR && !(styleNext == SCE_AU3_PREPROCESSOR)) { - levelNext--; - } - } - // ********************************* - // 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_AU3_COMMENT) - && stylePrev == SCE_AU3_COMMENT - && style == SCE_AU3_COMMENT) { - levelNext--; - } - // fold till the one but last line for Blockcomment lines - else if (IsStreamCommentStyle(stylePrev) - && !(styleNext == SCE_AU3_COMMENTBLOCK) - && style == SCE_AU3_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 character is an Underscore then don't reset since the line continues on the next line. - if (!(chPrev == '_')) { - szKeywordlen = 0; - szThenlen = 0; - FirstWordStart = false; - FirstWordEnd = false; - ThenFoundLast = false; - } - } - // save the last processed character - if (!isspacechar(ch)) { - chPrev = ch; - visibleChars++; - } - } -} - - -// - -static const char * const AU3WordLists[] = { - "#autoit keywords", - "#autoit functions", - "#autoit macros", - "#autoit Sent keys", - "#autoit Pre-processors", - "#autoit Special", - "#autoit Expand", - "#autoit UDF", - 0 -}; -LexerModule lmAU3(SCLEX_AU3, ColouriseAU3Doc, "au3", FoldAU3Doc , AU3WordLists); diff --git a/scintilla/lexers/LexAVE.cxx b/scintilla/lexers/LexAVE.cxx deleted file mode 100644 index 9cd30184..00000000 --- a/scintilla/lexers/LexAVE.cxx +++ /dev/null @@ -1,231 +0,0 @@ -// SciTE - Scintilla based Text Editor -/** @file LexAVE.cxx - ** Lexer for Avenue. - ** - ** Written by Alexey Yutkin . - **/ -// 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 "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 IsEnumChar(const int ch) { - return (ch < 0x80) && (isalnum(ch)|| ch == '_'); -} -static inline bool IsANumberChar(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '.' ); -} - -inline bool IsAWordStart(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_'); -} - -inline bool isAveOperator(char ch) { - if (IsASCII(ch) && isalnum(ch)) - return false; - // '.' left out as it is used to make up numbers - if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || - ch == '(' || ch == ')' || ch == '=' || - ch == '{' || ch == '}' || - ch == '[' || ch == ']' || ch == ';' || - ch == '<' || ch == '>' || ch == ',' || - ch == '.' ) - return true; - return false; -} - -static void ColouriseAveDoc( - 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]; - - // Do not leak onto next line - if (initStyle == SCE_AVE_STRINGEOL) { - initStyle = SCE_AVE_DEFAULT; - } - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - if (sc.atLineEnd) { - // Update the line state, so it can be seen by next line - Sci_Position currentLine = styler.GetLine(sc.currentPos); - styler.SetLineState(currentLine, 0); - } - if (sc.atLineStart && (sc.state == SCE_AVE_STRING)) { - // Prevent SCE_AVE_STRINGEOL from leaking back to previous line - sc.SetState(SCE_AVE_STRING); - } - - - // Determine if the current state should terminate. - if (sc.state == SCE_AVE_OPERATOR) { - sc.SetState(SCE_AVE_DEFAULT); - } else if (sc.state == SCE_AVE_NUMBER) { - if (!IsANumberChar(sc.ch)) { - sc.SetState(SCE_AVE_DEFAULT); - } - } else if (sc.state == SCE_AVE_ENUM) { - if (!IsEnumChar(sc.ch)) { - sc.SetState(SCE_AVE_DEFAULT); - } - } else if (sc.state == SCE_AVE_IDENTIFIER) { - if (!IsAWordChar(sc.ch) || (sc.ch == '.')) { - char s[100]; - //sc.GetCurrent(s, sizeof(s)); - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(SCE_AVE_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_AVE_WORD2); - } else if (keywords3.InList(s)) { - sc.ChangeState(SCE_AVE_WORD3); - } else if (keywords4.InList(s)) { - sc.ChangeState(SCE_AVE_WORD4); - } else if (keywords5.InList(s)) { - sc.ChangeState(SCE_AVE_WORD5); - } else if (keywords6.InList(s)) { - sc.ChangeState(SCE_AVE_WORD6); - } - sc.SetState(SCE_AVE_DEFAULT); - } - } else if (sc.state == SCE_AVE_COMMENT) { - if (sc.atLineEnd) { - sc.SetState(SCE_AVE_DEFAULT); - } - } else if (sc.state == SCE_AVE_STRING) { - if (sc.ch == '\"') { - sc.ForwardSetState(SCE_AVE_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_AVE_STRINGEOL); - sc.ForwardSetState(SCE_AVE_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_AVE_DEFAULT) { - if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_AVE_NUMBER); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_AVE_IDENTIFIER); - } else if (sc.Match('\"')) { - sc.SetState(SCE_AVE_STRING); - } else if (sc.Match('\'')) { - sc.SetState(SCE_AVE_COMMENT); - sc.Forward(); - } else if (isAveOperator(static_cast(sc.ch))) { - sc.SetState(SCE_AVE_OPERATOR); - } else if (sc.Match('#')) { - sc.SetState(SCE_AVE_ENUM); - sc.Forward(); - } - } - } - sc.Complete(); -} - -static void FoldAveDoc(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 = static_cast(tolower(styler[startPos])); - bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - int styleNext = styler.StyleAt(startPos); - char s[10] = ""; - - for (Sci_PositionU i = startPos; i < lengthDoc; i++) { - char ch = static_cast(tolower(chNext)); - chNext = static_cast(tolower(styler.SafeGetCharAt(i + 1))); - int style = styleNext; - styleNext = styler.StyleAt(i + 1); - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (style == SCE_AVE_WORD) { - if (ch == 't' || ch == 'f' || ch == 'w' || ch == 'e') { - for (unsigned int j = 0; j < 6; j++) { - if (!iswordchar(styler[i + j])) { - break; - } - s[j] = static_cast(tolower(styler[i + j])); - s[j + 1] = '\0'; - } - - if ((strcmp(s, "then") == 0) || (strcmp(s, "for") == 0) || (strcmp(s, "while") == 0)) { - levelCurrent++; - } - if ((strcmp(s, "end") == 0) || (strcmp(s, "elseif") == 0)) { - // Normally "elseif" and "then" will be on the same line and will cancel - // each other out. // As implemented, this does not support fold.at.else. - levelCurrent--; - } - } - } else if (style == SCE_AVE_OPERATOR) { - if (ch == '{' || ch == '(') { - levelCurrent++; - } else if (ch == '}' || ch == ')') { - 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); -} - -LexerModule lmAVE(SCLEX_AVE, ColouriseAveDoc, "ave", FoldAveDoc); - diff --git a/scintilla/lexers/LexAVS.cxx b/scintilla/lexers/LexAVS.cxx deleted file mode 100644 index 20a6ef68..00000000 --- a/scintilla/lexers/LexAVS.cxx +++ /dev/null @@ -1,293 +0,0 @@ -// Scintilla source code edit control -/** @file LexAVS.cxx - ** Lexer for AviSynth. - **/ -// Copyright 2012 by Bruno Barbieri -// Heavily based on LexPOV 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(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_'); -} - -static inline bool IsAWordStart(int ch) { - return isalpha(ch) || (ch != ' ' && ch != '\n' && ch != '(' && 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) || ch == '.' || ch == '-' || ch == '+'); -} - -static void ColouriseAvsDoc( - Sci_PositionU startPos, - Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler) { - - WordList &keywords = *keywordlists[0]; - WordList &filters = *keywordlists[1]; - WordList &plugins = *keywordlists[2]; - WordList &functions = *keywordlists[3]; - WordList &clipProperties = *keywordlists[4]; - WordList &userDefined = *keywordlists[5]; - - Sci_Position currentLine = styler.GetLine(startPos); - // Initialize the block comment nesting level, if we are inside such a comment. - int blockCommentLevel = 0; - if (initStyle == SCE_AVS_COMMENTBLOCK || initStyle == SCE_AVS_COMMENTBLOCKN) { - blockCommentLevel = styler.GetLineState(currentLine - 1); - } - - // Do not leak onto next line - if (initStyle == SCE_AVS_COMMENTLINE) { - initStyle = SCE_AVS_DEFAULT; - } - - StyleContext sc(startPos, length, initStyle, styler); - - 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); - if (sc.state == SCE_AVS_COMMENTBLOCK || sc.state == SCE_AVS_COMMENTBLOCKN) { - // Inside a block comment, we set the line state - styler.SetLineState(currentLine, blockCommentLevel); - } else { - // Reset the line state - styler.SetLineState(currentLine, 0); - } - } - - // Determine if the current state should terminate. - if (sc.state == SCE_AVS_OPERATOR) { - sc.SetState(SCE_AVS_DEFAULT); - } else if (sc.state == SCE_AVS_NUMBER) { - // We stop the number definition on non-numerical non-dot non-sign char - if (!IsANumberChar(sc.ch)) { - sc.SetState(SCE_AVS_DEFAULT); - } - } else if (sc.state == SCE_AVS_IDENTIFIER) { - if (!IsAWordChar(sc.ch)) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - - if (keywords.InList(s)) { - sc.ChangeState(SCE_AVS_KEYWORD); - } else if (filters.InList(s)) { - sc.ChangeState(SCE_AVS_FILTER); - } else if (plugins.InList(s)) { - sc.ChangeState(SCE_AVS_PLUGIN); - } else if (functions.InList(s)) { - sc.ChangeState(SCE_AVS_FUNCTION); - } else if (clipProperties.InList(s)) { - sc.ChangeState(SCE_AVS_CLIPPROP); - } else if (userDefined.InList(s)) { - sc.ChangeState(SCE_AVS_USERDFN); - } - sc.SetState(SCE_AVS_DEFAULT); - } - } else if (sc.state == SCE_AVS_COMMENTBLOCK) { - if (sc.Match('/', '*')) { - blockCommentLevel++; - sc.Forward(); - } else if (sc.Match('*', '/') && blockCommentLevel > 0) { - blockCommentLevel--; - sc.Forward(); - if (blockCommentLevel == 0) { - sc.ForwardSetState(SCE_AVS_DEFAULT); - } - } - } else if (sc.state == SCE_AVS_COMMENTBLOCKN) { - if (sc.Match('[', '*')) { - blockCommentLevel++; - sc.Forward(); - } else if (sc.Match('*', ']') && blockCommentLevel > 0) { - blockCommentLevel--; - sc.Forward(); - if (blockCommentLevel == 0) { - sc.ForwardSetState(SCE_AVS_DEFAULT); - } - } - } else if (sc.state == SCE_AVS_COMMENTLINE) { - if (sc.atLineEnd) { - sc.ForwardSetState(SCE_AVS_DEFAULT); - } - } else if (sc.state == SCE_AVS_STRING) { - if (sc.ch == '\"') { - sc.ForwardSetState(SCE_AVS_DEFAULT); - } - } else if (sc.state == SCE_AVS_TRIPLESTRING) { - if (sc.Match("\"\"\"")) { - sc.Forward(); - sc.Forward(); - sc.ForwardSetState(SCE_AVS_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_AVS_DEFAULT) { - if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_AVS_NUMBER); - } else if (IsADigit(sc.ch) || (sc.ch == ',' && IsADigit(sc.chNext))) { - sc.Forward(); - sc.SetState(SCE_AVS_NUMBER); - } else if (sc.Match('/', '*')) { - blockCommentLevel = 1; - sc.SetState(SCE_AVS_COMMENTBLOCK); - sc.Forward(); // Eat the * so it isn't used for the end of the comment - } else if (sc.Match('[', '*')) { - blockCommentLevel = 1; - sc.SetState(SCE_AVS_COMMENTBLOCKN); - sc.Forward(); // Eat the * so it isn't used for the end of the comment - } else if (sc.ch == '#') { - sc.SetState(SCE_AVS_COMMENTLINE); - } else if (sc.ch == '\"') { - if (sc.Match("\"\"\"")) { - sc.SetState(SCE_AVS_TRIPLESTRING); - } else { - sc.SetState(SCE_AVS_STRING); - } - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_AVS_OPERATOR); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_AVS_IDENTIFIER); - } - } - } - - // End of file: complete any pending changeState - if (sc.state == SCE_AVS_IDENTIFIER) { - if (!IsAWordChar(sc.ch)) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - - if (keywords.InList(s)) { - sc.ChangeState(SCE_AVS_KEYWORD); - } else if (filters.InList(s)) { - sc.ChangeState(SCE_AVS_FILTER); - } else if (plugins.InList(s)) { - sc.ChangeState(SCE_AVS_PLUGIN); - } else if (functions.InList(s)) { - sc.ChangeState(SCE_AVS_FUNCTION); - } else if (clipProperties.InList(s)) { - sc.ChangeState(SCE_AVS_CLIPPROP); - } else if (userDefined.InList(s)) { - sc.ChangeState(SCE_AVS_USERDFN); - } - sc.SetState(SCE_AVS_DEFAULT); - } - } - - sc.Complete(); -} - -static void FoldAvsDoc( - 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; - 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; - - 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 && style == SCE_AVS_COMMENTBLOCK) { - if (stylePrev != SCE_AVS_COMMENTBLOCK) { - levelCurrent++; - } else if ((styleNext != SCE_AVS_COMMENTBLOCK) && !atEOL) { - // Comments don't end at end of line and the next character may be unstyled. - levelCurrent--; - } - } - - if (foldComment && style == SCE_AVS_COMMENTBLOCKN) { - if (stylePrev != SCE_AVS_COMMENTBLOCKN) { - levelCurrent++; - } else if ((styleNext != SCE_AVS_COMMENTBLOCKN) && !atEOL) { - // Comments don't end at end of line and the next character may be unstyled. - levelCurrent--; - } - } - - if (style == SCE_AVS_OPERATOR) { - if (ch == '{') { - levelCurrent++; - } else if (ch == '}') { - 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 avsWordLists[] = { - "Keywords", - "Filters", - "Plugins", - "Functions", - "Clip properties", - "User defined functions", - 0, -}; - -LexerModule lmAVS(SCLEX_AVS, ColouriseAvsDoc, "avs", FoldAvsDoc, avsWordLists); diff --git a/scintilla/lexers/LexAbaqus.cxx b/scintilla/lexers/LexAbaqus.cxx deleted file mode 100644 index 88979dbe..00000000 --- a/scintilla/lexers/LexAbaqus.cxx +++ /dev/null @@ -1,605 +0,0 @@ -// Scintilla source code edit control -/** @file LexABAQUS.cxx - ** Lexer for ABAQUS. Based on the lexer for APDL by Hadar Raz. - ** By Sergio Lucato. - ** Sort of completely rewritten by Gertjan Kloosterman - **/ -// The License.txt file describes the conditions under which this software may be distributed. - -// Code folding copyied and modified from LexBasic.cxx - -#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 IsAKeywordChar(const int ch) { - return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == ' '))); -} - -static inline bool IsASetChar(const int ch) { - return (ch < 0x80 && (isalnum(ch) || (ch == '_') || (ch == '.') || (ch == '-'))); -} - -static void ColouriseABAQUSDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList*[] /* *keywordlists[] */, - Accessor &styler) { - enum localState { KW_LINE_KW, KW_LINE_COMMA, KW_LINE_PAR, KW_LINE_EQ, KW_LINE_VAL, \ - DAT_LINE_VAL, DAT_LINE_COMMA,\ - COMMENT_LINE,\ - ST_ERROR, LINE_END } state ; - - // Do not leak onto next line - state = LINE_END ; - initStyle = SCE_ABAQUS_DEFAULT; - StyleContext sc(startPos, length, initStyle, styler); - - // Things are actually quite simple - // we have commentlines - // keywordlines and datalines - // On a data line there will only be colouring of numbers - // a keyword line is constructed as - // *word,[ paramname[=paramvalue]]* - // if the line ends with a , the keyword line continues onto the new line - - for (; sc.More(); sc.Forward()) { - switch ( state ) { - case KW_LINE_KW : - if ( sc.atLineEnd ) { - // finished the line in keyword state, switch to LINE_END - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } else if ( IsAKeywordChar(sc.ch) ) { - // nothing changes - state = KW_LINE_KW ; - } else if ( sc.ch == ',' ) { - // Well well we say a comma, arguments *MUST* follow - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = KW_LINE_COMMA ; - } else { - // Flag an error - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - // Done with processing - break ; - case KW_LINE_COMMA : - // acomma on a keywordline was seen - if ( IsAKeywordChar(sc.ch)) { - sc.SetState(SCE_ABAQUS_ARGUMENT) ; - state = KW_LINE_PAR ; - } else if ( sc.atLineEnd || (sc.ch == ',') ) { - // we remain in keyword mode - state = KW_LINE_COMMA ; - } else if ( sc.ch == ' ' ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = KW_LINE_COMMA ; - } else { - // Anything else constitutes an error - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case KW_LINE_PAR : - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } else if ( IsAKeywordChar(sc.ch) || (sc.ch == '-') ) { - // remain in this state - state = KW_LINE_PAR ; - } else if ( sc.ch == ',' ) { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = KW_LINE_COMMA ; - } else if ( sc.ch == '=' ) { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = KW_LINE_EQ ; - } else { - // Anything else constitutes an error - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case KW_LINE_EQ : - if ( sc.ch == ' ' ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - // remain in this state - state = KW_LINE_EQ ; - } else if ( IsADigit(sc.ch) || (sc.ch == '-') || (sc.ch == '.' && IsADigit(sc.chNext)) ) { - sc.SetState(SCE_ABAQUS_NUMBER) ; - state = KW_LINE_VAL ; - } else if ( IsAKeywordChar(sc.ch) ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = KW_LINE_VAL ; - } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { - sc.SetState(SCE_ABAQUS_STRING) ; - state = KW_LINE_VAL ; - } else { - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case KW_LINE_VAL : - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) { - // nothing changes - state = KW_LINE_VAL ; - } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || - ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) && - (sc.state == SCE_ABAQUS_NUMBER)) { - // remain in number mode - state = KW_LINE_VAL ; - } else if (sc.state == SCE_ABAQUS_STRING) { - // accept everything until a closing quote - if ( sc.ch == '\'' || sc.ch == '\"' ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = KW_LINE_VAL ; - } - } else if ( sc.ch == ',' ) { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = KW_LINE_COMMA ; - } else { - // anything else is an error - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case DAT_LINE_VAL : - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } else if ( IsASetChar(sc.ch) && (sc.state == SCE_ABAQUS_DEFAULT) ) { - // nothing changes - state = DAT_LINE_VAL ; - } else if (( (IsADigit(sc.ch) || sc.ch == '.' || (sc.ch == 'e' || sc.ch == 'E') || - ((sc.ch == '+' || sc.ch == '-') && (sc.chPrev == 'e' || sc.chPrev == 'E')))) && - (sc.state == SCE_ABAQUS_NUMBER)) { - // remain in number mode - state = DAT_LINE_VAL ; - } else if (sc.state == SCE_ABAQUS_STRING) { - // accept everything until a closing quote - if ( sc.ch == '\'' || sc.ch == '\"' ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = DAT_LINE_VAL ; - } - } else if ( sc.ch == ',' ) { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = DAT_LINE_COMMA ; - } else { - // anything else is an error - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case DAT_LINE_COMMA : - // a comma on a data line was seen - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } else if ( sc.ch == ' ' ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = DAT_LINE_COMMA ; - } else if (sc.ch == ',') { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = DAT_LINE_COMMA ; - } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) { - sc.SetState(SCE_ABAQUS_NUMBER) ; - state = DAT_LINE_VAL ; - } else if ( IsAKeywordChar(sc.ch) ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = DAT_LINE_VAL ; - } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { - sc.SetState(SCE_ABAQUS_STRING) ; - state = DAT_LINE_VAL ; - } else { - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - break ; - case COMMENT_LINE : - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } - break ; - case ST_ERROR : - if ( sc.atLineEnd ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = LINE_END ; - } - break ; - case LINE_END : - if ( sc.atLineEnd || sc.ch == ' ' ) { - // nothing changes - state = LINE_END ; - } else if ( sc.ch == '*' ) { - if ( sc.chNext == '*' ) { - state = COMMENT_LINE ; - sc.SetState(SCE_ABAQUS_COMMENT) ; - } else { - state = KW_LINE_KW ; - sc.SetState(SCE_ABAQUS_STARCOMMAND) ; - } - } else { - // it must be a data line, things are as if we are in DAT_LINE_COMMA - if ( sc.ch == ',' ) { - sc.SetState(SCE_ABAQUS_OPERATOR) ; - state = DAT_LINE_COMMA ; - } else if ( IsADigit(sc.ch) || (sc.ch == '-')|| (sc.ch == '.' && IsADigit(sc.chNext)) ) { - sc.SetState(SCE_ABAQUS_NUMBER) ; - state = DAT_LINE_VAL ; - } else if ( IsAKeywordChar(sc.ch) ) { - sc.SetState(SCE_ABAQUS_DEFAULT) ; - state = DAT_LINE_VAL ; - } else if ( (sc.ch == '\'') || (sc.ch == '\"') ) { - sc.SetState(SCE_ABAQUS_STRING) ; - state = DAT_LINE_VAL ; - } else { - sc.SetState(SCE_ABAQUS_PROCESSOR) ; - state = ST_ERROR ; - } - } - break ; - } - } - sc.Complete(); -} - -//------------------------------------------------------------------------------ -// This copyied and modified from LexBasic.cxx -//------------------------------------------------------------------------------ - -/* Bits: - * 1 - whitespace - * 2 - operator - * 4 - identifier - * 8 - decimal digit - * 16 - hex digit - * 32 - bin digit - */ -static int character_classification[128] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 10, 6, - 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, - 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 4, - 2, 20, 20, 20, 20, 20, 20, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 0 -}; - -static bool IsSpace(int c) { - return c < 128 && (character_classification[c] & 1); -} - -static bool IsIdentifier(int c) { - return c < 128 && (character_classification[c] & 4); -} - -static int LowerCase(int c) -{ - if (c >= 'A' && c <= 'Z') - return 'a' + c - 'A'; - return c; -} - -static Sci_Position LineEnd(Sci_Position line, Accessor &styler) -{ - const Sci_Position docLines = styler.GetLine(styler.Length() - 1); // Available last line - Sci_Position eol_pos ; - // if the line is the last line, the eol_pos is styler.Length() - // eol will contain a new line, or a virtual new line - if ( docLines == line ) - eol_pos = styler.Length() ; - else - eol_pos = styler.LineStart(line + 1) - 1; - return eol_pos ; -} - -static Sci_Position LineStart(Sci_Position line, Accessor &styler) -{ - return styler.LineStart(line) ; -} - -// LineType -// -// bits determines the line type -// 1 : data line -// 2 : only whitespace -// 3 : data line with only whitespace -// 4 : keyword line -// 5 : block open keyword line -// 6 : block close keyword line -// 7 : keyword line in error -// 8 : comment line -static int LineType(Sci_Position line, Accessor &styler) { - Sci_Position pos = LineStart(line, styler) ; - Sci_Position eol_pos = LineEnd(line, styler) ; - - int c ; - char ch = ' '; - - Sci_Position i = pos ; - while ( i < eol_pos ) { - c = styler.SafeGetCharAt(i); - ch = static_cast(LowerCase(c)); - // We can say something as soon as no whitespace - // was encountered - if ( !IsSpace(c) ) - break ; - i++ ; - } - - if ( i >= eol_pos ) { - // This is a whitespace line, currently - // classifies as data line - return 3 ; - } - - if ( ch != '*' ) { - // This is a data line - return 1 ; - } - - if ( i == eol_pos - 1 ) { - // Only a single *, error but make keyword line - return 4+3 ; - } - - // This means we can have a second character - // if that is also a * this means a comment - // otherwise it is a keyword. - c = styler.SafeGetCharAt(i+1); - ch = static_cast(LowerCase(c)); - if ( ch == '*' ) { - return 8 ; - } - - // At this point we know this is a keyword line - // the character at position i is a * - // it is not a comment line - char word[256] ; - int wlen = 0; - - word[wlen] = '*' ; - wlen++ ; - - i++ ; - while ( (i < eol_pos) && (wlen < 255) ) { - c = styler.SafeGetCharAt(i); - ch = static_cast(LowerCase(c)); - - if ( (!IsSpace(c)) && (!IsIdentifier(c)) ) - break ; - - if ( IsIdentifier(c) ) { - word[wlen] = ch ; - wlen++ ; - } - - i++ ; - } - - word[wlen] = 0 ; - - // Make a comparison - if ( !strcmp(word, "*step") || - !strcmp(word, "*part") || - !strcmp(word, "*instance") || - !strcmp(word, "*assembly")) { - return 4+1 ; - } - - if ( !strcmp(word, "*endstep") || - !strcmp(word, "*endpart") || - !strcmp(word, "*endinstance") || - !strcmp(word, "*endassembly")) { - return 4+2 ; - } - - return 4 ; -} - -static void SafeSetLevel(Sci_Position line, int level, Accessor &styler) -{ - if ( line < 0 ) - return ; - - int mask = ((~SC_FOLDLEVELHEADERFLAG) | (~SC_FOLDLEVELWHITEFLAG)); - - if ( (level & mask) < 0 ) - return ; - - if ( styler.LevelAt(line) != level ) - styler.SetLevel(line, level) ; -} - -static void FoldABAQUSDoc(Sci_PositionU startPos, Sci_Position length, int, -WordList *[], Accessor &styler) { - Sci_Position startLine = styler.GetLine(startPos) ; - Sci_Position endLine = styler.GetLine(startPos+length-1) ; - - // bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - // We want to deal with all the cases - // To know the correct indentlevel, we need to look back to the - // previous command line indentation level - // order of formatting keyline datalines commentlines - Sci_Position beginData = -1 ; - Sci_Position beginComment = -1 ; - Sci_Position prvKeyLine = startLine ; - Sci_Position prvKeyLineTp = 0 ; - - // Scan until we find the previous keyword line - // this will give us the level reference that we need - while ( prvKeyLine > 0 ) { - prvKeyLine-- ; - prvKeyLineTp = LineType(prvKeyLine, styler) ; - if ( prvKeyLineTp & 4 ) - break ; - } - - // Determine the base line level of all lines following - // the previous keyword - // new keyword lines are placed on this level - //if ( prvKeyLineTp & 4 ) { - int level = styler.LevelAt(prvKeyLine) & ~SC_FOLDLEVELHEADERFLAG ; - //} - - // uncomment line below if weird behaviour continues - prvKeyLine = -1 ; - - // Now start scanning over the lines. - for ( Sci_Position line = startLine; line <= endLine; line++ ) { - int lineType = LineType(line, styler) ; - - // Check for comment line - if ( lineType == 8 ) { - if ( beginComment < 0 ) { - beginComment = line ; - } - } - - // Check for data line - if ( (lineType == 1) || (lineType == 3) ) { - if ( beginData < 0 ) { - if ( beginComment >= 0 ) { - beginData = beginComment ; - } else { - beginData = line ; - } - } - beginComment = -1 ; - } - - // Check for keywordline. - // As soon as a keyword line is encountered, we can set the - // levels of everything from the previous keyword line to this one - if ( lineType & 4 ) { - // this is a keyword, we can now place the previous keyword - // all its data lines and the remainder - - // Write comments and data line - if ( beginComment < 0 ) { - beginComment = line ; - } - - if ( beginData < 0 ) { - beginData = beginComment ; - if ( prvKeyLineTp != 5 ) - SafeSetLevel(prvKeyLine, level, styler) ; - else - SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; - } else { - SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; - } - - int datLevel = level + 1 ; - if ( !(prvKeyLineTp & 4) ) { - datLevel = level ; - } - - for ( Sci_Position ll = beginData; ll < beginComment; ll++ ) - SafeSetLevel(ll, datLevel, styler) ; - - // The keyword we just found is going to be written at another level - // if we have a type 5 and type 6 - if ( prvKeyLineTp == 5 ) { - level += 1 ; - } - - if ( prvKeyLineTp == 6 ) { - level -= 1 ; - if ( level < 0 ) { - level = 0 ; - } - } - - for ( Sci_Position lll = beginComment; lll < line; lll++ ) - SafeSetLevel(lll, level, styler) ; - - // wrap and reset - beginComment = -1 ; - beginData = -1 ; - prvKeyLine = line ; - prvKeyLineTp = lineType ; - } - - } - - if ( beginComment < 0 ) { - beginComment = endLine + 1 ; - } else { - // We need to find out whether this comment block is followed by - // a data line or a keyword line - const Sci_Position docLines = styler.GetLine(styler.Length() - 1); - - for ( Sci_Position line = endLine + 1; line <= docLines; line++ ) { - Sci_Position lineType = LineType(line, styler) ; - - if ( lineType != 8 ) { - if ( !(lineType & 4) ) { - beginComment = endLine + 1 ; - } - break ; - } - } - } - - if ( beginData < 0 ) { - beginData = beginComment ; - if ( prvKeyLineTp != 5 ) - SafeSetLevel(prvKeyLine, level, styler) ; - else - SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; - } else { - SafeSetLevel(prvKeyLine, level | SC_FOLDLEVELHEADERFLAG, styler) ; - } - - int datLevel = level + 1 ; - if ( !(prvKeyLineTp & 4) ) { - datLevel = level ; - } - - for ( Sci_Position ll = beginData; ll < beginComment; ll++ ) - SafeSetLevel(ll, datLevel, styler) ; - - if ( prvKeyLineTp == 5 ) { - level += 1 ; - } - - if ( prvKeyLineTp == 6 ) { - level -= 1 ; - } - for ( Sci_Position m = beginComment; m <= endLine; m++ ) - SafeSetLevel(m, level, styler) ; -} - -static const char * const abaqusWordListDesc[] = { - "processors", - "commands", - "slashommands", - "starcommands", - "arguments", - "functions", - 0 -}; - -LexerModule lmAbaqus(SCLEX_ABAQUS, ColouriseABAQUSDoc, "abaqus", FoldABAQUSDoc, abaqusWordListDesc); diff --git a/scintilla/lexers/LexAda.cxx b/scintilla/lexers/LexAda.cxx deleted file mode 100644 index 853e785c..00000000 --- a/scintilla/lexers/LexAda.cxx +++ /dev/null @@ -1,515 +0,0 @@ -// Scintilla source code edit control -/** @file LexAda.cxx - ** Lexer for Ada 95 - **/ -// Copyright 2002 by Sergey Koshcheyev -// The License.txt file describes the conditions under which this software may be distributed. - -#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" - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - -/* - * Interface - */ - -static void ColouriseDocument( - Sci_PositionU startPos, - Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler); - -static const char * const adaWordListDesc[] = { - "Keywords", - 0 -}; - -LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc); - -/* - * Implementation - */ - -// Functions that have apostropheStartsAttribute as a parameter set it according to whether -// an apostrophe encountered after processing the current token will start an attribute or -// a character literal. -static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseComment(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL); -static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); -static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseWhiteSpace(StyleContext& sc, bool& apostropheStartsAttribute); -static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute); - -static inline bool IsDelimiterCharacter(int ch); -static inline bool IsSeparatorOrDelimiterCharacter(int ch); -static bool IsValidIdentifier(const std::string& identifier); -static bool IsValidNumber(const std::string& number); -static inline bool IsWordStartCharacter(int ch); -static inline bool IsWordCharacter(int ch); - -static void ColouriseCharacter(StyleContext& sc, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = true; - - sc.SetState(SCE_ADA_CHARACTER); - - // Skip the apostrophe and one more character (so that '' is shown as non-terminated and ''' - // is handled correctly) - sc.Forward(); - sc.Forward(); - - ColouriseContext(sc, '\'', SCE_ADA_CHARACTEREOL); -} - -static void ColouriseContext(StyleContext& sc, char chEnd, int stateEOL) { - while (!sc.atLineEnd && !sc.Match(chEnd)) { - sc.Forward(); - } - - if (!sc.atLineEnd) { - sc.ForwardSetState(SCE_ADA_DEFAULT); - } else { - sc.ChangeState(stateEOL); - } -} - -static void ColouriseComment(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { - // Apostrophe meaning is not changed, but the parameter is present for uniformity - - sc.SetState(SCE_ADA_COMMENTLINE); - - while (!sc.atLineEnd) { - sc.Forward(); - } -} - -static void ColouriseDelimiter(StyleContext& sc, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = sc.Match (')'); - sc.SetState(SCE_ADA_DELIMITER); - sc.ForwardSetState(SCE_ADA_DEFAULT); -} - -static void ColouriseLabel(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = false; - - sc.SetState(SCE_ADA_LABEL); - - // Skip "<<" - sc.Forward(); - sc.Forward(); - - std::string identifier; - - while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { - identifier += static_cast(tolower(sc.ch)); - sc.Forward(); - } - - // Skip ">>" - if (sc.Match('>', '>')) { - sc.Forward(); - sc.Forward(); - } else { - sc.ChangeState(SCE_ADA_ILLEGAL); - } - - // If the name is an invalid identifier or a keyword, then make it invalid label - if (!IsValidIdentifier(identifier) || keywords.InList(identifier.c_str())) { - sc.ChangeState(SCE_ADA_ILLEGAL); - } - - sc.SetState(SCE_ADA_DEFAULT); - -} - -static void ColouriseNumber(StyleContext& sc, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = true; - - std::string number; - sc.SetState(SCE_ADA_NUMBER); - - // Get all characters up to a delimiter or a separator, including points, but excluding - // double points (ranges). - while (!IsSeparatorOrDelimiterCharacter(sc.ch) || (sc.ch == '.' && sc.chNext != '.')) { - number += static_cast(sc.ch); - sc.Forward(); - } - - // Special case: exponent with sign - if ((sc.chPrev == 'e' || sc.chPrev == 'E') && - (sc.ch == '+' || sc.ch == '-')) { - number += static_cast(sc.ch); - sc.Forward (); - - while (!IsSeparatorOrDelimiterCharacter(sc.ch)) { - number += static_cast(sc.ch); - sc.Forward(); - } - } - - if (!IsValidNumber(number)) { - sc.ChangeState(SCE_ADA_ILLEGAL); - } - - sc.SetState(SCE_ADA_DEFAULT); -} - -static void ColouriseString(StyleContext& sc, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = true; - - sc.SetState(SCE_ADA_STRING); - sc.Forward(); - - ColouriseContext(sc, '"', SCE_ADA_STRINGEOL); -} - -static void ColouriseWhiteSpace(StyleContext& sc, bool& /*apostropheStartsAttribute*/) { - // Apostrophe meaning is not changed, but the parameter is present for uniformity - sc.SetState(SCE_ADA_DEFAULT); - sc.ForwardSetState(SCE_ADA_DEFAULT); -} - -static void ColouriseWord(StyleContext& sc, WordList& keywords, bool& apostropheStartsAttribute) { - apostropheStartsAttribute = true; - sc.SetState(SCE_ADA_IDENTIFIER); - - std::string word; - - while (!sc.atLineEnd && !IsSeparatorOrDelimiterCharacter(sc.ch)) { - word += static_cast(tolower(sc.ch)); - sc.Forward(); - } - - if (!IsValidIdentifier(word)) { - sc.ChangeState(SCE_ADA_ILLEGAL); - - } else if (keywords.InList(word.c_str())) { - sc.ChangeState(SCE_ADA_WORD); - - if (word != "all") { - apostropheStartsAttribute = false; - } - } - - sc.SetState(SCE_ADA_DEFAULT); -} - -// -// ColouriseDocument -// - -static void ColouriseDocument( - Sci_PositionU startPos, - Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler) { - WordList &keywords = *keywordlists[0]; - - StyleContext sc(startPos, length, initStyle, styler); - - Sci_Position lineCurrent = styler.GetLine(startPos); - bool apostropheStartsAttribute = (styler.GetLineState(lineCurrent) & 1) != 0; - - while (sc.More()) { - if (sc.atLineEnd) { - // Go to the next line - sc.Forward(); - lineCurrent++; - - // Remember the line state for future incremental lexing - styler.SetLineState(lineCurrent, apostropheStartsAttribute); - - // Don't continue any styles on the next line - sc.SetState(SCE_ADA_DEFAULT); - } - - // Comments - if (sc.Match('-', '-')) { - ColouriseComment(sc, apostropheStartsAttribute); - - // Strings - } else if (sc.Match('"')) { - ColouriseString(sc, apostropheStartsAttribute); - - // Characters - } else if (sc.Match('\'') && !apostropheStartsAttribute) { - ColouriseCharacter(sc, apostropheStartsAttribute); - - // Labels - } else if (sc.Match('<', '<')) { - ColouriseLabel(sc, keywords, apostropheStartsAttribute); - - // Whitespace - } else if (IsASpace(sc.ch)) { - ColouriseWhiteSpace(sc, apostropheStartsAttribute); - - // Delimiters - } else if (IsDelimiterCharacter(sc.ch)) { - ColouriseDelimiter(sc, apostropheStartsAttribute); - - // Numbers - } else if (IsADigit(sc.ch) || sc.ch == '#') { - ColouriseNumber(sc, apostropheStartsAttribute); - - // Keywords or identifiers - } else { - ColouriseWord(sc, keywords, apostropheStartsAttribute); - } - } - - sc.Complete(); -} - -static inline bool IsDelimiterCharacter(int ch) { - switch (ch) { - case '&': - case '\'': - case '(': - case ')': - case '*': - case '+': - case ',': - case '-': - case '.': - case '/': - case ':': - case ';': - case '<': - case '=': - case '>': - case '|': - return true; - default: - return false; - } -} - -static inline bool IsSeparatorOrDelimiterCharacter(int ch) { - return IsASpace(ch) || IsDelimiterCharacter(ch); -} - -static bool IsValidIdentifier(const std::string& identifier) { - // First character can't be '_', so initialize the flag to true - bool lastWasUnderscore = true; - - size_t length = identifier.length(); - - // Zero-length identifiers are not valid (these can occur inside labels) - if (length == 0) { - return false; - } - - // Check for valid character at the start - if (!IsWordStartCharacter(identifier[0])) { - return false; - } - - // Check for only valid characters and no double underscores - for (size_t i = 0; i < length; i++) { - if (!IsWordCharacter(identifier[i]) || - (identifier[i] == '_' && lastWasUnderscore)) { - return false; - } - lastWasUnderscore = identifier[i] == '_'; - } - - // Check for underscore at the end - if (lastWasUnderscore == true) { - return false; - } - - // All checks passed - return true; -} - -static bool IsValidNumber(const std::string& number) { - size_t hashPos = number.find("#"); - bool seenDot = false; - - size_t i = 0; - size_t length = number.length(); - - if (length == 0) - return false; // Just in case - - // Decimal number - if (hashPos == std::string::npos) { - bool canBeSpecial = false; - - for (; i < length; i++) { - if (number[i] == '_') { - if (!canBeSpecial) { - return false; - } - canBeSpecial = false; - } else if (number[i] == '.') { - if (!canBeSpecial || seenDot) { - return false; - } - canBeSpecial = false; - seenDot = true; - } else if (IsADigit(number[i])) { - canBeSpecial = true; - } else { - break; - } - } - - if (!canBeSpecial) - return false; - } else { - // Based number - bool canBeSpecial = false; - int base = 0; - - // Parse base - for (; i < length; i++) { - int ch = number[i]; - if (ch == '_') { - if (!canBeSpecial) - return false; - canBeSpecial = false; - } else if (IsADigit(ch)) { - base = base * 10 + (ch - '0'); - if (base > 16) - return false; - canBeSpecial = true; - } else if (ch == '#' && canBeSpecial) { - break; - } else { - return false; - } - } - - if (base < 2) - return false; - if (i == length) - return false; - - i++; // Skip over '#' - - // Parse number - canBeSpecial = false; - - for (; i < length; i++) { - int ch = tolower(number[i]); - - if (ch == '_') { - if (!canBeSpecial) { - return false; - } - canBeSpecial = false; - - } else if (ch == '.') { - if (!canBeSpecial || seenDot) { - return false; - } - canBeSpecial = false; - seenDot = true; - - } else if (IsADigit(ch)) { - if (ch - '0' >= base) { - return false; - } - canBeSpecial = true; - - } else if (ch >= 'a' && ch <= 'f') { - if (ch - 'a' + 10 >= base) { - return false; - } - canBeSpecial = true; - - } else if (ch == '#' && canBeSpecial) { - break; - - } else { - return false; - } - } - - if (i == length) { - return false; - } - - i++; - } - - // Exponent (optional) - if (i < length) { - if (number[i] != 'e' && number[i] != 'E') - return false; - - i++; // Move past 'E' - - if (i == length) { - return false; - } - - if (number[i] == '+') - i++; - else if (number[i] == '-') { - if (seenDot) { - i++; - } else { - return false; // Integer literals should not have negative exponents - } - } - - if (i == length) { - return false; - } - - bool canBeSpecial = false; - - for (; i < length; i++) { - if (number[i] == '_') { - if (!canBeSpecial) { - return false; - } - canBeSpecial = false; - } else if (IsADigit(number[i])) { - canBeSpecial = true; - } else { - return false; - } - } - - if (!canBeSpecial) - return false; - } - - // if i == length, number was parsed successfully. - return i == length; -} - -static inline bool IsWordCharacter(int ch) { - return IsWordStartCharacter(ch) || IsADigit(ch); -} - -static inline bool IsWordStartCharacter(int ch) { - return (IsASCII(ch) && isalpha(ch)) || ch == '_'; -} diff --git a/scintilla/lexers/LexAsm.cxx b/scintilla/lexers/LexAsm.cxx deleted file mode 100644 index 6b61fc3d..00000000 --- a/scintilla/lexers/LexAsm.cxx +++ /dev/null @@ -1,467 +0,0 @@ -// Scintilla source code edit control -/** @file LexAsm.cxx - ** Lexer for Assembler, just for the MASM syntax - ** Written by The Black Horus - ** Enhancements and NASM stuff by Kein-Hong Man, 2003-10 - ** SCE_ASM_COMMENTBLOCK and SCE_ASM_CHARACTER are for future GNU as colouring - ** Converted to lexer object and added further folding features/properties by "Udo Lechner" - **/ -// Copyright 1998-2003 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 "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 - -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 == '.' || - ch == '%' || ch == '@' || ch == '$' || ch == '?'); -} - -static inline bool IsAsmOperator(const int ch) { - if ((ch < 0x80) && (isalnum(ch))) - return false; - // '.' left out as it is used to make up numbers - if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || - ch == '(' || ch == ')' || ch == '=' || ch == '^' || - ch == '[' || ch == ']' || ch == '<' || ch == '&' || - ch == '>' || ch == ',' || ch == '|' || ch == '~' || - ch == '%' || ch == ':') - return true; - return false; -} - -static bool IsStreamCommentStyle(int style) { - return style == SCE_ASM_COMMENTDIRECTIVE || style == SCE_ASM_COMMENTBLOCK; -} - -static inline int LowerCase(int c) { - if (c >= 'A' && c <= 'Z') - return 'a' + c - 'A'; - return c; -} - -// An individual named option for use in an OptionSet - -// Options used for LexerAsm -struct OptionsAsm { - std::string delimiter; - bool fold; - bool foldSyntaxBased; - bool foldCommentMultiline; - bool foldCommentExplicit; - std::string foldExplicitStart; - std::string foldExplicitEnd; - bool foldExplicitAnywhere; - bool foldCompact; - OptionsAsm() { - delimiter = ""; - fold = false; - foldSyntaxBased = true; - foldCommentMultiline = false; - foldCommentExplicit = false; - foldExplicitStart = ""; - foldExplicitEnd = ""; - foldExplicitAnywhere = false; - foldCompact = true; - } -}; - -static const char * const asmWordListDesc[] = { - "CPU instructions", - "FPU instructions", - "Registers", - "Directives", - "Directive operands", - "Extended instructions", - "Directives4Foldstart", - "Directives4Foldend", - 0 -}; - -struct OptionSetAsm : public OptionSet { - OptionSetAsm() { - DefineProperty("lexer.asm.comment.delimiter", &OptionsAsm::delimiter, - "Character used for COMMENT directive's delimiter, replacing the standard \"~\"."); - - DefineProperty("fold", &OptionsAsm::fold); - - DefineProperty("fold.asm.syntax.based", &OptionsAsm::foldSyntaxBased, - "Set this property to 0 to disable syntax based folding."); - - DefineProperty("fold.asm.comment.multiline", &OptionsAsm::foldCommentMultiline, - "Set this property to 1 to enable folding multi-line comments."); - - DefineProperty("fold.asm.comment.explicit", &OptionsAsm::foldCommentExplicit, - "This option enables folding explicit fold points when using the Asm 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.asm.explicit.start", &OptionsAsm::foldExplicitStart, - "The string to use for explicit fold start points, replacing the standard ;{."); - - DefineProperty("fold.asm.explicit.end", &OptionsAsm::foldExplicitEnd, - "The string to use for explicit fold end points, replacing the standard ;}."); - - DefineProperty("fold.asm.explicit.anywhere", &OptionsAsm::foldExplicitAnywhere, - "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); - - DefineProperty("fold.compact", &OptionsAsm::foldCompact); - - DefineWordListSets(asmWordListDesc); - } -}; - -class LexerAsm : public ILexer { - WordList cpuInstruction; - WordList mathInstruction; - WordList registers; - WordList directive; - WordList directiveOperand; - WordList extInstruction; - WordList directives4foldstart; - WordList directives4foldend; - OptionsAsm options; - OptionSetAsm osAsm; - int commentChar; -public: - LexerAsm(int commentChar_) { - commentChar = commentChar_; - } - virtual ~LexerAsm() { - } - void SCI_METHOD Release() { - delete this; - } - int SCI_METHOD Version() const { - return lvOriginal; - } - const char * SCI_METHOD PropertyNames() { - return osAsm.PropertyNames(); - } - int SCI_METHOD PropertyType(const char *name) { - return osAsm.PropertyType(name); - } - const char * SCI_METHOD DescribeProperty(const char *name) { - return osAsm.DescribeProperty(name); - } - Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); - const char * SCI_METHOD DescribeWordListSets() { - return osAsm.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 *LexerFactoryAsm() { - return new LexerAsm(';'); - } - - static ILexer *LexerFactoryAs() { - return new LexerAsm('#'); - } -}; - -Sci_Position SCI_METHOD LexerAsm::PropertySet(const char *key, const char *val) { - if (osAsm.PropertySet(&options, key, val)) { - return 0; - } - return -1; -} - -Sci_Position SCI_METHOD LexerAsm::WordListSet(int n, const char *wl) { - WordList *wordListN = 0; - switch (n) { - case 0: - wordListN = &cpuInstruction; - break; - case 1: - wordListN = &mathInstruction; - break; - case 2: - wordListN = ®isters; - break; - case 3: - wordListN = &directive; - break; - case 4: - wordListN = &directiveOperand; - break; - case 5: - wordListN = &extInstruction; - break; - case 6: - wordListN = &directives4foldstart; - break; - case 7: - wordListN = &directives4foldend; - 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 LexerAsm::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - LexAccessor styler(pAccess); - - // Do not leak onto next line - if (initStyle == SCE_ASM_STRINGEOL) - initStyle = SCE_ASM_DEFAULT; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) - { - - // Prevent SCE_ASM_STRINGEOL from leaking back to previous line - if (sc.atLineStart && (sc.state == SCE_ASM_STRING)) { - sc.SetState(SCE_ASM_STRING); - } else if (sc.atLineStart && (sc.state == SCE_ASM_CHARACTER)) { - sc.SetState(SCE_ASM_CHARACTER); - } - - // 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_ASM_OPERATOR) { - if (!IsAsmOperator(sc.ch)) { - sc.SetState(SCE_ASM_DEFAULT); - } - } else if (sc.state == SCE_ASM_NUMBER) { - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_ASM_DEFAULT); - } - } else if (sc.state == SCE_ASM_IDENTIFIER) { - if (!IsAWordChar(sc.ch) ) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - bool IsDirective = false; - - if (cpuInstruction.InList(s)) { - sc.ChangeState(SCE_ASM_CPUINSTRUCTION); - } else if (mathInstruction.InList(s)) { - sc.ChangeState(SCE_ASM_MATHINSTRUCTION); - } else if (registers.InList(s)) { - sc.ChangeState(SCE_ASM_REGISTER); - } else if (directive.InList(s)) { - sc.ChangeState(SCE_ASM_DIRECTIVE); - IsDirective = true; - } else if (directiveOperand.InList(s)) { - sc.ChangeState(SCE_ASM_DIRECTIVEOPERAND); - } else if (extInstruction.InList(s)) { - sc.ChangeState(SCE_ASM_EXTINSTRUCTION); - } - sc.SetState(SCE_ASM_DEFAULT); - if (IsDirective && !strcmp(s, "comment")) { - char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0]; - while (IsASpaceOrTab(sc.ch) && !sc.atLineEnd) { - sc.ForwardSetState(SCE_ASM_DEFAULT); - } - if (sc.ch == delimiter) { - sc.SetState(SCE_ASM_COMMENTDIRECTIVE); - } - } - } - } else if (sc.state == SCE_ASM_COMMENTDIRECTIVE) { - char delimiter = options.delimiter.empty() ? '~' : options.delimiter.c_str()[0]; - if (sc.ch == delimiter) { - while (!sc.atLineEnd) { - sc.Forward(); - } - sc.SetState(SCE_ASM_DEFAULT); - } - } else if (sc.state == SCE_ASM_COMMENT ) { - if (sc.atLineEnd) { - sc.SetState(SCE_ASM_DEFAULT); - } - } else if (sc.state == SCE_ASM_STRING) { - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_ASM_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_ASM_STRINGEOL); - sc.ForwardSetState(SCE_ASM_DEFAULT); - } - } else if (sc.state == SCE_ASM_CHARACTER) { - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\'') { - sc.ForwardSetState(SCE_ASM_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_ASM_STRINGEOL); - sc.ForwardSetState(SCE_ASM_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_ASM_DEFAULT) { - if (sc.ch == commentChar){ - sc.SetState(SCE_ASM_COMMENT); - } else if (IsASCII(sc.ch) && (isdigit(sc.ch) || (sc.ch == '.' && IsASCII(sc.chNext) && isdigit(sc.chNext)))) { - sc.SetState(SCE_ASM_NUMBER); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_ASM_IDENTIFIER); - } else if (sc.ch == '\"') { - sc.SetState(SCE_ASM_STRING); - } else if (sc.ch == '\'') { - sc.SetState(SCE_ASM_CHARACTER); - } else if (IsAsmOperator(sc.ch)) { - sc.SetState(SCE_ASM_OPERATOR); - } - } - - } - 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 LexerAsm::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); - int levelCurrent = SC_FOLDLEVELBASE; - if (lineCurrent > 0) - levelCurrent = styler.LevelAt(lineCurrent-1) >> 16; - int levelNext = levelCurrent; - char chNext = styler[startPos]; - int styleNext = styler.StyleAt(startPos); - int style = initStyle; - char word[100]; - int wordlen = 0; - 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 = styler.StyleAt(i + 1); - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (options.foldCommentMultiline && 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.foldCommentExplicit && ((style == SCE_ASM_COMMENT) || 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 == ';') { - if (chNext == '{') { - levelNext++; - } else if (chNext == '}') { - levelNext--; - } - } - } - } - if (options.foldSyntaxBased && (style == SCE_ASM_DIRECTIVE)) { - word[wordlen++] = static_cast(LowerCase(ch)); - if (wordlen == 100) { // prevent overflow - word[0] = '\0'; - wordlen = 1; - } - if (styleNext != SCE_ASM_DIRECTIVE) { // reading directive ready - word[wordlen] = '\0'; - wordlen = 0; - if (directives4foldstart.InList(word)) { - levelNext++; - } else if (directives4foldend.InList(word)){ - levelNext--; - } - } - } - if (!IsASpace(ch)) - visibleChars++; - if (atEOL || (i == endPos-1)) { - int levelUse = levelCurrent; - 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++; - levelCurrent = levelNext; - 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; - } - } -} - -LexerModule lmAsm(SCLEX_ASM, LexerAsm::LexerFactoryAsm, "asm", asmWordListDesc); -LexerModule lmAs(SCLEX_AS, LexerAsm::LexerFactoryAs, "as", asmWordListDesc); - diff --git a/scintilla/lexers/LexAsn1.cxx b/scintilla/lexers/LexAsn1.cxx deleted file mode 100644 index 8695cd33..00000000 --- a/scintilla/lexers/LexAsn1.cxx +++ /dev/null @@ -1,188 +0,0 @@ -// Scintilla source code edit control -/** @file LexAsn1.cxx - ** Lexer for ASN.1 - **/ -// Copyright 2004 by Herr Pfarrer rpfarrer yahoo de -// Last Updated: 20/07/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 - -// Some char test functions -static bool isAsn1Number(int ch) -{ - return (ch >= '0' && ch <= '9'); -} - -static bool isAsn1Letter(int ch) -{ - return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); -} - -static bool isAsn1Char(int ch) -{ - return (ch == '-' ) || isAsn1Number(ch) || isAsn1Letter (ch); -} - -// -// Function determining the color of a given code portion -// Based on a "state" -// -static void ColouriseAsn1Doc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordLists[], Accessor &styler) -{ - // The keywords - WordList &Keywords = *keywordLists[0]; - WordList &Attributes = *keywordLists[1]; - WordList &Descriptors = *keywordLists[2]; - WordList &Types = *keywordLists[3]; - - // Parse the whole buffer character by character using StyleContext - StyleContext sc(startPos, length, initStyle, styler); - for (; sc.More(); sc.Forward()) - { - // The state engine - switch (sc.state) - { - case SCE_ASN1_DEFAULT: // Plain characters -asn1_default: - if (sc.ch == '-' && sc.chNext == '-') - // A comment begins here - sc.SetState(SCE_ASN1_COMMENT); - else if (sc.ch == '"') - // A string begins here - sc.SetState(SCE_ASN1_STRING); - else if (isAsn1Number (sc.ch)) - // A number starts here (identifier should start with a letter in ASN.1) - sc.SetState(SCE_ASN1_SCALAR); - else if (isAsn1Char (sc.ch)) - // An identifier starts here (identifier always start with a letter) - sc.SetState(SCE_ASN1_IDENTIFIER); - else if (sc.ch == ':') - // A ::= operator starts here - sc.SetState(SCE_ASN1_OPERATOR); - break; - case SCE_ASN1_COMMENT: // A comment - if (sc.ch == '\r' || sc.ch == '\n') - // A comment ends here - sc.SetState(SCE_ASN1_DEFAULT); - break; - case SCE_ASN1_IDENTIFIER: // An identifier (keyword, attribute, descriptor or type) - if (!isAsn1Char (sc.ch)) - { - // The end of identifier is here: we can look for it in lists by now and change its state - char s[100]; - sc.GetCurrent(s, sizeof(s)); - if (Keywords.InList(s)) - // It's a keyword, change its state - sc.ChangeState(SCE_ASN1_KEYWORD); - else if (Attributes.InList(s)) - // It's an attribute, change its state - sc.ChangeState(SCE_ASN1_ATTRIBUTE); - else if (Descriptors.InList(s)) - // It's a descriptor, change its state - sc.ChangeState(SCE_ASN1_DESCRIPTOR); - else if (Types.InList(s)) - // It's a type, change its state - sc.ChangeState(SCE_ASN1_TYPE); - - // Set to default now - sc.SetState(SCE_ASN1_DEFAULT); - } - break; - case SCE_ASN1_STRING: // A string delimited by "" - if (sc.ch == '"') - { - // A string ends here - sc.ForwardSetState(SCE_ASN1_DEFAULT); - - // To correctly manage a char sticking to the string quote - goto asn1_default; - } - break; - case SCE_ASN1_SCALAR: // A plain number - if (!isAsn1Number (sc.ch)) - // A number ends here - sc.SetState(SCE_ASN1_DEFAULT); - break; - case SCE_ASN1_OPERATOR: // The affectation operator ::= and wath follows (eg: ::= { org 6 } OID or ::= 12 trap) - if (sc.ch == '{') - { - // An OID definition starts here: enter the sub loop - for (; sc.More(); sc.Forward()) - { - if (isAsn1Number (sc.ch) && (!isAsn1Char (sc.chPrev) || isAsn1Number (sc.chPrev))) - // The OID number is highlighted - sc.SetState(SCE_ASN1_OID); - else if (isAsn1Char (sc.ch)) - // The OID parent identifier is plain - sc.SetState(SCE_ASN1_IDENTIFIER); - else - sc.SetState(SCE_ASN1_DEFAULT); - - if (sc.ch == '}') - // Here ends the OID and the operator sub loop: go back to main loop - break; - } - } - else if (isAsn1Number (sc.ch)) - { - // A trap number definition starts here: enter the sub loop - for (; sc.More(); sc.Forward()) - { - if (isAsn1Number (sc.ch)) - // The trap number is highlighted - sc.SetState(SCE_ASN1_OID); - else - { - // The number ends here: go back to main loop - sc.SetState(SCE_ASN1_DEFAULT); - break; - } - } - } - else if (sc.ch != ':' && sc.ch != '=' && sc.ch != ' ') - // The operator doesn't imply an OID definition nor a trap, back to main loop - goto asn1_default; // To be sure to handle actually the state change - break; - } - } - sc.Complete(); -} - -static void FoldAsn1Doc(Sci_PositionU, Sci_Position, int, WordList *[], Accessor &styler) -{ - // No folding enabled, no reason to continue... - if( styler.GetPropertyInt("fold") == 0 ) - return; - - // No folding implemented: doesn't make sense for ASN.1 -} - -static const char * const asn1WordLists[] = { - "Keywords", - "Attributes", - "Descriptors", - "Types", - 0, }; - - -LexerModule lmAsn1(SCLEX_ASN1, ColouriseAsn1Doc, "asn1", FoldAsn1Doc, asn1WordLists); diff --git a/scintilla/lexers/LexBaan.cxx b/scintilla/lexers/LexBaan.cxx deleted file mode 100644 index 15353afa..00000000 --- a/scintilla/lexers/LexBaan.cxx +++ /dev/null @@ -1,714 +0,0 @@ -// Scintilla source code edit control -/** @file LexBaan.cxx -** Lexer for Baan. -** Based heavily on LexCPP.cxx -**/ -// Copyright 2001- by Vamsi Potluru & Praveen Ambekar -// The License.txt file describes the conditions under which this software may be distributed. - -// C standard library -#include -#include - -// C++ wrappers of C standard library -#include - -// C++ standard library -#include -#include - -// Scintilla headers - -// Non-platform-specific headers - -// include -#include "ILexer.h" -#include "Scintilla.h" -#include "SciLexer.h" - -// lexlib -#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 - -namespace { - // Use an unnamed namespace to protect the functions and classes from name conflicts - -// Options used for LexerBaan -struct OptionsBaan { - bool fold; - bool foldComment; - bool foldPreprocessor; - bool foldCompact; - bool baanFoldSyntaxBased; - bool baanFoldKeywordsBased; - bool baanStylingWithinPreprocessor; - OptionsBaan() { - fold = false; - foldComment = false; - foldPreprocessor = false; - foldCompact = false; - baanFoldSyntaxBased = false; - baanFoldKeywordsBased = false; - baanStylingWithinPreprocessor = false; - } -}; - -const char *const baanWordLists[] = { - "Baan & BaanSQL Reserved Keywords ", - "Baan Standard functions", - "Baan Functions Abridged", - "Baan Main Sections ", - "Baan Sub Sections", - "PreDefined Variables", - "PreDefined Attributes", - "Enumerates", - 0, -}; - -struct OptionSetBaan : public OptionSet { - OptionSetBaan() { - DefineProperty("fold", &OptionsBaan::fold); - - DefineProperty("fold.comment", &OptionsBaan::foldComment); - - DefineProperty("fold.preprocessor", &OptionsBaan::foldPreprocessor); - - DefineProperty("fold.compact", &OptionsBaan::foldCompact); - - DefineProperty("fold.baan.syntax.based", &OptionsBaan::baanFoldSyntaxBased, - "Set this property to 0 to disable syntax based folding, which is folding based on '{' & '('."); - - DefineProperty("fold.baan.keywords.based", &OptionsBaan::baanFoldKeywordsBased, - "Set this property to 0 to disable keywords based folding, which is folding based on " - " for, if, on (case), repeat, select, while and fold ends based on endfor, endif, endcase, until, endselect, endwhile respectively."); - - DefineProperty("lexer.baan.styling.within.preprocessor", &OptionsBaan::baanStylingWithinPreprocessor, - "For Baan 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)."); - - DefineWordListSets(baanWordLists); - } -}; - -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 == '_'); -} - -static inline bool IsAnOperator(int ch) { - if (IsAlphaNumeric(ch)) - return false; - if (ch == '#' || ch == '^' || ch == '&' || ch == '*' || - ch == '(' || ch == ')' || ch == '-' || ch == '+' || - ch == '=' || ch == '|' || ch == '{' || ch == '}' || - ch == '[' || ch == ']' || ch == ':' || ch == ';' || - ch == '<' || ch == '>' || ch == ',' || ch == '/' || - ch == '?' || ch == '!' || ch == '"' || ch == '~' || - ch == '\\') - return true; - return false; -} - -static inline int IsAnyOtherIdentifier(char *s, int sLength) { - - /* IsAnyOtherIdentifier uses standard templates used in baan. - The matching template is shown as comments just above the return condition. - ^ - refers to any character [a-z]. - # - refers to any number [0-9]. - Other characters shown are compared as is. - Tried implementing with Regex... it was too complicated for me. - Any other implementation suggestion welcome. - */ - switch (sLength) { - case 8: - if (isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - //^^^^^### - return(SCE_BAAN_TABLEDEF); - } - break; - case 9: - if (s[0] == 't' && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && isalpha(s[5]) && IsADigit(s[6]) && IsADigit(s[7]) && IsADigit(s[8])) { - //t^^^^^### - return(SCE_BAAN_TABLEDEF); - } - else if (s[8] == '.' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - //^^^^^###. - return(SCE_BAAN_TABLESQL); - } - break; - case 13: - if (s[8] == '.' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - //^^^^^###.**** - return(SCE_BAAN_TABLESQL); - } - else if (s[0] == 'r' && s[1] == 'c' && s[2] == 'd' && s[3] == '.' && s[4] == 't' && isalpha(s[5]) && isalpha(s[6]) && isalpha(s[7]) && isalpha(s[8]) && isalpha(s[9]) && IsADigit(s[10]) && IsADigit(s[11]) && IsADigit(s[12])) { - //rcd.t^^^^^### - return(SCE_BAAN_TABLEDEF); - } - break; - case 14: - case 15: - if (s[8] == '.' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - if (s[13] != ':') { - //^^^^^###.****** - return(SCE_BAAN_TABLESQL); - } - } - break; - case 16: - case 17: - if (s[8] == '.' && s[9] == '_' && s[10] == 'i' && s[11] == 'n' && s[12] == 'd' && s[13] == 'e' && s[14] == 'x' && IsADigit(s[15]) && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - //^^^^^###._index## - return(SCE_BAAN_TABLEDEF); - } - else if (s[8] == '.' && s[9] == '_' && s[10] == 'c' && s[11] == 'o' && s[12] == 'm' && s[13] == 'p' && s[14] == 'n' && s[15] == 'r' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[5]) && IsADigit(s[6]) && IsADigit(s[7])) { - //^^^^^###._compnr - return(SCE_BAAN_TABLEDEF); - } - break; - default: - break; - } - if (sLength > 14 && s[5] == '.' && s[6] == 'd' && s[7] == 'l' && s[8] == 'l' && s[13] == '.' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && IsADigit(s[9]) && IsADigit(s[10]) && IsADigit(s[11]) && IsADigit(s[12])) { - //^^^^^.dll####. - return(SCE_BAAN_FUNCTION); - } - else if (sLength > 15 && s[2] == 'i' && s[3] == 'n' && s[4] == 't' && s[5] == '.' && s[6] == 'd' && s[7] == 'l' && s[8] == 'l' && isalpha(s[0]) && isalpha(s[1]) && isalpha(s[9]) && isalpha(s[10]) && isalpha(s[11]) && isalpha(s[12]) && isalpha(s[13])) { - //^^int.dll^^^^^. - return(SCE_BAAN_FUNCTION); - } - else if (sLength > 11 && s[0] == 'i' && s[10] == '.' && isalpha(s[1]) && isalpha(s[2]) && isalpha(s[3]) && isalpha(s[4]) && isalpha(s[5]) && IsADigit(s[6]) && IsADigit(s[7]) && IsADigit(s[8]) && IsADigit(s[9])) { - //i^^^^^####. - return(SCE_BAAN_FUNCTION); - } - - return(SCE_BAAN_DEFAULT); -} - -static inline bool IsCommentLine(Sci_Position line, IDocument *pAccess) { - LexAccessor styler(pAccess); - 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 inline bool IsPreProcLine(Sci_Position line, IDocument *pAccess) { - LexAccessor styler(pAccess); - 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 == '#' || ch == '|' || ch == '^') - return true; - else if (ch != ' ' && ch != '\t') - return false; - } - return false; -} - -static inline int ToLowerCase(int c) { - if (c >= 'A' && c <= 'Z') - return 'a' + c - 'A'; - return c; -} - -static inline bool wordInArray(const std::string& value, std::string *array, int length) -{ - for (int i = 0; i < length; i++) - { - if (value == array[i]) - { - return true; - } - } - - return false; -} - -class WordListAbridged : public WordList { -public: - WordListAbridged() { - kwAbridged = false; - kwHasSection = false; - }; - ~WordListAbridged() { - Clear(); - }; - bool kwAbridged; - bool kwHasSection; - bool Contains(const char *s) { - return kwAbridged ? InListAbridged(s, '~') : InList(s); - }; -}; - -} - -class LexerBaan : public ILexer { - WordListAbridged keywords; - WordListAbridged keywords2; - WordListAbridged keywords3; - WordListAbridged keywords4; - WordListAbridged keywords5; - WordListAbridged keywords6; - WordListAbridged keywords7; - WordListAbridged keywords8; - WordListAbridged keywords9; - OptionsBaan options; - OptionSetBaan osBaan; -public: - LexerBaan() { - } - - virtual ~LexerBaan() { - } - - int SCI_METHOD Version() const { - return lvOriginal; - } - - void SCI_METHOD Release() { - delete this; - } - - const char * SCI_METHOD PropertyNames() { - return osBaan.PropertyNames(); - } - - int SCI_METHOD PropertyType(const char * name) { - return osBaan.PropertyType(name); - } - - const char * SCI_METHOD DescribeProperty(const char * name) { - return osBaan.DescribeProperty(name); - } - - int SCI_METHOD PropertySet(const char *key, const char *val); - - const char * SCI_METHOD DescribeWordListSets() { - return osBaan.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 NULL; - } - - static ILexer * LexerFactoryBaan() { - return new LexerBaan(); - } -}; - -Sci_Position SCI_METHOD LexerBaan::PropertySet(const char *key, const char *val) { - if (osBaan.PropertySet(&options, key, val)) { - return 0; - } - return -1; -} - -Sci_Position SCI_METHOD LexerBaan::WordListSet(int n, const char *wl) { - WordListAbridged *WordListAbridgedN = 0; - switch (n) { - case 0: - WordListAbridgedN = &keywords; - break; - case 1: - WordListAbridgedN = &keywords2; - break; - case 2: - WordListAbridgedN = &keywords3; - break; - case 3: - WordListAbridgedN = &keywords4; - break; - case 4: - WordListAbridgedN = &keywords5; - break; - case 5: - WordListAbridgedN = &keywords6; - break; - case 6: - WordListAbridgedN = &keywords7; - break; - case 7: - WordListAbridgedN = &keywords8; - break; - case 8: - WordListAbridgedN = &keywords9; - break; - } - Sci_Position firstModification = -1; - if (WordListAbridgedN) { - WordListAbridged wlNew; - wlNew.Set(wl); - if (*WordListAbridgedN != wlNew) { - WordListAbridgedN->Set(wl); - WordListAbridgedN->kwAbridged = strchr(wl, '~') != NULL; - WordListAbridgedN->kwHasSection = strchr(wl, ':') != NULL; - - firstModification = 0; - } - } - return firstModification; -} - -void SCI_METHOD LexerBaan::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - - if (initStyle == SCE_BAAN_STRINGEOL) // Does not leak onto next line - initStyle = SCE_BAAN_DEFAULT; - - int visibleChars = 0; - bool lineHasDomain = false; - bool lineHasFunction = false; - bool lineHasPreProc = false; - bool lineIgnoreString = false; - bool lineHasDefines = false; - - LexAccessor styler(pAccess); - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_BAAN_OPERATOR: - sc.SetState(SCE_BAAN_DEFAULT); - break; - case SCE_BAAN_NUMBER: - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_BAAN_DEFAULT); - } - break; - case SCE_BAAN_IDENTIFIER: - if (!IsAWordChar(sc.ch)) { - char s[1000]; - char s1[1000]; - sc.GetCurrentLowered(s, sizeof(s)); - if (sc.ch == ':') { - memcpy(s1, s, sizeof(s)); - s1[sc.LengthCurrent()] = sc.ch; - s1[sc.LengthCurrent() + 1] = '\0'; - } - if ((keywords.kwHasSection && (sc.ch == ':')) ? keywords.Contains(s1) : keywords.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD); - if (0 == strcmp(s, "domain")) { - lineHasDomain = true; - } - else if (0 == strcmp(s, "function")) { - lineHasFunction = true; - } - } - else if ((keywords2.kwHasSection && (sc.ch == ':')) ? keywords2.Contains(s1) : keywords2.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD2); - } - else if ((keywords3.kwHasSection && (sc.ch == ':')) ? keywords3.Contains(s1) : keywords3.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD3); - } - else if ((keywords4.kwHasSection && (sc.ch == ':')) ? keywords4.Contains(s1) : keywords4.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD4); - } - else if ((keywords5.kwHasSection && (sc.ch == ':')) ? keywords5.Contains(s1) : keywords5.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD5); - } - else if ((keywords6.kwHasSection && (sc.ch == ':')) ? keywords6.Contains(s1) : keywords6.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD6); - } - else if ((keywords7.kwHasSection && (sc.ch == ':')) ? keywords7.Contains(s1) : keywords7.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD7); - } - else if ((keywords8.kwHasSection && (sc.ch == ':')) ? keywords8.Contains(s1) : keywords8.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD8); - } - else if ((keywords9.kwHasSection && (sc.ch == ':')) ? keywords9.Contains(s1) : keywords9.Contains(s)) { - sc.ChangeState(SCE_BAAN_WORD9); - } - else if (lineHasDomain) { - sc.ChangeState(SCE_BAAN_DOMDEF); - lineHasDomain = false; - } - else if (lineHasFunction) { - sc.ChangeState(SCE_BAAN_FUNCDEF); - lineHasFunction = false; - } - else if (lineHasPreProc) { - sc.ChangeState(SCE_BAAN_OBJECTDEF); - lineHasPreProc = false; - } - else if (lineHasDefines) { - sc.ChangeState(SCE_BAAN_DEFINEDEF); - lineHasDefines = false; - } - else { - int state = IsAnyOtherIdentifier(s, sc.LengthCurrent()); - if (state > 0) { - sc.ChangeState(state); - } - } - sc.SetState(SCE_BAAN_DEFAULT); - } - break; - case SCE_BAAN_PREPROCESSOR: - if (options.baanStylingWithinPreprocessor) { - if (IsASpace(sc.ch) || IsAnOperator(sc.ch)) { - sc.SetState(SCE_BAAN_DEFAULT); - } - } - else { - if (sc.atLineEnd && (sc.chNext != '^')) { - sc.SetState(SCE_BAAN_DEFAULT); - } - } - break; - case SCE_BAAN_COMMENT: - if (sc.atLineEnd) { - sc.SetState(SCE_BAAN_DEFAULT); - } - break; - case SCE_BAAN_COMMENTDOC: - if (sc.MatchIgnoreCase("enddllusage")) { - for (unsigned int i = 0; i < 10; i++) { - sc.Forward(); - } - sc.ForwardSetState(SCE_BAAN_DEFAULT); - } - else if (sc.MatchIgnoreCase("endfunctionusage")) { - for (unsigned int i = 0; i < 15; i++) { - sc.Forward(); - } - sc.ForwardSetState(SCE_BAAN_DEFAULT); - } - break; - case SCE_BAAN_STRING: - if (sc.ch == '\"') { - sc.ForwardSetState(SCE_BAAN_DEFAULT); - } - else if ((sc.atLineEnd) && (sc.chNext != '^')) { - sc.ChangeState(SCE_BAAN_STRINGEOL); - sc.ForwardSetState(SCE_BAAN_DEFAULT); - visibleChars = 0; - } - break; - } - - // Determine if a new state should be entered. - if (sc.state == SCE_BAAN_DEFAULT) { - if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_BAAN_NUMBER); - } - else if (sc.MatchIgnoreCase("dllusage") || sc.MatchIgnoreCase("functionusage")) { - sc.SetState(SCE_BAAN_COMMENTDOC); - do { - sc.Forward(); - } while ((!sc.atLineEnd) && sc.More()); - } - else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_BAAN_IDENTIFIER); - } - else if (sc.Match('|')) { - sc.SetState(SCE_BAAN_COMMENT); - } - else if (sc.ch == '\"' && !(lineIgnoreString)) { - sc.SetState(SCE_BAAN_STRING); - } - else if (sc.ch == '#' && visibleChars == 0) { - // Preprocessor commands are alone on their line - sc.SetState(SCE_BAAN_PREPROCESSOR); - // Skip whitespace between # and preprocessor word - do { - sc.Forward(); - } while (IsASpace(sc.ch) && sc.More()); - if (sc.MatchIgnoreCase("pragma") || sc.MatchIgnoreCase("include")) { - lineHasPreProc = true; - lineIgnoreString = true; - } - else if (sc.MatchIgnoreCase("define") || sc.MatchIgnoreCase("undef")) { - lineHasDefines = true; - lineIgnoreString = false; - } - } - else if (IsAnOperator(static_cast(sc.ch))) { - sc.SetState(SCE_BAAN_OPERATOR); - } - } - - if (sc.atLineEnd) { - // Reset states to begining of colourise so no surprises - // if different sets of lines lexed. - visibleChars = 0; - lineHasDomain = false; - lineHasFunction = false; - lineHasPreProc = false; - lineIgnoreString = false; - lineHasDefines = false; - } - if (!IsASpace(sc.ch)) { - visibleChars++; - } - } - sc.Complete(); -} - -void SCI_METHOD LexerBaan::Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - - char word[100]; - bool foldStart = true; - bool foldNextSelect = true; - int wordlen = 0; - - std::string startTags[6] = { "for", "if", "on", "repeat", "select", "while" }; - std::string endTags[6] = { "endcase", "endfor", "endif", "endselect", "endwhile", "until" }; - std::string selectCloseTags[5] = { "selectdo", "selecteos", "selectempty", "selecterror", "endselect" }; - - LexAccessor styler(pAccess); - 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; - - 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 (options.foldComment && style == SCE_BAAN_COMMENTDOC) { - if (style != stylePrev) { - levelCurrent++; - } - else if ((style != styleNext) && !atEOL) { - // Comments don't end at end of line and the next character may be unstyled. - levelCurrent--; - } - } - if (options.foldComment && atEOL && IsCommentLine(lineCurrent, pAccess)) { - if (!IsCommentLine(lineCurrent - 1, pAccess) - && IsCommentLine(lineCurrent + 1, pAccess)) - levelCurrent++; - else if (IsCommentLine(lineCurrent - 1, pAccess) - && !IsCommentLine(lineCurrent + 1, pAccess)) - levelCurrent--; - } - if (options.foldPreprocessor && atEOL && IsPreProcLine(lineCurrent, pAccess)) { - if (!IsPreProcLine(lineCurrent - 1, pAccess) - && IsPreProcLine(lineCurrent + 1, pAccess)) - levelCurrent++; - else if (IsPreProcLine(lineCurrent - 1, pAccess) - && !IsPreProcLine(lineCurrent + 1, pAccess)) - levelCurrent--; - } - if (options.baanFoldSyntaxBased && (style == SCE_BAAN_OPERATOR)) { - if (ch == '{' || ch == '(') { - levelCurrent++; - } - else if (ch == '}' || ch == ')') { - levelCurrent--; - } - } - if (options.baanFoldKeywordsBased && style == SCE_BAAN_WORD) { - word[wordlen++] = static_cast(ToLowerCase(ch)); - if (wordlen == 100) { // prevent overflow - word[0] = '\0'; - wordlen = 1; - } - if (styleNext != SCE_BAAN_WORD) { - word[wordlen] = '\0'; - wordlen = 0; - if (strcmp(word, "for") == 0) { - Sci_PositionU j = i + 1; - while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { - j++; - } - if (styler.Match(j, "update")) { - // Means this is a "for update" used by Select which is already folded. - foldStart = false; - } - } - else if (strcmp(word, "on") == 0) { - Sci_PositionU j = i + 1; - while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { - j++; - } - if (!styler.Match(j, "case")) { - // Means this is not a "on Case" statement... could be "on" used by index. - foldStart = false; - } - } - else if (strcmp(word, "select") == 0) { - if (foldNextSelect) { - // Next Selects are sub-clause till reach of selectCloseTags[] array. - foldNextSelect = false; - foldStart = true; - } - else { - foldNextSelect = false; - foldStart = false; - } - } - else if (wordInArray(word, selectCloseTags, 5)) { - // select clause ends, next select clause can be folded. - foldNextSelect = true; - foldStart = true; - } - else { - foldStart = true; - } - if (foldStart) { - if (wordInArray(word, startTags, 6)) { - levelCurrent++; - } - else if (wordInArray(word, endTags, 6)) { - levelCurrent--; - } - } - } - } - if (atEOL) { - int lev = levelPrev; - 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++; - } - // 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 lmBaan(SCLEX_BAAN, LexerBaan::LexerFactoryBaan, "baan", baanWordLists); diff --git a/scintilla/lexers/LexBash.cxx b/scintilla/lexers/LexBash.cxx deleted file mode 100644 index 9582cc54..00000000 --- a/scintilla/lexers/LexBash.cxx +++ /dev/null @@ -1,881 +0,0 @@ -// 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 int GlobScan(StyleContext &sc) { - // forward scan for a glob-like (...), no whitespace allowed - int c, sLen = 0; - while ((c = sc.GetRelativeCharacter(++sLen)) != 0) { - if (IsASpace(c)) { - return 0; - } else if (c == ')') { - return sLen; - } - } - return 0; -} - -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() { - } - }; - 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[BASH_DELIM_STACK_MAX]; - int UpStack [BASH_DELIM_STACK_MAX]; - int StyleStack[BASH_DELIM_STACK_MAX]; - QuoteStackCls() { - Count = 0; - Up = '\0'; - Down = '\0'; - Style = 0; - Depth = 0; - } - 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() { - } - }; - 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); - } else if (cmdState == BASH_CMD_ARITH && !setWordStart.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) || - (sc.chNext == '=' && cmdState != BASH_CMD_ARITH)) { - // an unquoted here-doc delimiter, no special handling - 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) || - (sc.chNext == '=' && cmdState == BASH_CMD_ARITH)) { - // left shift <<$var or <<= 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! Syntax error in bash 4.3 - // Mark this bit as an error, do not colour any here-doc - sc.ChangeState(SCE_SH_ERROR); - sc.SetState(SCE_SH_DEFAULT); - } else { - // 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); - } - // handle some zsh features within arithmetic expressions only - if (cmdState == BASH_CMD_ARITH) { - if (sc.chPrev == '[') { // [#8] [##8] output digit setting - sc.SetState(SCE_SH_WORD); - if (sc.chNext == '#') { - sc.Forward(); - } - } else if (sc.Match("##^") && IsUpperCase(sc.GetRelative(3))) { // ##^A - sc.SetState(SCE_SH_IDENTIFIER); - sc.Forward(3); - } else if (sc.chNext == '#' && !IsASpace(sc.GetRelative(2))) { // ##a - sc.SetState(SCE_SH_IDENTIFIER); - sc.Forward(2); - } else if (setWordStart.Contains(sc.chNext)) { // #name - sc.SetState(SCE_SH_IDENTIFIER); - } - } - } 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); - // globs have no whitespace, do not appear in arithmetic expressions - if (cmdState != BASH_CMD_ARITH && sc.ch == '(' && sc.chNext != '(') { - int i = GlobScan(sc); - if (i > 1) { - sc.SetState(SCE_SH_IDENTIFIER); - sc.Forward(i); - continue; - } - } - // 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); diff --git a/scintilla/lexers/LexBasic.cxx b/scintilla/lexers/LexBasic.cxx deleted file mode 100644 index c07513e7..00000000 --- a/scintilla/lexers/LexBasic.cxx +++ /dev/null @@ -1,566 +0,0 @@ -// Scintilla source code edit control -/** @file LexBasic.cxx - ** Lexer for BlitzBasic and PureBasic. - ** Converted to lexer object and added further folding features/properties by "Udo Lechner" - **/ -// Copyright 1998-2003 by Neil Hodgson -// The License.txt file describes the conditions under which this software may be distributed. - -// This tries to be a unified Lexer/Folder for all the BlitzBasic/BlitzMax/PurBasic basics -// and derivatives. Once they diverge enough, might want to split it into multiple -// lexers for more code clearity. -// -// Mail me (elias users sf net) for any bugs. - -// Folding only works for simple things like functions or types. - -// You may want to have a look at my ctags lexer as well, if you additionally to coloring -// and folding need to extract things like label tags in your editor. - -#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 - -/* Bits: - * 1 - whitespace - * 2 - operator - * 4 - identifier - * 8 - decimal digit - * 16 - hex digit - * 32 - bin digit - * 64 - letter - */ -static int character_classification[128] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 2, - 60, 60, 28, 28, 28, 28, 28, 28, 28, 28, 2, 2, 2, 2, 2, 2, - 2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 68, - 2, 84, 84, 84, 84, 84, 84, 68, 68, 68, 68, 68, 68, 68, 68, 68, - 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 2, 2, 2, 2, 0 -}; - -static bool IsSpace(int c) { - return c < 128 && (character_classification[c] & 1); -} - -static bool IsOperator(int c) { - return c < 128 && (character_classification[c] & 2); -} - -static bool IsIdentifier(int c) { - return c < 128 && (character_classification[c] & 4); -} - -static bool IsDigit(int c) { - return c < 128 && (character_classification[c] & 8); -} - -static bool IsHexDigit(int c) { - return c < 128 && (character_classification[c] & 16); -} - -static bool IsBinDigit(int c) { - return c < 128 && (character_classification[c] & 32); -} - -static bool IsLetter(int c) { - return c < 128 && (character_classification[c] & 64); -} - -static int LowerCase(int c) -{ - if (c >= 'A' && c <= 'Z') - return 'a' + c - 'A'; - return c; -} - -static int CheckBlitzFoldPoint(char const *token, int &level) { - if (!strcmp(token, "function") || - !strcmp(token, "type")) { - level |= SC_FOLDLEVELHEADERFLAG; - return 1; - } - if (!strcmp(token, "end function") || - !strcmp(token, "end type")) { - return -1; - } - return 0; -} - -static int CheckPureFoldPoint(char const *token, int &level) { - if (!strcmp(token, "procedure") || - !strcmp(token, "enumeration") || - !strcmp(token, "interface") || - !strcmp(token, "structure")) { - level |= SC_FOLDLEVELHEADERFLAG; - return 1; - } - if (!strcmp(token, "endprocedure") || - !strcmp(token, "endenumeration") || - !strcmp(token, "endinterface") || - !strcmp(token, "endstructure")) { - return -1; - } - return 0; -} - -static int CheckFreeFoldPoint(char const *token, int &level) { - if (!strcmp(token, "function") || - !strcmp(token, "sub") || - !strcmp(token, "enum") || - !strcmp(token, "type") || - !strcmp(token, "union") || - !strcmp(token, "property") || - !strcmp(token, "destructor") || - !strcmp(token, "constructor")) { - level |= SC_FOLDLEVELHEADERFLAG; - return 1; - } - if (!strcmp(token, "end function") || - !strcmp(token, "end sub") || - !strcmp(token, "end enum") || - !strcmp(token, "end type") || - !strcmp(token, "end union") || - !strcmp(token, "end property") || - !strcmp(token, "end destructor") || - !strcmp(token, "end constructor")) { - return -1; - } - return 0; -} - -// An individual named option for use in an OptionSet - -// Options used for LexerBasic -struct OptionsBasic { - bool fold; - bool foldSyntaxBased; - bool foldCommentExplicit; - std::string foldExplicitStart; - std::string foldExplicitEnd; - bool foldExplicitAnywhere; - bool foldCompact; - OptionsBasic() { - fold = false; - foldSyntaxBased = true; - foldCommentExplicit = false; - foldExplicitStart = ""; - foldExplicitEnd = ""; - foldExplicitAnywhere = false; - foldCompact = true; - } -}; - -static const char * const blitzbasicWordListDesc[] = { - "BlitzBasic Keywords", - "user1", - "user2", - "user3", - 0 -}; - -static const char * const purebasicWordListDesc[] = { - "PureBasic Keywords", - "PureBasic PreProcessor Keywords", - "user defined 1", - "user defined 2", - 0 -}; - -static const char * const freebasicWordListDesc[] = { - "FreeBasic Keywords", - "FreeBasic PreProcessor Keywords", - "user defined 1", - "user defined 2", - 0 -}; - -struct OptionSetBasic : public OptionSet { - OptionSetBasic(const char * const wordListDescriptions[]) { - DefineProperty("fold", &OptionsBasic::fold); - - DefineProperty("fold.basic.syntax.based", &OptionsBasic::foldSyntaxBased, - "Set this property to 0 to disable syntax based folding."); - - DefineProperty("fold.basic.comment.explicit", &OptionsBasic::foldCommentExplicit, - "This option enables folding explicit fold points when using the Basic lexer. " - "Explicit fold points allows adding extra folding by placing a ;{ (BB/PB) or '{ (FB) comment at the start " - "and a ;} (BB/PB) or '} (FB) at the end of a section that should be folded."); - - DefineProperty("fold.basic.explicit.start", &OptionsBasic::foldExplicitStart, - "The string to use for explicit fold start points, replacing the standard ;{ (BB/PB) or '{ (FB)."); - - DefineProperty("fold.basic.explicit.end", &OptionsBasic::foldExplicitEnd, - "The string to use for explicit fold end points, replacing the standard ;} (BB/PB) or '} (FB)."); - - DefineProperty("fold.basic.explicit.anywhere", &OptionsBasic::foldExplicitAnywhere, - "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); - - DefineProperty("fold.compact", &OptionsBasic::foldCompact); - - DefineWordListSets(wordListDescriptions); - } -}; - -class LexerBasic : public ILexer { - char comment_char; - int (*CheckFoldPoint)(char const *, int &); - WordList keywordlists[4]; - OptionsBasic options; - OptionSetBasic osBasic; -public: - LexerBasic(char comment_char_, int (*CheckFoldPoint_)(char const *, int &), const char * const wordListDescriptions[]) : - comment_char(comment_char_), - CheckFoldPoint(CheckFoldPoint_), - osBasic(wordListDescriptions) { - } - virtual ~LexerBasic() { - } - void SCI_METHOD Release() { - delete this; - } - int SCI_METHOD Version() const { - return lvOriginal; - } - const char * SCI_METHOD PropertyNames() { - return osBasic.PropertyNames(); - } - int SCI_METHOD PropertyType(const char *name) { - return osBasic.PropertyType(name); - } - const char * SCI_METHOD DescribeProperty(const char *name) { - return osBasic.DescribeProperty(name); - } - Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); - const char * SCI_METHOD DescribeWordListSets() { - return osBasic.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 *LexerFactoryBlitzBasic() { - return new LexerBasic(';', CheckBlitzFoldPoint, blitzbasicWordListDesc); - } - static ILexer *LexerFactoryPureBasic() { - return new LexerBasic(';', CheckPureFoldPoint, purebasicWordListDesc); - } - static ILexer *LexerFactoryFreeBasic() { - return new LexerBasic('\'', CheckFreeFoldPoint, freebasicWordListDesc ); - } -}; - -Sci_Position SCI_METHOD LexerBasic::PropertySet(const char *key, const char *val) { - if (osBasic.PropertySet(&options, key, val)) { - return 0; - } - return -1; -} - -Sci_Position SCI_METHOD LexerBasic::WordListSet(int n, const char *wl) { - WordList *wordListN = 0; - switch (n) { - case 0: - wordListN = &keywordlists[0]; - break; - case 1: - wordListN = &keywordlists[1]; - break; - case 2: - wordListN = &keywordlists[2]; - break; - case 3: - wordListN = &keywordlists[3]; - 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 LexerBasic::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - LexAccessor styler(pAccess); - - bool wasfirst = true, isfirst = true; // true if first token in a line - styler.StartAt(startPos); - int styleBeforeKeyword = SCE_B_DEFAULT; - - StyleContext sc(startPos, length, initStyle, styler); - - // Can't use sc.More() here else we miss the last character - for (; ; sc.Forward()) { - if (sc.state == SCE_B_IDENTIFIER) { - if (!IsIdentifier(sc.ch)) { - // Labels - if (wasfirst && sc.Match(':')) { - sc.ChangeState(SCE_B_LABEL); - sc.ForwardSetState(SCE_B_DEFAULT); - } else { - char s[100]; - int kstates[4] = { - SCE_B_KEYWORD, - SCE_B_KEYWORD2, - SCE_B_KEYWORD3, - SCE_B_KEYWORD4, - }; - sc.GetCurrentLowered(s, sizeof(s)); - for (int i = 0; i < 4; i++) { - if (keywordlists[i].InList(s)) { - sc.ChangeState(kstates[i]); - } - } - // Types, must set them as operator else they will be - // matched as number/constant - if (sc.Match('.') || sc.Match('$') || sc.Match('%') || - sc.Match('#')) { - sc.SetState(SCE_B_OPERATOR); - } else { - sc.SetState(SCE_B_DEFAULT); - } - } - } - } else if (sc.state == SCE_B_OPERATOR) { - if (!IsOperator(sc.ch) || sc.Match('#')) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_LABEL) { - if (!IsIdentifier(sc.ch)) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_CONSTANT) { - if (!IsIdentifier(sc.ch)) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_NUMBER) { - if (!IsDigit(sc.ch)) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_HEXNUMBER) { - if (!IsHexDigit(sc.ch)) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_BINNUMBER) { - if (!IsBinDigit(sc.ch)) - sc.SetState(SCE_B_DEFAULT); - } else if (sc.state == SCE_B_STRING) { - if (sc.ch == '"') { - sc.ForwardSetState(SCE_B_DEFAULT); - } - if (sc.atLineEnd) { - sc.ChangeState(SCE_B_ERROR); - sc.SetState(SCE_B_DEFAULT); - } - } else if (sc.state == SCE_B_COMMENT || sc.state == SCE_B_PREPROCESSOR) { - if (sc.atLineEnd) { - sc.SetState(SCE_B_DEFAULT); - } - } else if (sc.state == SCE_B_DOCLINE) { - if (sc.atLineEnd) { - sc.SetState(SCE_B_DEFAULT); - } else if (sc.ch == '\\' || sc.ch == '@') { - if (IsLetter(sc.chNext) && sc.chPrev != '\\') { - styleBeforeKeyword = sc.state; - sc.SetState(SCE_B_DOCKEYWORD); - }; - } - } else if (sc.state == SCE_B_DOCKEYWORD) { - if (IsSpace(sc.ch)) { - sc.SetState(styleBeforeKeyword); - } else if (sc.atLineEnd && styleBeforeKeyword == SCE_B_DOCLINE) { - sc.SetState(SCE_B_DEFAULT); - } - } else if (sc.state == SCE_B_COMMENTBLOCK) { - if (sc.Match("\'/")) { - sc.Forward(); - sc.ForwardSetState(SCE_B_DEFAULT); - } - } else if (sc.state == SCE_B_DOCBLOCK) { - if (sc.Match("\'/")) { - sc.Forward(); - sc.ForwardSetState(SCE_B_DEFAULT); - } else if (sc.ch == '\\' || sc.ch == '@') { - if (IsLetter(sc.chNext) && sc.chPrev != '\\') { - styleBeforeKeyword = sc.state; - sc.SetState(SCE_B_DOCKEYWORD); - }; - } - } - - if (sc.atLineStart) - isfirst = true; - - if (sc.state == SCE_B_DEFAULT || sc.state == SCE_B_ERROR) { - if (isfirst && sc.Match('.') && comment_char != '\'') { - sc.SetState(SCE_B_LABEL); - } else if (isfirst && sc.Match('#')) { - wasfirst = isfirst; - sc.SetState(SCE_B_IDENTIFIER); - } else if (sc.Match(comment_char)) { - // Hack to make deprecated QBASIC '$Include show - // up in freebasic with SCE_B_PREPROCESSOR. - if (comment_char == '\'' && sc.Match(comment_char, '$')) - sc.SetState(SCE_B_PREPROCESSOR); - else if (sc.Match("\'*") || sc.Match("\'!")) { - sc.SetState(SCE_B_DOCLINE); - } else { - sc.SetState(SCE_B_COMMENT); - } - } else if (sc.Match("/\'")) { - if (sc.Match("/\'*") || sc.Match("/\'!")) { // Support of gtk-doc/Doxygen doc. style - sc.SetState(SCE_B_DOCBLOCK); - } else { - sc.SetState(SCE_B_COMMENTBLOCK); - } - sc.Forward(); // Eat the ' so it isn't used for the end of the comment - } else if (sc.Match('"')) { - sc.SetState(SCE_B_STRING); - } else if (IsDigit(sc.ch)) { - sc.SetState(SCE_B_NUMBER); - } else if (sc.Match('$') || sc.Match("&h") || sc.Match("&H") || sc.Match("&o") || sc.Match("&O")) { - sc.SetState(SCE_B_HEXNUMBER); - } else if (sc.Match('%') || sc.Match("&b") || sc.Match("&B")) { - sc.SetState(SCE_B_BINNUMBER); - } else if (sc.Match('#')) { - sc.SetState(SCE_B_CONSTANT); - } else if (IsOperator(sc.ch)) { - sc.SetState(SCE_B_OPERATOR); - } else if (IsIdentifier(sc.ch)) { - wasfirst = isfirst; - sc.SetState(SCE_B_IDENTIFIER); - } else if (!IsSpace(sc.ch)) { - sc.SetState(SCE_B_ERROR); - } - } - - if (!IsSpace(sc.ch)) - isfirst = false; - - if (!sc.More()) - break; - } - sc.Complete(); -} - - -void SCI_METHOD LexerBasic::Fold(Sci_PositionU startPos, Sci_Position length, int /* initStyle */, IDocument *pAccess) { - - if (!options.fold) - return; - - LexAccessor styler(pAccess); - - Sci_Position line = styler.GetLine(startPos); - int level = styler.LevelAt(line); - int go = 0, done = 0; - Sci_Position endPos = startPos + length; - char word[256]; - int wordlen = 0; - const bool userDefinedFoldMarkers = !options.foldExplicitStart.empty() && !options.foldExplicitEnd.empty(); - int cNext = styler[startPos]; - - // Scan for tokens at the start of the line (they may include - // whitespace, for tokens like "End Function" - for (Sci_Position i = startPos; i < endPos; i++) { - int c = cNext; - cNext = styler.SafeGetCharAt(i + 1); - bool atEOL = (c == '\r' && cNext != '\n') || (c == '\n'); - if (options.foldSyntaxBased && !done && !go) { - if (wordlen) { // are we scanning a token already? - word[wordlen] = static_cast(LowerCase(c)); - if (!IsIdentifier(c)) { // done with token - word[wordlen] = '\0'; - go = CheckFoldPoint(word, level); - if (!go) { - // Treat any whitespace as single blank, for - // things like "End Function". - if (IsSpace(c) && IsIdentifier(word[wordlen - 1])) { - word[wordlen] = ' '; - if (wordlen < 255) - wordlen++; - } - else // done with this line - done = 1; - } - } else if (wordlen < 255) { - wordlen++; - } - } else { // start scanning at first non-whitespace character - if (!IsSpace(c)) { - if (IsIdentifier(c)) { - word[0] = static_cast(LowerCase(c)); - wordlen = 1; - } else // done with this line - done = 1; - } - } - } - if (options.foldCommentExplicit && ((styler.StyleAt(i) == SCE_B_COMMENT) || options.foldExplicitAnywhere)) { - if (userDefinedFoldMarkers) { - if (styler.Match(i, options.foldExplicitStart.c_str())) { - level |= SC_FOLDLEVELHEADERFLAG; - go = 1; - } else if (styler.Match(i, options.foldExplicitEnd.c_str())) { - go = -1; - } - } else { - if (c == comment_char) { - if (cNext == '{') { - level |= SC_FOLDLEVELHEADERFLAG; - go = 1; - } else if (cNext == '}') { - go = -1; - } - } - } - } - if (atEOL) { // line end - if (!done && wordlen == 0 && options.foldCompact) // line was only space - level |= SC_FOLDLEVELWHITEFLAG; - if (level != styler.LevelAt(line)) - styler.SetLevel(line, level); - level += go; - line++; - // reset state - wordlen = 0; - level &= ~SC_FOLDLEVELHEADERFLAG; - level &= ~SC_FOLDLEVELWHITEFLAG; - go = 0; - done = 0; - } - } -} - -LexerModule lmBlitzBasic(SCLEX_BLITZBASIC, LexerBasic::LexerFactoryBlitzBasic, "blitzbasic", blitzbasicWordListDesc); - -LexerModule lmPureBasic(SCLEX_PUREBASIC, LexerBasic::LexerFactoryPureBasic, "purebasic", purebasicWordListDesc); - -LexerModule lmFreeBasic(SCLEX_FREEBASIC, LexerBasic::LexerFactoryFreeBasic, "freebasic", freebasicWordListDesc); diff --git a/scintilla/lexers/LexBatch.cxx b/scintilla/lexers/LexBatch.cxx deleted file mode 100644 index 04d33615..00000000 --- a/scintilla/lexers/LexBatch.cxx +++ /dev/null @@ -1,500 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexBibTeX.cxx b/scintilla/lexers/LexBibTeX.cxx deleted file mode 100644 index 1098cd54..00000000 --- a/scintilla/lexers/LexBibTeX.cxx +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright 2008-2010 Sergiu Dotenco. The License.txt file describes the -// conditions under which this software may be distributed. - -/** - * @file LexBibTeX.cxx - * @brief General BibTeX coloring scheme. - * @author Sergiu Dotenco - * @date April 18, 2009 - */ - -#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 "LexerModule.h" - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - -namespace { - bool IsAlphabetic(unsigned int ch) - { - return IsASCII(ch) && std::isalpha(ch) != 0; - } - bool IsAlphaNumeric(char ch) - { - return IsASCII(ch) && std::isalnum(ch); - } - - bool EqualCaseInsensitive(const char* a, const char* b) - { - return CompareCaseInsensitive(a, b) == 0; - } - - bool EntryWithoutKey(const char* name) - { - return EqualCaseInsensitive(name,"string"); - } - - char GetClosingBrace(char openbrace) - { - char result = openbrace; - - switch (openbrace) { - case '(': result = ')'; break; - case '{': result = '}'; break; - } - - return result; - } - - bool IsEntryStart(char prev, char ch) - { - return prev != '\\' && ch == '@'; - } - - bool IsEntryStart(const StyleContext& sc) - { - return IsEntryStart(sc.chPrev, sc.ch); - } - - void ColorizeBibTeX(Sci_PositionU start_pos, Sci_Position length, int /*init_style*/, WordList* keywordlists[], Accessor& styler) - { - WordList &EntryNames = *keywordlists[0]; - bool fold_compact = styler.GetPropertyInt("fold.compact", 1) != 0; - - std::string buffer; - buffer.reserve(25); - - // We always colorize a section from the beginning, so let's - // search for the @ character which isn't escaped, i.e. \@ - while (start_pos > 0 && !IsEntryStart(styler.SafeGetCharAt(start_pos - 1), - styler.SafeGetCharAt(start_pos))) { - --start_pos; ++length; - } - - styler.StartAt(start_pos); - styler.StartSegment(start_pos); - - Sci_Position current_line = styler.GetLine(start_pos); - int prev_level = styler.LevelAt(current_line) & SC_FOLDLEVELNUMBERMASK; - int current_level = prev_level; - int visible_chars = 0; - - bool in_comment = false ; - StyleContext sc(start_pos, length, SCE_BIBTEX_DEFAULT, styler); - - bool going = sc.More(); // needed because of a fuzzy end of file state - char closing_brace = 0; - bool collect_entry_name = false; - - for (; going; sc.Forward()) { - if (!sc.More()) - going = false; // we need to go one behind the end of text - - if (in_comment) { - if (sc.atLineEnd) { - sc.SetState(SCE_BIBTEX_DEFAULT); - in_comment = false; - } - } - else { - // Found @entry - if (IsEntryStart(sc)) { - sc.SetState(SCE_BIBTEX_UNKNOWN_ENTRY); - sc.Forward(); - ++current_level; - - buffer.clear(); - collect_entry_name = true; - } - else if ((sc.state == SCE_BIBTEX_ENTRY || sc.state == SCE_BIBTEX_UNKNOWN_ENTRY) - && (sc.ch == '{' || sc.ch == '(')) { - // Entry name colorization done - // Found either a { or a ( after entry's name, e.g. @entry(...) @entry{...} - // Closing counterpart needs to be stored. - closing_brace = GetClosingBrace(sc.ch); - - sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize { ( - - // @string doesn't have any key - if (EntryWithoutKey(buffer.c_str())) - sc.ForwardSetState(SCE_BIBTEX_PARAMETER); - else - sc.ForwardSetState(SCE_BIBTEX_KEY); // Key/label colorization - } - - // Need to handle the case where entry's key is empty - // e.g. @book{,...} - if (sc.state == SCE_BIBTEX_KEY && sc.ch == ',') { - // Key/label colorization done - sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the , - sc.ForwardSetState(SCE_BIBTEX_PARAMETER); // Parameter colorization - } - else if (sc.state == SCE_BIBTEX_PARAMETER && sc.ch == '=') { - sc.SetState(SCE_BIBTEX_DEFAULT); // Don't colorize the = - sc.ForwardSetState(SCE_BIBTEX_VALUE); // Parameter value colorization - - Sci_Position start = sc.currentPos; - - // We need to handle multiple situations: - // 1. name"one two {three}" - // 2. name={one {one two {two}} three} - // 3. year=2005 - - // Skip ", { until we encounter the first alphanumerical character - while (sc.More() && !(IsAlphaNumeric(sc.ch) || sc.ch == '"' || sc.ch == '{')) - sc.Forward(); - - if (sc.More()) { - // Store " or { - char ch = sc.ch; - - // Not interested in alphanumerical characters - if (IsAlphaNumeric(ch)) - ch = 0; - - int skipped = 0; - - if (ch) { - // Skip preceding " or { such as in name={{test}}. - // Remember how many characters have been skipped - // Make sure that empty values, i.e. "" are also handled correctly - while (sc.More() && (sc.ch == ch && (ch != '"' || skipped < 1))) { - sc.Forward(); - ++skipped; - } - } - - // Closing counterpart for " is the same character - if (ch == '{') - ch = '}'; - - // We have reached the parameter value - // In case the open character was a alnum char, skip until , is found - // otherwise until skipped == 0 - while (sc.More() && (skipped > 0 || (!ch && !(sc.ch == ',' || sc.ch == closing_brace)))) { - // Make sure the character isn't escaped - if (sc.chPrev != '\\') { - // Parameter value contains a { which is the 2nd case described above - if (sc.ch == '{') - ++skipped; // Remember it - else if (sc.ch == '}') - --skipped; - else if (skipped == 1 && sc.ch == ch && ch == '"') // Don't ignore cases like {"o} - skipped = 0; - } - - sc.Forward(); - } - } - - // Don't colorize the , - sc.SetState(SCE_BIBTEX_DEFAULT); - - // Skip until the , or entry's closing closing_brace is found - // since this parameter might be the last one - while (sc.More() && !(sc.ch == ',' || sc.ch == closing_brace)) - sc.Forward(); - - int state = SCE_BIBTEX_PARAMETER; // The might be more parameters - - // We've reached the closing closing_brace for the bib entry - // in case no " or {} has been used to enclose the value, - // as in 3rd case described above - if (sc.ch == closing_brace) { - --current_level; - // Make sure the text between entries is not colored - // using parameter's style - state = SCE_BIBTEX_DEFAULT; - } - - Sci_Position end = sc.currentPos; - current_line = styler.GetLine(end); - - // We have possibly skipped some lines, so the folding levels - // have to be adjusted separately - for (Sci_Position i = styler.GetLine(start); i <= styler.GetLine(end); ++i) - styler.SetLevel(i, prev_level); - - sc.ForwardSetState(state); - } - - if (sc.state == SCE_BIBTEX_PARAMETER && sc.ch == closing_brace) { - sc.SetState(SCE_BIBTEX_DEFAULT); - --current_level; - } - - // Non escaped % found which represents a comment until the end of the line - if (sc.chPrev != '\\' && sc.ch == '%') { - in_comment = true; - sc.SetState(SCE_BIBTEX_COMMENT); - } - } - - if (sc.state == SCE_BIBTEX_UNKNOWN_ENTRY || sc.state == SCE_BIBTEX_ENTRY) { - if (!IsAlphabetic(sc.ch) && collect_entry_name) - collect_entry_name = false; - - if (collect_entry_name) { - buffer += static_cast(tolower(sc.ch)); - if (EntryNames.InList(buffer.c_str())) - sc.ChangeState(SCE_BIBTEX_ENTRY); - else - sc.ChangeState(SCE_BIBTEX_UNKNOWN_ENTRY); - } - } - - if (sc.atLineEnd) { - int level = prev_level; - - if (visible_chars == 0 && fold_compact) - level |= SC_FOLDLEVELWHITEFLAG; - - if ((current_level > prev_level)) - level |= SC_FOLDLEVELHEADERFLAG; - // else if (current_level < prev_level) - // level |= SC_FOLDLEVELBOXFOOTERFLAG; // Deprecated - - if (level != styler.LevelAt(current_line)) { - styler.SetLevel(current_line, level); - } - - ++current_line; - prev_level = current_level; - visible_chars = 0; - } - - if (!isspacechar(sc.ch)) - ++visible_chars; - } - - sc.Complete(); - - // Fill in the real level of the next line, keeping the current flags as they will be filled in later - int flagsNext = styler.LevelAt(current_line) & ~SC_FOLDLEVELNUMBERMASK; - styler.SetLevel(current_line, prev_level | flagsNext); - } -} -static const char * const BibTeXWordLists[] = { - "Entry Names", - 0, -}; - - -LexerModule lmBibTeX(SCLEX_BIBTEX, ColorizeBibTeX, "bib", 0, BibTeXWordLists); - -// Entry Names -// article, book, booklet, conference, inbook, -// incollection, inproceedings, manual, mastersthesis, -// misc, phdthesis, proceedings, techreport, unpublished, -// string, url - diff --git a/scintilla/lexers/LexBullant.cxx b/scintilla/lexers/LexBullant.cxx deleted file mode 100644 index 2577b89d..00000000 --- a/scintilla/lexers/LexBullant.cxx +++ /dev/null @@ -1,233 +0,0 @@ -// SciTE - Scintilla based Text Editor -// LexBullant.cxx - lexer for Bullant - -#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 classifyWordBullant(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler) { - char s[100]; - s[0] = '\0'; - for (Sci_PositionU i = 0; i < end - start + 1 && i < 30; i++) { - s[i] = static_cast(tolower(styler[start + i])); - s[i + 1] = '\0'; - } - int lev= 0; - char chAttr = SCE_C_IDENTIFIER; - if (isdigit(s[0]) || (s[0] == '.')){ - chAttr = SCE_C_NUMBER; - } - else { - if (keywords.InList(s)) { - chAttr = SCE_C_WORD; - if (strcmp(s, "end") == 0) - lev = -1; - else if (strcmp(s, "method") == 0 || - strcmp(s, "case") == 0 || - strcmp(s, "class") == 0 || - strcmp(s, "debug") == 0 || - strcmp(s, "test") == 0 || - strcmp(s, "if") == 0 || - strcmp(s, "lock") == 0 || - strcmp(s, "transaction") == 0 || - strcmp(s, "trap") == 0 || - strcmp(s, "until") == 0 || - strcmp(s, "while") == 0) - lev = 1; - } - } - styler.ColourTo(end, chAttr); - return lev; -} - -static void ColouriseBullantDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - WordList &keywords = *keywordlists[0]; - - styler.StartAt(startPos); - - bool fold = styler.GetPropertyInt("fold") != 0; - Sci_Position lineCurrent = styler.GetLine(startPos); - int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - int levelCurrent = levelPrev; - - int state = initStyle; - if (state == SCE_C_STRINGEOL) // Does not leak onto next line - state = SCE_C_DEFAULT; - char chPrev = ' '; - char chNext = styler[startPos]; - Sci_PositionU lengthDoc = startPos + length; - int visibleChars = 0; - styler.StartSegment(startPos); - int endFoundThisLine = 0; - for (Sci_PositionU i = startPos; i < lengthDoc; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - - if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { - // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) - // Avoid triggering two times on Dos/Win - // End of line - endFoundThisLine = 0; - if (state == SCE_C_STRINGEOL) { - styler.ColourTo(i, state); - state = SCE_C_DEFAULT; - } - if (fold) { - int lev = levelPrev; - if (visibleChars == 0) - lev |= SC_FOLDLEVELWHITEFLAG; - if ((levelCurrent > levelPrev) && (visibleChars > 0)) - lev |= SC_FOLDLEVELHEADERFLAG; - styler.SetLevel(lineCurrent, lev); - lineCurrent++; - levelPrev = levelCurrent; - } - visibleChars = 0; - -/* int indentBlock = GetLineIndentation(lineCurrent); - if (blockChange==1){ - lineCurrent++; - int pos=SetLineIndentation(lineCurrent, indentBlock + indentSize); - } else if (blockChange==-1) { - indentBlock -= indentSize; - if (indentBlock < 0) - indentBlock = 0; - SetLineIndentation(lineCurrent, indentBlock); - lineCurrent++; - } - blockChange=0; -*/ } - if (!(IsASCII(ch) && isspace(ch))) - visibleChars++; - - if (styler.IsLeadByte(ch)) { - chNext = styler.SafeGetCharAt(i + 2); - chPrev = ' '; - i += 1; - continue; - } - - if (state == SCE_C_DEFAULT) { - if (iswordstart(ch)) { - styler.ColourTo(i-1, state); - state = SCE_C_IDENTIFIER; - } else if (ch == '@' && chNext == 'o') { - if ((styler.SafeGetCharAt(i+2) =='f') && (styler.SafeGetCharAt(i+3) == 'f')) { - styler.ColourTo(i-1, state); - state = SCE_C_COMMENT; - } - } else if (ch == '#') { - styler.ColourTo(i-1, state); - state = SCE_C_COMMENTLINE; - } else if (ch == '\"') { - styler.ColourTo(i-1, state); - state = SCE_C_STRING; - } else if (ch == '\'') { - styler.ColourTo(i-1, state); - state = SCE_C_CHARACTER; - } else if (isoperator(ch)) { - styler.ColourTo(i-1, state); - styler.ColourTo(i, SCE_C_OPERATOR); - } - } else if (state == SCE_C_IDENTIFIER) { - if (!iswordchar(ch)) { - int levelChange = classifyWordBullant(styler.GetStartSegment(), i - 1, keywords, styler); - state = SCE_C_DEFAULT; - chNext = styler.SafeGetCharAt(i + 1); - if (ch == '#') { - state = SCE_C_COMMENTLINE; - } else if (ch == '\"') { - state = SCE_C_STRING; - } else if (ch == '\'') { - state = SCE_C_CHARACTER; - } else if (isoperator(ch)) { - styler.ColourTo(i, SCE_C_OPERATOR); - } - if (endFoundThisLine == 0) - levelCurrent+=levelChange; - if (levelChange == -1) - endFoundThisLine=1; - } - } else if (state == SCE_C_COMMENT) { - if (ch == '@' && chNext == 'o') { - if (styler.SafeGetCharAt(i+2) == 'n') { - styler.ColourTo(i+2, state); - state = SCE_C_DEFAULT; - i+=2; - } - } - } else if (state == SCE_C_COMMENTLINE) { - if (ch == '\r' || ch == '\n') { - endFoundThisLine = 0; - styler.ColourTo(i-1, state); - state = SCE_C_DEFAULT; - } - } else if (state == SCE_C_STRING) { - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - } - } else if (ch == '\"') { - styler.ColourTo(i, state); - state = SCE_C_DEFAULT; - } else if (chNext == '\r' || chNext == '\n') { - endFoundThisLine = 0; - styler.ColourTo(i-1, SCE_C_STRINGEOL); - state = SCE_C_STRINGEOL; - } - } else if (state == SCE_C_CHARACTER) { - if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) { - endFoundThisLine = 0; - styler.ColourTo(i-1, SCE_C_STRINGEOL); - state = SCE_C_STRINGEOL; - } else if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - } - } else if (ch == '\'') { - styler.ColourTo(i, state); - state = SCE_C_DEFAULT; - } - } - chPrev = ch; - } - styler.ColourTo(lengthDoc - 1, state); - - // Fill in the real level of the next line, keeping the current flags as they will be filled in later - if (fold) { - int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; - //styler.SetLevel(lineCurrent, levelCurrent | flagsNext); - styler.SetLevel(lineCurrent, levelPrev | flagsNext); - - } -} - -static const char * const bullantWordListDesc[] = { - "Keywords", - 0 -}; - -LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant", 0, bullantWordListDesc); diff --git a/scintilla/lexers/LexCLW.cxx b/scintilla/lexers/LexCLW.cxx deleted file mode 100644 index c12e6c01..00000000 --- a/scintilla/lexers/LexCLW.cxx +++ /dev/null @@ -1,682 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexCOBOL.cxx b/scintilla/lexers/LexCOBOL.cxx deleted file mode 100644 index 92849923..00000000 --- a/scintilla/lexers/LexCOBOL.cxx +++ /dev/null @@ -1,381 +0,0 @@ -// Scintilla source code edit control -/** @file LexCOBOL.cxx - ** Lexer for COBOL - ** Based on LexPascal.cxx - ** Written by Laurent le Tynevez - ** Updated by Simon Steele September 2002 - ** Updated by Mathias Rauen May 2003 (Delphi adjustments) - ** Updated by Rod Falck, Aug 2006 Converted to COBOL - **/ - -#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 - -#define IN_DIVISION 0x01 -#define IN_DECLARATIVES 0x02 -#define IN_SECTION 0x04 -#define IN_PARAGRAPH 0x08 -#define IN_FLAGS 0xF -#define NOT_HEADER 0x10 - -inline bool isCOBOLoperator(char ch) - { - return isoperator(ch); - } - -inline bool isCOBOLwordchar(char ch) - { - return IsASCII(ch) && (isalnum(ch) || ch == '-'); - - } - -inline bool isCOBOLwordstart(char ch) - { - return IsASCII(ch) && isalnum(ch); - } - -static int CountBits(int nBits) - { - int count = 0; - for (int i = 0; i < 32; ++i) - { - count += nBits & 1; - nBits >>= 1; - } - return count; - } - -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(tolower(styler[start + i])); - i++; - } - s[i] = '\0'; -} - -static void ColourTo(Accessor &styler, Sci_PositionU end, unsigned int attr) { - styler.ColourTo(end, attr); -} - - -static int classifyWordCOBOL(Sci_PositionU start, Sci_PositionU end, /*WordList &keywords*/WordList *keywordlists[], Accessor &styler, int nContainment, bool *bAarea) { - int ret = 0; - - WordList& a_keywords = *keywordlists[0]; - WordList& b_keywords = *keywordlists[1]; - WordList& c_keywords = *keywordlists[2]; - - char s[100]; - s[0] = '\0'; - s[1] = '\0'; - getRange(start, end, styler, s, sizeof(s)); - - char chAttr = SCE_C_IDENTIFIER; - if (isdigit(s[0]) || (s[0] == '.') || (s[0] == 'v')) { - chAttr = SCE_C_NUMBER; - char *p = s + 1; - while (*p) { - if ((!isdigit(*p) && (*p) != 'v') && isCOBOLwordchar(*p)) { - chAttr = SCE_C_IDENTIFIER; - break; - } - ++p; - } - } - else { - if (a_keywords.InList(s)) { - chAttr = SCE_C_WORD; - } - else if (b_keywords.InList(s)) { - chAttr = SCE_C_WORD2; - } - else if (c_keywords.InList(s)) { - chAttr = SCE_C_UUID; - } - } - if (*bAarea) { - if (strcmp(s, "division") == 0) { - ret = IN_DIVISION; - // we've determined the containment, anything else is just ignored for those purposes - *bAarea = false; - } else if (strcmp(s, "declaratives") == 0) { - ret = IN_DIVISION | IN_DECLARATIVES; - if (nContainment & IN_DECLARATIVES) - ret |= NOT_HEADER | IN_SECTION; - // we've determined the containment, anything else is just ignored for those purposes - *bAarea = false; - } else if (strcmp(s, "section") == 0) { - ret = (nContainment &~ IN_PARAGRAPH) | IN_SECTION; - // we've determined the containment, anything else is just ignored for those purposes - *bAarea = false; - } else if (strcmp(s, "end") == 0 && (nContainment & IN_DECLARATIVES)) { - ret = IN_DIVISION | IN_DECLARATIVES | IN_SECTION | NOT_HEADER; - } else { - ret = nContainment | IN_PARAGRAPH; - } - } - ColourTo(styler, end, chAttr); - return ret; -} - -static void ColouriseCOBOLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - - styler.StartAt(startPos); - - int state = initStyle; - if (state == SCE_C_CHARACTER) // Does not leak onto next line - state = SCE_C_DEFAULT; - char chPrev = ' '; - char chNext = styler[startPos]; - Sci_PositionU lengthDoc = startPos + length; - - int nContainment; - - Sci_Position currentLine = styler.GetLine(startPos); - if (currentLine > 0) { - styler.SetLineState(currentLine, styler.GetLineState(currentLine-1)); - nContainment = styler.GetLineState(currentLine); - nContainment &= ~NOT_HEADER; - } else { - styler.SetLineState(currentLine, 0); - nContainment = 0; - } - - styler.StartSegment(startPos); - bool bNewLine = true; - bool bAarea = !isspacechar(chNext); - int column = 0; - for (Sci_PositionU i = startPos; i < lengthDoc; i++) { - char ch = chNext; - - chNext = styler.SafeGetCharAt(i + 1); - - ++column; - - if (bNewLine) { - column = 0; - } - if (column <= 1 && !bAarea) { - bAarea = !isspacechar(ch); - } - bool bSetNewLine = false; - if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { - // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) - // Avoid triggering two times on Dos/Win - // End of line - if (state == SCE_C_CHARACTER) { - ColourTo(styler, i, state); - state = SCE_C_DEFAULT; - } - styler.SetLineState(currentLine, nContainment); - currentLine++; - bSetNewLine = true; - if (nContainment & NOT_HEADER) - nContainment &= ~(NOT_HEADER | IN_DECLARATIVES | IN_SECTION); - } - - if (styler.IsLeadByte(ch)) { - chNext = styler.SafeGetCharAt(i + 2); - chPrev = ' '; - i += 1; - continue; - } - - if (state == SCE_C_DEFAULT) { - if (isCOBOLwordstart(ch) || (ch == '$' && IsASCII(chNext) && isalpha(chNext))) { - ColourTo(styler, i-1, state); - state = SCE_C_IDENTIFIER; - } else if (column == 6 && ch == '*') { - // Cobol comment line: asterisk in column 7. - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTLINE; - } else if (ch == '*' && chNext == '>') { - // Cobol inline comment: asterisk, followed by greater than. - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTLINE; - } else if (column == 0 && ch == '*' && chNext != '*') { - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTLINE; - } else if (column == 0 && ch == '/' && chNext != '*') { - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTLINE; - } else if (column == 0 && ch == '*' && chNext == '*') { - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTDOC; - } else if (column == 0 && ch == '/' && chNext == '*') { - ColourTo(styler, i-1, state); - state = SCE_C_COMMENTDOC; - } else if (ch == '"') { - ColourTo(styler, i-1, state); - state = SCE_C_STRING; - } else if (ch == '\'') { - ColourTo(styler, i-1, state); - state = SCE_C_CHARACTER; - } else if (ch == '?' && column == 0) { - ColourTo(styler, i-1, state); - state = SCE_C_PREPROCESSOR; - } else if (isCOBOLoperator(ch)) { - ColourTo(styler, i-1, state); - ColourTo(styler, i, SCE_C_OPERATOR); - } - } else if (state == SCE_C_IDENTIFIER) { - if (!isCOBOLwordchar(ch)) { - int lStateChange = classifyWordCOBOL(styler.GetStartSegment(), i - 1, keywordlists, styler, nContainment, &bAarea); - - if(lStateChange != 0) { - styler.SetLineState(currentLine, lStateChange); - nContainment = lStateChange; - } - - state = SCE_C_DEFAULT; - chNext = styler.SafeGetCharAt(i + 1); - if (ch == '"') { - state = SCE_C_STRING; - } else if (ch == '\'') { - state = SCE_C_CHARACTER; - } else if (isCOBOLoperator(ch)) { - ColourTo(styler, i, SCE_C_OPERATOR); - } - } - } else { - if (state == SCE_C_PREPROCESSOR) { - if ((ch == '\r' || ch == '\n') && !(chPrev == '\\' || chPrev == '\r')) { - ColourTo(styler, i-1, state); - state = SCE_C_DEFAULT; - } - } else if (state == SCE_C_COMMENT) { - if (ch == '\r' || ch == '\n') { - ColourTo(styler, i, state); - state = SCE_C_DEFAULT; - } - } else if (state == SCE_C_COMMENTDOC) { - if (ch == '\r' || ch == '\n') { - if (((i > styler.GetStartSegment() + 2) || ( - (initStyle == SCE_C_COMMENTDOC) && - (styler.GetStartSegment() == static_cast(startPos))))) { - ColourTo(styler, i, state); - state = SCE_C_DEFAULT; - } - } - } else if (state == SCE_C_COMMENTLINE) { - if (ch == '\r' || ch == '\n') { - ColourTo(styler, i-1, state); - state = SCE_C_DEFAULT; - } - } else if (state == SCE_C_STRING) { - if (ch == '"') { - ColourTo(styler, i, state); - state = SCE_C_DEFAULT; - } - } else if (state == SCE_C_CHARACTER) { - if (ch == '\'') { - ColourTo(styler, i, state); - state = SCE_C_DEFAULT; - } - } - } - chPrev = ch; - bNewLine = bSetNewLine; - if (bNewLine) - { - bAarea = false; - } - } - ColourTo(styler, lengthDoc - 1, state); -} - -static void FoldCOBOLDoc(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); - int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) & SC_FOLDLEVELNUMBERMASK : 0xFFF; - char chNext = styler[startPos]; - - bool bNewLine = true; - bool bAarea = !isspacechar(chNext); - int column = 0; - bool bComment = false; - for (Sci_PositionU i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - ++column; - - if (bNewLine) { - column = 0; - bComment = (ch == '*' || ch == '/' || ch == '?'); - } - if (column <= 1 && !bAarea) { - bAarea = !isspacechar(ch); - } - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (atEOL) { - int nContainment = styler.GetLineState(lineCurrent); - int lev = CountBits(nContainment & IN_FLAGS) | SC_FOLDLEVELBASE; - if (bAarea && !bComment) - --lev; - if (visibleChars == 0 && foldCompact) - lev |= SC_FOLDLEVELWHITEFLAG; - if ((bAarea) && (visibleChars > 0) && !(nContainment & NOT_HEADER) && !bComment) - lev |= SC_FOLDLEVELHEADERFLAG; - if (lev != styler.LevelAt(lineCurrent)) { - styler.SetLevel(lineCurrent, lev); - } - if ((lev & SC_FOLDLEVELNUMBERMASK) <= (levelPrev & SC_FOLDLEVELNUMBERMASK)) { - // this level is at the same level or less than the previous line - // therefore these is nothing for the previous header to collapse, so remove the header - styler.SetLevel(lineCurrent - 1, levelPrev & ~SC_FOLDLEVELHEADERFLAG); - } - levelPrev = lev; - visibleChars = 0; - bAarea = false; - bNewLine = true; - lineCurrent++; - } else { - bNewLine = false; - } - - - 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 COBOLWordListDesc[] = { - "A Keywords", - "B Keywords", - "Extended Keywords", - 0 -}; - -LexerModule lmCOBOL(SCLEX_COBOL, ColouriseCOBOLDoc, "COBOL", FoldCOBOLDoc, COBOLWordListDesc); diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx deleted file mode 100644 index 6963229f..00000000 --- a/scintilla/lexers/LexCPP.cxx +++ /dev/null @@ -1,1640 +0,0 @@ -// 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, const 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 foldPreprocessorAtElse; - 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; - foldPreprocessorAtElse = 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.cpp.preprocessor.at.else", &OptionsCPP::foldPreprocessorAtElse, - "This option enables folding on a preprocessor #else or #endif line of an #if statement."); - - 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); - if (rawStringTerminator != "") { - rawSTNew.Set(lineCurrent-1, rawStringTerminator); - } - 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.foldPreprocessorAtElse && (styler.Match(j, "else") || styler.Match(j, "elif"))) { - levelMinCurrent--; - } - } - } - if (options.foldSyntaxBased && (style == SCE_C_OPERATOR)) { - if (ch == '{' || ch == '[' || ch == '(') { - // Measure the minimum before a '{' to allow - // folding on "} else {" - if (options.foldAtElse && levelMinCurrent > levelNext) { - levelMinCurrent = levelNext; - } - levelNext++; - } else if (ch == '}' || ch == ']' || ch == ')') { - levelNext--; - } - } - if (!IsASpace(ch)) - visibleChars++; - if (atEOL || (i == endPos-1)) { - int levelUse = levelCurrent; - if ((options.foldSyntaxBased && options.foldAtElse) || - (options.foldPreprocessor && options.foldPreprocessorAtElse) - ) { - 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); diff --git a/scintilla/lexers/LexCSS.cxx b/scintilla/lexers/LexCSS.cxx deleted file mode 100644 index 4142fcbb..00000000 --- a/scintilla/lexers/LexCSS.cxx +++ /dev/null @@ -1,567 +0,0 @@ -// Scintilla source code edit control -/** @file LexCSS.cxx - ** Lexer for Cascading Style Sheets - ** Written by Jakub Vrána - ** Improved by Philippe Lhoste (CSS2) - ** Improved by Ross McKay (SCSS mode; see http://sass-lang.com/ ) - **/ -// Copyright 1998-2002 by Neil Hodgson -// The License.txt file describes the conditions under which this software may be distributed. - -// TODO: handle SCSS nested properties like font: { weight: bold; size: 1em; } -// TODO: handle SCSS interpolation: #{} -// TODO: add features for Less if somebody feels like contributing; http://lesscss.org/ -// TODO: refactor this monster so that the next poor slob can read it! - -#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 unsigned int ch) { - /* FIXME: - * The CSS spec allows "ISO 10646 characters U+00A1 and higher" to be treated as word chars. - * Unfortunately, we are only getting string bytes here, and not full unicode characters. We cannot guarantee - * that our byte is between U+0080 - U+00A0 (to return false), so we have to allow all characters U+0080 and higher - */ - return ch >= 0x80 || isalnum(ch) || ch == '-' || ch == '_'; -} - -inline bool IsCssOperator(const int ch) { - if (!((ch < 0x80) && isalnum(ch)) && - (ch == '{' || ch == '}' || ch == ':' || ch == ',' || ch == ';' || - ch == '.' || ch == '#' || ch == '!' || ch == '@' || - /* CSS2 */ - ch == '*' || ch == '>' || ch == '+' || ch == '=' || ch == '~' || ch == '|' || - ch == '[' || ch == ']' || ch == '(' || ch == ')')) { - return true; - } - return false; -} - -// look behind (from start of document to our start position) to determine current nesting level -inline int NestingLevelLookBehind(Sci_PositionU startPos, Accessor &styler) { - int ch; - int nestingLevel = 0; - - for (Sci_PositionU i = 0; i < startPos; i++) { - ch = styler.SafeGetCharAt(i); - if (ch == '{') - nestingLevel++; - else if (ch == '}') - nestingLevel--; - } - - return nestingLevel; -} - -static void ColouriseCssDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler) { - WordList &css1Props = *keywordlists[0]; - WordList &pseudoClasses = *keywordlists[1]; - WordList &css2Props = *keywordlists[2]; - WordList &css3Props = *keywordlists[3]; - WordList &pseudoElements = *keywordlists[4]; - WordList &exProps = *keywordlists[5]; - WordList &exPseudoClasses = *keywordlists[6]; - WordList &exPseudoElements = *keywordlists[7]; - - StyleContext sc(startPos, length, initStyle, styler); - - int lastState = -1; // before operator - int lastStateC = -1; // before comment - int lastStateS = -1; // before single-quoted/double-quoted string - int lastStateVar = -1; // before variable (SCSS) - int lastStateVal = -1; // before value (SCSS) - int op = ' '; // last operator - int opPrev = ' '; // last operator - bool insideParentheses = false; // true if currently in a CSS url() or similar construct - - // property lexer.css.scss.language - // Set to 1 for Sassy CSS (.scss) - bool isScssDocument = styler.GetPropertyInt("lexer.css.scss.language") != 0; - - // property lexer.css.less.language - // Set to 1 for Less CSS (.less) - bool isLessDocument = styler.GetPropertyInt("lexer.css.less.language") != 0; - - // property lexer.css.hss.language - // Set to 1 for HSS (.hss) - bool isHssDocument = styler.GetPropertyInt("lexer.css.hss.language") != 0; - - // SCSS/LESS/HSS have the concept of variable - bool hasVariables = isScssDocument || isLessDocument || isHssDocument; - char varPrefix = 0; - if (hasVariables) - varPrefix = isLessDocument ? '@' : '$'; - - // SCSS/LESS/HSS support single-line comments - typedef enum _CommentModes { eCommentBlock = 0, eCommentLine = 1} CommentMode; - CommentMode comment_mode = eCommentBlock; - bool hasSingleLineComments = isScssDocument || isLessDocument || isHssDocument; - - // must keep track of nesting level in document types that support it (SCSS/LESS/HSS) - bool hasNesting = false; - int nestingLevel = 0; - if (isScssDocument || isLessDocument || isHssDocument) { - hasNesting = true; - nestingLevel = NestingLevelLookBehind(startPos, styler); - } - - // "the loop" - for (; sc.More(); sc.Forward()) { - if (sc.state == SCE_CSS_COMMENT && ((comment_mode == eCommentBlock && sc.Match('*', '/')) || (comment_mode == eCommentLine && sc.atLineEnd))) { - if (lastStateC == -1) { - // backtrack to get last state: - // comments are like whitespace, so we must return to the previous state - Sci_PositionU i = startPos; - for (; i > 0; i--) { - if ((lastStateC = styler.StyleAt(i-1)) != SCE_CSS_COMMENT) { - if (lastStateC == SCE_CSS_OPERATOR) { - op = styler.SafeGetCharAt(i-1); - opPrev = styler.SafeGetCharAt(i-2); - while (--i) { - lastState = styler.StyleAt(i-1); - if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) - break; - } - if (i == 0) - lastState = SCE_CSS_DEFAULT; - } - break; - } - } - if (i == 0) - lastStateC = SCE_CSS_DEFAULT; - } - if (comment_mode == eCommentBlock) { - sc.Forward(); - sc.ForwardSetState(lastStateC); - } else /* eCommentLine */ { - sc.SetState(lastStateC); - } - } - - if (sc.state == SCE_CSS_COMMENT) - continue; - - if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) { - if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\'')) - continue; - Sci_PositionU i = sc.currentPos; - while (i && styler[i-1] == '\\') - i--; - if ((sc.currentPos - i) % 2 == 1) - continue; - sc.ForwardSetState(lastStateS); - } - - if (sc.state == SCE_CSS_OPERATOR) { - if (op == ' ') { - Sci_PositionU i = startPos; - op = styler.SafeGetCharAt(i-1); - opPrev = styler.SafeGetCharAt(i-2); - while (--i) { - lastState = styler.StyleAt(i-1); - if (lastState != SCE_CSS_OPERATOR && lastState != SCE_CSS_COMMENT) - break; - } - } - switch (op) { - case '@': - if (lastState == SCE_CSS_DEFAULT || hasNesting) - sc.SetState(SCE_CSS_DIRECTIVE); - break; - case '>': - case '+': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || - lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) - sc.SetState(SCE_CSS_DEFAULT); - break; - case '[': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || - lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) - sc.SetState(SCE_CSS_ATTRIBUTE); - break; - case ']': - if (lastState == SCE_CSS_ATTRIBUTE) - sc.SetState(SCE_CSS_TAG); - break; - case '{': - nestingLevel++; - switch (lastState) { - case SCE_CSS_MEDIA: - sc.SetState(SCE_CSS_DEFAULT); - break; - case SCE_CSS_TAG: - case SCE_CSS_DIRECTIVE: - sc.SetState(SCE_CSS_IDENTIFIER); - break; - } - break; - case '}': - if (--nestingLevel < 0) - nestingLevel = 0; - switch (lastState) { - case SCE_CSS_DEFAULT: - case SCE_CSS_VALUE: - case SCE_CSS_IMPORTANT: - case SCE_CSS_IDENTIFIER: - case SCE_CSS_IDENTIFIER2: - case SCE_CSS_IDENTIFIER3: - if (hasNesting) - sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT); - else - sc.SetState(SCE_CSS_DEFAULT); - break; - } - break; - case '(': - if (lastState == SCE_CSS_PSEUDOCLASS) - sc.SetState(SCE_CSS_TAG); - else if (lastState == SCE_CSS_EXTENDED_PSEUDOCLASS) - sc.SetState(SCE_CSS_EXTENDED_PSEUDOCLASS); - break; - case ')': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || - lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS || - lastState == SCE_CSS_PSEUDOELEMENT || lastState == SCE_CSS_EXTENDED_PSEUDOELEMENT) - sc.SetState(SCE_CSS_TAG); - break; - case ':': - switch (lastState) { - case SCE_CSS_TAG: - case SCE_CSS_DEFAULT: - case SCE_CSS_CLASS: - case SCE_CSS_ID: - case SCE_CSS_PSEUDOCLASS: - case SCE_CSS_EXTENDED_PSEUDOCLASS: - case SCE_CSS_UNKNOWN_PSEUDOCLASS: - case SCE_CSS_PSEUDOELEMENT: - case SCE_CSS_EXTENDED_PSEUDOELEMENT: - sc.SetState(SCE_CSS_PSEUDOCLASS); - break; - case SCE_CSS_IDENTIFIER: - case SCE_CSS_IDENTIFIER2: - case SCE_CSS_IDENTIFIER3: - case SCE_CSS_EXTENDED_IDENTIFIER: - case SCE_CSS_UNKNOWN_IDENTIFIER: - case SCE_CSS_VARIABLE: - sc.SetState(SCE_CSS_VALUE); - lastStateVal = lastState; - break; - } - break; - case '.': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || - lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) - sc.SetState(SCE_CSS_CLASS); - break; - case '#': - if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID || - lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_EXTENDED_PSEUDOCLASS || lastState == SCE_CSS_UNKNOWN_PSEUDOCLASS) - sc.SetState(SCE_CSS_ID); - break; - case ',': - case '|': - case '~': - if (lastState == SCE_CSS_TAG) - sc.SetState(SCE_CSS_DEFAULT); - break; - case ';': - switch (lastState) { - case SCE_CSS_DIRECTIVE: - if (hasNesting) { - sc.SetState(nestingLevel > 0 ? SCE_CSS_IDENTIFIER : SCE_CSS_DEFAULT); - } else { - sc.SetState(SCE_CSS_DEFAULT); - } - break; - case SCE_CSS_VALUE: - case SCE_CSS_IMPORTANT: - // data URLs can have semicolons; simplistically check for wrapping parentheses and move along - if (insideParentheses) { - sc.SetState(lastState); - } else { - if (lastStateVal == SCE_CSS_VARIABLE) { - sc.SetState(SCE_CSS_DEFAULT); - } else { - sc.SetState(SCE_CSS_IDENTIFIER); - } - } - break; - case SCE_CSS_VARIABLE: - if (lastStateVar == SCE_CSS_VALUE) { - // data URLs can have semicolons; simplistically check for wrapping parentheses and move along - if (insideParentheses) { - sc.SetState(SCE_CSS_VALUE); - } else { - sc.SetState(SCE_CSS_IDENTIFIER); - } - } else { - sc.SetState(SCE_CSS_DEFAULT); - } - break; - } - break; - case '!': - if (lastState == SCE_CSS_VALUE) - sc.SetState(SCE_CSS_IMPORTANT); - break; - } - } - - if (sc.ch == '*' && sc.state == SCE_CSS_DEFAULT) { - sc.SetState(SCE_CSS_TAG); - continue; - } - - // check for inside parentheses (whether part of an "operator" or not) - if (sc.ch == '(') - insideParentheses = true; - else if (sc.ch == ')') - insideParentheses = false; - - // SCSS special modes - if (hasVariables) { - // variable name - if (sc.ch == varPrefix) { - switch (sc.state) { - case SCE_CSS_DEFAULT: - if (isLessDocument) // give priority to pseudo elements - break; - case SCE_CSS_VALUE: - lastStateVar = sc.state; - sc.SetState(SCE_CSS_VARIABLE); - continue; - } - } - if (sc.state == SCE_CSS_VARIABLE) { - if (IsAWordChar(sc.ch)) { - // still looking at the variable name - continue; - } - if (lastStateVar == SCE_CSS_VALUE) { - // not looking at the variable name any more, and it was part of a value - sc.SetState(SCE_CSS_VALUE); - } - } - - // nested rule parent selector - if (sc.ch == '&') { - switch (sc.state) { - case SCE_CSS_DEFAULT: - case SCE_CSS_IDENTIFIER: - sc.SetState(SCE_CSS_TAG); - continue; - } - } - } - - // nesting rules that apply to SCSS and Less - if (hasNesting) { - // check for nested rule selector - if (sc.state == SCE_CSS_IDENTIFIER && (IsAWordChar(sc.ch) || sc.ch == ':' || sc.ch == '.' || sc.ch == '#')) { - // look ahead to see whether { comes before next ; and } - Sci_PositionU endPos = startPos + length; - int ch; - - for (Sci_PositionU i = sc.currentPos; i < endPos; i++) { - ch = styler.SafeGetCharAt(i); - if (ch == ';' || ch == '}') - break; - if (ch == '{') { - sc.SetState(SCE_CSS_DEFAULT); - continue; - } - } - } - - } - - if (IsAWordChar(sc.ch)) { - if (sc.state == SCE_CSS_DEFAULT) - sc.SetState(SCE_CSS_TAG); - continue; - } - - if (IsAWordChar(sc.chPrev) && ( - sc.state == SCE_CSS_IDENTIFIER || sc.state == SCE_CSS_IDENTIFIER2 || - sc.state == SCE_CSS_IDENTIFIER3 || sc.state == SCE_CSS_EXTENDED_IDENTIFIER || - sc.state == SCE_CSS_UNKNOWN_IDENTIFIER || - sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT || - sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT || - sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || - sc.state == SCE_CSS_IMPORTANT || - sc.state == SCE_CSS_DIRECTIVE - )) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - char *s2 = s; - while (*s2 && !IsAWordChar(*s2)) - s2++; - switch (sc.state) { - case SCE_CSS_IDENTIFIER: - case SCE_CSS_IDENTIFIER2: - case SCE_CSS_IDENTIFIER3: - case SCE_CSS_EXTENDED_IDENTIFIER: - case SCE_CSS_UNKNOWN_IDENTIFIER: - if (css1Props.InList(s2)) - sc.ChangeState(SCE_CSS_IDENTIFIER); - else if (css2Props.InList(s2)) - sc.ChangeState(SCE_CSS_IDENTIFIER2); - else if (css3Props.InList(s2)) - sc.ChangeState(SCE_CSS_IDENTIFIER3); - else if (exProps.InList(s2)) - sc.ChangeState(SCE_CSS_EXTENDED_IDENTIFIER); - else - sc.ChangeState(SCE_CSS_UNKNOWN_IDENTIFIER); - break; - case SCE_CSS_PSEUDOCLASS: - case SCE_CSS_PSEUDOELEMENT: - case SCE_CSS_EXTENDED_PSEUDOCLASS: - case SCE_CSS_EXTENDED_PSEUDOELEMENT: - case SCE_CSS_UNKNOWN_PSEUDOCLASS: - if (op == ':' && opPrev != ':' && pseudoClasses.InList(s2)) - sc.ChangeState(SCE_CSS_PSEUDOCLASS); - else if (opPrev == ':' && pseudoElements.InList(s2)) - sc.ChangeState(SCE_CSS_PSEUDOELEMENT); - else if ((op == ':' || (op == '(' && lastState == SCE_CSS_EXTENDED_PSEUDOCLASS)) && opPrev != ':' && exPseudoClasses.InList(s2)) - sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOCLASS); - else if (opPrev == ':' && exPseudoElements.InList(s2)) - sc.ChangeState(SCE_CSS_EXTENDED_PSEUDOELEMENT); - else - sc.ChangeState(SCE_CSS_UNKNOWN_PSEUDOCLASS); - break; - case SCE_CSS_IMPORTANT: - if (strcmp(s2, "important") != 0) - sc.ChangeState(SCE_CSS_VALUE); - break; - case SCE_CSS_DIRECTIVE: - if (op == '@' && strcmp(s2, "media") == 0) - sc.ChangeState(SCE_CSS_MEDIA); - break; - } - } - - if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && ( - sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_ID || - (sc.ch != '(' && sc.ch != ')' && ( /* This line of the condition makes it possible to extend pseudo-classes with parentheses */ - sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_PSEUDOELEMENT || - sc.state == SCE_CSS_EXTENDED_PSEUDOCLASS || sc.state == SCE_CSS_EXTENDED_PSEUDOELEMENT || - sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS - )) - )) - sc.SetState(SCE_CSS_TAG); - - if (sc.Match('/', '*')) { - lastStateC = sc.state; - comment_mode = eCommentBlock; - sc.SetState(SCE_CSS_COMMENT); - sc.Forward(); - } else if (hasSingleLineComments && sc.Match('/', '/') && !insideParentheses) { - // note that we've had to treat ([...]// as the start of a URL not a comment, e.g. url(http://example.com), url(//example.com) - lastStateC = sc.state; - comment_mode = eCommentLine; - sc.SetState(SCE_CSS_COMMENT); - sc.Forward(); - } else if ((sc.state == SCE_CSS_VALUE || sc.state == SCE_CSS_ATTRIBUTE) - && (sc.ch == '\"' || sc.ch == '\'')) { - lastStateS = sc.state; - sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING)); - } else if (IsCssOperator(sc.ch) - && (sc.state != SCE_CSS_ATTRIBUTE || sc.ch == ']') - && (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!') - && ((sc.state != SCE_CSS_DIRECTIVE && sc.state != SCE_CSS_MEDIA) || sc.ch == ';' || sc.ch == '{') - ) { - if (sc.state != SCE_CSS_OPERATOR) - lastState = sc.state; - sc.SetState(SCE_CSS_OPERATOR); - op = sc.ch; - opPrev = sc.chPrev; - } - } - - sc.Complete(); -} - -static void FoldCSSDoc(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; - Sci_Position lineCurrent = styler.GetLine(startPos); - int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - int levelCurrent = levelPrev; - char chNext = styler[startPos]; - bool inComment = (styler.StyleAt(startPos-1) == SCE_CSS_COMMENT); - for (Sci_PositionU i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - int style = styler.StyleAt(i); - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (foldComment) { - if (!inComment && (style == SCE_CSS_COMMENT)) - levelCurrent++; - else if (inComment && (style != SCE_CSS_COMMENT)) - levelCurrent--; - inComment = (style == SCE_CSS_COMMENT); - } - if (style == SCE_CSS_OPERATOR) { - if (ch == '{') { - levelCurrent++; - } else if (ch == '}') { - 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 cssWordListDesc[] = { - "CSS1 Properties", - "Pseudo-classes", - "CSS2 Properties", - "CSS3 Properties", - "Pseudo-elements", - "Browser-Specific CSS Properties", - "Browser-Specific Pseudo-classes", - "Browser-Specific Pseudo-elements", - 0 -}; - -LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc, cssWordListDesc); diff --git a/scintilla/lexers/LexCaml.cxx b/scintilla/lexers/LexCaml.cxx deleted file mode 100644 index af04524a..00000000 --- a/scintilla/lexers/LexCaml.cxx +++ /dev/null @@ -1,457 +0,0 @@ -// Scintilla source code edit control -/** @file LexCaml.cxx - ** Lexer for Objective Caml. - **/ -// Copyright 2005-2009 by Robert Roessler -// The License.txt file describes the conditions under which this software may be distributed. -/* Release History - 20050204 Initial release. - 20050205 Quick compiler standards/"cleanliness" adjustment. - 20050206 Added cast for IsLeadByte(). - 20050209 Changes to "external" build support. - 20050306 Fix for 1st-char-in-doc "corner" case. - 20050502 Fix for [harmless] one-past-the-end coloring. - 20050515 Refined numeric token recognition logic. - 20051125 Added 2nd "optional" keywords class. - 20051129 Support "magic" (read-only) comments for RCaml. - 20051204 Swtich to using StyleContext infrastructure. - 20090629 Add full Standard ML '97 support. -*/ - -#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" - -// Since the Microsoft __iscsym[f] funcs are not ANSI... -inline int iscaml(int c) {return isalnum(c) || c == '_';} -inline int iscamlf(int c) {return isalpha(c) || c == '_';} - -static const int baseT[24] = { - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A - L */ - 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0,16 /* M - X */ -}; - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - -#ifdef BUILD_AS_EXTERNAL_LEXER -/* - (actually seems to work!) -*/ -#include -#include "WindowAccessor.h" -#include "ExternalLexer.h" - -#undef EXT_LEXER_DECL -#define EXT_LEXER_DECL __declspec( dllexport ) __stdcall - -#if PLAT_WIN -#include -#endif - -static void ColouriseCamlDoc( - Sci_PositionU startPos, Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler); - -static void FoldCamlDoc( - Sci_PositionU startPos, Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler); - -static void InternalLexOrFold(int lexOrFold, Sci_PositionU startPos, Sci_Position length, - int initStyle, char *words[], WindowID window, char *props); - -static const char* LexerName = "caml"; - -#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 - -bool Platform::IsDBCSLeadByte(int codePage, char ch) { - return ::IsDBCSLeadByteEx(codePage, ch) != 0; -} - -long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { - return ::SendMessage(reinterpret_cast(w), msg, wParam, lParam); -} - -long Platform::SendScintillaPointer(WindowID w, unsigned int msg, unsigned long wParam, void *lParam) { - return ::SendMessage(reinterpret_cast(w), msg, wParam, - reinterpret_cast(lParam)); -} - -void EXT_LEXER_DECL Fold(unsigned int lexer, Sci_PositionU startPos, Sci_Position length, - int initStyle, char *words[], WindowID window, char *props) -{ - // below useless evaluation(s) to supress "not used" warnings - lexer; - // build expected data structures and do the Fold - InternalLexOrFold(1, startPos, length, initStyle, words, window, props); - -} - -int EXT_LEXER_DECL GetLexerCount() -{ - return 1; // just us [Objective] Caml lexers here! -} - -void EXT_LEXER_DECL GetLexerName(unsigned int Index, char *name, int buflength) -{ - // below useless evaluation(s) to supress "not used" warnings - Index; - // return as much of our lexer name as will fit (what's up with Index?) - if (buflength > 0) { - buflength--; - int n = strlen(LexerName); - if (n > buflength) - n = buflength; - memcpy(name, LexerName, n), name[n] = '\0'; - } -} - -void EXT_LEXER_DECL Lex(unsigned int lexer, Sci_PositionU startPos, Sci_Position length, - int initStyle, char *words[], WindowID window, char *props) -{ - // below useless evaluation(s) to supress "not used" warnings - lexer; - // build expected data structures and do the Lex - InternalLexOrFold(0, startPos, length, initStyle, words, window, props); -} - -static void InternalLexOrFold(int foldOrLex, Sci_PositionU startPos, Sci_Position length, - int initStyle, char *words[], WindowID window, char *props) -{ - // create and initialize a WindowAccessor (including contained PropSet) - PropSetSimple ps; - ps.SetMultiple(props); - WindowAccessor wa(window, ps); - // create and initialize WordList(s) - int nWL = 0; - for (; words[nWL]; nWL++) ; // count # of WordList PTRs needed - WordList** wl = new WordList* [nWL + 1];// alloc WordList PTRs - int i = 0; - for (; i < nWL; i++) { - wl[i] = new WordList(); // (works or THROWS bad_alloc EXCEPTION) - wl[i]->Set(words[i]); - } - wl[i] = 0; - // call our "internal" folder/lexer (... then do Flush!) - if (foldOrLex) - FoldCamlDoc(startPos, length, initStyle, wl, wa); - else - ColouriseCamlDoc(startPos, length, initStyle, wl, wa); - wa.Flush(); - // clean up before leaving - for (i = nWL - 1; i >= 0; i--) - delete wl[i]; - delete [] wl; -} - -static -#endif /* BUILD_AS_EXTERNAL_LEXER */ - -void ColouriseCamlDoc( - Sci_PositionU startPos, Sci_Position length, - int initStyle, - WordList *keywordlists[], - Accessor &styler) -{ - // initialize styler - StyleContext sc(startPos, length, initStyle, styler); - - Sci_PositionU chToken = 0; - int chBase = 0, chLit = 0; - WordList& keywords = *keywordlists[0]; - WordList& keywords2 = *keywordlists[1]; - WordList& keywords3 = *keywordlists[2]; - const bool isSML = keywords.InList("andalso"); - const int useMagic = styler.GetPropertyInt("lexer.caml.magic", 0); - - // set up [initial] state info (terminating states that shouldn't "bleed") - const int state_ = sc.state & 0x0f; - if (state_ <= SCE_CAML_CHAR - || (isSML && state_ == SCE_CAML_STRING)) - sc.state = SCE_CAML_DEFAULT; - int nesting = (state_ >= SCE_CAML_COMMENT)? (state_ - SCE_CAML_COMMENT): 0; - - // foreach char in range... - while (sc.More()) { - // set up [per-char] state info - int state2 = -1; // (ASSUME no state change) - Sci_Position chColor = sc.currentPos - 1;// (ASSUME standard coloring range) - bool advance = true; // (ASSUME scanner "eats" 1 char) - - // step state machine - switch (sc.state & 0x0f) { - case SCE_CAML_DEFAULT: - chToken = sc.currentPos; // save [possible] token start (JIC) - // it's wide open; what do we have? - if (iscamlf(sc.ch)) - state2 = SCE_CAML_IDENTIFIER; - else if (!isSML && sc.Match('`') && iscamlf(sc.chNext)) - state2 = SCE_CAML_TAGNAME; - else if (!isSML && sc.Match('#') && isdigit(sc.chNext)) - state2 = SCE_CAML_LINENUM; - else if (isdigit(sc.ch)) { - // it's a number, assume base 10 - state2 = SCE_CAML_NUMBER, chBase = 10; - if (sc.Match('0')) { - // there MAY be a base specified... - const char* baseC = "bBoOxX"; - if (isSML) { - if (sc.chNext == 'w') - sc.Forward(); // (consume SML "word" indicator) - baseC = "x"; - } - // ... change to specified base AS REQUIRED - if (strchr(baseC, sc.chNext)) - chBase = baseT[tolower(sc.chNext) - 'a'], sc.Forward(); - } - } else if (!isSML && sc.Match('\'')) // (Caml char literal?) - state2 = SCE_CAML_CHAR, chLit = 0; - else if (isSML && sc.Match('#', '"')) // (SML char literal?) - state2 = SCE_CAML_CHAR, sc.Forward(); - else if (sc.Match('"')) - state2 = SCE_CAML_STRING; - else if (sc.Match('(', '*')) - state2 = SCE_CAML_COMMENT, sc.Forward(), sc.ch = ' '; // (*)... - else if (strchr("!?~" /* Caml "prefix-symbol" */ - "=<>@^|&+-*/$%" /* Caml "infix-symbol" */ - "()[]{};,:.#", sc.ch) // Caml "bracket" or ;,:.# - // SML "extra" ident chars - || (isSML && (sc.Match('\\') || sc.Match('`')))) - state2 = SCE_CAML_OPERATOR; - break; - - case SCE_CAML_IDENTIFIER: - // [try to] interpret as [additional] identifier char - if (!(iscaml(sc.ch) || sc.Match('\''))) { - const Sci_Position n = sc.currentPos - chToken; - if (n < 24) { - // length is believable as keyword, [re-]construct token - char t[24]; - for (Sci_Position i = -n; i < 0; i++) - t[n + i] = static_cast(sc.GetRelative(i)); - t[n] = '\0'; - // special-case "_" token as KEYWORD - if ((n == 1 && sc.chPrev == '_') || keywords.InList(t)) - sc.ChangeState(SCE_CAML_KEYWORD); - else if (keywords2.InList(t)) - sc.ChangeState(SCE_CAML_KEYWORD2); - else if (keywords3.InList(t)) - sc.ChangeState(SCE_CAML_KEYWORD3); - } - state2 = SCE_CAML_DEFAULT, advance = false; - } - break; - - case SCE_CAML_TAGNAME: - // [try to] interpret as [additional] tagname char - if (!(iscaml(sc.ch) || sc.Match('\''))) - state2 = SCE_CAML_DEFAULT, advance = false; - break; - - /*case SCE_CAML_KEYWORD: - case SCE_CAML_KEYWORD2: - case SCE_CAML_KEYWORD3: - // [try to] interpret as [additional] keyword char - if (!iscaml(ch)) - state2 = SCE_CAML_DEFAULT, advance = false; - break;*/ - - case SCE_CAML_LINENUM: - // [try to] interpret as [additional] linenum directive char - if (!isdigit(sc.ch)) - state2 = SCE_CAML_DEFAULT, advance = false; - break; - - case SCE_CAML_OPERATOR: { - // [try to] interpret as [additional] operator char - const char* o = 0; - if (iscaml(sc.ch) || isspace(sc.ch) // ident or whitespace - || (o = strchr(")]};,\'\"#", sc.ch),o) // "termination" chars - || (!isSML && sc.Match('`')) // Caml extra term char - || (!strchr("!$%&*+-./:<=>?@^|~", sc.ch)// "operator" chars - // SML extra ident chars - && !(isSML && (sc.Match('\\') || sc.Match('`'))))) { - // check for INCLUSIVE termination - if (o && strchr(")]};,", sc.ch)) { - if ((sc.Match(')') && sc.chPrev == '(') - || (sc.Match(']') && sc.chPrev == '[')) - // special-case "()" and "[]" tokens as KEYWORDS - sc.ChangeState(SCE_CAML_KEYWORD); - chColor++; - } else - advance = false; - state2 = SCE_CAML_DEFAULT; - } - break; - } - - case SCE_CAML_NUMBER: - // [try to] interpret as [additional] numeric literal char - if ((!isSML && sc.Match('_')) || IsADigit(sc.ch, chBase)) - break; - // how about an integer suffix? - if (!isSML && (sc.Match('l') || sc.Match('L') || sc.Match('n')) - && (sc.chPrev == '_' || IsADigit(sc.chPrev, chBase))) - break; - // or a floating-point literal? - if (chBase == 10) { - // with a decimal point? - if (sc.Match('.') - && ((!isSML && sc.chPrev == '_') - || IsADigit(sc.chPrev, chBase))) - break; - // with an exponent? (I) - if ((sc.Match('e') || sc.Match('E')) - && ((!isSML && (sc.chPrev == '.' || sc.chPrev == '_')) - || IsADigit(sc.chPrev, chBase))) - break; - // with an exponent? (II) - if (((!isSML && (sc.Match('+') || sc.Match('-'))) - || (isSML && sc.Match('~'))) - && (sc.chPrev == 'e' || sc.chPrev == 'E')) - break; - } - // it looks like we have run out of number - state2 = SCE_CAML_DEFAULT, advance = false; - break; - - case SCE_CAML_CHAR: - if (!isSML) { - // [try to] interpret as [additional] char literal char - if (sc.Match('\\')) { - chLit = 1; // (definitely IS a char literal) - if (sc.chPrev == '\\') - sc.ch = ' '; // (...\\') - // should we be terminating - one way or another? - } else if ((sc.Match('\'') && sc.chPrev != '\\') - || sc.atLineEnd) { - state2 = SCE_CAML_DEFAULT; - if (sc.Match('\'')) - chColor++; - else - sc.ChangeState(SCE_CAML_IDENTIFIER); - // ... maybe a char literal, maybe not - } else if (chLit < 1 && sc.currentPos - chToken >= 2) - sc.ChangeState(SCE_CAML_IDENTIFIER), advance = false; - break; - }/* else - // fall through for SML char literal (handle like string) */ - - case SCE_CAML_STRING: - // [try to] interpret as [additional] [SML char/] string literal char - if (isSML && sc.Match('\\') && sc.chPrev != '\\' && isspace(sc.chNext)) - state2 = SCE_CAML_WHITE; - else if (sc.Match('\\') && sc.chPrev == '\\') - sc.ch = ' '; // (...\\") - // should we be terminating - one way or another? - else if ((sc.Match('"') && sc.chPrev != '\\') - || (isSML && sc.atLineEnd)) { - state2 = SCE_CAML_DEFAULT; - if (sc.Match('"')) - chColor++; - } - break; - - case SCE_CAML_WHITE: - // [try to] interpret as [additional] SML embedded whitespace char - if (sc.Match('\\')) { - // style this puppy NOW... - state2 = SCE_CAML_STRING, sc.ch = ' ' /* (...\") */, chColor++, - styler.ColourTo(chColor, SCE_CAML_WHITE), styler.Flush(); - // ... then backtrack to determine original SML literal type - Sci_Position p = chColor - 2; - for (; p >= 0 && styler.StyleAt(p) == SCE_CAML_WHITE; p--) ; - if (p >= 0) - state2 = static_cast(styler.StyleAt(p)); - // take care of state change NOW - sc.ChangeState(state2), state2 = -1; - } - break; - - case SCE_CAML_COMMENT: - case SCE_CAML_COMMENT1: - case SCE_CAML_COMMENT2: - case SCE_CAML_COMMENT3: - // we're IN a comment - does this start a NESTED comment? - if (sc.Match('(', '*')) - state2 = sc.state + 1, chToken = sc.currentPos, - sc.Forward(), sc.ch = ' ' /* (*)... */, nesting++; - // [try to] interpret as [additional] comment char - else if (sc.Match(')') && sc.chPrev == '*') { - if (nesting) - state2 = (sc.state & 0x0f) - 1, chToken = 0, nesting--; - else - state2 = SCE_CAML_DEFAULT; - chColor++; - // enable "magic" (read-only) comment AS REQUIRED - } else if (useMagic && sc.currentPos - chToken == 4 - && sc.Match('c') && sc.chPrev == 'r' && sc.GetRelative(-2) == '@') - sc.state |= 0x10; // (switch to read-only comment style) - break; - } - - // handle state change and char coloring AS REQUIRED - if (state2 >= 0) - styler.ColourTo(chColor, sc.state), sc.ChangeState(state2); - // move to next char UNLESS re-scanning current char - if (advance) - sc.Forward(); - } - - // do any required terminal char coloring (JIC) - sc.Complete(); -} - -#ifdef BUILD_AS_EXTERNAL_LEXER -static -#endif /* BUILD_AS_EXTERNAL_LEXER */ -void FoldCamlDoc( - Sci_PositionU, Sci_Position, - int, - WordList *[], - Accessor &) -{ -} - -static const char * const camlWordListDesc[] = { - "Keywords", // primary Objective Caml keywords - "Keywords2", // "optional" keywords (typically from Pervasives) - "Keywords3", // "optional" keywords (typically typenames) - 0 -}; - -#ifndef BUILD_AS_EXTERNAL_LEXER -LexerModule lmCaml(SCLEX_CAML, ColouriseCamlDoc, "caml", FoldCamlDoc, camlWordListDesc); -#endif /* BUILD_AS_EXTERNAL_LEXER */ diff --git a/scintilla/lexers/LexCmake.cxx b/scintilla/lexers/LexCmake.cxx deleted file mode 100644 index 90107079..00000000 --- a/scintilla/lexers/LexCmake.cxx +++ /dev/null @@ -1,457 +0,0 @@ -// Scintilla source code edit control -/** @file LexCmake.cxx - ** Lexer for Cmake - **/ -// Copyright 2007 by Cristian Adam -// based on the NSIS 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 isCmakeNumber(char ch) -{ - return(ch >= '0' && ch <= '9'); -} - -static bool isCmakeChar(char ch) -{ - return(ch == '.' ) || (ch == '_' ) || isCmakeNumber(ch) || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); -} - -static bool isCmakeLetter(char ch) -{ - return(ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'); -} - -static bool CmakeNextLineHasElse(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 foudn 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 ( styler.Match(firstChar, "ELSE") || styler.Match(firstChar, "else")) - return true; - break; - } - - return false; -} - -static int calculateFoldCmake(Sci_PositionU start, Sci_PositionU end, int foldlevel, Accessor &styler, bool bElse) -{ - // If the word is too long, it is not what we are looking for - if ( end - start > 20 ) - return foldlevel; - - int newFoldlevel = foldlevel; - - char s[20]; // The key word we are looking for has atmost 13 characters - for (unsigned int i = 0; i < end - start + 1 && i < 19; i++) { - s[i] = static_cast( styler[ start + i ] ); - s[i + 1] = '\0'; - } - - if ( CompareCaseInsensitive(s, "IF") == 0 || CompareCaseInsensitive(s, "WHILE") == 0 - || CompareCaseInsensitive(s, "MACRO") == 0 || CompareCaseInsensitive(s, "FOREACH") == 0 - || CompareCaseInsensitive(s, "ELSEIF") == 0 ) - newFoldlevel++; - else if ( CompareCaseInsensitive(s, "ENDIF") == 0 || CompareCaseInsensitive(s, "ENDWHILE") == 0 - || CompareCaseInsensitive(s, "ENDMACRO") == 0 || CompareCaseInsensitive(s, "ENDFOREACH") == 0) - newFoldlevel--; - else if ( bElse && CompareCaseInsensitive(s, "ELSEIF") == 0 ) - newFoldlevel++; - else if ( bElse && CompareCaseInsensitive(s, "ELSE") == 0 ) - newFoldlevel++; - - return newFoldlevel; -} - -static int classifyWordCmake(Sci_PositionU start, Sci_PositionU end, WordList *keywordLists[], Accessor &styler ) -{ - char word[100] = {0}; - char lowercaseWord[100] = {0}; - - WordList &Commands = *keywordLists[0]; - WordList &Parameters = *keywordLists[1]; - WordList &UserDefined = *keywordLists[2]; - - for (Sci_PositionU i = 0; i < end - start + 1 && i < 99; i++) { - word[i] = static_cast( styler[ start + i ] ); - lowercaseWord[i] = static_cast(tolower(word[i])); - } - - // Check for special words... - if ( CompareCaseInsensitive(word, "MACRO") == 0 || CompareCaseInsensitive(word, "ENDMACRO") == 0 ) - return SCE_CMAKE_MACRODEF; - - if ( CompareCaseInsensitive(word, "IF") == 0 || CompareCaseInsensitive(word, "ENDIF") == 0 ) - return SCE_CMAKE_IFDEFINEDEF; - - if ( CompareCaseInsensitive(word, "ELSEIF") == 0 || CompareCaseInsensitive(word, "ELSE") == 0 ) - return SCE_CMAKE_IFDEFINEDEF; - - if ( CompareCaseInsensitive(word, "WHILE") == 0 || CompareCaseInsensitive(word, "ENDWHILE") == 0) - return SCE_CMAKE_WHILEDEF; - - if ( CompareCaseInsensitive(word, "FOREACH") == 0 || CompareCaseInsensitive(word, "ENDFOREACH") == 0) - return SCE_CMAKE_FOREACHDEF; - - if ( Commands.InList(lowercaseWord) ) - return SCE_CMAKE_COMMANDS; - - if ( Parameters.InList(word) ) - return SCE_CMAKE_PARAMETERS; - - - if ( UserDefined.InList(word) ) - return SCE_CMAKE_USERDEFINED; - - if ( strlen(word) > 3 ) { - if ( word[1] == '{' && word[strlen(word)-1] == '}' ) - return SCE_CMAKE_VARIABLE; - } - - // To check for numbers - if ( isCmakeNumber( word[0] ) ) { - bool bHasSimpleCmakeNumber = true; - for (unsigned int j = 1; j < end - start + 1 && j < 99; j++) { - if ( !isCmakeNumber( word[j] ) ) { - bHasSimpleCmakeNumber = false; - break; - } - } - - if ( bHasSimpleCmakeNumber ) - return SCE_CMAKE_NUMBER; - } - - return SCE_CMAKE_DEFAULT; -} - -static void ColouriseCmakeDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) -{ - int state = SCE_CMAKE_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_CMAKE_DEFAULT: - if ( cCurrChar == '#' ) { // we have a comment line - styler.ColourTo(i-1, state ); - state = SCE_CMAKE_COMMENT; - break; - } - if ( cCurrChar == '"' ) { - styler.ColourTo(i-1, state ); - state = SCE_CMAKE_STRINGDQ; - bVarInString = false; - bClassicVarInString = false; - break; - } - if ( cCurrChar == '\'' ) { - styler.ColourTo(i-1, state ); - state = SCE_CMAKE_STRINGRQ; - bVarInString = false; - bClassicVarInString = false; - break; - } - if ( cCurrChar == '`' ) { - styler.ColourTo(i-1, state ); - state = SCE_CMAKE_STRINGLQ; - bVarInString = false; - bClassicVarInString = false; - break; - } - - // CMake Variable - if ( cCurrChar == '$' || isCmakeChar(cCurrChar)) { - styler.ColourTo(i-1,state); - state = SCE_CMAKE_VARIABLE; - - // If it is a number, we must check and set style here first... - if ( isCmakeNumber(cCurrChar) && (cNextChar == '\t' || cNextChar == ' ' || cNextChar == '\r' || cNextChar == '\n' ) ) - styler.ColourTo( i, SCE_CMAKE_NUMBER); - - break; - } - - break; - case SCE_CMAKE_COMMENT: - if ( cCurrChar == '\n' || cCurrChar == '\r' ) { - if ( styler.SafeGetCharAt(i-1) == '\\' ) { - styler.ColourTo(i-2,state); - styler.ColourTo(i-1,SCE_CMAKE_DEFAULT); - } - else { - styler.ColourTo(i-1,state); - state = SCE_CMAKE_DEFAULT; - } - } - break; - case SCE_CMAKE_STRINGDQ: - case SCE_CMAKE_STRINGLQ: - case SCE_CMAKE_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_CMAKE_STRINGDQ ) { - styler.ColourTo(i,state); - state = SCE_CMAKE_DEFAULT; - break; - } - - if ( cCurrChar == '`' && state == SCE_CMAKE_STRINGLQ ) { - styler.ColourTo(i,state); - state = SCE_CMAKE_DEFAULT; - break; - } - - if ( cCurrChar == '\'' && state == SCE_CMAKE_STRINGRQ ) { - styler.ColourTo(i,state); - state = SCE_CMAKE_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_CMAKE_DEFAULT; - } - } - break; - - case SCE_CMAKE_VARIABLE: - - // CMake Variable: - if ( cCurrChar == '$' ) - state = SCE_CMAKE_DEFAULT; - else if ( cCurrChar == '\\' && (cNextChar == 'n' || cNextChar == 'r' || cNextChar == 't' ) ) - state = SCE_CMAKE_DEFAULT; - else if ( (isCmakeChar(cCurrChar) && !isCmakeChar( cNextChar) && cNextChar != '}') || cCurrChar == '}' ) { - state = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler ); - styler.ColourTo( i, state); - state = SCE_CMAKE_DEFAULT; - } - else if ( !isCmakeChar( cCurrChar ) && cCurrChar != '{' && cCurrChar != '}' ) { - if ( classifyWordCmake( styler.GetStartSegment(), i-1, keywordLists, styler) == SCE_CMAKE_NUMBER ) - styler.ColourTo( i-1, SCE_CMAKE_NUMBER ); - - state = SCE_CMAKE_DEFAULT; - - if ( cCurrChar == '"' ) { - state = SCE_CMAKE_STRINGDQ; - bVarInString = false; - bClassicVarInString = false; - } - else if ( cCurrChar == '`' ) { - state = SCE_CMAKE_STRINGLQ; - bVarInString = false; - bClassicVarInString = false; - } - else if ( cCurrChar == '\'' ) { - state = SCE_CMAKE_STRINGRQ; - bVarInString = false; - bClassicVarInString = false; - } - else if ( cCurrChar == '#' ) { - state = SCE_CMAKE_COMMENT; - } - } - break; - } - - if ( state == SCE_CMAKE_STRINGDQ || state == SCE_CMAKE_STRINGLQ || state == SCE_CMAKE_STRINGRQ ) { - bool bIngoreNextDollarSign = false; - - 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_CMAKE_STRINGVAR); - bVarInString = false; - bIngoreNextDollarSign = false; - } - - else if ( bVarInString && !isCmakeChar(cNextChar) ) { - int nWordState = classifyWordCmake( styler.GetStartSegment(), i, keywordLists, styler); - if ( nWordState == SCE_CMAKE_VARIABLE ) - styler.ColourTo( i, SCE_CMAKE_STRINGVAR); - bVarInString = false; - } - // Covers "${TEST}..." - else if ( bClassicVarInString && cNextChar == '}' ) { - styler.ColourTo( i+1, SCE_CMAKE_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 FoldCmakeDoc(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; - - 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; - - for (Sci_PositionU i = safeStartPos; i < startPos + length; i++) { - char chCurr = styler.SafeGetCharAt(i); - - if ( bArg1 ) { - if ( nWordStart == -1 && (isCmakeLetter(chCurr)) ) { - nWordStart = i; - } - else if ( isCmakeLetter(chCurr) == false && nWordStart > -1 ) { - int newLevel = calculateFoldCmake( nWordStart, i-1, levelNext, styler, foldAtElse); - - if ( newLevel == levelNext ) { - if ( foldAtElse ) { - if ( CmakeNextLineHasElse(i, startPos + length, styler) ) - levelNext--; - } - } - else - levelNext = newLevel; - bArg1 = false; - } - } - - if ( chCurr == '\n' ) { - if ( bArg1 && foldAtElse) { - if ( CmakeNextLineHasElse(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 cmakeWordLists[] = { - "Commands", - "Parameters", - "UserDefined", - 0, - 0,}; - -LexerModule lmCmake(SCLEX_CMAKE, ColouriseCmakeDoc, "cmake", FoldCmakeDoc, cmakeWordLists); diff --git a/scintilla/lexers/LexCoffeeScript.cxx b/scintilla/lexers/LexCoffeeScript.cxx deleted file mode 100644 index df81e11f..00000000 --- a/scintilla/lexers/LexCoffeeScript.cxx +++ /dev/null @@ -1,484 +0,0 @@ -// Scintilla source code edit control -/** @file LexCoffeeScript.cxx - ** Lexer for CoffeeScript. - **/ -// Copyright 1998-2011 by Neil Hodgson -// Based on the Scintilla C++ Lexer -// Written by Eric Promislow in 2011 for the Komodo IDE -// The License.txt file describes the conditions under which this software may be distributed. - -#include -#include -#include -#include -#include -#include - -#include "Platform.h" -#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 IsSpaceEquiv(int state) { - return (state == SCE_COFFEESCRIPT_DEFAULT - || state == SCE_COFFEESCRIPT_COMMENTLINE - || state == SCE_COFFEESCRIPT_COMMENTBLOCK - || state == SCE_COFFEESCRIPT_VERBOSE_REGEX - || state == SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT - || state == SCE_COFFEESCRIPT_WORD - || state == SCE_COFFEESCRIPT_REGEX); -} - -// Store the current lexer state and brace count prior to starting a new -// `#{}` interpolation level. -// Based on LexRuby.cxx. -static void enterInnerExpression(int *p_inner_string_types, - int *p_inner_expn_brace_counts, - int& inner_string_count, - int state, - int& brace_counts - ) { - p_inner_string_types[inner_string_count] = state; - p_inner_expn_brace_counts[inner_string_count] = brace_counts; - brace_counts = 0; - ++inner_string_count; -} - -// Restore the lexer state and brace count for the previous `#{}` interpolation -// level upon returning to it. -// Note the previous lexer state is the return value and needs to be restored -// manually by the StyleContext. -// Based on LexRuby.cxx. -static int exitInnerExpression(int *p_inner_string_types, - int *p_inner_expn_brace_counts, - int& inner_string_count, - int& brace_counts - ) { - --inner_string_count; - brace_counts = p_inner_expn_brace_counts[inner_string_count]; - return p_inner_string_types[inner_string_count]; -} - -// 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. -static bool FollowsPostfixOperator(StyleContext &sc, Accessor &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; -} - -static bool followsKeyword(StyleContext &sc, Accessor &styler) { - 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; - } - } - styler.Flush(); - return styler.StyleAt(pos) == SCE_COFFEESCRIPT_WORD; -} - -static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords4 = *keywordlists[3]; - - CharacterSet setOKBeforeRE(CharacterSet::setNone, "([{=,:;!%^&*|?~+-"); - CharacterSet setCouldBePostOp(CharacterSet::setNone, "+-"); - - CharacterSet setWordStart(CharacterSet::setAlpha, "_$@", 0x80, true); - CharacterSet setWord(CharacterSet::setAlphaNum, "._$", 0x80, true); - - int chPrevNonWhite = ' '; - int visibleChars = 0; - - // String/Regex interpolation variables, based on LexRuby.cxx. - // In most cases a value of 2 should be ample for the code the user is - // likely to enter. For example, - // "Filling the #{container} with #{liquid}..." - // from the CoffeeScript homepage nests to a level of 2 - // If the user actually hits a 6th occurrence of '#{' in a double-quoted - // string (including regexes), it will stay as a string. The problem with - // this is that quotes might flip, a 7th '#{' will look like a comment, - // and code-folding might be wrong. -#define INNER_STRINGS_MAX_COUNT 5 - // These vars track our instances of "...#{,,,'..#{,,,}...',,,}..." - int inner_string_types[INNER_STRINGS_MAX_COUNT]; - // Track # braces when we push a new #{ thing - int inner_expn_brace_counts[INNER_STRINGS_MAX_COUNT]; - int inner_string_count = 0; - int brace_counts = 0; // Number of #{ ... } things within an expression - for (int i = 0; i < INNER_STRINGS_MAX_COUNT; i++) { - inner_string_types[i] = 0; - inner_expn_brace_counts[i] = 0; - } - - // look back to set chPrevNonWhite properly for better regex colouring - Sci_Position endPos = startPos + length; - if (startPos > 0 && IsSpaceEquiv(initStyle)) { - Sci_PositionU back = startPos; - styler.Flush(); - while (back > 0 && IsSpaceEquiv(styler.StyleAt(--back))) - ; - if (styler.StyleAt(back) == SCE_COFFEESCRIPT_OPERATOR) { - chPrevNonWhite = styler.SafeGetCharAt(back); - } - if (startPos != back) { - initStyle = styler.StyleAt(back); - if (IsSpaceEquiv(initStyle)) { - initStyle = SCE_COFFEESCRIPT_DEFAULT; - } - } - startPos = back; - } - - StyleContext sc(startPos, endPos - startPos, initStyle, styler); - - for (; sc.More();) { - - if (sc.atLineStart) { - // Reset states to beginning of colourise so no surprises - // if different sets of lines lexed. - visibleChars = 0; - } - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_COFFEESCRIPT_OPERATOR: - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - break; - case SCE_COFFEESCRIPT_NUMBER: - // We accept almost anything because of hex. and number suffixes - if (!setWord.Contains(sc.ch) || sc.Match('.', '.')) { - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_IDENTIFIER: - if (!setWord.Contains(sc.ch) || (sc.ch == '.') || (sc.ch == '$')) { - char s[1000]; - sc.GetCurrent(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(SCE_COFFEESCRIPT_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_COFFEESCRIPT_WORD2); - } else if (keywords4.InList(s)) { - sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS); - } else if (sc.LengthCurrent() > 0 && s[0] == '@') { - sc.ChangeState(SCE_COFFEESCRIPT_INSTANCEPROPERTY); - } - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_WORD: - case SCE_COFFEESCRIPT_WORD2: - case SCE_COFFEESCRIPT_GLOBALCLASS: - case SCE_COFFEESCRIPT_INSTANCEPROPERTY: - if (!setWord.Contains(sc.ch)) { - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_COMMENTLINE: - if (sc.atLineStart) { - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_STRING: - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT); - } else if (sc.ch == '#' && sc.chNext == '{' && inner_string_count < INNER_STRINGS_MAX_COUNT) { - // process interpolated code #{ ... } - enterInnerExpression(inner_string_types, - inner_expn_brace_counts, - inner_string_count, - sc.state, - brace_counts); - sc.SetState(SCE_COFFEESCRIPT_OPERATOR); - sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_CHARACTER: - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\'') { - sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_REGEX: - if (sc.atLineStart) { - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } else if (sc.ch == '/') { - sc.Forward(); - while ((sc.ch < 0x80) && islower(sc.ch)) - sc.Forward(); // gobble regex flags - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } else if (sc.ch == '\\') { - // Gobble up the quoted character - if (sc.chNext == '\\' || sc.chNext == '/') { - sc.Forward(); - } - } - break; - case SCE_COFFEESCRIPT_STRINGEOL: - if (sc.atLineStart) { - sc.SetState(SCE_COFFEESCRIPT_DEFAULT); - } - break; - case SCE_COFFEESCRIPT_COMMENTBLOCK: - if (sc.Match("###")) { - sc.Forward(); - sc.Forward(); - sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT); - } else if (sc.ch == '\\') { - sc.Forward(); - } - break; - case SCE_COFFEESCRIPT_VERBOSE_REGEX: - if (sc.Match("///")) { - sc.Forward(); - sc.Forward(); - sc.ForwardSetState(SCE_COFFEESCRIPT_DEFAULT); - } else if (sc.Match('#')) { - sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT); - } else if (sc.ch == '\\') { - sc.Forward(); - } - break; - case SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT: - if (sc.atLineStart) { - sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX); - } - break; - } - - // Determine if a new state should be entered. - if (sc.state == SCE_COFFEESCRIPT_DEFAULT) { - if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_COFFEESCRIPT_NUMBER); - } else if (setWordStart.Contains(sc.ch)) { - sc.SetState(SCE_COFFEESCRIPT_IDENTIFIER); - } else if (sc.Match("///")) { - sc.SetState(SCE_COFFEESCRIPT_VERBOSE_REGEX); - sc.Forward(); - sc.Forward(); - } else if (sc.ch == '/' - && (setOKBeforeRE.Contains(chPrevNonWhite) - || followsKeyword(sc, styler)) - && (!setCouldBePostOp.Contains(chPrevNonWhite) - || !FollowsPostfixOperator(sc, styler))) { - sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx - } else if (sc.ch == '\"') { - sc.SetState(SCE_COFFEESCRIPT_STRING); - } else if (sc.ch == '\'') { - sc.SetState(SCE_COFFEESCRIPT_CHARACTER); - } else if (sc.ch == '#') { - if (sc.Match("###")) { - sc.SetState(SCE_COFFEESCRIPT_COMMENTBLOCK); - sc.Forward(); - sc.Forward(); - } else { - sc.SetState(SCE_COFFEESCRIPT_COMMENTLINE); - } - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_COFFEESCRIPT_OPERATOR); - // Handle '..' and '...' operators correctly. - if (sc.ch == '.') { - for (int i = 0; i < 2 && sc.chNext == '.'; i++, sc.Forward()) ; - } else if (sc.ch == '{') { - ++brace_counts; - } else if (sc.ch == '}' && --brace_counts <= 0 && inner_string_count > 0) { - // Return to previous state before #{ ... } - sc.ForwardSetState(exitInnerExpression(inner_string_types, - inner_expn_brace_counts, - inner_string_count, - brace_counts)); - continue; // skip sc.Forward() at loop end - } - } - } - - if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { - chPrevNonWhite = sc.ch; - visibleChars++; - } - sc.Forward(); - } - 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 FoldCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length, int, - WordList *[], Accessor &styler) { - // A simplified version of FoldPyDoc - 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 - - // property fold.coffeescript.comment - const bool foldComment = styler.GetPropertyInt("fold.coffeescript.comment") != 0; - - const bool foldCompact = styler.GetPropertyInt("fold.compact") != 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 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 = Platform::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 (foldCompact) { - if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments) - skipLevel = levelBeforeComments; - - int whiteFlag = skipLineIndent & SC_FOLDLEVELWHITEFLAG; - - styler.SetLevel(skipLine, skipLevel | whiteFlag); - } else { - if ((skipLineIndent & SC_FOLDLEVELNUMBERMASK) > levelAfterComments && - !(skipLineIndent & SC_FOLDLEVELWHITEFLAG) && - !IsCommentLine(skipLine, styler)) - skipLevel = levelBeforeComments; - - styler.SetLevel(skipLine, skipLevel); - } - } - - // 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; - } -} - -static const char *const csWordLists[] = { - "Keywords", - "Secondary keywords", - "Unused", - "Global classes", - 0, -}; - -LexerModule lmCoffeeScript(SCLEX_COFFEESCRIPT, ColouriseCoffeeScriptDoc, "coffeescript", FoldCoffeeScriptDoc, csWordLists); diff --git a/scintilla/lexers/LexConf.cxx b/scintilla/lexers/LexConf.cxx deleted file mode 100644 index 2dfe1132..00000000 --- a/scintilla/lexers/LexConf.cxx +++ /dev/null @@ -1,192 +0,0 @@ -// Scintilla source code edit control -/** @file LexConf.cxx - ** Lexer for Apache Configuration Files. - ** - ** First working version contributed by Ahmad Zawawi on October 28, 2000. - ** i created this lexer because i needed something pretty when dealing - ** when Apache Configuration 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 void ColouriseConfDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) -{ - int state = SCE_CONF_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; - - // this assumes that we have 2 keyword list in conf.properties - WordList &directives = *keywordLists[0]; - WordList ¶ms = *keywordLists[1]; - - // 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_CONF_DEFAULT: - if( ch == '\n' || ch == '\r' || ch == '\t' || ch == ' ') { - // whitespace is simply ignored here... - styler.ColourTo(i,SCE_CONF_DEFAULT); - break; - } else if( ch == '#' ) { - // signals the start of a comment... - state = SCE_CONF_COMMENT; - styler.ColourTo(i,SCE_CONF_COMMENT); - } else if( ch == '.' /*|| ch == '/'*/) { - // signals the start of a file... - state = SCE_CONF_EXTENSION; - styler.ColourTo(i,SCE_CONF_EXTENSION); - } else if( ch == '"') { - state = SCE_CONF_STRING; - styler.ColourTo(i,SCE_CONF_STRING); - } else if( IsASCII(ch) && ispunct(ch) ) { - // signals an operator... - // no state jump necessary for this - // simple case... - styler.ColourTo(i,SCE_CONF_OPERATOR); - } else if( IsASCII(ch) && isalpha(ch) ) { - // signals the start of an identifier - bufferCount = 0; - buffer[bufferCount++] = static_cast(tolower(ch)); - state = SCE_CONF_IDENTIFIER; - } else if( IsASCII(ch) && isdigit(ch) ) { - // signals the start of a number - bufferCount = 0; - buffer[bufferCount++] = ch; - //styler.ColourTo(i,SCE_CONF_NUMBER); - state = SCE_CONF_NUMBER; - } else { - // style it the default style.. - styler.ColourTo(i,SCE_CONF_DEFAULT); - } - break; - - case SCE_CONF_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_CONF_DEFAULT; - } else { - styler.ColourTo(i,SCE_CONF_COMMENT); - } - break; - - case SCE_CONF_EXTENSION: - // if we find a non-alphanumeric char, - // we simply go to default state - // else we're still dealing with an extension... - if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || - (ch == '-') || (ch == '$') || - (ch == '/') || (ch == '.') || (ch == '*') ) - { - styler.ColourTo(i,SCE_CONF_EXTENSION); - } else { - state = SCE_CONF_DEFAULT; - chNext = styler[i--]; - } - break; - - case SCE_CONF_STRING: - // 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_CONF_DEFAULT; - } - styler.ColourTo(i,SCE_CONF_STRING); - break; - - case SCE_CONF_IDENTIFIER: - // stay in CONF_IDENTIFIER state until we find a non-alphanumeric - if( (IsASCII(ch) && isalnum(ch)) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) { - buffer[bufferCount++] = static_cast(tolower(ch)); - } else { - state = SCE_CONF_DEFAULT; - buffer[bufferCount] = '\0'; - - // check if the buffer contains a keyword, and highlight it if it is a keyword... - if(directives.InList(buffer)) { - styler.ColourTo(i-1,SCE_CONF_DIRECTIVE ); - } else if(params.InList(buffer)) { - styler.ColourTo(i-1,SCE_CONF_PARAMETER ); - } else if(strchr(buffer,'/') || strchr(buffer,'.')) { - styler.ColourTo(i-1,SCE_CONF_EXTENSION); - } else { - styler.ColourTo(i-1,SCE_CONF_DEFAULT); - } - - // push back the faulty character - chNext = styler[i--]; - - } - break; - - case SCE_CONF_NUMBER: - // stay in CONF_NUMBER state until we find a non-numeric - if( (IsASCII(ch) && isdigit(ch)) || ch == '.') { - buffer[bufferCount++] = ch; - } else { - state = SCE_CONF_DEFAULT; - buffer[bufferCount] = '\0'; - - // Colourize here... - if( strchr(buffer,'.') ) { - // it is an IP address... - styler.ColourTo(i-1,SCE_CONF_IP); - } else { - // normal number - styler.ColourTo(i-1,SCE_CONF_NUMBER); - } - - // push back a character - chNext = styler[i--]; - } - break; - - } - } - delete []buffer; -} - -static const char * const confWordListDesc[] = { - "Directives", - "Parameters", - 0 -}; - -LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc); diff --git a/scintilla/lexers/LexCrontab.cxx b/scintilla/lexers/LexCrontab.cxx deleted file mode 100644 index 2ad83d3a..00000000 --- a/scintilla/lexers/LexCrontab.cxx +++ /dev/null @@ -1,226 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexCsound.cxx b/scintilla/lexers/LexCsound.cxx deleted file mode 100644 index 77da3cde..00000000 --- a/scintilla/lexers/LexCsound.cxx +++ /dev/null @@ -1,214 +0,0 @@ -// Scintilla source code edit control -/** @file LexCsound.cxx - ** Lexer for Csound (Orchestra & Score) - ** Written by Georg Ritter - - **/ -// Copyright 1998-2003 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(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 == '.' || - ch == '%' || ch == '@' || ch == '$' || ch == '?'); -} - -static inline bool IsCsoundOperator(char ch) { - if (IsASCII(ch) && isalnum(ch)) - return false; - // '.' left out as it is used to make up numbers - if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || - ch == '(' || ch == ')' || ch == '=' || ch == '^' || - ch == '[' || ch == ']' || ch == '<' || ch == '&' || - ch == '>' || ch == ',' || ch == '|' || ch == '~' || - ch == '%' || ch == ':') - return true; - return false; -} - -static void ColouriseCsoundDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - - WordList &opcode = *keywordlists[0]; - WordList &headerStmt = *keywordlists[1]; - WordList &otherKeyword = *keywordlists[2]; - - // Do not leak onto next line - if (initStyle == SCE_CSOUND_STRINGEOL) - initStyle = SCE_CSOUND_DEFAULT; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) - { - // 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_CSOUND_OPERATOR) { - if (!IsCsoundOperator(static_cast(sc.ch))) { - sc.SetState(SCE_CSOUND_DEFAULT); - } - }else if (sc.state == SCE_CSOUND_NUMBER) { - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_CSOUND_DEFAULT); - } - } else if (sc.state == SCE_CSOUND_IDENTIFIER) { - if (!IsAWordChar(sc.ch) ) { - char s[100]; - sc.GetCurrent(s, sizeof(s)); - - if (opcode.InList(s)) { - sc.ChangeState(SCE_CSOUND_OPCODE); - } else if (headerStmt.InList(s)) { - sc.ChangeState(SCE_CSOUND_HEADERSTMT); - } else if (otherKeyword.InList(s)) { - sc.ChangeState(SCE_CSOUND_USERKEYWORD); - } else if (s[0] == 'p') { - sc.ChangeState(SCE_CSOUND_PARAM); - } else if (s[0] == 'a') { - sc.ChangeState(SCE_CSOUND_ARATE_VAR); - } else if (s[0] == 'k') { - sc.ChangeState(SCE_CSOUND_KRATE_VAR); - } else if (s[0] == 'i') { // covers both i-rate variables and i-statements - sc.ChangeState(SCE_CSOUND_IRATE_VAR); - } else if (s[0] == 'g') { - sc.ChangeState(SCE_CSOUND_GLOBAL_VAR); - } - sc.SetState(SCE_CSOUND_DEFAULT); - } - } - else if (sc.state == SCE_CSOUND_COMMENT ) { - if (sc.atLineEnd) { - sc.SetState(SCE_CSOUND_DEFAULT); - } - } - else if ((sc.state == SCE_CSOUND_ARATE_VAR) || - (sc.state == SCE_CSOUND_KRATE_VAR) || - (sc.state == SCE_CSOUND_IRATE_VAR)) { - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_CSOUND_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_CSOUND_DEFAULT) { - if (sc.ch == ';'){ - sc.SetState(SCE_CSOUND_COMMENT); - } else if (isdigit(sc.ch) || (sc.ch == '.' && isdigit(sc.chNext))) { - sc.SetState(SCE_CSOUND_NUMBER); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_CSOUND_IDENTIFIER); - } else if (IsCsoundOperator(static_cast(sc.ch))) { - sc.SetState(SCE_CSOUND_OPERATOR); - } else if (sc.ch == 'p') { - sc.SetState(SCE_CSOUND_PARAM); - } else if (sc.ch == 'a') { - sc.SetState(SCE_CSOUND_ARATE_VAR); - } else if (sc.ch == 'k') { - sc.SetState(SCE_CSOUND_KRATE_VAR); - } else if (sc.ch == 'i') { // covers both i-rate variables and i-statements - sc.SetState(SCE_CSOUND_IRATE_VAR); - } else if (sc.ch == 'g') { - sc.SetState(SCE_CSOUND_GLOBAL_VAR); - } - } - } - sc.Complete(); -} - -static void FoldCsoundInstruments(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); - 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_CSOUND_OPCODE) && (style == SCE_CSOUND_OPCODE)) { - char s[20]; - unsigned int j = 0; - while ((j < (sizeof(s) - 1)) && (iswordchar(styler[i + j]))) { - s[j] = styler[i + j]; - j++; - } - s[j] = '\0'; - - if (strcmp(s, "instr") == 0) - levelCurrent++; - if (strcmp(s, "endin") == 0) - 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++; - 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 csoundWordListDesc[] = { - "Opcodes", - "Header Statements", - "User keywords", - 0 -}; - -LexerModule lmCsound(SCLEX_CSOUND, ColouriseCsoundDoc, "csound", FoldCsoundInstruments, csoundWordListDesc); diff --git a/scintilla/lexers/LexD.cxx b/scintilla/lexers/LexD.cxx deleted file mode 100644 index b23bf46c..00000000 --- a/scintilla/lexers/LexD.cxx +++ /dev/null @@ -1,568 +0,0 @@ -/** @file LexD.cxx - ** Lexer for D. - ** - ** Copyright (c) 2006 by Waldemar Augustyn - ** Converted to lexer object and added further folding features/properties 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 "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 - -/* Nested comments require keeping the value of the nesting level for every - position in the document. But since scintilla always styles line by line, - we only need to store one value per line. The non-negative number indicates - nesting level at the end of the line. -*/ - -// Underscore, letter, digit and universal alphas from C99 Appendix D. - -static bool IsWordStart(int ch) { - return (IsASCII(ch) && (isalpha(ch) || ch == '_')) || !IsASCII(ch); -} - -static bool IsWord(int ch) { - return (IsASCII(ch) && (isalnum(ch) || ch == '_')) || !IsASCII(ch); -} - -static bool IsDoxygen(int ch) { - if (IsASCII(ch) && islower(ch)) - return true; - if (ch == '$' || ch == '@' || ch == '\\' || - ch == '&' || ch == '#' || ch == '<' || ch == '>' || - ch == '{' || ch == '}' || ch == '[' || ch == ']') - return true; - return false; -} - -static bool IsStringSuffix(int ch) { - return ch == 'c' || ch == 'w' || ch == 'd'; -} - -static bool IsStreamCommentStyle(int style) { - return style == SCE_D_COMMENT || - style == SCE_D_COMMENTDOC || - style == SCE_D_COMMENTDOCKEYWORD || - style == SCE_D_COMMENTDOCKEYWORDERROR; -} - -// An individual named option for use in an OptionSet - -// Options used for LexerD -struct OptionsD { - bool fold; - bool foldSyntaxBased; - bool foldComment; - bool foldCommentMultiline; - bool foldCommentExplicit; - std::string foldExplicitStart; - std::string foldExplicitEnd; - bool foldExplicitAnywhere; - bool foldCompact; - int foldAtElseInt; - bool foldAtElse; - OptionsD() { - fold = false; - foldSyntaxBased = true; - foldComment = false; - foldCommentMultiline = true; - foldCommentExplicit = true; - foldExplicitStart = ""; - foldExplicitEnd = ""; - foldExplicitAnywhere = false; - foldCompact = true; - foldAtElseInt = -1; - foldAtElse = false; - } -}; - -static const char * const dWordLists[] = { - "Primary keywords and identifiers", - "Secondary keywords and identifiers", - "Documentation comment keywords", - "Type definitions and aliases", - "Keywords 5", - "Keywords 6", - "Keywords 7", - 0, - }; - -struct OptionSetD : public OptionSet { - OptionSetD() { - DefineProperty("fold", &OptionsD::fold); - - DefineProperty("fold.d.syntax.based", &OptionsD::foldSyntaxBased, - "Set this property to 0 to disable syntax based folding."); - - DefineProperty("fold.comment", &OptionsD::foldComment); - - DefineProperty("fold.d.comment.multiline", &OptionsD::foldCommentMultiline, - "Set this property to 0 to disable folding multi-line comments when fold.comment=1."); - - DefineProperty("fold.d.comment.explicit", &OptionsD::foldCommentExplicit, - "Set this property to 0 to disable folding explicit fold points when fold.comment=1."); - - DefineProperty("fold.d.explicit.start", &OptionsD::foldExplicitStart, - "The string to use for explicit fold start points, replacing the standard //{."); - - DefineProperty("fold.d.explicit.end", &OptionsD::foldExplicitEnd, - "The string to use for explicit fold end points, replacing the standard //}."); - - DefineProperty("fold.d.explicit.anywhere", &OptionsD::foldExplicitAnywhere, - "Set this property to 1 to enable explicit fold points anywhere, not just in line comments."); - - DefineProperty("fold.compact", &OptionsD::foldCompact); - - DefineProperty("lexer.d.fold.at.else", &OptionsD::foldAtElseInt, - "This option enables D folding on a \"} else {\" line of an if statement."); - - DefineProperty("fold.at.else", &OptionsD::foldAtElse); - - DefineWordListSets(dWordLists); - } -}; - -class LexerD : public ILexer { - bool caseSensitive; - WordList keywords; - WordList keywords2; - WordList keywords3; - WordList keywords4; - WordList keywords5; - WordList keywords6; - WordList keywords7; - OptionsD options; - OptionSetD osD; -public: - LexerD(bool caseSensitive_) : - caseSensitive(caseSensitive_) { - } - virtual ~LexerD() { - } - void SCI_METHOD Release() { - delete this; - } - int SCI_METHOD Version() const { - return lvOriginal; - } - const char * SCI_METHOD PropertyNames() { - return osD.PropertyNames(); - } - int SCI_METHOD PropertyType(const char *name) { - return osD.PropertyType(name); - } - const char * SCI_METHOD DescribeProperty(const char *name) { - return osD.DescribeProperty(name); - } - Sci_Position SCI_METHOD PropertySet(const char *key, const char *val); - const char * SCI_METHOD DescribeWordListSets() { - return osD.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 *LexerFactoryD() { - return new LexerD(true); - } - static ILexer *LexerFactoryDInsensitive() { - return new LexerD(false); - } -}; - -Sci_Position SCI_METHOD LexerD::PropertySet(const char *key, const char *val) { - if (osD.PropertySet(&options, key, val)) { - return 0; - } - return -1; -} - -Sci_Position SCI_METHOD LexerD::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 = &keywords6; - break; - case 6: - wordListN = &keywords7; - 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 LexerD::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - LexAccessor styler(pAccess); - - int styleBeforeDCKeyword = SCE_D_DEFAULT; - - StyleContext sc(startPos, length, initStyle, styler); - - Sci_Position curLine = styler.GetLine(startPos); - int curNcLevel = curLine > 0? styler.GetLineState(curLine-1): 0; - bool numFloat = false; // Float literals have '+' and '-' signs - bool numHex = false; - - for (; sc.More(); sc.Forward()) { - - if (sc.atLineStart) { - curLine = styler.GetLine(sc.currentPos); - styler.SetLineState(curLine, curNcLevel); - } - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_D_OPERATOR: - sc.SetState(SCE_D_DEFAULT); - break; - case SCE_D_NUMBER: - // We accept almost anything because of hex. and number suffixes - if (IsASCII(sc.ch) && (isalnum(sc.ch) || sc.ch == '_')) { - continue; - } else if (sc.ch == '.' && sc.chNext != '.' && !numFloat) { - // Don't parse 0..2 as number. - numFloat=true; - continue; - } else if ( ( sc.ch == '-' || sc.ch == '+' ) && ( /*sign and*/ - ( !numHex && ( sc.chPrev == 'e' || sc.chPrev == 'E' ) ) || /*decimal or*/ - ( sc.chPrev == 'p' || sc.chPrev == 'P' ) ) ) { /*hex*/ - // Parse exponent sign in float literals: 2e+10 0x2e+10 - continue; - } else { - sc.SetState(SCE_D_DEFAULT); - } - break; - case SCE_D_IDENTIFIER: - if (!IsWord(sc.ch)) { - char s[1000]; - if (caseSensitive) { - sc.GetCurrent(s, sizeof(s)); - } else { - sc.GetCurrentLowered(s, sizeof(s)); - } - if (keywords.InList(s)) { - sc.ChangeState(SCE_D_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_D_WORD2); - } else if (keywords4.InList(s)) { - sc.ChangeState(SCE_D_TYPEDEF); - } else if (keywords5.InList(s)) { - sc.ChangeState(SCE_D_WORD5); - } else if (keywords6.InList(s)) { - sc.ChangeState(SCE_D_WORD6); - } else if (keywords7.InList(s)) { - sc.ChangeState(SCE_D_WORD7); - } - sc.SetState(SCE_D_DEFAULT); - } - break; - case SCE_D_COMMENT: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } - break; - case SCE_D_COMMENTDOC: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } 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_D_COMMENTDOC; - sc.SetState(SCE_D_COMMENTDOCKEYWORD); - } - } - break; - case SCE_D_COMMENTLINE: - if (sc.atLineStart) { - sc.SetState(SCE_D_DEFAULT); - } - break; - case SCE_D_COMMENTLINEDOC: - if (sc.atLineStart) { - sc.SetState(SCE_D_DEFAULT); - } 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_D_COMMENTLINEDOC; - sc.SetState(SCE_D_COMMENTDOCKEYWORD); - } - } - break; - case SCE_D_COMMENTDOCKEYWORD: - if ((styleBeforeDCKeyword == SCE_D_COMMENTDOC) && sc.Match('*', '/')) { - sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR); - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } else if (!IsDoxygen(sc.ch)) { - char s[100]; - if (caseSensitive) { - sc.GetCurrent(s, sizeof(s)); - } else { - sc.GetCurrentLowered(s, sizeof(s)); - } - if (!IsASpace(sc.ch) || !keywords3.InList(s + 1)) { - sc.ChangeState(SCE_D_COMMENTDOCKEYWORDERROR); - } - sc.SetState(styleBeforeDCKeyword); - } - break; - case SCE_D_COMMENTNESTED: - if (sc.Match('+', '/')) { - if (curNcLevel > 0) - curNcLevel -= 1; - curLine = styler.GetLine(sc.currentPos); - styler.SetLineState(curLine, curNcLevel); - sc.Forward(); - if (curNcLevel == 0) { - sc.ForwardSetState(SCE_D_DEFAULT); - } - } else if (sc.Match('/','+')) { - curNcLevel += 1; - curLine = styler.GetLine(sc.currentPos); - styler.SetLineState(curLine, curNcLevel); - sc.Forward(); - } - break; - case SCE_D_STRING: - if (sc.ch == '\\') { - if (sc.chNext == '"' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '"') { - if(IsStringSuffix(sc.chNext)) - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } - break; - case SCE_D_CHARACTER: - if (sc.atLineEnd) { - sc.ChangeState(SCE_D_STRINGEOL); - } else if (sc.ch == '\\') { - if (sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\'') { - // Char has no suffixes - sc.ForwardSetState(SCE_D_DEFAULT); - } - break; - case SCE_D_STRINGEOL: - if (sc.atLineStart) { - sc.SetState(SCE_D_DEFAULT); - } - break; - case SCE_D_STRINGB: - if (sc.ch == '`') { - if(IsStringSuffix(sc.chNext)) - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } - break; - case SCE_D_STRINGR: - if (sc.ch == '"') { - if(IsStringSuffix(sc.chNext)) - sc.Forward(); - sc.ForwardSetState(SCE_D_DEFAULT); - } - break; - } - - // Determine if a new state should be entered. - if (sc.state == SCE_D_DEFAULT) { - if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_D_NUMBER); - numFloat = sc.ch == '.'; - // Remember hex literal - numHex = sc.ch == '0' && ( sc.chNext == 'x' || sc.chNext == 'X' ); - } else if ( (sc.ch == 'r' || sc.ch == 'x' || sc.ch == 'q') - && sc.chNext == '"' ) { - // Limited support for hex and delimited strings: parse as r"" - sc.SetState(SCE_D_STRINGR); - sc.Forward(); - } else if (IsWordStart(sc.ch) || sc.ch == '$') { - sc.SetState(SCE_D_IDENTIFIER); - } else if (sc.Match('/','+')) { - curNcLevel += 1; - curLine = styler.GetLine(sc.currentPos); - styler.SetLineState(curLine, curNcLevel); - sc.SetState(SCE_D_COMMENTNESTED); - sc.Forward(); - } else if (sc.Match('/', '*')) { - if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style - sc.SetState(SCE_D_COMMENTDOC); - } else { - sc.SetState(SCE_D_COMMENT); - } - 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_D_COMMENTLINEDOC); - else - sc.SetState(SCE_D_COMMENTLINE); - } else if (sc.ch == '"') { - sc.SetState(SCE_D_STRING); - } else if (sc.ch == '\'') { - sc.SetState(SCE_D_CHARACTER); - } else if (sc.ch == '`') { - sc.SetState(SCE_D_STRINGB); - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_D_OPERATOR); - if (sc.ch == '.' && sc.chNext == '.') sc.Forward(); // Range operator - } - } - } - 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 LexerD::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); - 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 = styler.StyleAt(startPos); - int style = initStyle; - bool foldAtElse = options.foldAtElseInt >= 0 ? options.foldAtElseInt != 0 : options.foldAtElse; - 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 = styler.StyleAt(i + 1); - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - if (options.foldComment && options.foldCommentMultiline && 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 && options.foldCommentExplicit && ((style == SCE_D_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.foldSyntaxBased && (style == SCE_D_OPERATOR)) { - if (ch == '{') { - // Measure the minimum before a '{' to allow - // folding on "} else {" - if (levelMinCurrent > levelNext) { - levelMinCurrent = levelNext; - } - levelNext++; - } else if (ch == '}') { - levelNext--; - } - } - if (atEOL || (i == endPos-1)) { - if (options.foldComment && options.foldCommentMultiline) { // Handle nested comments - int nc; - nc = styler.GetLineState(lineCurrent); - nc -= lineCurrent>0? styler.GetLineState(lineCurrent-1): 0; - levelNext += nc; - } - int levelUse = levelCurrent; - if (options.foldSyntaxBased && 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++; - levelCurrent = levelNext; - levelMinCurrent = levelCurrent; - visibleChars = 0; - } - if (!IsASpace(ch)) - visibleChars++; - } -} - -LexerModule lmD(SCLEX_D, LexerD::LexerFactoryD, "d", dWordLists); diff --git a/scintilla/lexers/LexDMAP.cxx b/scintilla/lexers/LexDMAP.cxx deleted file mode 100644 index 0504fc03..00000000 --- a/scintilla/lexers/LexDMAP.cxx +++ /dev/null @@ -1,228 +0,0 @@ -// Scintilla source code edit control -/** @file LexDMAP.cxx - ** Lexer for MSC Nastran DMAP. - ** Written by Mark Robinson, based on the Fortran lexer by Chuan-jian Shen, Last changed Aug. 2013 - **/ -// 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 IsAWordChar(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%'); -} -/**********************************************/ -static inline bool IsAWordStart(const int ch) { - return (ch < 0x80) && (isalnum(ch)); -} -/***************************************/ -static void ColouriseDMAPDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *keywordlists[], Accessor &styler) { - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords3 = *keywordlists[2]; - /***************************************/ - Sci_Position posLineStart = 0, numNonBlank = 0; - Sci_Position endPos = startPos + length; - /***************************************/ - // backtrack to the nearest keyword - while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_DMAP_WORD)) { - startPos--; - } - startPos = styler.LineStart(styler.GetLine(startPos)); - initStyle = styler.StyleAt(startPos - 1); - StyleContext sc(startPos, endPos-startPos, initStyle, styler); - /***************************************/ - for (; sc.More(); sc.Forward()) { - // remember the start position of the line - if (sc.atLineStart) { - posLineStart = sc.currentPos; - numNonBlank = 0; - sc.SetState(SCE_DMAP_DEFAULT); - } - if (!IsASpaceOrTab(sc.ch)) numNonBlank ++; - /***********************************************/ - // Handle data appearing after column 72; it is ignored - Sci_Position toLineStart = sc.currentPos - posLineStart; - if (toLineStart >= 72 || sc.ch == '$') { - sc.SetState(SCE_DMAP_COMMENT); - while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end - continue; - } - /***************************************/ - // Determine if the current state should terminate. - if (sc.state == SCE_DMAP_OPERATOR) { - sc.SetState(SCE_DMAP_DEFAULT); - } else if (sc.state == SCE_DMAP_NUMBER) { - if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) { - sc.SetState(SCE_DMAP_DEFAULT); - } - } else if (sc.state == SCE_DMAP_IDENTIFIER) { - if (!IsAWordChar(sc.ch) || (sc.ch == '%')) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(SCE_DMAP_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_DMAP_WORD2); - } else if (keywords3.InList(s)) { - sc.ChangeState(SCE_DMAP_WORD3); - } - sc.SetState(SCE_DMAP_DEFAULT); - } - } else if (sc.state == SCE_DMAP_COMMENT) { - if (sc.ch == '\r' || sc.ch == '\n') { - sc.SetState(SCE_DMAP_DEFAULT); - } - } else if (sc.state == SCE_DMAP_STRING1) { - if (sc.ch == '\'') { - if (sc.chNext == '\'') { - sc.Forward(); - } else { - sc.ForwardSetState(SCE_DMAP_DEFAULT); - } - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_DMAP_STRINGEOL); - sc.ForwardSetState(SCE_DMAP_DEFAULT); - } - } else if (sc.state == SCE_DMAP_STRING2) { - if (sc.atLineEnd) { - sc.ChangeState(SCE_DMAP_STRINGEOL); - sc.ForwardSetState(SCE_DMAP_DEFAULT); - } else if (sc.ch == '\"') { - if (sc.chNext == '\"') { - sc.Forward(); - } else { - sc.ForwardSetState(SCE_DMAP_DEFAULT); - } - } - } - /***************************************/ - // Determine if a new state should be entered. - if (sc.state == SCE_DMAP_DEFAULT) { - if (sc.ch == '$') { - sc.SetState(SCE_DMAP_COMMENT); - } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) || (sc.ch == '-' && IsADigit(sc.chNext))) { - sc.SetState(SCE_F_NUMBER); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_DMAP_IDENTIFIER); - } else if (sc.ch == '\"') { - sc.SetState(SCE_DMAP_STRING2); - } else if (sc.ch == '\'') { - sc.SetState(SCE_DMAP_STRING1); - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_DMAP_OPERATOR); - } - } - } - sc.Complete(); -} -/***************************************/ -// To determine the folding level depending on keywords -static int classifyFoldPointDMAP(const char* s, const char* prevWord) { - int lev = 0; - if ((strcmp(prevWord, "else") == 0 && strcmp(s, "if") == 0) || strcmp(s, "enddo") == 0 || strcmp(s, "endif") == 0) { - lev = -1; - } else if ((strcmp(prevWord, "do") == 0 && strcmp(s, "while") == 0) || strcmp(s, "then") == 0) { - lev = 1; - } - return lev; -} -// Folding the code -static void FoldDMAPDoc(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; - 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 ((stylePrev == SCE_DMAP_DEFAULT || stylePrev == SCE_DMAP_OPERATOR || stylePrev == SCE_DMAP_COMMENT) && (style == SCE_DMAP_WORD)) { - // Store last word and label start point. - lastStart = i; - } - /***************************************/ - if (style == SCE_DMAP_WORD) { - if(iswordchar(ch) && !iswordchar(chNext)) { - char s[32]; - Sci_PositionU k; - for(k=0; (k<31 ) && (k(tolower(styler[lastStart+k])); - } - s[k] = '\0'; - levelCurrent += classifyFoldPointDMAP(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 DMAPWordLists[] = { - "Primary keywords and identifiers", - "Intrinsic functions", - "Extended and user defined functions", - 0, -}; -/***************************************/ -LexerModule lmDMAP(SCLEX_DMAP, ColouriseDMAPDoc, "DMAP", FoldDMAPDoc, DMAPWordLists); diff --git a/scintilla/lexers/LexDMIS.cxx b/scintilla/lexers/LexDMIS.cxx deleted file mode 100644 index 5803e535..00000000 --- a/scintilla/lexers/LexDMIS.cxx +++ /dev/null @@ -1,355 +0,0 @@ -// Scintilla source code edit control -/** @file LexDMIS.cxx - ** Lexer for DMIS. - **/ -// Copyright 1998-2005 by Neil Hodgson -// Copyright 2013-2014 by Andreas Tscharner -// The License.txt file describes the conditions under which this software may be distributed. - - -#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" - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - - -static const char *const DMISWordListDesc[] = { - "DMIS Major Words", - "DMIS Minor Words", - "Unsupported DMIS Major Words", - "Unsupported DMIS Minor Words", - "Keywords for code folding start", - "Corresponding keywords for code folding end", - 0 -}; - - -class LexerDMIS : public ILexer -{ - private: - char *m_wordListSets; - WordList m_majorWords; - WordList m_minorWords; - WordList m_unsupportedMajor; - WordList m_unsupportedMinor; - WordList m_codeFoldingStart; - WordList m_codeFoldingEnd; - - char * SCI_METHOD UpperCase(char *item); - void SCI_METHOD InitWordListSets(void); - - public: - LexerDMIS(void); - virtual ~LexerDMIS(void); - - int SCI_METHOD Version() const { - return lvOriginal; - } - - void SCI_METHOD Release() { - delete this; - } - - const char * SCI_METHOD PropertyNames() { - return NULL; - } - - int SCI_METHOD PropertyType(const char *) { - return -1; - } - - const char * SCI_METHOD DescribeProperty(const char *) { - return NULL; - } - - Sci_Position SCI_METHOD PropertySet(const char *, const char *) { - return -1; - } - - Sci_Position SCI_METHOD WordListSet(int n, const char *wl); - - void * SCI_METHOD PrivateCall(int, void *) { - return NULL; - } - - static ILexer *LexerFactoryDMIS() { - return new LexerDMIS; - } - - const char * SCI_METHOD DescribeWordListSets(); - void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess); - void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess); -}; - - -char * SCI_METHOD LexerDMIS::UpperCase(char *item) -{ - char *itemStart; - - - itemStart = item; - while (item && *item) { - *item = toupper(*item); - item++; - }; - return itemStart; -} - -void SCI_METHOD LexerDMIS::InitWordListSets(void) -{ - size_t totalLen = 0; - - - for (int i=0; DMISWordListDesc[i]; i++) { - totalLen += strlen(DMISWordListDesc[i]); - totalLen++; - }; - - totalLen++; - this->m_wordListSets = new char[totalLen]; - memset(this->m_wordListSets, 0, totalLen); - - for (int i=0; DMISWordListDesc[i]; i++) { - strcat(this->m_wordListSets, DMISWordListDesc[i]); - strcat(this->m_wordListSets, "\n"); - }; -} - - -LexerDMIS::LexerDMIS(void) { - this->InitWordListSets(); - - this->m_majorWords.Clear(); - this->m_minorWords.Clear(); - this->m_unsupportedMajor.Clear(); - this->m_unsupportedMinor.Clear(); - this->m_codeFoldingStart.Clear(); - this->m_codeFoldingEnd.Clear(); -} - -LexerDMIS::~LexerDMIS(void) { - delete[] this->m_wordListSets; -} - -Sci_Position SCI_METHOD LexerDMIS::WordListSet(int n, const char *wl) -{ - switch (n) { - case 0: - this->m_majorWords.Clear(); - this->m_majorWords.Set(wl); - break; - case 1: - this->m_minorWords.Clear(); - this->m_minorWords.Set(wl); - break; - case 2: - this->m_unsupportedMajor.Clear(); - this->m_unsupportedMajor.Set(wl); - break; - case 3: - this->m_unsupportedMinor.Clear(); - this->m_unsupportedMinor.Set(wl); - break; - case 4: - this->m_codeFoldingStart.Clear(); - this->m_codeFoldingStart.Set(wl); - break; - case 5: - this->m_codeFoldingEnd.Clear(); - this->m_codeFoldingEnd.Set(wl); - break; - default: - return -1; - break; - } - - return 0; -} - -const char * SCI_METHOD LexerDMIS::DescribeWordListSets() -{ - return this->m_wordListSets; -} - -void SCI_METHOD LexerDMIS::Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) -{ - const Sci_PositionU MAX_STR_LEN = 100; - - LexAccessor styler(pAccess); - StyleContext scCTX(startPos, lengthDoc, initStyle, styler); - CharacterSet setDMISNumber(CharacterSet::setDigits, ".-+eE"); - CharacterSet setDMISWordStart(CharacterSet::setAlpha, "-234", 0x80, true); - CharacterSet setDMISWord(CharacterSet::setAlpha); - - - bool isIFLine = false; - - for (; scCTX.More(); scCTX.Forward()) { - if (scCTX.atLineEnd) { - isIFLine = false; - }; - - switch (scCTX.state) { - case SCE_DMIS_DEFAULT: - if (scCTX.Match('$', '$')) { - scCTX.SetState(SCE_DMIS_COMMENT); - scCTX.Forward(); - }; - if (scCTX.Match('\'')) { - scCTX.SetState(SCE_DMIS_STRING); - }; - if (IsADigit(scCTX.ch) || ((scCTX.Match('-') || scCTX.Match('+')) && IsADigit(scCTX.chNext))) { - scCTX.SetState(SCE_DMIS_NUMBER); - break; - }; - if (setDMISWordStart.Contains(scCTX.ch)) { - scCTX.SetState(SCE_DMIS_KEYWORD); - }; - if (scCTX.Match('(') && (!isIFLine)) { - scCTX.SetState(SCE_DMIS_LABEL); - }; - break; - - case SCE_DMIS_COMMENT: - if (scCTX.atLineEnd) { - scCTX.SetState(SCE_DMIS_DEFAULT); - }; - break; - - case SCE_DMIS_STRING: - if (scCTX.Match('\'')) { - scCTX.SetState(SCE_DMIS_DEFAULT); - }; - break; - - case SCE_DMIS_NUMBER: - if (!setDMISNumber.Contains(scCTX.ch)) { - scCTX.SetState(SCE_DMIS_DEFAULT); - }; - break; - - case SCE_DMIS_KEYWORD: - if (!setDMISWord.Contains(scCTX.ch)) { - char tmpStr[MAX_STR_LEN]; - memset(tmpStr, 0, MAX_STR_LEN*sizeof(char)); - scCTX.GetCurrent(tmpStr, (MAX_STR_LEN-1)); - strncpy(tmpStr, this->UpperCase(tmpStr), (MAX_STR_LEN-1)); - - if (this->m_minorWords.InList(tmpStr)) { - scCTX.ChangeState(SCE_DMIS_MINORWORD); - }; - if (this->m_majorWords.InList(tmpStr)) { - isIFLine = (strcmp(tmpStr, "IF") == 0); - scCTX.ChangeState(SCE_DMIS_MAJORWORD); - }; - if (this->m_unsupportedMajor.InList(tmpStr)) { - scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MAJOR); - }; - if (this->m_unsupportedMinor.InList(tmpStr)) { - scCTX.ChangeState(SCE_DMIS_UNSUPPORTED_MINOR); - }; - - if (scCTX.Match('(') && (!isIFLine)) { - scCTX.SetState(SCE_DMIS_LABEL); - } else { - scCTX.SetState(SCE_DMIS_DEFAULT); - }; - }; - break; - - case SCE_DMIS_LABEL: - if (scCTX.Match(')')) { - scCTX.SetState(SCE_DMIS_DEFAULT); - }; - break; - }; - }; - scCTX.Complete(); -} - -void SCI_METHOD LexerDMIS::Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int, IDocument *pAccess) -{ - const int MAX_STR_LEN = 100; - - LexAccessor styler(pAccess); - Sci_PositionU endPos = startPos + lengthDoc; - char chNext = styler[startPos]; - Sci_Position lineCurrent = styler.GetLine(startPos); - int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - int levelCurrent = levelPrev; - int strPos = 0; - bool foldWordPossible = false; - CharacterSet setDMISFoldWord(CharacterSet::setAlpha); - char *tmpStr; - - - tmpStr = new char[MAX_STR_LEN]; - memset(tmpStr, 0, MAX_STR_LEN*sizeof(char)); - - for (Sci_PositionU i=startPos; i= (MAX_STR_LEN-1)) { - strPos = MAX_STR_LEN-1; - }; - - int style = styler.StyleAt(i); - bool noFoldPos = ((style == SCE_DMIS_COMMENT) || (style == SCE_DMIS_STRING)); - - if (foldWordPossible) { - if (setDMISFoldWord.Contains(ch)) { - tmpStr[strPos++] = ch; - } else { - tmpStr = this->UpperCase(tmpStr); - if (this->m_codeFoldingStart.InList(tmpStr) && (!noFoldPos)) { - levelCurrent++; - }; - if (this->m_codeFoldingEnd.InList(tmpStr) && (!noFoldPos)) { - levelCurrent--; - }; - memset(tmpStr, 0, MAX_STR_LEN*sizeof(char)); - strPos = 0; - foldWordPossible = false; - }; - } else { - if (setDMISFoldWord.Contains(ch)) { - tmpStr[strPos++] = ch; - foldWordPossible = true; - }; - }; - - if (atEOL || (i == (endPos-1))) { - int lev = levelPrev; - - if (levelCurrent > levelPrev) { - lev |= SC_FOLDLEVELHEADERFLAG; - }; - if (lev != styler.LevelAt(lineCurrent)) { - styler.SetLevel(lineCurrent, lev); - }; - lineCurrent++; - levelPrev = levelCurrent; - }; - }; - delete[] tmpStr; -} - - -LexerModule lmDMIS(SCLEX_DMIS, LexerDMIS::LexerFactoryDMIS, "DMIS", DMISWordListDesc); diff --git a/scintilla/lexers/LexDiff.cxx b/scintilla/lexers/LexDiff.cxx deleted file mode 100644 index e4e4d9e0..00000000 --- a/scintilla/lexers/LexDiff.cxx +++ /dev/null @@ -1,153 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexECL.cxx b/scintilla/lexers/LexECL.cxx deleted file mode 100644 index 4ab6c1bc..00000000 --- a/scintilla/lexers/LexECL.cxx +++ /dev/null @@ -1,521 +0,0 @@ -// Scintilla source code edit control -/** @file LexECL.cxx - ** Lexer for ECL. - **/ -// 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 - -#ifdef _MSC_VER -#pragma warning(disable: 4786) -#endif -#ifdef __BORLANDC__ -// Borland C++ displays warnings in vector header without this -#pragma option -w-ccc -w-rch -#endif - -#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" -#include "OptionSet.h" - -#define SET_LOWER "abcdefghijklmnopqrstuvwxyz" -#define SET_UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" -#define SET_DIGITS "0123456789" - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - -static bool IsSpaceEquiv(int state) { - switch (state) { - case SCE_ECL_DEFAULT: - case SCE_ECL_COMMENT: - case SCE_ECL_COMMENTLINE: - case SCE_ECL_COMMENTLINEDOC: - case SCE_ECL_COMMENTDOCKEYWORD: - case SCE_ECL_COMMENTDOCKEYWORDERROR: - case SCE_ECL_COMMENTDOC: - return true; - - default: - return false; - } -} - -static void ColouriseEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - WordList &keywords0 = *keywordlists[0]; - WordList &keywords1 = *keywordlists[1]; - WordList &keywords2 = *keywordlists[2]; - WordList &keywords3 = *keywordlists[3]; //Value Types - WordList &keywords4 = *keywordlists[4]; - WordList &keywords5 = *keywordlists[5]; - WordList &keywords6 = *keywordlists[6]; //Javadoc Tags - WordList cplusplus; - cplusplus.Set("beginc endc"); - - bool stylingWithinPreprocessor = false; - - CharacterSet setOKBeforeRE(CharacterSet::setNone, "(=,"); - CharacterSet setDoxygen(CharacterSet::setLower, "$@\\&<>#{}[]"); - CharacterSet setWordStart(CharacterSet::setAlpha, "_", 0x80, true); - CharacterSet setWord(CharacterSet::setAlphaNum, "._", 0x80, true); - CharacterSet setQualified(CharacterSet::setNone, "uUxX"); - - int chPrevNonWhite = ' '; - int visibleChars = 0; - bool lastWordWasUUID = false; - int styleBeforeDCKeyword = SCE_ECL_DEFAULT; - bool continuationLine = false; - - if (initStyle == SCE_ECL_PREPROCESSOR) { - // Set continuationLine if last character of previous line is '\' - Sci_Position lineCurrent = styler.GetLine(startPos); - if (lineCurrent > 0) { - int chBack = styler.SafeGetCharAt(startPos-1, 0); - int chBack2 = styler.SafeGetCharAt(startPos-2, 0); - int lineEndChar = '!'; - if (chBack2 == '\r' && chBack == '\n') { - lineEndChar = styler.SafeGetCharAt(startPos-3, 0); - } else if (chBack == '\n' || chBack == '\r') { - lineEndChar = chBack2; - } - continuationLine = lineEndChar == '\\'; - } - } - - // look back to set chPrevNonWhite properly for better regex colouring - if (startPos > 0) { - Sci_Position back = startPos; - while (--back && IsSpaceEquiv(styler.StyleAt(back))) - ; - if (styler.StyleAt(back) == SCE_ECL_OPERATOR) { - chPrevNonWhite = styler.SafeGetCharAt(back); - } - } - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - if (sc.atLineStart) { - if (sc.state == SCE_ECL_STRING) { - // Prevent SCE_ECL_STRINGEOL from leaking back to previous line which - // ends with a line continuation by locking in the state upto this position. - sc.SetState(SCE_ECL_STRING); - } - // Reset states to begining of colourise so no surprises - // if different sets of lines lexed. - visibleChars = 0; - lastWordWasUUID = false; - } - - // 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(); - } - continuationLine = true; - continue; - } - } - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_ECL_ADDED: - case SCE_ECL_DELETED: - case SCE_ECL_CHANGED: - case SCE_ECL_MOVED: - if (sc.atLineStart) - sc.SetState(SCE_ECL_DEFAULT); - break; - case SCE_ECL_OPERATOR: - sc.SetState(SCE_ECL_DEFAULT); - break; - case SCE_ECL_NUMBER: - // We accept almost anything because of hex. and number suffixes - if (!setWord.Contains(sc.ch)) { - sc.SetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_IDENTIFIER: - if (!setWord.Contains(sc.ch) || (sc.ch == '.')) { - char s[1000]; - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords0.InList(s)) { - lastWordWasUUID = strcmp(s, "uuid") == 0; - sc.ChangeState(SCE_ECL_WORD0); - } else if (keywords1.InList(s)) { - sc.ChangeState(SCE_ECL_WORD1); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_ECL_WORD2); - } else if (keywords4.InList(s)) { - sc.ChangeState(SCE_ECL_WORD4); - } else if (keywords5.InList(s)) { - sc.ChangeState(SCE_ECL_WORD5); - } - else //Data types are of from KEYWORD## - { - int i = static_cast(strlen(s)) - 1; - while(i >= 0 && (isdigit(s[i]) || s[i] == '_')) - --i; - - char s2[1000]; - strncpy(s2, s, i + 1); - s2[i + 1] = 0; - if (keywords3.InList(s2)) { - sc.ChangeState(SCE_ECL_WORD3); - } - } - sc.SetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_PREPROCESSOR: - if (sc.atLineStart && !continuationLine) { - sc.SetState(SCE_ECL_DEFAULT); - } else if (stylingWithinPreprocessor) { - if (IsASpace(sc.ch)) { - sc.SetState(SCE_ECL_DEFAULT); - } - } else { - if (sc.Match('/', '*') || sc.Match('/', '/')) { - sc.SetState(SCE_ECL_DEFAULT); - } - } - break; - case SCE_ECL_COMMENT: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_COMMENTDOC: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(SCE_ECL_DEFAULT); - } 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_ECL_COMMENTDOC; - sc.SetState(SCE_ECL_COMMENTDOCKEYWORD); - } - } - break; - case SCE_ECL_COMMENTLINE: - if (sc.atLineStart) { - sc.SetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_COMMENTLINEDOC: - if (sc.atLineStart) { - sc.SetState(SCE_ECL_DEFAULT); - } 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_ECL_COMMENTLINEDOC; - sc.SetState(SCE_ECL_COMMENTDOCKEYWORD); - } - } - break; - case SCE_ECL_COMMENTDOCKEYWORD: - if ((styleBeforeDCKeyword == SCE_ECL_COMMENTDOC) && sc.Match('*', '/')) { - sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR); - sc.Forward(); - sc.ForwardSetState(SCE_ECL_DEFAULT); - } else if (!setDoxygen.Contains(sc.ch)) { - char s[1000]; - sc.GetCurrentLowered(s, sizeof(s)); - if (!IsASpace(sc.ch) || !keywords6.InList(s+1)) { - sc.ChangeState(SCE_ECL_COMMENTDOCKEYWORDERROR); - } - sc.SetState(styleBeforeDCKeyword); - } - break; - case SCE_ECL_STRING: - if (sc.atLineEnd) { - sc.ChangeState(SCE_ECL_STRINGEOL); - } else if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_CHARACTER: - if (sc.atLineEnd) { - sc.ChangeState(SCE_ECL_STRINGEOL); - } else if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\'') { - sc.ForwardSetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_REGEX: - if (sc.atLineStart) { - sc.SetState(SCE_ECL_DEFAULT); - } else if (sc.ch == '/') { - sc.Forward(); - while ((sc.ch < 0x80) && islower(sc.ch)) - sc.Forward(); // gobble regex flags - sc.SetState(SCE_ECL_DEFAULT); - } else if (sc.ch == '\\') { - // Gobble up the quoted character - if (sc.chNext == '\\' || sc.chNext == '/') { - sc.Forward(); - } - } - break; - case SCE_ECL_STRINGEOL: - if (sc.atLineStart) { - sc.SetState(SCE_ECL_DEFAULT); - } - break; - case SCE_ECL_VERBATIM: - if (sc.ch == '\"') { - if (sc.chNext == '\"') { - sc.Forward(); - } else { - sc.ForwardSetState(SCE_ECL_DEFAULT); - } - } - break; - case SCE_ECL_UUID: - if (sc.ch == '\r' || sc.ch == '\n' || sc.ch == ')') { - sc.SetState(SCE_ECL_DEFAULT); - } - break; - } - - // Determine if a new state should be entered. - Sci_Position lineCurrent = styler.GetLine(sc.currentPos); - int lineState = styler.GetLineState(lineCurrent); - if (sc.state == SCE_ECL_DEFAULT) { - if (lineState) { - sc.SetState(lineState); - } - else if (sc.Match('@', '\"')) { - sc.SetState(SCE_ECL_VERBATIM); - sc.Forward(); - } else if (setQualified.Contains(sc.ch) && sc.chNext == '\'') { - sc.SetState(SCE_ECL_CHARACTER); - sc.Forward(); - } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - if (lastWordWasUUID) { - sc.SetState(SCE_ECL_UUID); - lastWordWasUUID = false; - } else { - sc.SetState(SCE_ECL_NUMBER); - } - } else if (setWordStart.Contains(sc.ch) || (sc.ch == '@')) { - if (lastWordWasUUID) { - sc.SetState(SCE_ECL_UUID); - lastWordWasUUID = false; - } else { - sc.SetState(SCE_ECL_IDENTIFIER); - } - } else if (sc.Match('/', '*')) { - if (sc.Match("/**") || sc.Match("/*!")) { // Support of Qt/Doxygen doc. style - sc.SetState(SCE_ECL_COMMENTDOC); - } else { - sc.SetState(SCE_ECL_COMMENT); - } - 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_ECL_COMMENTLINEDOC); - else - sc.SetState(SCE_ECL_COMMENTLINE); - } else if (sc.ch == '/' && setOKBeforeRE.Contains(chPrevNonWhite)) { - sc.SetState(SCE_ECL_REGEX); // JavaScript's RegEx -// } else if (sc.ch == '\"') { -// sc.SetState(SCE_ECL_STRING); - } else if (sc.ch == '\'') { - sc.SetState(SCE_ECL_CHARACTER); - } else if (sc.ch == '#' && visibleChars == 0) { - // Preprocessor commands are alone on their line - sc.SetState(SCE_ECL_PREPROCESSOR); - // Skip whitespace between # and preprocessor word - do { - sc.Forward(); - } while ((sc.ch == ' ' || sc.ch == '\t') && sc.More()); - if (sc.atLineEnd) { - sc.SetState(SCE_ECL_DEFAULT); - } - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_ECL_OPERATOR); - } - } - - if (!IsASpace(sc.ch) && !IsSpaceEquiv(sc.state)) { - chPrevNonWhite = sc.ch; - visibleChars++; - } - continuationLine = false; - } - sc.Complete(); - -} - -static bool IsStreamCommentStyle(int style) { - return style == SCE_ECL_COMMENT || - style == SCE_ECL_COMMENTDOC || - style == SCE_ECL_COMMENTDOCKEYWORD || - style == SCE_ECL_COMMENTDOCKEYWORDERROR; -} - -static bool MatchNoCase(Accessor & styler, Sci_PositionU & pos, const char *s) { - Sci_Position i=0; - for (; *s; i++) { - char compare_char = tolower(*s); - char styler_char = tolower(styler.SafeGetCharAt(pos+i)); - if (compare_char != styler_char) - return false; - s++; - } - pos+=i-1; - 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 -// and to make it possible to fiddle the current level for "} else {". -static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *[], Accessor &styler) { - bool foldComment = true; - bool foldPreprocessor = true; - bool foldCompact = true; - bool foldAtElse = true; - Sci_PositionU endPos = startPos + length; - int visibleChars = 0; - Sci_Position lineCurrent = styler.GetLine(startPos); - 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 = styler.StyleAt(startPos); - int style = initStyle; - 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) && (stylePrev != SCE_ECL_COMMENTLINEDOC)) { - levelNext++; - } else if (!IsStreamCommentStyle(styleNext) && (styleNext != SCE_ECL_COMMENTLINEDOC) && !atEOL) { - // Comments don't end at end of line and the next character may be unstyled. - levelNext--; - } - } - if (foldComment && (style == SCE_ECL_COMMENTLINE)) { - if ((ch == '/') && (chNext == '/')) { - char chNext2 = styler.SafeGetCharAt(i + 2); - if (chNext2 == '{') { - levelNext++; - } else if (chNext2 == '}') { - levelNext--; - } - } - } - if (foldPreprocessor && (style == SCE_ECL_PREPROCESSOR)) { - if (ch == '#') { - Sci_PositionU j = i + 1; - while ((j < endPos) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { - j++; - } - if (MatchNoCase(styler, j, "region") || MatchNoCase(styler, j, "if")) { - levelNext++; - } else if (MatchNoCase(styler, j, "endregion") || MatchNoCase(styler, j, "end")) { - levelNext--; - } - } - } - if (style == SCE_ECL_OPERATOR) { - if (ch == '{') { - // Measure the minimum before a '{' to allow - // folding on "} else {" - if (levelMinCurrent > levelNext) { - levelMinCurrent = levelNext; - } - levelNext++; - } else if (ch == '}') { - levelNext--; - } - } - if (style == SCE_ECL_WORD2) { - if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") || - MatchNoCase(styler, i, "module") || MatchNoCase(styler, i, "service") || MatchNoCase(styler, i, "interface") || MatchNoCase(styler, i, "ifblock") || - MatchNoCase(styler, i, "macro") || MatchNoCase(styler, i, "beginc++")) { - levelNext++; - } else if (MatchNoCase(styler, i, "endmacro") || MatchNoCase(styler, i, "endc++") || MatchNoCase(styler, i, "end")) { - levelNext--; - } - } - if (atEOL || (i == endPos-1)) { - int levelUse = levelCurrent; - if (foldAtElse) { - levelUse = levelMinCurrent; - } - 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; - 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; - } - if (!IsASpace(ch)) - visibleChars++; - } -} - -static const char * const EclWordListDesc[] = { - "Keywords", - 0 -}; - -LexerModule lmECL( - SCLEX_ECL, - ColouriseEclDoc, - "ecl", - FoldEclDoc, - EclWordListDesc); diff --git a/scintilla/lexers/LexEScript.cxx b/scintilla/lexers/LexEScript.cxx deleted file mode 100644 index d0a6d73c..00000000 --- a/scintilla/lexers/LexEScript.cxx +++ /dev/null @@ -1,276 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexEiffel.cxx b/scintilla/lexers/LexEiffel.cxx deleted file mode 100644 index 527933e3..00000000 --- a/scintilla/lexers/LexEiffel.cxx +++ /dev/null @@ -1,241 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexErlang.cxx b/scintilla/lexers/LexErlang.cxx deleted file mode 100644 index b6c80072..00000000 --- a/scintilla/lexers/LexErlang.cxx +++ /dev/null @@ -1,623 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexErrorList.cxx b/scintilla/lexers/LexErrorList.cxx deleted file mode 100644 index c479ad29..00000000 --- a/scintilla/lexers/LexErrorList.cxx +++ /dev/null @@ -1,394 +0,0 @@ -// Scintilla source code edit control -/** @file LexErrorList.cxx - ** Lexer for error lists. Used for the output pane in SciTE. - **/ -// 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 strstart(const char *haystack, const char *needle) { - return strncmp(haystack, needle, strlen(needle)) == 0; -} - -static bool Is0To9(char ch) { - return (ch >= '0') && (ch <= '9'); -} - -static bool Is1To9(char ch) { - return (ch >= '1') && (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')); -} - -static int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLine, Sci_Position &startValue) { - if (lineBuffer[0] == '>') { - // Command or return status - return SCE_ERR_CMD; - } else if (lineBuffer[0] == '<') { - // Diff removal. - return SCE_ERR_DIFF_DELETION; - } else if (lineBuffer[0] == '!') { - return SCE_ERR_DIFF_CHANGED; - } else if (lineBuffer[0] == '+') { - if (strstart(lineBuffer, "+++ ")) { - return SCE_ERR_DIFF_MESSAGE; - } else { - return SCE_ERR_DIFF_ADDITION; - } - } else if (lineBuffer[0] == '-') { - if (strstart(lineBuffer, "--- ")) { - return SCE_ERR_DIFF_MESSAGE; - } else { - return SCE_ERR_DIFF_DELETION; - } - } else if (strstart(lineBuffer, "cf90-")) { - // Absoft Pro Fortran 90/95 v8.2 error and/or warning message - return SCE_ERR_ABSF; - } else if (strstart(lineBuffer, "fortcom:")) { - // Intel Fortran Compiler v8.0 error/warning message - return SCE_ERR_IFORT; - } else if (strstr(lineBuffer, "File \"") && strstr(lineBuffer, ", line ")) { - return SCE_ERR_PYTHON; - } else if (strstr(lineBuffer, " in ") && strstr(lineBuffer, " on line ")) { - return SCE_ERR_PHP; - } else if ((strstart(lineBuffer, "Error ") || - strstart(lineBuffer, "Warning ")) && - strstr(lineBuffer, " at (") && - strstr(lineBuffer, ") : ") && - (strstr(lineBuffer, " at (") < strstr(lineBuffer, ") : "))) { - // Intel Fortran Compiler error/warning message - return SCE_ERR_IFC; - } else if (strstart(lineBuffer, "Error ")) { - // Borland error message - return SCE_ERR_BORLAND; - } else if (strstart(lineBuffer, "Warning ")) { - // Borland warning message - return SCE_ERR_BORLAND; - } else if (strstr(lineBuffer, "at line ") && - (strstr(lineBuffer, "at line ") < (lineBuffer + lengthLine)) && - strstr(lineBuffer, "file ") && - (strstr(lineBuffer, "file ") < (lineBuffer + lengthLine))) { - // Lua 4 error message - return SCE_ERR_LUA; - } else if (strstr(lineBuffer, " at ") && - (strstr(lineBuffer, " at ") < (lineBuffer + lengthLine)) && - strstr(lineBuffer, " line ") && - (strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) && - (strstr(lineBuffer, " at ") + 4 < (strstr(lineBuffer, " line ")))) { - // perl error message: - // at line - return SCE_ERR_PERL; - } else if ((memcmp(lineBuffer, " at ", 6) == 0) && - strstr(lineBuffer, ":line ")) { - // A .NET traceback - return SCE_ERR_NET; - } else if (strstart(lineBuffer, "Line ") && - strstr(lineBuffer, ", file ")) { - // Essential Lahey Fortran error message - return SCE_ERR_ELF; - } else if (strstart(lineBuffer, "line ") && - strstr(lineBuffer, " column ")) { - // HTML tidy style: line 42 column 1 - return SCE_ERR_TIDY; - } else if (strstart(lineBuffer, "\tat ") && - strstr(lineBuffer, "(") && - strstr(lineBuffer, ".java:")) { - // Java stack back trace - return SCE_ERR_JAVA_STACK; - } else if (strstart(lineBuffer, "In file included from ") || - strstart(lineBuffer, " from ")) { - // GCC showing include path to following error - return SCE_ERR_GCC_INCLUDED_FROM; - } else if (strstr(lineBuffer, "warning LNK")) { - // Microsoft linker warning: - // { : } warning LNK9999 - return SCE_ERR_MS; - } else { - // Look for one of the following formats: - // GCC: :: - // Microsoft: () : - // Common: (): warning|error|note|remark|catastrophic|fatal - // Common: () warning|error|note|remark|catastrophic|fatal - // Microsoft: (,) - // CTags: \t\t - // Lua 5 traceback: \t:: - // Lua 5.1: : :: - bool initialTab = (lineBuffer[0] == '\t'); - bool initialColonPart = false; - bool canBeCtags = !initialTab; // For ctags must have an identifier with no spaces then a tab - enum { stInitial, - stGccStart, stGccDigit, stGccColumn, stGcc, - stMsStart, stMsDigit, stMsBracket, stMsVc, stMsDigitComma, stMsDotNet, - stCtagsStart, stCtagsFile, stCtagsStartString, stCtagsStringDollar, stCtags, - stUnrecognized - } state = stInitial; - for (Sci_PositionU i = 0; i < lengthLine; i++) { - char ch = lineBuffer[i]; - char chNext = ' '; - if ((i + 1) < lengthLine) - chNext = lineBuffer[i + 1]; - if (state == stInitial) { - if (ch == ':') { - // May be GCC, or might be Lua 5 (Lua traceback same but with tab prefix) - if ((chNext != '\\') && (chNext != '/') && (chNext != ' ')) { - // This check is not completely accurate as may be on - // GTK+ with a file name that includes ':'. - state = stGccStart; - } else if (chNext == ' ') { // indicates a Lua 5.1 error message - initialColonPart = true; - } - } else if ((ch == '(') && Is1To9(chNext) && (!initialTab)) { - // May be Microsoft - // Check against '0' often removes phone numbers - state = stMsStart; - } else if ((ch == '\t') && canBeCtags) { - // May be CTags - state = stCtagsStart; - } else if (ch == ' ') { - canBeCtags = false; - } - } else if (state == stGccStart) { // : - state = Is0To9(ch) ? stGccDigit : stUnrecognized; - } else if (state == stGccDigit) { // : - if (ch == ':') { - state = stGccColumn; // :9.*: is GCC - startValue = i + 1; - } else if (!Is0To9(ch)) { - state = stUnrecognized; - } - } else if (state == stGccColumn) { // :: - if (!Is0To9(ch)) { - state = stGcc; - if (ch == ':') - startValue = i + 1; - break; - } - } else if (state == stMsStart) { // ( - state = Is0To9(ch) ? stMsDigit : stUnrecognized; - } else if (state == stMsDigit) { // ( - if (ch == ',') { - state = stMsDigitComma; - } else if (ch == ')') { - state = stMsBracket; - } else if ((ch != ' ') && !Is0To9(ch)) { - state = stUnrecognized; - } - } else if (state == stMsBracket) { // () - if ((ch == ' ') && (chNext == ':')) { - state = stMsVc; - } else if ((ch == ':' && chNext == ' ') || (ch == ' ')) { - // Possibly Delphi.. don't test against chNext as it's one of the strings below. - char word[512]; - Sci_PositionU j, chPos; - unsigned numstep; - chPos = 0; - if (ch == ' ') - numstep = 1; // ch was ' ', handle as if it's a delphi errorline, only add 1 to i. - else - numstep = 2; // otherwise add 2. - for (j = i + numstep; j < lengthLine && IsAlphabetic(lineBuffer[j]) && chPos < sizeof(word) - 1; j++) - word[chPos++] = lineBuffer[j]; - word[chPos] = 0; - if (!CompareCaseInsensitive(word, "error") || !CompareCaseInsensitive(word, "warning") || - !CompareCaseInsensitive(word, "fatal") || !CompareCaseInsensitive(word, "catastrophic") || - !CompareCaseInsensitive(word, "note") || !CompareCaseInsensitive(word, "remark")) { - state = stMsVc; - } else { - state = stUnrecognized; - } - } else { - state = stUnrecognized; - } - } else if (state == stMsDigitComma) { // (, - if (ch == ')') { - state = stMsDotNet; - break; - } else if ((ch != ' ') && !Is0To9(ch)) { - state = stUnrecognized; - } - } else if (state == stCtagsStart) { - if (ch == '\t') { - state = stCtagsFile; - } - } else if (state == stCtagsFile) { - if ((lineBuffer[i - 1] == '\t') && - ((ch == '/' && chNext == '^') || Is0To9(ch))) { - state = stCtags; - break; - } else if ((ch == '/') && (chNext == '^')) { - state = stCtagsStartString; - } - } else if ((state == stCtagsStartString) && ((lineBuffer[i] == '$') && (lineBuffer[i + 1] == '/'))) { - state = stCtagsStringDollar; - break; - } - } - if (state == stGcc) { - return initialColonPart ? SCE_ERR_LUA : SCE_ERR_GCC; - } else if ((state == stMsVc) || (state == stMsDotNet)) { - return SCE_ERR_MS; - } else if ((state == stCtagsStringDollar) || (state == stCtags)) { - return SCE_ERR_CTAG; - } else if (initialColonPart && strstr(lineBuffer, ": warning C")) { - // Microsoft warning without line number - // : warning C9999 - return SCE_ERR_MS; - } else { - return SCE_ERR_DEFAULT; - } - } -} - -#define CSI "\033[" - -namespace { - -bool SequenceEnd(int ch) { - return (ch == 0) || ((ch >= '@') && (ch <= '~')); -} - -int StyleFromSequence(const char *seq) { - int bold = 0; - int colour = 0; - while (!SequenceEnd(*seq)) { - if (Is0To9(*seq)) { - int base = *seq - '0'; - if (Is0To9(seq[1])) { - base = base * 10; - base += seq[1] - '0'; - seq++; - } - if (base == 0) { - colour = 0; - bold = 0; - } - else if (base == 1) { - bold = 1; - } - else if (base >= 30 && base <= 37) { - colour = base - 30; - } - } - seq++; - } - return SCE_ERR_ES_BLACK + bold * 8 + colour; -} - -} - -static void ColouriseErrorListLine( - char *lineBuffer, - Sci_PositionU lengthLine, - Sci_PositionU endPos, - Accessor &styler, - bool valueSeparate, - bool escapeSequences) { - Sci_Position startValue = -1; - int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue); - if (escapeSequences && strstr(lineBuffer, CSI)) { - const int startPos = endPos - lengthLine; - const char *linePortion = lineBuffer; - int startPortion = startPos; - int portionStyle = style; - while (const char *startSeq = strstr(linePortion, CSI)) { - if (startSeq > linePortion) { - styler.ColourTo(startPortion + static_cast(startSeq - linePortion), portionStyle); - } - const char *endSeq = startSeq + 2; - while (!SequenceEnd(*endSeq)) - endSeq++; - const int endSeqPosition = startPortion + static_cast(endSeq - linePortion) + 1; - switch (*endSeq) { - case 0: - styler.ColourTo(endPos, SCE_ERR_ESCSEQ_UNKNOWN); - return; - case 'm': // Colour command - styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ); - portionStyle = StyleFromSequence(startSeq+2); - break; - case 'K': // Erase to end of line -> ignore - styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ); - break; - default: - styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ_UNKNOWN); - portionStyle = style; - } - startPortion = endSeqPosition; - linePortion = endSeq + 1; - } - styler.ColourTo(endPos, portionStyle); - } else { - if (valueSeparate && (startValue >= 0)) { - styler.ColourTo(endPos - (lengthLine - startValue), style); - styler.ColourTo(endPos, SCE_ERR_VALUE); - } else { - styler.ColourTo(endPos, style); - } - } -} - -static void ColouriseErrorListDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { - char lineBuffer[10000]; - styler.StartAt(startPos); - styler.StartSegment(startPos); - Sci_PositionU linePos = 0; - - // property lexer.errorlist.value.separate - // For lines in the output pane that are matches from Find in Files or GCC-style - // diagnostics, style the path and line number separately from the rest of the - // line with style 21 used for the rest of the line. - // This allows matched text to be more easily distinguished from its location. - bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0; - - // property lexer.errorlist.escape.sequences - // Set to 1 to interpret escape sequences. - const bool escapeSequences = styler.GetPropertyInt("lexer.errorlist.escape.sequences") != 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'; - ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate, escapeSequences); - linePos = 0; - } - } - if (linePos > 0) { // Last line does not have ending characters - lineBuffer[linePos] = '\0'; - ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate, escapeSequences); - } -} - -static const char *const emptyWordListDesc[] = { - 0 -}; - -LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc); diff --git a/scintilla/lexers/LexFlagship.cxx b/scintilla/lexers/LexFlagship.cxx deleted file mode 100644 index a5c8d7ab..00000000 --- a/scintilla/lexers/LexFlagship.cxx +++ /dev/null @@ -1,354 +0,0 @@ -// Scintilla source code edit control -/** @file LexFlagShip.cxx - ** Lexer for Harbour and FlagShip. - ** (Syntactically compatible to other xBase dialects, like Clipper, dBase, Clip, FoxPro etc.) - **/ -// Copyright 2005 by Randy Butler -// Copyright 2010 by Xavi (Harbour) -// Copyright 1998-2003 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 - -// Extended to accept accented characters -static inline bool IsAWordChar(int ch) -{ - return ch >= 0x80 || - (isalnum(ch) || ch == '_'); -} - -static void ColouriseFlagShipDoc(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]; - - // property lexer.flagship.styling.within.preprocessor - // For Harbour code, determines whether all preprocessor code is styled in the preprocessor style (0) or only from the - // initial # to the end of the command word(1, the default). It also determines how to present text, dump, and disabled code. - bool stylingWithinPreprocessor = styler.GetPropertyInt("lexer.flagship.styling.within.preprocessor", 1) != 0; - - CharacterSet setDoxygen(CharacterSet::setAlpha, "$@\\&<>#{}[]"); - - int visibleChars = 0; - int closeStringChar = 0; - int styleBeforeDCKeyword = SCE_FS_DEFAULT; - bool bEnableCode = initStyle < SCE_FS_DISABLEDCODE; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - - // Determine if the current state should terminate. - switch (sc.state) { - case SCE_FS_OPERATOR: - case SCE_FS_OPERATOR_C: - case SCE_FS_WORDOPERATOR: - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - break; - case SCE_FS_IDENTIFIER: - case SCE_FS_IDENTIFIER_C: - if (!IsAWordChar(sc.ch)) { - char s[64]; - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD : SCE_FS_KEYWORD_C); - } else if (keywords2.InList(s)) { - sc.ChangeState(bEnableCode ? SCE_FS_KEYWORD2 : SCE_FS_KEYWORD2_C); - } else if (bEnableCode && keywords3.InList(s)) { - sc.ChangeState(SCE_FS_KEYWORD3); - } else if (bEnableCode && keywords4.InList(s)) { - sc.ChangeState(SCE_FS_KEYWORD4); - }// Else, it is really an identifier... - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } - break; - case SCE_FS_NUMBER: - if (!IsAWordChar(sc.ch) && !(sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_FS_DEFAULT); - } - break; - case SCE_FS_NUMBER_C: - if (!IsAWordChar(sc.ch) && sc.ch != '.') { - sc.SetState(SCE_FS_DEFAULT_C); - } - break; - case SCE_FS_CONSTANT: - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_FS_DEFAULT); - } - break; - case SCE_FS_STRING: - case SCE_FS_STRING_C: - if (sc.ch == closeStringChar) { - sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } else if (sc.atLineEnd) { - sc.ChangeState(bEnableCode ? SCE_FS_STRINGEOL : SCE_FS_STRINGEOL_C); - } - break; - case SCE_FS_STRINGEOL: - case SCE_FS_STRINGEOL_C: - if (sc.atLineStart) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } - break; - case SCE_FS_COMMENTDOC: - case SCE_FS_COMMENTDOC_C: - if (sc.Match('*', '/')) { - sc.Forward(); - sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } 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 = bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C; - sc.SetState(SCE_FS_COMMENTDOCKEYWORD); - } - } - break; - case SCE_FS_COMMENT: - case SCE_FS_COMMENTLINE: - if (sc.atLineStart) { - sc.SetState(SCE_FS_DEFAULT); - } - break; - case SCE_FS_COMMENTLINEDOC: - case SCE_FS_COMMENTLINEDOC_C: - if (sc.atLineStart) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } 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 = bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C; - sc.SetState(SCE_FS_COMMENTDOCKEYWORD); - } - } - break; - case SCE_FS_COMMENTDOCKEYWORD: - if ((styleBeforeDCKeyword == SCE_FS_COMMENTDOC || styleBeforeDCKeyword == SCE_FS_COMMENTDOC_C) && - sc.Match('*', '/')) { - sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR); - sc.Forward(); - sc.ForwardSetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } else if (!setDoxygen.Contains(sc.ch)) { - char s[64]; - sc.GetCurrentLowered(s, sizeof(s)); - if (!IsASpace(sc.ch) || !keywords5.InList(s + 1)) { - sc.ChangeState(SCE_FS_COMMENTDOCKEYWORDERROR); - } - sc.SetState(styleBeforeDCKeyword); - } - break; - case SCE_FS_PREPROCESSOR: - case SCE_FS_PREPROCESSOR_C: - if (sc.atLineEnd) { - if (!(sc.chPrev == ';' || sc.GetRelative(-2) == ';')) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } - } else if (stylingWithinPreprocessor) { - if (IsASpaceOrTab(sc.ch)) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } - } else if (sc.Match('/', '*') || sc.Match('/', '/') || sc.Match('&', '&')) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } - break; - case SCE_FS_DISABLEDCODE: - if (sc.ch == '#' && visibleChars == 0) { - sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C); - do { // Skip whitespace between # and preprocessor word - sc.Forward(); - } while (IsASpaceOrTab(sc.ch) && sc.More()); - if (sc.MatchIgnoreCase("pragma")) { - sc.Forward(6); - do { // Skip more whitespace until keyword - sc.Forward(); - } while (IsASpaceOrTab(sc.ch) && sc.More()); - if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) { - bEnableCode = true; - sc.SetState(SCE_FS_DISABLEDCODE); - sc.Forward(sc.ch == '_' ? 8 : 6); - sc.ForwardSetState(SCE_FS_DEFAULT); - } else { - sc.ChangeState(SCE_FS_DISABLEDCODE); - } - } else { - sc.ChangeState(SCE_FS_DISABLEDCODE); - } - } - break; - case SCE_FS_DATE: - if (sc.ch == '}') { - sc.ForwardSetState(SCE_FS_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_FS_STRINGEOL); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_FS_DEFAULT || sc.state == SCE_FS_DEFAULT_C) { - if (bEnableCode && - (sc.MatchIgnoreCase(".and.") || sc.MatchIgnoreCase(".not."))) { - sc.SetState(SCE_FS_WORDOPERATOR); - sc.Forward(4); - } else if (bEnableCode && sc.MatchIgnoreCase(".or.")) { - sc.SetState(SCE_FS_WORDOPERATOR); - sc.Forward(3); - } else if (bEnableCode && - (sc.MatchIgnoreCase(".t.") || sc.MatchIgnoreCase(".f.") || - (!IsAWordChar(sc.GetRelative(3)) && sc.MatchIgnoreCase("nil")))) { - sc.SetState(SCE_FS_CONSTANT); - sc.Forward(2); - } else if (sc.Match('/', '*')) { - sc.SetState(bEnableCode ? SCE_FS_COMMENTDOC : SCE_FS_COMMENTDOC_C); - sc.Forward(); - } else if (bEnableCode && sc.Match('&', '&')) { - sc.SetState(SCE_FS_COMMENTLINE); - sc.Forward(); - } else if (sc.Match('/', '/')) { - sc.SetState(bEnableCode ? SCE_FS_COMMENTLINEDOC : SCE_FS_COMMENTLINEDOC_C); - sc.Forward(); - } else if (bEnableCode && sc.ch == '*' && visibleChars == 0) { - sc.SetState(SCE_FS_COMMENT); - } else if (sc.ch == '\"' || sc.ch == '\'') { - sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C); - closeStringChar = sc.ch; - } else if (closeStringChar == '>' && sc.ch == '<') { - sc.SetState(bEnableCode ? SCE_FS_STRING : SCE_FS_STRING_C); - } else if (sc.ch == '#' && visibleChars == 0) { - sc.SetState(bEnableCode ? SCE_FS_PREPROCESSOR : SCE_FS_PREPROCESSOR_C); - do { // Skip whitespace between # and preprocessor word - sc.Forward(); - } while (IsASpaceOrTab(sc.ch) && sc.More()); - if (sc.atLineEnd) { - sc.SetState(bEnableCode ? SCE_FS_DEFAULT : SCE_FS_DEFAULT_C); - } else if (sc.MatchIgnoreCase("include")) { - if (stylingWithinPreprocessor) { - closeStringChar = '>'; - } - } else if (sc.MatchIgnoreCase("pragma")) { - sc.Forward(6); - do { // Skip more whitespace until keyword - sc.Forward(); - } while (IsASpaceOrTab(sc.ch) && sc.More()); - if (sc.MatchIgnoreCase("begindump") || sc.MatchIgnoreCase("__cstream")) { - bEnableCode = false; - if (stylingWithinPreprocessor) { - sc.SetState(SCE_FS_DISABLEDCODE); - sc.Forward(8); - sc.ForwardSetState(SCE_FS_DEFAULT_C); - } else { - sc.SetState(SCE_FS_DISABLEDCODE); - } - } else if (sc.MatchIgnoreCase("enddump") || sc.MatchIgnoreCase("__endtext")) { - bEnableCode = true; - sc.SetState(SCE_FS_DISABLEDCODE); - sc.Forward(sc.ch == '_' ? 8 : 6); - sc.ForwardSetState(SCE_FS_DEFAULT); - } - } - } else if (bEnableCode && sc.ch == '{') { - Sci_Position p = 0; - int chSeek; - Sci_PositionU endPos(startPos + length); - do { // Skip whitespace - chSeek = sc.GetRelative(++p); - } while (IsASpaceOrTab(chSeek) && (sc.currentPos + p < endPos)); - if (chSeek == '^') { - sc.SetState(SCE_FS_DATE); - } else { - sc.SetState(SCE_FS_OPERATOR); - } - } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(bEnableCode ? SCE_FS_NUMBER : SCE_FS_NUMBER_C); - } else if (IsAWordChar(sc.ch)) { - sc.SetState(bEnableCode ? SCE_FS_IDENTIFIER : SCE_FS_IDENTIFIER_C); - } else if (isoperator(static_cast(sc.ch)) || (bEnableCode && sc.ch == '@')) { - sc.SetState(bEnableCode ? SCE_FS_OPERATOR : SCE_FS_OPERATOR_C); - } - } - - if (sc.atLineEnd) { - visibleChars = 0; - closeStringChar = 0; - } - if (!IsASpace(sc.ch)) { - visibleChars++; - } - } - sc.Complete(); -} - -static void FoldFlagShipDoc(Sci_PositionU startPos, Sci_Position length, int, - WordList *[], Accessor &styler) -{ - - Sci_Position endPos = startPos + length; - - // Backtrack to previous line in case need to fix its fold status - Sci_Position lineCurrent = styler.GetLine(startPos); - if (startPos > 0 && lineCurrent > 0) { - lineCurrent--; - startPos = styler.LineStart(lineCurrent); - } - int spaceFlags = 0; - int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags); - char chNext = styler[startPos]; - for (Sci_Position i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - - if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos-1)) { - int lev = indentCurrent; - int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags); - if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) { - if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) { - lev |= SC_FOLDLEVELHEADERFLAG; - } else if (indentNext & SC_FOLDLEVELWHITEFLAG) { - int spaceFlags2 = 0; - int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2); - if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) { - lev |= SC_FOLDLEVELHEADERFLAG; - } - } - } - indentCurrent = indentNext; - styler.SetLevel(lineCurrent, lev); - lineCurrent++; - } - } -} - -static const char * const FSWordListDesc[] = { - "Keywords Commands", - "Std Library Functions", - "Procedure, return, exit", - "Class (oop)", - "Doxygen keywords", - 0 -}; - -LexerModule lmFlagShip(SCLEX_FLAGSHIP, ColouriseFlagShipDoc, "flagship", FoldFlagShipDoc, FSWordListDesc); diff --git a/scintilla/lexers/LexForth.cxx b/scintilla/lexers/LexForth.cxx deleted file mode 100644 index 741431cc..00000000 --- a/scintilla/lexers/LexForth.cxx +++ /dev/null @@ -1,170 +0,0 @@ -// Scintilla source code edit control -/** @file LexForth.cxx - ** Lexer for FORTH - **/ -// Copyright 1998-2003 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 IsAWordStart(int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.'); -} - -static inline bool IsANumChar(int ch) { - return (ch < 0x80) && (isxdigit(ch) || ch == '.' || ch == 'e' || ch == 'E' ); -} - -static inline bool IsASpaceChar(int ch) { - return (ch < 0x80) && isspace(ch); -} - -static void ColouriseForthDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordLists[], - Accessor &styler) { - - WordList &control = *keywordLists[0]; - WordList &keyword = *keywordLists[1]; - WordList &defword = *keywordLists[2]; - WordList &preword1 = *keywordLists[3]; - WordList &preword2 = *keywordLists[4]; - WordList &strings = *keywordLists[5]; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) - { - // Determine if the current state should terminate. - if (sc.state == SCE_FORTH_COMMENT) { - if (sc.atLineEnd) { - sc.SetState(SCE_FORTH_DEFAULT); - } - }else if (sc.state == SCE_FORTH_COMMENT_ML) { - if (sc.ch == ')') { - sc.ForwardSetState(SCE_FORTH_DEFAULT); - } - }else if (sc.state == SCE_FORTH_IDENTIFIER || sc.state == SCE_FORTH_NUMBER) { - // handle numbers here too, because what we thought was a number might - // turn out to be a keyword e.g. 2DUP - if (IsASpaceChar(sc.ch) ) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - int newState = sc.state == SCE_FORTH_NUMBER ? SCE_FORTH_NUMBER : SCE_FORTH_DEFAULT; - if (control.InList(s)) { - sc.ChangeState(SCE_FORTH_CONTROL); - } else if (keyword.InList(s)) { - sc.ChangeState(SCE_FORTH_KEYWORD); - } else if (defword.InList(s)) { - sc.ChangeState(SCE_FORTH_DEFWORD); - } else if (preword1.InList(s)) { - sc.ChangeState(SCE_FORTH_PREWORD1); - } else if (preword2.InList(s)) { - sc.ChangeState(SCE_FORTH_PREWORD2); - } else if (strings.InList(s)) { - sc.ChangeState(SCE_FORTH_STRING); - newState = SCE_FORTH_STRING; - } - sc.SetState(newState); - } - if (sc.state == SCE_FORTH_NUMBER) { - if (IsASpaceChar(sc.ch)) { - sc.SetState(SCE_FORTH_DEFAULT); - } else if (!IsANumChar(sc.ch)) { - sc.ChangeState(SCE_FORTH_IDENTIFIER); - } - } - }else if (sc.state == SCE_FORTH_STRING) { - if (sc.ch == '\"') { - sc.ForwardSetState(SCE_FORTH_DEFAULT); - } - }else if (sc.state == SCE_FORTH_LOCALE) { - if (sc.ch == '}') { - sc.ForwardSetState(SCE_FORTH_DEFAULT); - } - }else if (sc.state == SCE_FORTH_DEFWORD) { - if (IsASpaceChar(sc.ch)) { - sc.SetState(SCE_FORTH_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_FORTH_DEFAULT) { - if (sc.ch == '\\'){ - sc.SetState(SCE_FORTH_COMMENT); - } else if (sc.ch == '(' && - (sc.atLineStart || IsASpaceChar(sc.chPrev)) && - (sc.atLineEnd || IsASpaceChar(sc.chNext))) { - sc.SetState(SCE_FORTH_COMMENT_ML); - } else if ( (sc.ch == '$' && (IsASCII(sc.chNext) && isxdigit(sc.chNext))) ) { - // number starting with $ is a hex number - sc.SetState(SCE_FORTH_NUMBER); - while(sc.More() && IsASCII(sc.chNext) && isxdigit(sc.chNext)) - sc.Forward(); - } else if ( (sc.ch == '%' && (IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1'))) ) { - // number starting with % is binary - sc.SetState(SCE_FORTH_NUMBER); - while(sc.More() && IsASCII(sc.chNext) && (sc.chNext == '0' || sc.chNext == '1')) - sc.Forward(); - } else if ( IsASCII(sc.ch) && - (isxdigit(sc.ch) || ((sc.ch == '.' || sc.ch == '-') && IsASCII(sc.chNext) && isxdigit(sc.chNext)) ) - ){ - sc.SetState(SCE_FORTH_NUMBER); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_FORTH_IDENTIFIER); - } else if (sc.ch == '{') { - sc.SetState(SCE_FORTH_LOCALE); - } else if (sc.ch == ':' && IsASCII(sc.chNext) && isspace(sc.chNext)) { - // highlight word definitions e.g. : GCD ( n n -- n ) ..... ; - // ^ ^^^ - sc.SetState(SCE_FORTH_DEFWORD); - while(sc.More() && IsASCII(sc.chNext) && isspace(sc.chNext)) - sc.Forward(); - } else if (sc.ch == ';' && - (sc.atLineStart || IsASpaceChar(sc.chPrev)) && - (sc.atLineEnd || IsASpaceChar(sc.chNext)) ) { - // mark the ';' that ends a word - sc.SetState(SCE_FORTH_DEFWORD); - sc.ForwardSetState(SCE_FORTH_DEFAULT); - } - } - - } - sc.Complete(); -} - -static void FoldForthDoc(Sci_PositionU, Sci_Position, int, WordList *[], - Accessor &) { -} - -static const char * const forthWordLists[] = { - "control keywords", - "keywords", - "definition words", - "prewords with one argument", - "prewords with two arguments", - "string definition keywords", - 0, - }; - -LexerModule lmForth(SCLEX_FORTH, ColouriseForthDoc, "forth", FoldForthDoc, forthWordLists); - - diff --git a/scintilla/lexers/LexFortran.cxx b/scintilla/lexers/LexFortran.cxx deleted file mode 100644 index 7675c206..00000000 --- a/scintilla/lexers/LexFortran.cxx +++ /dev/null @@ -1,515 +0,0 @@ -// Scintilla source code edit control -/** @file LexFortran.cxx - ** Lexer for Fortran. - ** Written by Chuan-jian Shen, Last changed Sep. 2003 - **/ -// 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 IsAWordChar(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '%'); -} -/**********************************************/ -static inline bool IsAWordStart(const int ch) { - return (ch < 0x80) && (isalnum(ch)); -} -/***************************************/ -static inline bool IsABlank(unsigned int ch) { - return (ch == ' ') || (ch == 0x09) || (ch == 0x0b) ; -} -/***************************************/ -static inline bool IsALineEnd(char ch) { - return ((ch == '\n') || (ch == '\r')) ; -} -/***************************************/ -static Sci_PositionU GetContinuedPos(Sci_PositionU pos, Accessor &styler) { - while (!IsALineEnd(styler.SafeGetCharAt(pos++))) continue; - if (styler.SafeGetCharAt(pos) == '\n') pos++; - while (IsABlank(styler.SafeGetCharAt(pos++))) continue; - char chCur = styler.SafeGetCharAt(pos); - if (chCur == '&') { - while (IsABlank(styler.SafeGetCharAt(++pos))) continue; - return pos; - } else { - return pos; - } -} -/***************************************/ -static void ColouriseFortranDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *keywordlists[], Accessor &styler, bool isFixFormat) { - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords3 = *keywordlists[2]; - /***************************************/ - Sci_Position posLineStart = 0; - int numNonBlank = 0, prevState = 0; - Sci_Position endPos = startPos + length; - /***************************************/ - // backtrack to the nearest keyword - while ((startPos > 1) && (styler.StyleAt(startPos) != SCE_F_WORD)) { - startPos--; - } - startPos = styler.LineStart(styler.GetLine(startPos)); - initStyle = styler.StyleAt(startPos - 1); - StyleContext sc(startPos, endPos-startPos, initStyle, styler); - /***************************************/ - for (; sc.More(); sc.Forward()) { - // remember the start position of the line - if (sc.atLineStart) { - posLineStart = sc.currentPos; - numNonBlank = 0; - sc.SetState(SCE_F_DEFAULT); - } - if (!IsASpaceOrTab(sc.ch)) numNonBlank ++; - /***********************************************/ - // Handle the fix format generically - Sci_Position toLineStart = sc.currentPos - posLineStart; - if (isFixFormat && (toLineStart < 6 || toLineStart >= 72)) { - if ((toLineStart == 0 && (tolower(sc.ch) == 'c' || sc.ch == '*')) || sc.ch == '!') { - if (sc.MatchIgnoreCase("cdec$") || sc.MatchIgnoreCase("*dec$") || sc.MatchIgnoreCase("!dec$") || - sc.MatchIgnoreCase("cdir$") || sc.MatchIgnoreCase("*dir$") || sc.MatchIgnoreCase("!dir$") || - sc.MatchIgnoreCase("cms$") || sc.MatchIgnoreCase("*ms$") || sc.MatchIgnoreCase("!ms$") || - sc.chNext == '$') { - sc.SetState(SCE_F_PREPROCESSOR); - } else { - sc.SetState(SCE_F_COMMENT); - } - - while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end - } else if (toLineStart >= 72) { - sc.SetState(SCE_F_COMMENT); - while (!sc.atLineEnd && sc.More()) sc.Forward(); // Until line end - } else if (toLineStart < 5) { - if (IsADigit(sc.ch)) - sc.SetState(SCE_F_LABEL); - else - sc.SetState(SCE_F_DEFAULT); - } else if (toLineStart == 5) { - //if (!IsASpace(sc.ch) && sc.ch != '0') { - if (sc.ch != '\r' && sc.ch != '\n') { - sc.SetState(SCE_F_CONTINUATION); - if (!IsASpace(sc.ch) && sc.ch != '0') - sc.ForwardSetState(prevState); - } else - sc.SetState(SCE_F_DEFAULT); - } - continue; - } - /***************************************/ - // Hanndle preprocessor directives - if (sc.ch == '#' && numNonBlank == 1) - { - sc.SetState(SCE_F_PREPROCESSOR); - while (!sc.atLineEnd && sc.More()) - sc.Forward(); // Until line end - } - /***************************************/ - // Handle line continuation generically. - if (!isFixFormat && sc.ch == '&' && sc.state != SCE_F_COMMENT) { - char chTemp = ' '; - Sci_Position j = 1; - while (IsABlank(chTemp) && j<132) { - chTemp = static_cast(sc.GetRelative(j)); - j++; - } - if (chTemp == '!') { - sc.SetState(SCE_F_CONTINUATION); - if (sc.chNext == '!') sc.ForwardSetState(SCE_F_COMMENT); - } else if (chTemp == '\r' || chTemp == '\n') { - int currentState = sc.state; - sc.SetState(SCE_F_CONTINUATION); - sc.ForwardSetState(SCE_F_DEFAULT); - while (IsASpace(sc.ch) && sc.More()) sc.Forward(); - if (sc.ch == '&') { - sc.SetState(SCE_F_CONTINUATION); - sc.Forward(); - } - sc.SetState(currentState); - } - } - /***************************************/ - // Determine if the current state should terminate. - if (sc.state == SCE_F_OPERATOR) { - sc.SetState(SCE_F_DEFAULT); - } else if (sc.state == SCE_F_NUMBER) { - if (!(IsAWordChar(sc.ch) || sc.ch=='\'' || sc.ch=='\"' || sc.ch=='.')) { - sc.SetState(SCE_F_DEFAULT); - } - } else if (sc.state == SCE_F_IDENTIFIER) { - if (!IsAWordChar(sc.ch) || (sc.ch == '%')) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - if (keywords.InList(s)) { - sc.ChangeState(SCE_F_WORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_F_WORD2); - } else if (keywords3.InList(s)) { - sc.ChangeState(SCE_F_WORD3); - } - sc.SetState(SCE_F_DEFAULT); - } - } else if (sc.state == SCE_F_COMMENT || sc.state == SCE_F_PREPROCESSOR) { - if (sc.ch == '\r' || sc.ch == '\n') { - sc.SetState(SCE_F_DEFAULT); - } - } else if (sc.state == SCE_F_STRING1) { - prevState = sc.state; - if (sc.ch == '\'') { - if (sc.chNext == '\'') { - sc.Forward(); - } else { - sc.ForwardSetState(SCE_F_DEFAULT); - prevState = SCE_F_DEFAULT; - } - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_F_STRINGEOL); - sc.ForwardSetState(SCE_F_DEFAULT); - } - } else if (sc.state == SCE_F_STRING2) { - prevState = sc.state; - if (sc.atLineEnd) { - sc.ChangeState(SCE_F_STRINGEOL); - sc.ForwardSetState(SCE_F_DEFAULT); - } else if (sc.ch == '\"') { - if (sc.chNext == '\"') { - sc.Forward(); - } else { - sc.ForwardSetState(SCE_F_DEFAULT); - prevState = SCE_F_DEFAULT; - } - } - } else if (sc.state == SCE_F_OPERATOR2) { - if (sc.ch == '.') { - sc.ForwardSetState(SCE_F_DEFAULT); - } - } else if (sc.state == SCE_F_CONTINUATION) { - sc.SetState(SCE_F_DEFAULT); - } else if (sc.state == SCE_F_LABEL) { - if (!IsADigit(sc.ch)) { - sc.SetState(SCE_F_DEFAULT); - } else { - if (isFixFormat && sc.currentPos-posLineStart > 4) - sc.SetState(SCE_F_DEFAULT); - else if (numNonBlank > 5) - sc.SetState(SCE_F_DEFAULT); - } - } - /***************************************/ - // Determine if a new state should be entered. - if (sc.state == SCE_F_DEFAULT) { - if (sc.ch == '!') { - if (sc.MatchIgnoreCase("!dec$") || sc.MatchIgnoreCase("!dir$") || - sc.MatchIgnoreCase("!ms$") || sc.chNext == '$') { - sc.SetState(SCE_F_PREPROCESSOR); - } else { - sc.SetState(SCE_F_COMMENT); - } - } else if ((!isFixFormat) && IsADigit(sc.ch) && numNonBlank == 1) { - sc.SetState(SCE_F_LABEL); - } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_F_NUMBER); - } else if ((tolower(sc.ch) == 'b' || tolower(sc.ch) == 'o' || - tolower(sc.ch) == 'z') && (sc.chNext == '\"' || sc.chNext == '\'')) { - sc.SetState(SCE_F_NUMBER); - sc.Forward(); - } else if (sc.ch == '.' && isalpha(sc.chNext)) { - sc.SetState(SCE_F_OPERATOR2); - } else if (IsAWordStart(sc.ch)) { - sc.SetState(SCE_F_IDENTIFIER); - } else if (sc.ch == '\"') { - sc.SetState(SCE_F_STRING2); - } else if (sc.ch == '\'') { - sc.SetState(SCE_F_STRING1); - } else if (isoperator(static_cast(sc.ch))) { - sc.SetState(SCE_F_OPERATOR); - } - } - } - sc.Complete(); -} -/***************************************/ -// To determine the folding level depending on keywords -static int classifyFoldPointFortran(const char* s, const char* prevWord, const char chNextNonBlank) { - int lev = 0; - - if ((strcmp(prevWord, "module") == 0 && strcmp(s, "subroutine") == 0) - || (strcmp(prevWord, "module") == 0 && strcmp(s, "function") == 0)) { - lev = 0; - } else if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0 - || strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0 - || strcmp(s, "selecttype") == 0 || strcmp(s, "selectcase") == 0 - || strcmp(s, "do") == 0 || strcmp(s, "enum") ==0 - || strcmp(s, "function") == 0 || strcmp(s, "interface") == 0 - || strcmp(s, "module") == 0 || strcmp(s, "program") == 0 - || strcmp(s, "subroutine") == 0 || strcmp(s, "then") == 0 - || (strcmp(s, "type") == 0 && chNextNonBlank != '(') - || strcmp(s, "critical") == 0 || strcmp(s, "submodule") == 0){ - if (strcmp(prevWord, "end") == 0) - lev = 0; - else - lev = 1; - } else if ((strcmp(s, "end") == 0 && chNextNonBlank != '=') - || strcmp(s, "endassociate") == 0 || strcmp(s, "endblock") == 0 - || strcmp(s, "endblockdata") == 0 || strcmp(s, "endselect") == 0 - || strcmp(s, "enddo") == 0 || strcmp(s, "endenum") ==0 - || strcmp(s, "endif") == 0 || strcmp(s, "endforall") == 0 - || strcmp(s, "endfunction") == 0 || strcmp(s, "endinterface") == 0 - || strcmp(s, "endmodule") == 0 || strcmp(s, "endprogram") == 0 - || strcmp(s, "endsubroutine") == 0 || strcmp(s, "endtype") == 0 - || strcmp(s, "endwhere") == 0 || strcmp(s, "endcritical") == 0 - || (strcmp(prevWord, "module") == 0 && strcmp(s, "procedure") == 0) // Take care of the "module procedure" statement - || strcmp(s, "endsubmodule") == 0) { - lev = -1; - } else if (strcmp(prevWord, "end") == 0 && strcmp(s, "if") == 0){ // end if - lev = 0; - } else if (strcmp(prevWord, "type") == 0 && strcmp(s, "is") == 0){ // type is - lev = -1; - } else if ((strcmp(prevWord, "end") == 0 && strcmp(s, "procedure") == 0) - || strcmp(s, "endprocedure") == 0) { - lev = 1; // level back to 0, because no folding support for "module procedure" in submodule - } - return lev; -} -/***************************************/ -// Folding the code -static void FoldFortranDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - Accessor &styler, bool isFixFormat) { - // - // 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; - Sci_PositionU endPos = startPos + length; - int visibleChars = 0; - Sci_Position lineCurrent = styler.GetLine(startPos); - int levelCurrent; - bool isPrevLine; - if (lineCurrent > 0) { - lineCurrent--; - startPos = styler.LineStart(lineCurrent); - levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - isPrevLine = true; - } else { - levelCurrent = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - isPrevLine = false; - } - char chNext = styler[startPos]; - int styleNext = styler.StyleAt(startPos); - int style = initStyle; - int levelDeltaNext = 0; - /***************************************/ - Sci_Position lastStart = 0; - char prevWord[32] = ""; - /***************************************/ - for (Sci_PositionU i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - char chNextNonBlank = chNext; - bool nextEOL = false; - if (IsALineEnd(chNextNonBlank)) { - nextEOL = true; - } - Sci_PositionU j=i+1; - while(IsABlank(chNextNonBlank) && j(tolower(styler[lastStart+k])); - } - s[k] = '\0'; - // Handle the forall and where statement and structure. - if (strcmp(s, "forall") == 0 || (strcmp(s, "where") == 0 && strcmp(prevWord, "else") != 0)) { - if (strcmp(prevWord, "end") != 0) { - j = i + 1; - char chBrace = '(', chSeek = ')', ch1 = styler.SafeGetCharAt(j); - // Find the position of the first ( - while (ch1 != chBrace && j 0) && (visibleChars > 0)) - lev |= SC_FOLDLEVELHEADERFLAG; - if (lev != styler.LevelAt(lineCurrent)) - styler.SetLevel(lineCurrent, lev); - - lineCurrent++; - levelCurrent += levelDeltaNext; - levelDeltaNext = 0; - visibleChars = 0; - strcpy(prevWord, ""); - isPrevLine = false; - } - /***************************************/ - if (!isspacechar(ch)) visibleChars++; - } - /***************************************/ -} -/***************************************/ -static const char * const FortranWordLists[] = { - "Primary keywords and identifiers", - "Intrinsic functions", - "Extended and user defined functions", - 0, -}; -/***************************************/ -static void ColouriseFortranDocFreeFormat(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, false); -} -/***************************************/ -static void ColouriseFortranDocFixFormat(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - ColouriseFortranDoc(startPos, length, initStyle, keywordlists, styler, true); -} -/***************************************/ -static void FoldFortranDocFreeFormat(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *[], Accessor &styler) { - FoldFortranDoc(startPos, length, initStyle,styler, false); -} -/***************************************/ -static void FoldFortranDocFixFormat(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *[], Accessor &styler) { - FoldFortranDoc(startPos, length, initStyle,styler, true); -} -/***************************************/ -LexerModule lmFortran(SCLEX_FORTRAN, ColouriseFortranDocFreeFormat, "fortran", FoldFortranDocFreeFormat, FortranWordLists); -LexerModule lmF77(SCLEX_F77, ColouriseFortranDocFixFormat, "f77", FoldFortranDocFixFormat, FortranWordLists); diff --git a/scintilla/lexers/LexGAP.cxx b/scintilla/lexers/LexGAP.cxx deleted file mode 100644 index 598c3a4b..00000000 --- a/scintilla/lexers/LexGAP.cxx +++ /dev/null @@ -1,266 +0,0 @@ -// 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); diff --git a/scintilla/lexers/LexGui4Cli.cxx b/scintilla/lexers/LexGui4Cli.cxx deleted file mode 100644 index 8abee018..00000000 --- a/scintilla/lexers/LexGui4Cli.cxx +++ /dev/null @@ -1,313 +0,0 @@ -// Scintilla source code edit control -// Copyright 1998-2002 by Neil Hodgson -/* -This is the Lexer for Gui4Cli, included in SciLexer.dll -- by d. Keletsekis, 2/10/2003 - -To add to SciLexer.dll: -1. Add the values below to INCLUDE\Scintilla.iface -2. Run the scripts/HFacer.py script -3. Run the scripts/LexGen.py script - -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 -*/ - -#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 - -#define debug Platform::DebugPrintf - -static inline bool IsAWordChar(const int ch) { - return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_' || ch =='\\'); -} - -inline bool isGCOperator(int ch) -{ if (isalnum(ch)) - return false; - // '.' left out as it is used to make up numbers - if (ch == '*' || ch == '/' || ch == '-' || ch == '+' || - ch == '(' || ch == ')' || ch == '=' || ch == '%' || - ch == '[' || ch == ']' || ch == '<' || ch == '>' || - ch == ',' || ch == ';' || ch == ':') - return true; - return false; -} - -#define isSpace(x) ((x)==' ' || (x)=='\t') -#define isNL(x) ((x)=='\n' || (x)=='\r') -#define isSpaceOrNL(x) (isSpace(x) || isNL(x)) -#define BUFFSIZE 500 -#define isFoldPoint(x) ((styler.LevelAt(x) & SC_FOLDLEVELNUMBERMASK) == 1024) - -static void colorFirstWord(WordList *keywordlists[], Accessor &styler, - StyleContext *sc, char *buff, Sci_Position length, int) -{ - Sci_Position c = 0; - while (sc->More() && isSpaceOrNL(sc->ch)) - { sc->Forward(); - } - styler.ColourTo(sc->currentPos - 1, sc->state); - - if (!IsAWordChar(sc->ch)) // comment, marker, etc.. - return; - - while (sc->More() && !isSpaceOrNL(sc->ch) && (c < length-1) && !isGCOperator(sc->ch)) - { buff[c] = static_cast(sc->ch); - ++c; sc->Forward(); - } - buff[c] = '\0'; - char *p = buff; - while (*p) // capitalize.. - { if (islower(*p)) *p = static_cast(toupper(*p)); - ++p; - } - - WordList &kGlobal = *keywordlists[0]; // keyword lists set by the user - WordList &kEvent = *keywordlists[1]; - WordList &kAttribute = *keywordlists[2]; - WordList &kControl = *keywordlists[3]; - WordList &kCommand = *keywordlists[4]; - - int state = 0; - // int level = styler.LevelAt(line) & SC_FOLDLEVELNUMBERMASK; - // debug ("line = %d, level = %d", line, level); - - if (kGlobal.InList(buff)) state = SCE_GC_GLOBAL; - else if (kAttribute.InList(buff)) state = SCE_GC_ATTRIBUTE; - else if (kControl.InList(buff)) state = SCE_GC_CONTROL; - else if (kCommand.InList(buff)) state = SCE_GC_COMMAND; - else if (kEvent.InList(buff)) state = SCE_GC_EVENT; - - if (state) - { sc->ChangeState(state); - styler.ColourTo(sc->currentPos - 1, sc->state); - sc->ChangeState(SCE_GC_DEFAULT); - } - else - { sc->ChangeState(SCE_GC_DEFAULT); - styler.ColourTo(sc->currentPos - 1, sc->state); - } -} - -// Main colorizing function called by Scintilla -static void -ColouriseGui4CliDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *keywordlists[], Accessor &styler) -{ - styler.StartAt(startPos); - - Sci_Position currentline = styler.GetLine(startPos); - int quotestart = 0, oldstate; - styler.StartSegment(startPos); - bool noforward; - char buff[BUFFSIZE+1]; // buffer for command name - - StyleContext sc(startPos, length, initStyle, styler); - buff[0] = '\0'; // cbuff = 0; - - if (sc.state != SCE_GC_COMMENTBLOCK) // colorize 1st word.. - colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); - - while (sc.More()) - { noforward = 0; - - switch (sc.ch) - { - case '/': - if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_STRING) - break; - if (sc.chNext == '/') // line comment - { sc.SetState (SCE_GC_COMMENTLINE); - sc.Forward(); - styler.ColourTo(sc.currentPos, sc.state); - } - else if (sc.chNext == '*') // block comment - { sc.SetState(SCE_GC_COMMENTBLOCK); - sc.Forward(); - styler.ColourTo(sc.currentPos, sc.state); - } - else - styler.ColourTo(sc.currentPos, sc.state); - break; - - case '*': // end of comment block, or operator.. - if (sc.state == SCE_GC_STRING) - break; - if (sc.state == SCE_GC_COMMENTBLOCK && sc.chNext == '/') - { sc.Forward(); - styler.ColourTo(sc.currentPos, sc.state); - sc.ChangeState (SCE_GC_DEFAULT); - } - else - styler.ColourTo(sc.currentPos, sc.state); - break; - - case '\'': case '\"': // strings.. - if (sc.state == SCE_GC_COMMENTBLOCK || sc.state == SCE_GC_COMMENTLINE) - break; - if (sc.state == SCE_GC_STRING) - { if (sc.ch == quotestart) // match same quote char.. - { styler.ColourTo(sc.currentPos, sc.state); - sc.ChangeState(SCE_GC_DEFAULT); - quotestart = 0; - } } - else - { styler.ColourTo(sc.currentPos - 1, sc.state); - sc.ChangeState(SCE_GC_STRING); - quotestart = sc.ch; - } - break; - - case ';': // end of commandline character - if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && - sc.state != SCE_GC_STRING) - { - styler.ColourTo(sc.currentPos - 1, sc.state); - styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); - sc.ChangeState(SCE_GC_DEFAULT); - sc.Forward(); - colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); - noforward = 1; // don't move forward - already positioned at next char.. - } - break; - - case '+': case '-': case '=': case '!': // operators.. - case '<': case '>': case '&': case '|': case '$': - if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE && - sc.state != SCE_GC_STRING) - { - styler.ColourTo(sc.currentPos - 1, sc.state); - styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); - sc.ChangeState(SCE_GC_DEFAULT); - } - break; - - case '\\': // escape - same as operator, but also mark in strings.. - if (sc.state != SCE_GC_COMMENTBLOCK && sc.state != SCE_GC_COMMENTLINE) - { - oldstate = sc.state; - styler.ColourTo(sc.currentPos - 1, sc.state); - sc.Forward(); // mark also the next char.. - styler.ColourTo(sc.currentPos, SCE_GC_OPERATOR); - sc.ChangeState(oldstate); - } - break; - - case '\n': case '\r': - ++currentline; - if (sc.state == SCE_GC_COMMENTLINE) - { styler.ColourTo(sc.currentPos, sc.state); - sc.ChangeState (SCE_GC_DEFAULT); - } - else if (sc.state != SCE_GC_COMMENTBLOCK) - { colorFirstWord(keywordlists, styler, &sc, buff, BUFFSIZE, currentline); - noforward = 1; // don't move forward - already positioned at next char.. - } - break; - -// case ' ': case '\t': -// default : - } - - if (!noforward) sc.Forward(); - - } - sc.Complete(); -} - -// Main folding function called by Scintilla - (based on props (.ini) files function) -static void FoldGui4Cli(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; - - 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_GC_EVENT || style == SCE_GC_GLOBAL) - { headerPoint = true; // fold at events and globals - } - - if (atEOL) - { int lev = SC_FOLDLEVELBASE+1; - - if (headerPoint) - lev = SC_FOLDLEVELBASE; - - if (visibleChars == 0 && foldCompact) - lev |= SC_FOLDLEVELWHITEFLAG; - - if (headerPoint) - lev |= SC_FOLDLEVELHEADERFLAG; - - if (lev != styler.LevelAt(lineCurrent)) // set level, if not already correct - { styler.SetLevel(lineCurrent, lev); - } - - lineCurrent++; // re-initialize our flags - visibleChars = 0; - headerPoint = false; - } - - if (!(isspacechar(ch))) // || (style == SCE_GC_COMMENTLINE) || (style != SCE_GC_COMMENTBLOCK))) - visibleChars++; - } - - int lev = headerPoint ? SC_FOLDLEVELBASE : SC_FOLDLEVELBASE+1; - int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; - styler.SetLevel(lineCurrent, lev | flagsNext); -} - -// I have no idea what these are for.. probably accessible by some message. -static const char * const gui4cliWordListDesc[] = { - "Globals", "Events", "Attributes", "Control", "Commands", - 0 -}; - -// Declare language & pass our function pointers to Scintilla -LexerModule lmGui4Cli(SCLEX_GUI4CLI, ColouriseGui4CliDoc, "gui4cli", FoldGui4Cli, gui4cliWordListDesc); - -#undef debug - diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx deleted file mode 100644 index 667edaa5..00000000 --- a/scintilla/lexers/LexHTML.cxx +++ /dev/null @@ -1,2203 +0,0 @@ -// Scintilla source code edit control -/** @file LexHTML.cxx - ** Lexer for HTML. - **/ -// 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 "StringCopy.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 SCE_HA_JS (SCE_HJA_START - SCE_HJ_START) -#define SCE_HA_VBS (SCE_HBA_START - SCE_HB_START) -#define SCE_HA_PYTHON (SCE_HPA_START - SCE_HP_START) - -enum script_type { eScriptNone = 0, eScriptJS, eScriptVBS, eScriptPython, eScriptPHP, eScriptXML, eScriptSGML, eScriptSGMLblock, eScriptComment }; -enum script_mode { eHtml = 0, eNonHtmlScript, eNonHtmlPreProc, eNonHtmlScriptPreProc }; - -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 == '_'); -} - -inline bool IsOperator(int ch) { - if (IsASCII(ch) && isalnum(ch)) - return false; - // '.' left out as it is used to make up numbers - if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || - ch == '(' || 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 GetTextSegment(Accessor &styler, Sci_PositionU start, Sci_PositionU end, char *s, size_t len) { - Sci_PositionU i = 0; - for (; (i < end - start + 1) && (i < len-1); i++) { - s[i] = static_cast(MakeLowerCase(styler[start + i])); - } - s[i] = '\0'; -} - -static const char *GetNextWord(Accessor &styler, Sci_PositionU start, char *s, size_t sLen) { - - Sci_PositionU i = 0; - for (; i < sLen-1; i++) { - char ch = static_cast(styler.SafeGetCharAt(start + i)); - if ((i == 0) && !IsAWordStart(ch)) - break; - if ((i > 0) && !IsAWordChar(ch)) - break; - s[i] = ch; - } - s[i] = '\0'; - - return s; -} - -static script_type segIsScriptingIndicator(Accessor &styler, Sci_PositionU start, Sci_PositionU end, script_type prevValue) { - char s[100]; - GetTextSegment(styler, start, end, s, sizeof(s)); - //Platform::DebugPrintf("Scripting indicator [%s]\n", s); - if (strstr(s, "src")) // External script - return eScriptNone; - if (strstr(s, "vbs")) - return eScriptVBS; - if (strstr(s, "pyth")) - return eScriptPython; - if (strstr(s, "javas")) - return eScriptJS; - if (strstr(s, "jscr")) - return eScriptJS; - if (strstr(s, "php")) - return eScriptPHP; - if (strstr(s, "xml")) { - const char *xml = strstr(s, "xml"); - for (const char *t=s; t= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { - return eScriptPython; - } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { - return eScriptVBS; - } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { - return eScriptJS; - } else if ((state >= SCE_HPHP_DEFAULT) && (state <= SCE_HPHP_COMMENTLINE)) { - return eScriptPHP; - } else if ((state >= SCE_H_SGML_DEFAULT) && (state < SCE_H_SGML_BLOCK_DEFAULT)) { - return eScriptSGML; - } else if (state == SCE_H_SGML_BLOCK_DEFAULT) { - return eScriptSGMLblock; - } else { - return eScriptNone; - } -} - -static int statePrintForState(int state, script_mode inScriptType) { - int StateToPrint = state; - - if (state >= SCE_HJ_START) { - if ((state >= SCE_HP_START) && (state <= SCE_HP_IDENTIFIER)) { - StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON); - } else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) { - StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS); - } else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) { - StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS); - } - } - - return StateToPrint; -} - -static int stateForPrintState(int StateToPrint) { - int state; - - if ((StateToPrint >= SCE_HPA_START) && (StateToPrint <= SCE_HPA_IDENTIFIER)) { - state = StateToPrint - SCE_HA_PYTHON; - } else if ((StateToPrint >= SCE_HBA_START) && (StateToPrint <= SCE_HBA_STRINGEOL)) { - state = StateToPrint - SCE_HA_VBS; - } else if ((StateToPrint >= SCE_HJA_START) && (StateToPrint <= SCE_HJA_REGEX)) { - state = StateToPrint - SCE_HA_JS; - } else { - state = StateToPrint; - } - - return state; -} - -static inline bool IsNumber(Sci_PositionU start, Accessor &styler) { - return IsADigit(styler[start]) || (styler[start] == '.') || - (styler[start] == '-') || (styler[start] == '#'); -} - -static inline bool isStringState(int state) { - bool bResult; - - switch (state) { - case SCE_HJ_DOUBLESTRING: - case SCE_HJ_SINGLESTRING: - case SCE_HJA_DOUBLESTRING: - case SCE_HJA_SINGLESTRING: - case SCE_HB_STRING: - case SCE_HBA_STRING: - case SCE_HP_STRING: - case SCE_HP_CHARACTER: - case SCE_HP_TRIPLE: - case SCE_HP_TRIPLEDOUBLE: - case SCE_HPA_STRING: - case SCE_HPA_CHARACTER: - case SCE_HPA_TRIPLE: - case SCE_HPA_TRIPLEDOUBLE: - case SCE_HPHP_HSTRING: - case SCE_HPHP_SIMPLESTRING: - case SCE_HPHP_HSTRING_VARIABLE: - case SCE_HPHP_COMPLEX_VARIABLE: - bResult = true; - break; - default : - bResult = false; - break; - } - return bResult; -} - -static inline bool stateAllowsTermination(int state) { - bool allowTermination = !isStringState(state); - if (allowTermination) { - switch (state) { - case SCE_HB_COMMENTLINE: - case SCE_HPHP_COMMENT: - case SCE_HP_COMMENTLINE: - case SCE_HPA_COMMENTLINE: - allowTermination = false; - } - } - return allowTermination; -} - -// not really well done, since it's only comments that should lex the %> and <% -static inline bool isCommentASPState(int state) { - bool bResult; - - switch (state) { - case SCE_HJ_COMMENT: - case SCE_HJ_COMMENTLINE: - case SCE_HJ_COMMENTDOC: - case SCE_HB_COMMENTLINE: - case SCE_HP_COMMENTLINE: - case SCE_HPHP_COMMENT: - case SCE_HPHP_COMMENTLINE: - bResult = true; - break; - default : - bResult = false; - break; - } - return bResult; -} - -static void classifyAttribHTML(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler) { - bool wordIsNumber = IsNumber(start, styler); - char chAttr = SCE_H_ATTRIBUTEUNKNOWN; - if (wordIsNumber) { - chAttr = SCE_H_NUMBER; - } else { - char s[100]; - GetTextSegment(styler, start, end, s, sizeof(s)); - if (keywords.InList(s)) - chAttr = SCE_H_ATTRIBUTE; - } - if ((chAttr == SCE_H_ATTRIBUTEUNKNOWN) && !keywords) - // No keywords -> all are known - chAttr = SCE_H_ATTRIBUTE; - styler.ColourTo(end, chAttr); -} - -static int classifyTagHTML(Sci_PositionU start, Sci_PositionU end, - WordList &keywords, Accessor &styler, bool &tagDontFold, - bool caseSensitive, bool isXml, bool allowScripts) { - char withSpace[30 + 2] = " "; - const char *s = withSpace + 1; - // Copy after the '<' - Sci_PositionU i = 1; - for (Sci_PositionU cPos = start; cPos <= end && i < 30; cPos++) { - char ch = styler[cPos]; - if ((ch != '<') && (ch != '/')) { - withSpace[i++] = caseSensitive ? ch : static_cast(MakeLowerCase(ch)); - } - } - - //The following is only a quick hack, to see if this whole thing would work - //we first need the tagname with a trailing space... - withSpace[i] = ' '; - withSpace[i+1] = '\0'; - - // if the current language is XML, I can fold any tag - // if the current language is HTML, I don't want to fold certain tags (input, meta, etc.) - //...to find it in the list of no-container-tags - tagDontFold = (!isXml) && (NULL != strstr(" area base basefont br col command embed frame hr img input isindex keygen link meta param source track wbr ", withSpace)); - - //now we can remove the trailing space - withSpace[i] = '\0'; - - // No keywords -> all are known - char chAttr = SCE_H_TAGUNKNOWN; - if (s[0] == '!') { - chAttr = SCE_H_SGML_DEFAULT; - } else if (!keywords || keywords.InList(s)) { - chAttr = SCE_H_TAG; - } - styler.ColourTo(end, chAttr); - if (chAttr == SCE_H_TAG) { - if (allowScripts && 0 == strcmp(s, "script")) { - // check to see if this is a self-closing tag by sniffing ahead - bool isSelfClose = false; - for (Sci_PositionU cPos = end; cPos <= end + 200; cPos++) { - char ch = styler.SafeGetCharAt(cPos, '\0'); - if (ch == '\0' || ch == '>') - break; - else if (ch == '/' && styler.SafeGetCharAt(cPos + 1, '\0') == '>') { - isSelfClose = true; - break; - } - } - - // do not enter a script state if the tag self-closed - if (!isSelfClose) - chAttr = SCE_H_SCRIPT; - } else if (!isXml && 0 == strcmp(s, "comment")) { - chAttr = SCE_H_COMMENT; - } - } - return chAttr; -} - -static void classifyWordHTJS(Sci_PositionU start, Sci_PositionU end, - WordList &keywords, Accessor &styler, script_mode inScriptType) { - char s[30 + 1]; - Sci_PositionU i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = styler[start + i]; - } - s[i] = '\0'; - - char chAttr = SCE_HJ_WORD; - bool wordIsNumber = IsADigit(s[0]) || ((s[0] == '.') && IsADigit(s[1])); - if (wordIsNumber) { - chAttr = SCE_HJ_NUMBER; - } else if (keywords.InList(s)) { - chAttr = SCE_HJ_KEYWORD; - } - styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); -} - -static int classifyWordHTVB(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler, script_mode inScriptType) { - char chAttr = SCE_HB_IDENTIFIER; - bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.'); - if (wordIsNumber) { - chAttr = SCE_HB_NUMBER; - } else { - char s[100]; - GetTextSegment(styler, start, end, s, sizeof(s)); - if (keywords.InList(s)) { - chAttr = SCE_HB_WORD; - if (strcmp(s, "rem") == 0) - chAttr = SCE_HB_COMMENTLINE; - } - } - styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); - if (chAttr == SCE_HB_COMMENTLINE) - return SCE_HB_COMMENTLINE; - else - return SCE_HB_DEFAULT; -} - -static void classifyWordHTPy(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler, char *prevWord, script_mode inScriptType, bool isMako) { - bool wordIsNumber = IsADigit(styler[start]); - char s[30 + 1]; - Sci_PositionU i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = styler[start + i]; - } - s[i] = '\0'; - char chAttr = SCE_HP_IDENTIFIER; - if (0 == strcmp(prevWord, "class")) - chAttr = SCE_HP_CLASSNAME; - else if (0 == strcmp(prevWord, "def")) - chAttr = SCE_HP_DEFNAME; - else if (wordIsNumber) - chAttr = SCE_HP_NUMBER; - else if (keywords.InList(s)) - chAttr = SCE_HP_WORD; - else if (isMako && 0 == strcmp(s, "block")) - chAttr = SCE_HP_WORD; - styler.ColourTo(end, statePrintForState(chAttr, inScriptType)); - strcpy(prevWord, s); -} - -// Update the word colour to default or keyword -// Called when in a PHP word -static void classifyWordHTPHP(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler) { - char chAttr = SCE_HPHP_DEFAULT; - bool wordIsNumber = IsADigit(styler[start]) || (styler[start] == '.' && start+1 <= end && IsADigit(styler[start+1])); - if (wordIsNumber) { - chAttr = SCE_HPHP_NUMBER; - } else { - char s[100]; - GetTextSegment(styler, start, end, s, sizeof(s)); - if (keywords.InList(s)) - chAttr = SCE_HPHP_WORD; - } - styler.ColourTo(end, chAttr); -} - -static bool isWordHSGML(Sci_PositionU start, Sci_PositionU end, WordList &keywords, Accessor &styler) { - char s[30 + 1]; - Sci_PositionU i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = styler[start + i]; - } - s[i] = '\0'; - return keywords.InList(s); -} - -static bool isWordCdata(Sci_PositionU start, Sci_PositionU end, Accessor &styler) { - char s[30 + 1]; - Sci_PositionU i = 0; - for (; i < end - start + 1 && i < 30; i++) { - s[i] = styler[start + i]; - } - s[i] = '\0'; - return (0 == strcmp(s, "[CDATA[")); -} - -// Return the first state to reach when entering a scripting language -static int StateForScript(script_type scriptLanguage) { - int Result; - switch (scriptLanguage) { - case eScriptVBS: - Result = SCE_HB_START; - break; - case eScriptPython: - Result = SCE_HP_START; - break; - case eScriptPHP: - Result = SCE_HPHP_DEFAULT; - break; - case eScriptXML: - Result = SCE_H_TAGUNKNOWN; - break; - case eScriptSGML: - Result = SCE_H_SGML_DEFAULT; - break; - case eScriptComment: - Result = SCE_H_COMMENT; - break; - default : - Result = SCE_HJ_START; - break; - } - return Result; -} - -static inline bool issgmlwordchar(int ch) { - return !IsASCII(ch) || - (isalnum(ch) || ch == '.' || ch == '_' || ch == ':' || ch == '!' || ch == '#' || ch == '['); -} - -static inline bool IsPhpWordStart(int ch) { - return (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) || (ch >= 0x7f); -} - -static inline bool IsPhpWordChar(int ch) { - return IsADigit(ch) || IsPhpWordStart(ch); -} - -static bool InTagState(int state) { - return state == SCE_H_TAG || state == SCE_H_TAGUNKNOWN || - state == SCE_H_SCRIPT || - state == SCE_H_ATTRIBUTE || state == SCE_H_ATTRIBUTEUNKNOWN || - state == SCE_H_NUMBER || state == SCE_H_OTHER || - state == SCE_H_DOUBLESTRING || state == SCE_H_SINGLESTRING; -} - -static bool IsCommentState(const int state) { - return state == SCE_H_COMMENT || state == SCE_H_SGML_COMMENT; -} - -static bool IsScriptCommentState(const int state) { - return state == SCE_HJ_COMMENT || state == SCE_HJ_COMMENTLINE || state == SCE_HJA_COMMENT || - state == SCE_HJA_COMMENTLINE || state == SCE_HB_COMMENTLINE || state == SCE_HBA_COMMENTLINE; -} - -static bool isLineEnd(int ch) { - return ch == '\r' || ch == '\n'; -} - -static bool isMakoBlockEnd(const int ch, const int chNext, const char *blockType) { - if (strlen(blockType) == 0) { - return ((ch == '%') && (chNext == '>')); - } else if ((0 == strcmp(blockType, "inherit")) || - (0 == strcmp(blockType, "namespace")) || - (0 == strcmp(blockType, "include")) || - (0 == strcmp(blockType, "page"))) { - return ((ch == '/') && (chNext == '>')); - } else if (0 == strcmp(blockType, "%")) { - if (ch == '/' && isLineEnd(chNext)) - return 1; - else - return isLineEnd(ch); - } else if (0 == strcmp(blockType, "{")) { - return ch == '}'; - } else { - return (ch == '>'); - } -} - -static bool isDjangoBlockEnd(const int ch, const int chNext, const char *blockType) { - if (strlen(blockType) == 0) { - return 0; - } else if (0 == strcmp(blockType, "%")) { - return ((ch == '%') && (chNext == '}')); - } else if (0 == strcmp(blockType, "{")) { - return ((ch == '}') && (chNext == '}')); - } else { - return 0; - } -} - -static bool isPHPStringState(int state) { - return - (state == SCE_HPHP_HSTRING) || - (state == SCE_HPHP_SIMPLESTRING) || - (state == SCE_HPHP_HSTRING_VARIABLE) || - (state == SCE_HPHP_COMPLEX_VARIABLE); -} - -static Sci_Position FindPhpStringDelimiter(char *phpStringDelimiter, const int phpStringDelimiterSize, Sci_Position i, const Sci_Position lengthDoc, Accessor &styler, bool &isSimpleString) { - Sci_Position j; - const Sci_Position beginning = i - 1; - bool isValidSimpleString = false; - - while (i < lengthDoc && (styler[i] == ' ' || styler[i] == '\t')) - i++; - - char ch = styler.SafeGetCharAt(i); - const char chNext = styler.SafeGetCharAt(i + 1); - if (!IsPhpWordStart(ch)) { - if (ch == '\'' && IsPhpWordStart(chNext)) { - i++; - ch = chNext; - isSimpleString = true; - } else { - phpStringDelimiter[0] = '\0'; - return beginning; - } - } - phpStringDelimiter[0] = ch; - i++; - - for (j = i; j < lengthDoc && !isLineEnd(styler[j]); j++) { - if (!IsPhpWordChar(styler[j])) { - if (isSimpleString && (styler[j] == '\'') && isLineEnd(styler.SafeGetCharAt(j + 1))) { - isValidSimpleString = true; - j++; - break; - } else { - phpStringDelimiter[0] = '\0'; - return beginning; - } - } - if (j - i < phpStringDelimiterSize - 2) - phpStringDelimiter[j-i+1] = styler[j]; - else - i++; - } - if (isSimpleString && !isValidSimpleString) { - phpStringDelimiter[0] = '\0'; - return beginning; - } - phpStringDelimiter[j-i+1 - (isSimpleString ? 1 : 0)] = '\0'; - return j - 1; -} - -static void ColouriseHyperTextDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler, bool isXml) { - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords3 = *keywordlists[2]; - WordList &keywords4 = *keywordlists[3]; - WordList &keywords5 = *keywordlists[4]; - WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords - - styler.StartAt(startPos); - char prevWord[200]; - prevWord[0] = '\0'; - char phpStringDelimiter[200]; // PHP is not limited in length, we are - phpStringDelimiter[0] = '\0'; - int StateToPrint = initStyle; - int state = stateForPrintState(StateToPrint); - char makoBlockType[200]; - makoBlockType[0] = '\0'; - int makoComment = 0; - char djangoBlockType[2]; - djangoBlockType[0] = '\0'; - - // If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen - if (InTagState(state)) { - while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) { - Sci_Position backLineStart = styler.LineStart(styler.GetLine(startPos-1)); - length += startPos - backLineStart; - startPos = backLineStart; - } - state = SCE_H_DEFAULT; - } - // String can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState - if (isPHPStringState(state)) { - while (startPos > 0 && (isPHPStringState(state) || !isLineEnd(styler[startPos - 1]))) { - startPos--; - length++; - state = styler.StyleAt(startPos); - } - if (startPos == 0) - state = SCE_H_DEFAULT; - } - styler.StartAt(startPos); - - /* Nothing handles getting out of these, so we need not start in any of them. - * As we're at line start and they can't span lines, we'll re-detect them anyway */ - switch (state) { - case SCE_H_QUESTION: - case SCE_H_XMLSTART: - case SCE_H_XMLEND: - case SCE_H_ASP: - state = SCE_H_DEFAULT; - break; - } - - Sci_Position lineCurrent = styler.GetLine(startPos); - int lineState; - if (lineCurrent > 0) { - lineState = styler.GetLineState(lineCurrent-1); - } else { - // Default client and ASP scripting language is JavaScript - lineState = eScriptJS << 8; - - // property asp.default.language - // Script in ASP code is initially assumed to be in JavaScript. - // To change this to VBScript set asp.default.language to 2. Python is 3. - lineState |= styler.GetPropertyInt("asp.default.language", eScriptJS) << 4; - } - script_mode inScriptType = script_mode((lineState >> 0) & 0x03); // 2 bits of scripting mode - bool tagOpened = (lineState >> 2) & 0x01; // 1 bit to know if we are in an opened tag - bool tagClosing = (lineState >> 3) & 0x01; // 1 bit to know if we are in a closing tag - bool tagDontFold = false; //some HTML tags should not be folded - script_type aspScript = script_type((lineState >> 4) & 0x0F); // 4 bits of script name - script_type clientScript = script_type((lineState >> 8) & 0x0F); // 4 bits of script name - int beforePreProc = (lineState >> 12) & 0xFF; // 8 bits of state - - script_type scriptLanguage = ScriptOfState(state); - // If eNonHtmlScript coincides with SCE_H_COMMENT, assume eScriptComment - if (inScriptType == eNonHtmlScript && state == SCE_H_COMMENT) { - scriptLanguage = eScriptComment; - } - script_type beforeLanguage = ScriptOfState(beforePreProc); - - // property fold.html - // Folding is turned on or off for HTML and XML files with this option. - // The fold option must also be on for folding to occur. - const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0; - - const bool fold = foldHTML && styler.GetPropertyInt("fold", 0); - - // property fold.html.preprocessor - // Folding is turned on or off for scripts embedded in HTML files with this option. - // The default is on. - const bool foldHTMLPreprocessor = foldHTML && styler.GetPropertyInt("fold.html.preprocessor", 1); - - const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - - // property fold.hypertext.comment - // Allow folding for comments in scripts embedded in HTML. - // The default is off. - const bool foldComment = fold && styler.GetPropertyInt("fold.hypertext.comment", 0) != 0; - - // property fold.hypertext.heredoc - // Allow folding for heredocs in scripts embedded in HTML. - // The default is off. - const bool foldHeredoc = fold && styler.GetPropertyInt("fold.hypertext.heredoc", 0) != 0; - - // property html.tags.case.sensitive - // For XML and HTML, setting this property to 1 will make tags match in a case - // sensitive way which is the expected behaviour for XML and XHTML. - const bool caseSensitive = styler.GetPropertyInt("html.tags.case.sensitive", 0) != 0; - - // property lexer.xml.allow.scripts - // Set to 0 to disable scripts in XML. - const bool allowScripts = styler.GetPropertyInt("lexer.xml.allow.scripts", 1) != 0; - - // property lexer.html.mako - // Set to 1 to enable the mako template language. - const bool isMako = styler.GetPropertyInt("lexer.html.mako", 0) != 0; - - // property lexer.html.django - // Set to 1 to enable the django template language. - const bool isDjango = styler.GetPropertyInt("lexer.html.django", 0) != 0; - - const CharacterSet setHTMLWord(CharacterSet::setAlphaNum, ".-_:!#", 0x80, true); - const CharacterSet setTagContinue(CharacterSet::setAlphaNum, ".-_:!#[", 0x80, true); - const CharacterSet setAttributeContinue(CharacterSet::setAlphaNum, ".-_:!#/", 0x80, true); - // TODO: also handle + and - (except if they're part of ++ or --) and return keywords - const CharacterSet setOKBeforeJSRE(CharacterSet::setNone, "([{=,:;!%^&*|?~"); - - int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; - int levelCurrent = levelPrev; - int visibleChars = 0; - int lineStartVisibleChars = 0; - - int chPrev = ' '; - int ch = ' '; - int chPrevNonWhite = ' '; - // look back to set chPrevNonWhite properly for better regex colouring - if (scriptLanguage == eScriptJS && startPos > 0) { - Sci_Position back = startPos; - int style = 0; - while (--back) { - style = styler.StyleAt(back); - if (style < SCE_HJ_DEFAULT || style > SCE_HJ_COMMENTDOC) - // includes SCE_HJ_COMMENT & SCE_HJ_COMMENTLINE - break; - } - if (style == SCE_HJ_SYMBOLS) { - chPrevNonWhite = static_cast(styler.SafeGetCharAt(back)); - } - } - - styler.StartSegment(startPos); - const Sci_Position lengthDoc = startPos + length; - for (Sci_Position i = startPos; i < lengthDoc; i++) { - const int chPrev2 = chPrev; - chPrev = ch; - if (!IsASpace(ch) && state != SCE_HJ_COMMENT && - state != SCE_HJ_COMMENTLINE && state != SCE_HJ_COMMENTDOC) - chPrevNonWhite = ch; - ch = static_cast(styler[i]); - int chNext = static_cast(styler.SafeGetCharAt(i + 1)); - const int chNext2 = static_cast(styler.SafeGetCharAt(i + 2)); - - // Handle DBCS codepages - if (styler.IsLeadByte(static_cast(ch))) { - chPrev = ' '; - i += 1; - continue; - } - - if ((!IsASpace(ch) || !foldCompact) && fold) - visibleChars++; - if (!IsASpace(ch)) - lineStartVisibleChars++; - - // decide what is the current state to print (depending of the script tag) - StateToPrint = statePrintForState(state, inScriptType); - - // handle script folding - if (fold) { - switch (scriptLanguage) { - case eScriptJS: - case eScriptPHP: - //not currently supported case eScriptVBS: - - if ((state != SCE_HPHP_COMMENT) && (state != SCE_HPHP_COMMENTLINE) && (state != SCE_HJ_COMMENT) && (state != SCE_HJ_COMMENTLINE) && (state != SCE_HJ_COMMENTDOC) && (!isStringState(state))) { - //Platform::DebugPrintf("state=%d, StateToPrint=%d, initStyle=%d\n", state, StateToPrint, initStyle); - //if ((state == SCE_HPHP_OPERATOR) || (state == SCE_HPHP_DEFAULT) || (state == SCE_HJ_SYMBOLS) || (state == SCE_HJ_START) || (state == SCE_HJ_DEFAULT)) { - if (ch == '#') { - Sci_Position j = i + 1; - while ((j < lengthDoc) && IsASpaceOrTab(styler.SafeGetCharAt(j))) { - j++; - } - if (styler.Match(j, "region") || styler.Match(j, "if")) { - levelCurrent++; - } else if (styler.Match(j, "end")) { - levelCurrent--; - } - } else if ((ch == '{') || (ch == '}') || (foldComment && (ch == '/') && (chNext == '*'))) { - levelCurrent += (((ch == '{') || (ch == '/')) ? 1 : -1); - } - } else if (((state == SCE_HPHP_COMMENT) || (state == SCE_HJ_COMMENT)) && foldComment && (ch == '*') && (chNext == '/')) { - levelCurrent--; - } - break; - case eScriptPython: - if (state != SCE_HP_COMMENTLINE && !isMako) { - if ((ch == ':') && ((chNext == '\n') || (chNext == '\r' && chNext2 == '\n'))) { - levelCurrent++; - } else if ((ch == '\n') && !((chNext == '\r') && (chNext2 == '\n')) && (chNext != '\n')) { - // check if the number of tabs is lower than the level - int Findlevel = (levelCurrent & ~SC_FOLDLEVELBASE) * 8; - for (Sci_Position j = 0; Findlevel > 0; j++) { - char chTmp = styler.SafeGetCharAt(i + j + 1); - if (chTmp == '\t') { - Findlevel -= 8; - } else if (chTmp == ' ') { - Findlevel--; - } else { - break; - } - } - - if (Findlevel > 0) { - levelCurrent -= Findlevel / 8; - if (Findlevel % 8) - levelCurrent--; - } - } - } - break; - default: - break; - } - } - - if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { - // Trigger on CR only (Mac style) or either on LF from CR+LF (Dos/Win) or on LF alone (Unix) - // Avoid triggering two times on Dos/Win - // New line -> record any line state onto /next/ line - if (fold) { - int lev = levelPrev; - if (visibleChars == 0) - lev |= SC_FOLDLEVELWHITEFLAG; - if ((levelCurrent > levelPrev) && (visibleChars > 0)) - lev |= SC_FOLDLEVELHEADERFLAG; - - styler.SetLevel(lineCurrent, lev); - visibleChars = 0; - levelPrev = levelCurrent; - } - styler.SetLineState(lineCurrent, - ((inScriptType & 0x03) << 0) | - ((tagOpened ? 1 : 0) << 2) | - ((tagClosing ? 1 : 0) << 3) | - ((aspScript & 0x0F) << 4) | - ((clientScript & 0x0F) << 8) | - ((beforePreProc & 0xFF) << 12)); - lineCurrent++; - lineStartVisibleChars = 0; - } - - // handle start of Mako comment line - if (isMako && ch == '#' && chNext == '#') { - makoComment = 1; - state = SCE_HP_COMMENTLINE; - } - - // handle end of Mako comment line - else if (isMako && makoComment && (ch == '\r' || ch == '\n')) { - makoComment = 0; - styler.ColourTo(i - 1, StateToPrint); - if (scriptLanguage == eScriptPython) { - state = SCE_HP_DEFAULT; - } else { - state = SCE_H_DEFAULT; - } - } - - // Allow falling through to mako handling code if newline is going to end a block - if (((ch == '\r' && chNext != '\n') || (ch == '\n')) && - (!isMako || (0 != strcmp(makoBlockType, "%")))) { - } - // Ignore everything in mako comment until the line ends - else if (isMako && makoComment) { - } - - // generic end of script processing - else if ((inScriptType == eNonHtmlScript) && (ch == '<') && (chNext == '/')) { - // Check if it's the end of the script tag (or any other HTML tag) - switch (state) { - // in these cases, you can embed HTML tags (to confirm !!!!!!!!!!!!!!!!!!!!!!) - case SCE_H_DOUBLESTRING: - case SCE_H_SINGLESTRING: - case SCE_HJ_COMMENT: - case SCE_HJ_COMMENTDOC: - //case SCE_HJ_COMMENTLINE: // removed as this is a common thing done to hide - // the end of script marker from some JS interpreters. - case SCE_HB_COMMENTLINE: - case SCE_HBA_COMMENTLINE: - case SCE_HJ_DOUBLESTRING: - case SCE_HJ_SINGLESTRING: - case SCE_HJ_REGEX: - case SCE_HB_STRING: - case SCE_HBA_STRING: - case SCE_HP_STRING: - case SCE_HP_TRIPLE: - case SCE_HP_TRIPLEDOUBLE: - case SCE_HPHP_HSTRING: - case SCE_HPHP_SIMPLESTRING: - case SCE_HPHP_COMMENT: - case SCE_HPHP_COMMENTLINE: - break; - default : - // check if the closing tag is a script tag - if (const char *tag = - state == SCE_HJ_COMMENTLINE || isXml ? "script" : - state == SCE_H_COMMENT ? "comment" : 0) { - Sci_Position j = i + 2; - int chr; - do { - chr = static_cast(*tag++); - } while (chr != 0 && chr == MakeLowerCase(styler.SafeGetCharAt(j++))); - if (chr != 0) break; - } - // closing tag of the script (it's a closing HTML tag anyway) - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_TAGUNKNOWN; - inScriptType = eHtml; - scriptLanguage = eScriptNone; - clientScript = eScriptJS; - i += 2; - visibleChars += 2; - tagClosing = true; - continue; - } - } - - ///////////////////////////////////// - // handle the start of PHP pre-processor = Non-HTML - else if ((state != SCE_H_ASPAT) && - !isStringState(state) && - (state != SCE_HPHP_COMMENT) && - (state != SCE_HPHP_COMMENTLINE) && - (ch == '<') && - (chNext == '?') && - !IsScriptCommentState(state)) { - beforeLanguage = scriptLanguage; - scriptLanguage = segIsScriptingIndicator(styler, i + 2, i + 6, isXml ? eScriptXML : eScriptPHP); - if ((scriptLanguage != eScriptPHP) && (isStringState(state) || (state==SCE_H_COMMENT))) continue; - styler.ColourTo(i - 1, StateToPrint); - beforePreProc = state; - i++; - visibleChars++; - i += PrintScriptingIndicatorOffset(styler, styler.GetStartSegment() + 2, i + 6); - if (scriptLanguage == eScriptXML) - styler.ColourTo(i, SCE_H_XMLSTART); - else - styler.ColourTo(i, SCE_H_QUESTION); - state = StateForScript(scriptLanguage); - if (inScriptType == eNonHtmlScript) - inScriptType = eNonHtmlScriptPreProc; - else - inScriptType = eNonHtmlPreProc; - // Fold whole script, but not if the XML first tag (all XML-like tags in this case) - if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) { - levelCurrent++; - } - // should be better - ch = static_cast(styler.SafeGetCharAt(i)); - continue; - } - - // handle the start Mako template Python code - else if (isMako && scriptLanguage == eScriptNone && ((ch == '<' && chNext == '%') || - (lineStartVisibleChars == 1 && ch == '%') || - (lineStartVisibleChars == 1 && ch == '/' && chNext == '%') || - (ch == '$' && chNext == '{') || - (ch == '<' && chNext == '/' && chNext2 == '%'))) { - if (ch == '%' || ch == '/') - StringCopy(makoBlockType, "%"); - else if (ch == '$') - StringCopy(makoBlockType, "{"); - else if (chNext == '/') - GetNextWord(styler, i+3, makoBlockType, sizeof(makoBlockType)); - else - GetNextWord(styler, i+2, makoBlockType, sizeof(makoBlockType)); - styler.ColourTo(i - 1, StateToPrint); - beforePreProc = state; - if (inScriptType == eNonHtmlScript) - inScriptType = eNonHtmlScriptPreProc; - else - inScriptType = eNonHtmlPreProc; - - if (chNext == '/') { - i += 2; - visibleChars += 2; - } else if (ch != '%') { - i++; - visibleChars++; - } - state = SCE_HP_START; - scriptLanguage = eScriptPython; - styler.ColourTo(i, SCE_H_ASP); - - if (ch != '%' && ch != '$' && ch != '/') { - i += static_cast(strlen(makoBlockType)); - visibleChars += static_cast(strlen(makoBlockType)); - if (keywords4.InList(makoBlockType)) - styler.ColourTo(i, SCE_HP_WORD); - else - styler.ColourTo(i, SCE_H_TAGUNKNOWN); - } - - ch = static_cast(styler.SafeGetCharAt(i)); - continue; - } - - // handle the start/end of Django comment - else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) { - styler.ColourTo(i - 1, StateToPrint); - beforePreProc = state; - beforeLanguage = scriptLanguage; - if (inScriptType == eNonHtmlScript) - inScriptType = eNonHtmlScriptPreProc; - else - inScriptType = eNonHtmlPreProc; - i += 1; - visibleChars += 1; - scriptLanguage = eScriptComment; - state = SCE_H_COMMENT; - styler.ColourTo(i, SCE_H_ASP); - ch = static_cast(styler.SafeGetCharAt(i)); - continue; - } else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) { - styler.ColourTo(i - 1, StateToPrint); - i += 1; - visibleChars += 1; - styler.ColourTo(i, SCE_H_ASP); - state = beforePreProc; - if (inScriptType == eNonHtmlScriptPreProc) - inScriptType = eNonHtmlScript; - else - inScriptType = eHtml; - scriptLanguage = beforeLanguage; - continue; - } - - // handle the start Django template code - else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) { - if (chNext == '%') - StringCopy(djangoBlockType, "%"); - else - StringCopy(djangoBlockType, "{"); - styler.ColourTo(i - 1, StateToPrint); - beforePreProc = state; - if (inScriptType == eNonHtmlScript) - inScriptType = eNonHtmlScriptPreProc; - else - inScriptType = eNonHtmlPreProc; - - i += 1; - visibleChars += 1; - state = SCE_HP_START; - beforeLanguage = scriptLanguage; - scriptLanguage = eScriptPython; - styler.ColourTo(i, SCE_H_ASP); - - ch = static_cast(styler.SafeGetCharAt(i)); - continue; - } - - // handle the start of ASP pre-processor = Non-HTML - else if (!isMako && !isDjango && !isCommentASPState(state) && (ch == '<') && (chNext == '%') && !isPHPStringState(state)) { - styler.ColourTo(i - 1, StateToPrint); - beforePreProc = state; - if (inScriptType == eNonHtmlScript) - inScriptType = eNonHtmlScriptPreProc; - else - inScriptType = eNonHtmlPreProc; - - if (chNext2 == '@') { - i += 2; // place as if it was the second next char treated - visibleChars += 2; - state = SCE_H_ASPAT; - } else if ((chNext2 == '-') && (styler.SafeGetCharAt(i + 3) == '-')) { - styler.ColourTo(i + 3, SCE_H_ASP); - state = SCE_H_XCCOMMENT; - scriptLanguage = eScriptVBS; - continue; - } else { - if (chNext2 == '=') { - i += 2; // place as if it was the second next char treated - visibleChars += 2; - } else { - i++; // place as if it was the next char treated - visibleChars++; - } - - state = StateForScript(aspScript); - } - scriptLanguage = eScriptVBS; - styler.ColourTo(i, SCE_H_ASP); - // fold whole script - if (foldHTMLPreprocessor) - levelCurrent++; - // should be better - ch = static_cast(styler.SafeGetCharAt(i)); - continue; - } - - ///////////////////////////////////// - // handle the start of SGML language (DTD) - else if (((scriptLanguage == eScriptNone) || (scriptLanguage == eScriptXML)) && - (chPrev == '<') && - (ch == '!') && - (StateToPrint != SCE_H_CDATA) && - (!IsCommentState(StateToPrint)) && - (!IsScriptCommentState(StateToPrint))) { - beforePreProc = state; - styler.ColourTo(i - 2, StateToPrint); - if ((chNext == '-') && (chNext2 == '-')) { - state = SCE_H_COMMENT; // wait for a pending command - styler.ColourTo(i + 2, SCE_H_COMMENT); - i += 2; // follow styling after the -- - } else if (isWordCdata(i + 1, i + 7, styler)) { - state = SCE_H_CDATA; - } else { - styler.ColourTo(i, SCE_H_SGML_DEFAULT); // ') { - i++; - visibleChars++; - } - else if (0 == strcmp(makoBlockType, "%") && ch == '/') { - i++; - visibleChars++; - } - if (0 != strcmp(makoBlockType, "%") || ch == '/') { - styler.ColourTo(i, SCE_H_ASP); - } - state = beforePreProc; - if (inScriptType == eNonHtmlScriptPreProc) - inScriptType = eNonHtmlScript; - else - inScriptType = eHtml; - scriptLanguage = eScriptNone; - continue; - } - - // handle the end of Django template code - else if (isDjango && - ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) && - (scriptLanguage != eScriptNone) && stateAllowsTermination(state) && - isDjangoBlockEnd(ch, chNext, djangoBlockType)) { - if (state == SCE_H_ASPAT) { - aspScript = segIsScriptingIndicator(styler, - styler.GetStartSegment(), i - 1, aspScript); - } - if (state == SCE_HP_WORD) { - classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); - } else { - styler.ColourTo(i - 1, StateToPrint); - } - i += 1; - visibleChars += 1; - styler.ColourTo(i, SCE_H_ASP); - state = beforePreProc; - if (inScriptType == eNonHtmlScriptPreProc) - inScriptType = eNonHtmlScript; - else - inScriptType = eHtml; - scriptLanguage = beforeLanguage; - continue; - } - - // handle the end of a pre-processor = Non-HTML - else if ((!isMako && !isDjango && ((inScriptType == eNonHtmlPreProc) || (inScriptType == eNonHtmlScriptPreProc)) && - (((scriptLanguage != eScriptNone) && stateAllowsTermination(state))) && - (((ch == '%') || (ch == '?')) && (chNext == '>'))) || - ((scriptLanguage == eScriptSGML) && (ch == '>') && (state != SCE_H_SGML_COMMENT))) { - if (state == SCE_H_ASPAT) { - aspScript = segIsScriptingIndicator(styler, - styler.GetStartSegment(), i - 1, aspScript); - } - // Bounce out of any ASP mode - switch (state) { - case SCE_HJ_WORD: - classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType); - break; - case SCE_HB_WORD: - classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType); - break; - case SCE_HP_WORD: - classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); - break; - case SCE_HPHP_WORD: - classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler); - break; - case SCE_H_XCCOMMENT: - styler.ColourTo(i - 1, state); - break; - default : - styler.ColourTo(i - 1, StateToPrint); - break; - } - if (scriptLanguage != eScriptSGML) { - i++; - visibleChars++; - } - if (ch == '%') - styler.ColourTo(i, SCE_H_ASP); - else if (scriptLanguage == eScriptXML) - styler.ColourTo(i, SCE_H_XMLEND); - else if (scriptLanguage == eScriptSGML) - styler.ColourTo(i, SCE_H_SGML_DEFAULT); - else - styler.ColourTo(i, SCE_H_QUESTION); - state = beforePreProc; - if (inScriptType == eNonHtmlScriptPreProc) - inScriptType = eNonHtmlScript; - else - inScriptType = eHtml; - // Unfold all scripting languages, except for XML tag - if (foldHTMLPreprocessor && (scriptLanguage != eScriptXML)) { - levelCurrent--; - } - scriptLanguage = beforeLanguage; - continue; - } - ///////////////////////////////////// - - switch (state) { - case SCE_H_DEFAULT: - if (ch == '<') { - // in HTML, fold on tag open and unfold on tag close - tagOpened = true; - tagClosing = (chNext == '/'); - styler.ColourTo(i - 1, StateToPrint); - if (chNext != '!') - state = SCE_H_TAGUNKNOWN; - } else if (ch == '&') { - styler.ColourTo(i - 1, SCE_H_DEFAULT); - state = SCE_H_ENTITY; - } - break; - case SCE_H_SGML_DEFAULT: - case SCE_H_SGML_BLOCK_DEFAULT: -// if (scriptLanguage == eScriptSGMLblock) -// StateToPrint = SCE_H_SGML_BLOCK_DEFAULT; - - if (ch == '\"') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_SGML_DOUBLESTRING; - } else if (ch == '\'') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_SGML_SIMPLESTRING; - } else if ((ch == '-') && (chPrev == '-')) { - if (static_cast(styler.GetStartSegment()) <= (i - 2)) { - styler.ColourTo(i - 2, StateToPrint); - } - state = SCE_H_SGML_COMMENT; - } else if (IsASCII(ch) && isalpha(ch) && (chPrev == '%')) { - styler.ColourTo(i - 2, StateToPrint); - state = SCE_H_SGML_ENTITY; - } else if (ch == '#') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_SGML_SPECIAL; - } else if (ch == '[') { - styler.ColourTo(i - 1, StateToPrint); - scriptLanguage = eScriptSGMLblock; - state = SCE_H_SGML_BLOCK_DEFAULT; - } else if (ch == ']') { - if (scriptLanguage == eScriptSGMLblock) { - styler.ColourTo(i, StateToPrint); - scriptLanguage = eScriptSGML; - } else { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, SCE_H_SGML_ERROR); - } - state = SCE_H_SGML_DEFAULT; - } else if (scriptLanguage == eScriptSGMLblock) { - if ((ch == '!') && (chPrev == '<')) { - styler.ColourTo(i - 2, StateToPrint); - styler.ColourTo(i, SCE_H_SGML_DEFAULT); - state = SCE_H_SGML_COMMAND; - } else if (ch == '>') { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, SCE_H_SGML_DEFAULT); - } - } - break; - case SCE_H_SGML_COMMAND: - if ((ch == '-') && (chPrev == '-')) { - styler.ColourTo(i - 2, StateToPrint); - state = SCE_H_SGML_COMMENT; - } else if (!issgmlwordchar(ch)) { - if (isWordHSGML(styler.GetStartSegment(), i - 1, keywords6, styler)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_SGML_1ST_PARAM; - } else { - state = SCE_H_SGML_ERROR; - } - } - break; - case SCE_H_SGML_1ST_PARAM: - // wait for the beginning of the word - if ((ch == '-') && (chPrev == '-')) { - if (scriptLanguage == eScriptSGMLblock) { - styler.ColourTo(i - 2, SCE_H_SGML_BLOCK_DEFAULT); - } else { - styler.ColourTo(i - 2, SCE_H_SGML_DEFAULT); - } - state = SCE_H_SGML_1ST_PARAM_COMMENT; - } else if (issgmlwordchar(ch)) { - if (scriptLanguage == eScriptSGMLblock) { - styler.ColourTo(i - 1, SCE_H_SGML_BLOCK_DEFAULT); - } else { - styler.ColourTo(i - 1, SCE_H_SGML_DEFAULT); - } - // find the length of the word - int size = 1; - while (setHTMLWord.Contains(static_cast(styler.SafeGetCharAt(i + size)))) - size++; - styler.ColourTo(i + size - 1, StateToPrint); - i += size - 1; - visibleChars += size - 1; - ch = static_cast(styler.SafeGetCharAt(i)); - if (scriptLanguage == eScriptSGMLblock) { - state = SCE_H_SGML_BLOCK_DEFAULT; - } else { - state = SCE_H_SGML_DEFAULT; - } - continue; - } - break; - case SCE_H_SGML_ERROR: - if ((ch == '-') && (chPrev == '-')) { - styler.ColourTo(i - 2, StateToPrint); - state = SCE_H_SGML_COMMENT; - } - break; - case SCE_H_SGML_DOUBLESTRING: - if (ch == '\"') { - styler.ColourTo(i, StateToPrint); - state = SCE_H_SGML_DEFAULT; - } - break; - case SCE_H_SGML_SIMPLESTRING: - if (ch == '\'') { - styler.ColourTo(i, StateToPrint); - state = SCE_H_SGML_DEFAULT; - } - break; - case SCE_H_SGML_COMMENT: - if ((ch == '-') && (chPrev == '-')) { - styler.ColourTo(i, StateToPrint); - state = SCE_H_SGML_DEFAULT; - } - break; - case SCE_H_CDATA: - if ((chPrev2 == ']') && (chPrev == ']') && (ch == '>')) { - styler.ColourTo(i, StateToPrint); - state = SCE_H_DEFAULT; - levelCurrent--; - } - break; - case SCE_H_COMMENT: - if ((scriptLanguage != eScriptComment) && (chPrev2 == '-') && (chPrev == '-') && (ch == '>')) { - styler.ColourTo(i, StateToPrint); - state = SCE_H_DEFAULT; - levelCurrent--; - } - break; - case SCE_H_SGML_1ST_PARAM_COMMENT: - if ((ch == '-') && (chPrev == '-')) { - styler.ColourTo(i, SCE_H_SGML_COMMENT); - state = SCE_H_SGML_1ST_PARAM; - } - break; - case SCE_H_SGML_SPECIAL: - if (!(IsASCII(ch) && isupper(ch))) { - styler.ColourTo(i - 1, StateToPrint); - if (isalnum(ch)) { - state = SCE_H_SGML_ERROR; - } else { - state = SCE_H_SGML_DEFAULT; - } - } - break; - case SCE_H_SGML_ENTITY: - if (ch == ';') { - styler.ColourTo(i, StateToPrint); - state = SCE_H_SGML_DEFAULT; - } else if (!(IsASCII(ch) && isalnum(ch)) && ch != '-' && ch != '.') { - styler.ColourTo(i, SCE_H_SGML_ERROR); - state = SCE_H_SGML_DEFAULT; - } - break; - case SCE_H_ENTITY: - if (ch == ';') { - styler.ColourTo(i, StateToPrint); - state = SCE_H_DEFAULT; - } - if (ch != '#' && !(IsASCII(ch) && isalnum(ch)) // Should check that '#' follows '&', but it is unlikely anyway... - && ch != '.' && ch != '-' && ch != '_' && ch != ':') { // valid in XML - if (!IsASCII(ch)) // Possibly start of a multibyte character so don't allow this byte to be in entity style - styler.ColourTo(i-1, SCE_H_TAGUNKNOWN); - else - styler.ColourTo(i, SCE_H_TAGUNKNOWN); - state = SCE_H_DEFAULT; - } - break; - case SCE_H_TAGUNKNOWN: - if (!setTagContinue.Contains(ch) && !((ch == '/') && (chPrev == '<'))) { - int eClass = classifyTagHTML(styler.GetStartSegment(), - i - 1, keywords, styler, tagDontFold, caseSensitive, isXml, allowScripts); - if (eClass == SCE_H_SCRIPT || eClass == SCE_H_COMMENT) { - if (!tagClosing) { - inScriptType = eNonHtmlScript; - scriptLanguage = eClass == SCE_H_SCRIPT ? clientScript : eScriptComment; - } else { - scriptLanguage = eScriptNone; - } - eClass = SCE_H_TAG; - } - if (ch == '>') { - styler.ColourTo(i, eClass); - if (inScriptType == eNonHtmlScript) { - state = StateForScript(scriptLanguage); - } else { - state = SCE_H_DEFAULT; - } - tagOpened = false; - if (!tagDontFold) { - if (tagClosing) { - levelCurrent--; - } else { - levelCurrent++; - } - } - tagClosing = false; - } else if (ch == '/' && chNext == '>') { - if (eClass == SCE_H_TAGUNKNOWN) { - styler.ColourTo(i + 1, SCE_H_TAGUNKNOWN); - } else { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i + 1, SCE_H_TAGEND); - } - i++; - ch = chNext; - state = SCE_H_DEFAULT; - tagOpened = false; - } else { - if (eClass != SCE_H_TAGUNKNOWN) { - if (eClass == SCE_H_SGML_DEFAULT) { - state = SCE_H_SGML_DEFAULT; - } else { - state = SCE_H_OTHER; - } - } - } - } - break; - case SCE_H_ATTRIBUTE: - if (!setAttributeContinue.Contains(ch)) { - if (inScriptType == eNonHtmlScript) { - int scriptLanguagePrev = scriptLanguage; - clientScript = segIsScriptingIndicator(styler, styler.GetStartSegment(), i - 1, scriptLanguage); - scriptLanguage = clientScript; - if ((scriptLanguagePrev != scriptLanguage) && (scriptLanguage == eScriptNone)) - inScriptType = eHtml; - } - classifyAttribHTML(styler.GetStartSegment(), i - 1, keywords, styler); - if (ch == '>') { - styler.ColourTo(i, SCE_H_TAG); - if (inScriptType == eNonHtmlScript) { - state = StateForScript(scriptLanguage); - } else { - state = SCE_H_DEFAULT; - } - tagOpened = false; - if (!tagDontFold) { - if (tagClosing) { - levelCurrent--; - } else { - levelCurrent++; - } - } - tagClosing = false; - } else if (ch == '=') { - styler.ColourTo(i, SCE_H_OTHER); - state = SCE_H_VALUE; - } else { - state = SCE_H_OTHER; - } - } - break; - case SCE_H_OTHER: - if (ch == '>') { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, SCE_H_TAG); - if (inScriptType == eNonHtmlScript) { - state = StateForScript(scriptLanguage); - } else { - state = SCE_H_DEFAULT; - } - tagOpened = false; - if (!tagDontFold) { - if (tagClosing) { - levelCurrent--; - } else { - levelCurrent++; - } - } - tagClosing = false; - } else if (ch == '\"') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_DOUBLESTRING; - } else if (ch == '\'') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_SINGLESTRING; - } else if (ch == '=') { - styler.ColourTo(i, StateToPrint); - state = SCE_H_VALUE; - } else if (ch == '/' && chNext == '>') { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i + 1, SCE_H_TAGEND); - i++; - ch = chNext; - state = SCE_H_DEFAULT; - tagOpened = false; - } else if (ch == '?' && chNext == '>') { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i + 1, SCE_H_XMLEND); - i++; - ch = chNext; - state = SCE_H_DEFAULT; - } else if (setHTMLWord.Contains(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_H_ATTRIBUTE; - } - break; - case SCE_H_DOUBLESTRING: - if (ch == '\"') { - if (inScriptType == eNonHtmlScript) { - scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage); - } - styler.ColourTo(i, SCE_H_DOUBLESTRING); - state = SCE_H_OTHER; - } - break; - case SCE_H_SINGLESTRING: - if (ch == '\'') { - if (inScriptType == eNonHtmlScript) { - scriptLanguage = segIsScriptingIndicator(styler, styler.GetStartSegment(), i, scriptLanguage); - } - styler.ColourTo(i, SCE_H_SINGLESTRING); - state = SCE_H_OTHER; - } - break; - case SCE_H_VALUE: - if (!setHTMLWord.Contains(ch)) { - if (ch == '\"' && chPrev == '=') { - // Should really test for being first character - state = SCE_H_DOUBLESTRING; - } else if (ch == '\'' && chPrev == '=') { - state = SCE_H_SINGLESTRING; - } else { - if (IsNumber(styler.GetStartSegment(), styler)) { - styler.ColourTo(i - 1, SCE_H_NUMBER); - } else { - styler.ColourTo(i - 1, StateToPrint); - } - if (ch == '>') { - styler.ColourTo(i, SCE_H_TAG); - if (inScriptType == eNonHtmlScript) { - state = StateForScript(scriptLanguage); - } else { - state = SCE_H_DEFAULT; - } - tagOpened = false; - if (!tagDontFold) { - if (tagClosing) { - levelCurrent--; - } else { - levelCurrent++; - } - } - tagClosing = false; - } else { - state = SCE_H_OTHER; - } - } - } - break; - case SCE_HJ_DEFAULT: - case SCE_HJ_START: - case SCE_HJ_SYMBOLS: - if (IsAWordStart(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_WORD; - } else if (ch == '/' && chNext == '*') { - styler.ColourTo(i - 1, StateToPrint); - if (chNext2 == '*') - state = SCE_HJ_COMMENTDOC; - else - state = SCE_HJ_COMMENT; - if (chNext2 == '/') { - // Eat the * so it isn't used for the end of the comment - i++; - } - } else if (ch == '/' && chNext == '/') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - } else if (ch == '/' && setOKBeforeJSRE.Contains(chPrevNonWhite)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_REGEX; - } else if (ch == '\"') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_DOUBLESTRING; - } else if (ch == '\'') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_SINGLESTRING; - } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && - styler.SafeGetCharAt(i + 3) == '-') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - i += 2; - } else if (IsOperator(ch)) { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); - state = SCE_HJ_DEFAULT; - } else if ((ch == ' ') || (ch == '\t')) { - if (state == SCE_HJ_START) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_DEFAULT; - } - } - break; - case SCE_HJ_WORD: - if (!IsAWordChar(ch)) { - classifyWordHTJS(styler.GetStartSegment(), i - 1, keywords2, styler, inScriptType); - //styler.ColourTo(i - 1, eHTJSKeyword); - state = SCE_HJ_DEFAULT; - if (ch == '/' && chNext == '*') { - if (chNext2 == '*') - state = SCE_HJ_COMMENTDOC; - else - state = SCE_HJ_COMMENT; - } else if (ch == '/' && chNext == '/') { - state = SCE_HJ_COMMENTLINE; - } else if (ch == '\"') { - state = SCE_HJ_DOUBLESTRING; - } else if (ch == '\'') { - state = SCE_HJ_SINGLESTRING; - } else if ((ch == '-') && (chNext == '-') && (chNext2 == '>')) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - i += 2; - } else if (IsOperator(ch)) { - styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); - state = SCE_HJ_DEFAULT; - } - } - break; - case SCE_HJ_COMMENT: - case SCE_HJ_COMMENTDOC: - if (ch == '/' && chPrev == '*') { - styler.ColourTo(i, StateToPrint); - state = SCE_HJ_DEFAULT; - ch = ' '; - } - break; - case SCE_HJ_COMMENTLINE: - if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, statePrintForState(SCE_HJ_COMMENTLINE, inScriptType)); - state = SCE_HJ_DEFAULT; - ch = ' '; - } - break; - case SCE_HJ_DOUBLESTRING: - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - } - } else if (ch == '\"') { - styler.ColourTo(i, statePrintForState(SCE_HJ_DOUBLESTRING, inScriptType)); - state = SCE_HJ_DEFAULT; - } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - i += 2; - } else if (isLineEnd(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_STRINGEOL; - } - break; - case SCE_HJ_SINGLESTRING: - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - } - } else if (ch == '\'') { - styler.ColourTo(i, statePrintForState(SCE_HJ_SINGLESTRING, inScriptType)); - state = SCE_HJ_DEFAULT; - } else if ((inScriptType == eNonHtmlScript) && (ch == '-') && (chNext == '-') && (chNext2 == '>')) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_COMMENTLINE; - i += 2; - } else if (isLineEnd(ch)) { - styler.ColourTo(i - 1, StateToPrint); - if (chPrev != '\\' && (chPrev2 != '\\' || chPrev != '\r' || ch != '\n')) { - state = SCE_HJ_STRINGEOL; - } - } - break; - case SCE_HJ_STRINGEOL: - if (!isLineEnd(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HJ_DEFAULT; - } else if (!isLineEnd(chNext)) { - styler.ColourTo(i, StateToPrint); - state = SCE_HJ_DEFAULT; - } - break; - case SCE_HJ_REGEX: - if (ch == '\r' || ch == '\n' || ch == '/') { - if (ch == '/') { - while (IsASCII(chNext) && islower(chNext)) { // gobble regex flags - i++; - ch = chNext; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } - } - styler.ColourTo(i, StateToPrint); - state = SCE_HJ_DEFAULT; - } else if (ch == '\\') { - // Gobble up the quoted character - if (chNext == '\\' || chNext == '/') { - i++; - ch = chNext; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } - } - break; - case SCE_HB_DEFAULT: - case SCE_HB_START: - if (IsAWordStart(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_WORD; - } else if (ch == '\'') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_COMMENTLINE; - } else if (ch == '\"') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_STRING; - } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && - styler.SafeGetCharAt(i + 3) == '-') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_COMMENTLINE; - } else if (IsOperator(ch)) { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType)); - state = SCE_HB_DEFAULT; - } else if ((ch == ' ') || (ch == '\t')) { - if (state == SCE_HB_START) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_DEFAULT; - } - } - break; - case SCE_HB_WORD: - if (!IsAWordChar(ch)) { - state = classifyWordHTVB(styler.GetStartSegment(), i - 1, keywords3, styler, inScriptType); - if (state == SCE_HB_DEFAULT) { - if (ch == '\"') { - state = SCE_HB_STRING; - } else if (ch == '\'') { - state = SCE_HB_COMMENTLINE; - } else if (IsOperator(ch)) { - styler.ColourTo(i, statePrintForState(SCE_HB_DEFAULT, inScriptType)); - state = SCE_HB_DEFAULT; - } - } - } - break; - case SCE_HB_STRING: - if (ch == '\"') { - styler.ColourTo(i, StateToPrint); - state = SCE_HB_DEFAULT; - } else if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_STRINGEOL; - } - break; - case SCE_HB_COMMENTLINE: - if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_DEFAULT; - } - break; - case SCE_HB_STRINGEOL: - if (!isLineEnd(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HB_DEFAULT; - } else if (!isLineEnd(chNext)) { - styler.ColourTo(i, StateToPrint); - state = SCE_HB_DEFAULT; - } - break; - case SCE_HP_DEFAULT: - case SCE_HP_START: - if (IsAWordStart(ch)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HP_WORD; - } else if ((ch == '<') && (chNext == '!') && (chNext2 == '-') && - styler.SafeGetCharAt(i + 3) == '-') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HP_COMMENTLINE; - } else if (ch == '#') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HP_COMMENTLINE; - } else if (ch == '\"') { - styler.ColourTo(i - 1, StateToPrint); - if (chNext == '\"' && chNext2 == '\"') { - i += 2; - state = SCE_HP_TRIPLEDOUBLE; - ch = ' '; - chPrev = ' '; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } else { - // state = statePrintForState(SCE_HP_STRING,inScriptType); - state = SCE_HP_STRING; - } - } else if (ch == '\'') { - styler.ColourTo(i - 1, StateToPrint); - if (chNext == '\'' && chNext2 == '\'') { - i += 2; - state = SCE_HP_TRIPLE; - ch = ' '; - chPrev = ' '; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } else { - state = SCE_HP_CHARACTER; - } - } else if (IsOperator(ch)) { - styler.ColourTo(i - 1, StateToPrint); - styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType)); - } else if ((ch == ' ') || (ch == '\t')) { - if (state == SCE_HP_START) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HP_DEFAULT; - } - } - break; - case SCE_HP_WORD: - if (!IsAWordChar(ch)) { - classifyWordHTPy(styler.GetStartSegment(), i - 1, keywords4, styler, prevWord, inScriptType, isMako); - state = SCE_HP_DEFAULT; - if (ch == '#') { - state = SCE_HP_COMMENTLINE; - } else if (ch == '\"') { - if (chNext == '\"' && chNext2 == '\"') { - i += 2; - state = SCE_HP_TRIPLEDOUBLE; - ch = ' '; - chPrev = ' '; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } else { - state = SCE_HP_STRING; - } - } else if (ch == '\'') { - if (chNext == '\'' && chNext2 == '\'') { - i += 2; - state = SCE_HP_TRIPLE; - ch = ' '; - chPrev = ' '; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } else { - state = SCE_HP_CHARACTER; - } - } else if (IsOperator(ch)) { - styler.ColourTo(i, statePrintForState(SCE_HP_OPERATOR, inScriptType)); - } - } - break; - case SCE_HP_COMMENTLINE: - if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HP_DEFAULT; - } - break; - case SCE_HP_STRING: - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - ch = chNext; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } - } else if (ch == '\"') { - styler.ColourTo(i, StateToPrint); - state = SCE_HP_DEFAULT; - } - break; - case SCE_HP_CHARACTER: - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - ch = chNext; - chNext = static_cast(styler.SafeGetCharAt(i + 1)); - } - } else if (ch == '\'') { - styler.ColourTo(i, StateToPrint); - state = SCE_HP_DEFAULT; - } - break; - case SCE_HP_TRIPLE: - if (ch == '\'' && chPrev == '\'' && chPrev2 == '\'') { - styler.ColourTo(i, StateToPrint); - state = SCE_HP_DEFAULT; - } - break; - case SCE_HP_TRIPLEDOUBLE: - if (ch == '\"' && chPrev == '\"' && chPrev2 == '\"') { - styler.ColourTo(i, StateToPrint); - state = SCE_HP_DEFAULT; - } - break; - ///////////// start - PHP state handling - case SCE_HPHP_WORD: - if (!IsAWordChar(ch)) { - classifyWordHTPHP(styler.GetStartSegment(), i - 1, keywords5, styler); - if (ch == '/' && chNext == '*') { - i++; - state = SCE_HPHP_COMMENT; - } else if (ch == '/' && chNext == '/') { - i++; - state = SCE_HPHP_COMMENTLINE; - } else if (ch == '#') { - state = SCE_HPHP_COMMENTLINE; - } else if (ch == '\"') { - state = SCE_HPHP_HSTRING; - StringCopy(phpStringDelimiter, "\""); - } else if (styler.Match(i, "<<<")) { - bool isSimpleString = false; - i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString); - if (strlen(phpStringDelimiter)) { - state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING); - if (foldHeredoc) levelCurrent++; - } - } else if (ch == '\'') { - state = SCE_HPHP_SIMPLESTRING; - StringCopy(phpStringDelimiter, "\'"); - } else if (ch == '$' && IsPhpWordStart(chNext)) { - state = SCE_HPHP_VARIABLE; - } else if (IsOperator(ch)) { - state = SCE_HPHP_OPERATOR; - } else { - state = SCE_HPHP_DEFAULT; - } - } - break; - case SCE_HPHP_NUMBER: - // recognize bases 8,10 or 16 integers OR floating-point numbers - if (!IsADigit(ch) - && strchr(".xXabcdefABCDEF", ch) == NULL - && ((ch != '-' && ch != '+') || (chPrev != 'e' && chPrev != 'E'))) { - styler.ColourTo(i - 1, SCE_HPHP_NUMBER); - if (IsOperator(ch)) - state = SCE_HPHP_OPERATOR; - else - state = SCE_HPHP_DEFAULT; - } - break; - case SCE_HPHP_VARIABLE: - if (!IsPhpWordChar(chNext)) { - styler.ColourTo(i, SCE_HPHP_VARIABLE); - state = SCE_HPHP_DEFAULT; - } - break; - case SCE_HPHP_COMMENT: - if (ch == '/' && chPrev == '*') { - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_DEFAULT; - } - break; - case SCE_HPHP_COMMENTLINE: - if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HPHP_DEFAULT; - } - break; - case SCE_HPHP_HSTRING: - if (ch == '\\' && (phpStringDelimiter[0] == '\"' || chNext == '$' || chNext == '{')) { - // skip the next char - i++; - } else if (((ch == '{' && chNext == '$') || (ch == '$' && chNext == '{')) - && IsPhpWordStart(chNext2)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HPHP_COMPLEX_VARIABLE; - } else if (ch == '$' && IsPhpWordStart(chNext)) { - styler.ColourTo(i - 1, StateToPrint); - state = SCE_HPHP_HSTRING_VARIABLE; - } else if (styler.Match(i, phpStringDelimiter)) { - if (phpStringDelimiter[0] == '\"') { - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_DEFAULT; - } else if (isLineEnd(chPrev)) { - const int psdLength = static_cast(strlen(phpStringDelimiter)); - const char chAfterPsd = styler.SafeGetCharAt(i + psdLength); - const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1); - if (isLineEnd(chAfterPsd) || - (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) { - i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1; - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_DEFAULT; - if (foldHeredoc) levelCurrent--; - } - } - } - break; - case SCE_HPHP_SIMPLESTRING: - if (phpStringDelimiter[0] == '\'') { - if (ch == '\\') { - // skip the next char - i++; - } else if (ch == '\'') { - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_DEFAULT; - } - } else if (isLineEnd(chPrev) && styler.Match(i, phpStringDelimiter)) { - const int psdLength = static_cast(strlen(phpStringDelimiter)); - const char chAfterPsd = styler.SafeGetCharAt(i + psdLength); - const char chAfterPsd2 = styler.SafeGetCharAt(i + psdLength + 1); - if (isLineEnd(chAfterPsd) || - (chAfterPsd == ';' && isLineEnd(chAfterPsd2))) { - i += (((i + psdLength) < lengthDoc) ? psdLength : lengthDoc) - 1; - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_DEFAULT; - if (foldHeredoc) levelCurrent--; - } - } - break; - case SCE_HPHP_HSTRING_VARIABLE: - if (!IsPhpWordChar(chNext)) { - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_HSTRING; - } - break; - case SCE_HPHP_COMPLEX_VARIABLE: - if (ch == '}') { - styler.ColourTo(i, StateToPrint); - state = SCE_HPHP_HSTRING; - } - break; - case SCE_HPHP_OPERATOR: - case SCE_HPHP_DEFAULT: - styler.ColourTo(i - 1, StateToPrint); - if (IsADigit(ch) || (ch == '.' && IsADigit(chNext))) { - state = SCE_HPHP_NUMBER; - } else if (IsAWordStart(ch)) { - state = SCE_HPHP_WORD; - } else if (ch == '/' && chNext == '*') { - i++; - state = SCE_HPHP_COMMENT; - } else if (ch == '/' && chNext == '/') { - i++; - state = SCE_HPHP_COMMENTLINE; - } else if (ch == '#') { - state = SCE_HPHP_COMMENTLINE; - } else if (ch == '\"') { - state = SCE_HPHP_HSTRING; - StringCopy(phpStringDelimiter, "\""); - } else if (styler.Match(i, "<<<")) { - bool isSimpleString = false; - i = FindPhpStringDelimiter(phpStringDelimiter, sizeof(phpStringDelimiter), i + 3, lengthDoc, styler, isSimpleString); - if (strlen(phpStringDelimiter)) { - state = (isSimpleString ? SCE_HPHP_SIMPLESTRING : SCE_HPHP_HSTRING); - if (foldHeredoc) levelCurrent++; - } - } else if (ch == '\'') { - state = SCE_HPHP_SIMPLESTRING; - StringCopy(phpStringDelimiter, "\'"); - } else if (ch == '$' && IsPhpWordStart(chNext)) { - state = SCE_HPHP_VARIABLE; - } else if (IsOperator(ch)) { - state = SCE_HPHP_OPERATOR; - } else if ((state == SCE_HPHP_OPERATOR) && (IsASpace(ch))) { - state = SCE_HPHP_DEFAULT; - } - break; - ///////////// end - PHP state handling - } - - // Some of the above terminated their lexeme but since the same character starts - // the same class again, only reenter if non empty segment. - - bool nonEmptySegment = i >= static_cast(styler.GetStartSegment()); - if (state == SCE_HB_DEFAULT) { // One of the above succeeded - if ((ch == '\"') && (nonEmptySegment)) { - state = SCE_HB_STRING; - } else if (ch == '\'') { - state = SCE_HB_COMMENTLINE; - } else if (IsAWordStart(ch)) { - state = SCE_HB_WORD; - } else if (IsOperator(ch)) { - styler.ColourTo(i, SCE_HB_DEFAULT); - } - } else if (state == SCE_HBA_DEFAULT) { // One of the above succeeded - if ((ch == '\"') && (nonEmptySegment)) { - state = SCE_HBA_STRING; - } else if (ch == '\'') { - state = SCE_HBA_COMMENTLINE; - } else if (IsAWordStart(ch)) { - state = SCE_HBA_WORD; - } else if (IsOperator(ch)) { - styler.ColourTo(i, SCE_HBA_DEFAULT); - } - } else if (state == SCE_HJ_DEFAULT) { // One of the above succeeded - if (ch == '/' && chNext == '*') { - if (styler.SafeGetCharAt(i + 2) == '*') - state = SCE_HJ_COMMENTDOC; - else - state = SCE_HJ_COMMENT; - } else if (ch == '/' && chNext == '/') { - state = SCE_HJ_COMMENTLINE; - } else if ((ch == '\"') && (nonEmptySegment)) { - state = SCE_HJ_DOUBLESTRING; - } else if ((ch == '\'') && (nonEmptySegment)) { - state = SCE_HJ_SINGLESTRING; - } else if (IsAWordStart(ch)) { - state = SCE_HJ_WORD; - } else if (IsOperator(ch)) { - styler.ColourTo(i, statePrintForState(SCE_HJ_SYMBOLS, inScriptType)); - } - } - } - - switch (state) { - case SCE_HJ_WORD: - classifyWordHTJS(styler.GetStartSegment(), lengthDoc - 1, keywords2, styler, inScriptType); - break; - case SCE_HB_WORD: - classifyWordHTVB(styler.GetStartSegment(), lengthDoc - 1, keywords3, styler, inScriptType); - break; - case SCE_HP_WORD: - classifyWordHTPy(styler.GetStartSegment(), lengthDoc - 1, keywords4, styler, prevWord, inScriptType, isMako); - break; - case SCE_HPHP_WORD: - classifyWordHTPHP(styler.GetStartSegment(), lengthDoc - 1, keywords5, styler); - break; - default: - StateToPrint = statePrintForState(state, inScriptType); - if (static_cast(styler.GetStartSegment()) < lengthDoc) - styler.ColourTo(lengthDoc - 1, StateToPrint); - break; - } - - // Fill in the real level of the next line, keeping the current flags as they will be filled in later - if (fold) { - int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; - styler.SetLevel(lineCurrent, levelPrev | flagsNext); - } -} - -static void ColouriseXMLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - // Passing in true because we're lexing XML - ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, true); -} - -static void ColouriseHTMLDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - // Passing in false because we're notlexing XML - ColouriseHyperTextDoc(startPos, length, initStyle, keywordlists, styler, false); -} - -static void ColourisePHPScriptDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - if (startPos == 0) - initStyle = SCE_HPHP_DEFAULT; - ColouriseHTMLDoc(startPos, length, initStyle, keywordlists, styler); -} - -static const char * const htmlWordListDesc[] = { - "HTML elements and attributes", - "JavaScript keywords", - "VBScript keywords", - "Python keywords", - "PHP keywords", - "SGML and DTD keywords", - 0, -}; - -static const char * const phpscriptWordListDesc[] = { - "", //Unused - "", //Unused - "", //Unused - "", //Unused - "PHP keywords", - "", //Unused - 0, -}; - -LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc); -LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc); -LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc); diff --git a/scintilla/lexers/LexHaskell.cxx b/scintilla/lexers/LexHaskell.cxx deleted file mode 100644 index 61d216ce..00000000 --- a/scintilla/lexers/LexHaskell.cxx +++ /dev/null @@ -1,1111 +0,0 @@ -/****************************************************************** - * 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); diff --git a/scintilla/lexers/LexHex.cxx b/scintilla/lexers/LexHex.cxx deleted file mode 100644 index 473e0a36..00000000 --- a/scintilla/lexers/LexHex.cxx +++ /dev/null @@ -1,1045 +0,0 @@ -// Scintilla source code edit control -/** @file LexHex.cxx - ** Lexers for Motorola S-Record, Intel HEX and Tektronix extended HEX. - ** - ** Written by Markus Heidelberg - **/ -// Copyright 1998-2001 by Neil Hodgson -// The License.txt file describes the conditions under which this software may be distributed. - -/* - * Motorola S-Record - * =============================== - * - * Each record (line) is built as follows: - * - * field digits states - * - * +----------+ - * | start | 1 ('S') SCE_HEX_RECSTART - * +----------+ - * | type | 1 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN) - * +----------+ - * | count | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG - * +----------+ - * | address | 4/6/8 SCE_HEX_NOADDRESS, SCE_HEX_DATAADDRESS, SCE_HEX_RECCOUNT, SCE_HEX_STARTADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN) - * +----------+ - * | data | 0..504/502/500 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN, SCE_HEX_DATA_EMPTY, (SCE_HEX_DATA_UNKNOWN) - * +----------+ - * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG - * +----------+ - * - * - * Intel HEX - * =============================== - * - * Each record (line) is built as follows: - * - * field digits states - * - * +----------+ - * | start | 1 (':') SCE_HEX_RECSTART - * +----------+ - * | count | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG - * +----------+ - * | address | 4 SCE_HEX_NOADDRESS, SCE_HEX_DATAADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN) - * +----------+ - * | type | 2 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN) - * +----------+ - * | data | 0..510 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN, SCE_HEX_DATA_EMPTY, SCE_HEX_EXTENDEDADDRESS, SCE_HEX_STARTADDRESS, (SCE_HEX_DATA_UNKNOWN) - * +----------+ - * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG - * +----------+ - * - * - * Folding: - * - * Data records (type 0x00), which follow an extended address record (type - * 0x02 or 0x04), can be folded. The extended address record is the fold - * point at fold level 0, the corresponding data records are set to level 1. - * - * Any record, which is not a data record, sets the fold level back to 0. - * Any line, which is not a record (blank lines and lines starting with a - * character other than ':'), leaves the fold level unchanged. - * - * - * Tektronix extended HEX - * =============================== - * - * Each record (line) is built as follows: - * - * field digits states - * - * +----------+ - * | start | 1 ('%') SCE_HEX_RECSTART - * +----------+ - * | length | 2 SCE_HEX_BYTECOUNT, SCE_HEX_BYTECOUNT_WRONG - * +----------+ - * | type | 1 SCE_HEX_RECTYPE, (SCE_HEX_RECTYPE_UNKNOWN) - * +----------+ - * | checksum | 2 SCE_HEX_CHECKSUM, SCE_HEX_CHECKSUM_WRONG - * +----------+ - * | address | 9 SCE_HEX_DATAADDRESS, SCE_HEX_STARTADDRESS, (SCE_HEX_ADDRESSFIELD_UNKNOWN) - * +----------+ - * | data | 0..241 SCE_HEX_DATA_ODD, SCE_HEX_DATA_EVEN - * +----------+ - * - * - * General notes for all lexers - * =============================== - * - * - Depending on where the helper functions are invoked, some of them have to - * read beyond the current position. In case of malformed data (record too - * short), it has to be ensured that this either does not have bad influence - * or will be captured deliberately. - * - * - States in parentheses in the upper format descriptions indicate that they - * should not appear in a valid hex file. - * - * - State SCE_HEX_GARBAGE means garbage data after the intended end of the - * record, the line is too long then. This state is used in all lexers. - */ - -#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 - -// prototypes for general helper functions -static inline bool IsNewline(const int ch); -static int GetHexaNibble(char hd); -static int GetHexaChar(char hd1, char hd2); -static int GetHexaChar(Sci_PositionU pos, Accessor &styler); -static bool ForwardWithinLine(StyleContext &sc, Sci_Position nb = 1); -static bool PosInSameRecord(Sci_PositionU pos1, Sci_PositionU pos2, Accessor &styler); -static Sci_Position CountByteCount(Sci_PositionU startPos, Sci_Position uncountedDigits, Accessor &styler); -static int CalcChecksum(Sci_PositionU startPos, Sci_Position cnt, bool twosCompl, Accessor &styler); - -// prototypes for file format specific helper functions -static Sci_PositionU GetSrecRecStartPosition(Sci_PositionU pos, Accessor &styler); -static int GetSrecByteCount(Sci_PositionU recStartPos, Accessor &styler); -static Sci_Position CountSrecByteCount(Sci_PositionU recStartPos, Accessor &styler); -static int GetSrecAddressFieldSize(Sci_PositionU recStartPos, Accessor &styler); -static int GetSrecAddressFieldType(Sci_PositionU recStartPos, Accessor &styler); -static int GetSrecDataFieldType(Sci_PositionU recStartPos, Accessor &styler); -static Sci_Position GetSrecRequiredDataFieldSize(Sci_PositionU recStartPos, Accessor &styler); -static int GetSrecChecksum(Sci_PositionU recStartPos, Accessor &styler); -static int CalcSrecChecksum(Sci_PositionU recStartPos, Accessor &styler); - -static Sci_PositionU GetIHexRecStartPosition(Sci_PositionU pos, Accessor &styler); -static int GetIHexByteCount(Sci_PositionU recStartPos, Accessor &styler); -static Sci_Position CountIHexByteCount(Sci_PositionU recStartPos, Accessor &styler); -static int GetIHexAddressFieldType(Sci_PositionU recStartPos, Accessor &styler); -static int GetIHexDataFieldType(Sci_PositionU recStartPos, Accessor &styler); -static int GetIHexRequiredDataFieldSize(Sci_PositionU recStartPos, Accessor &styler); -static int GetIHexChecksum(Sci_PositionU recStartPos, Accessor &styler); -static int CalcIHexChecksum(Sci_PositionU recStartPos, Accessor &styler); - -static int GetTEHexDigitCount(Sci_PositionU recStartPos, Accessor &styler); -static Sci_Position CountTEHexDigitCount(Sci_PositionU recStartPos, Accessor &styler); -static int GetTEHexAddressFieldType(Sci_PositionU recStartPos, Accessor &styler); -static int GetTEHexChecksum(Sci_PositionU recStartPos, Accessor &styler); -static int CalcTEHexChecksum(Sci_PositionU recStartPos, Accessor &styler); - -static inline bool IsNewline(const int ch) -{ - return (ch == '\n' || ch == '\r'); -} - -static int GetHexaNibble(char hd) -{ - int hexValue = 0; - - if (hd >= '0' && hd <= '9') { - hexValue += hd - '0'; - } else if (hd >= 'A' && hd <= 'F') { - hexValue += hd - 'A' + 10; - } else if (hd >= 'a' && hd <= 'f') { - hexValue += hd - 'a' + 10; - } else { - return -1; - } - - return hexValue; -} - -static int GetHexaChar(char hd1, char hd2) -{ - int hexValue = 0; - - if (hd1 >= '0' && hd1 <= '9') { - hexValue += 16 * (hd1 - '0'); - } else if (hd1 >= 'A' && hd1 <= 'F') { - hexValue += 16 * (hd1 - 'A' + 10); - } else if (hd1 >= 'a' && hd1 <= 'f') { - hexValue += 16 * (hd1 - 'a' + 10); - } else { - return -1; - } - - if (hd2 >= '0' && hd2 <= '9') { - hexValue += hd2 - '0'; - } else if (hd2 >= 'A' && hd2 <= 'F') { - hexValue += hd2 - 'A' + 10; - } else if (hd2 >= 'a' && hd2 <= 'f') { - hexValue += hd2 - 'a' + 10; - } else { - return -1; - } - - return hexValue; -} - -static int GetHexaChar(Sci_PositionU pos, Accessor &styler) -{ - char highNibble, lowNibble; - - highNibble = styler.SafeGetCharAt(pos); - lowNibble = styler.SafeGetCharAt(pos + 1); - - return GetHexaChar(highNibble, lowNibble); -} - -// Forward characters, but abort (and return false) if hitting the line -// end. Return true if forwarding within the line was possible. -// Avoids influence on highlighting of the subsequent line if the current line -// is malformed (too short). -static bool ForwardWithinLine(StyleContext &sc, Sci_Position nb) -{ - for (Sci_Position i = 0; i < nb; i++) { - if (sc.atLineEnd) { - // line is too short - sc.SetState(SCE_HEX_DEFAULT); - sc.Forward(); - return false; - } else { - sc.Forward(); - } - } - - return true; -} - -// Checks whether the given positions are in the same record. -static bool PosInSameRecord(Sci_PositionU pos1, Sci_PositionU pos2, Accessor &styler) -{ - return styler.GetLine(pos1) == styler.GetLine(pos2); -} - -// Count the number of digit pairs from till end of record, ignoring -// digits. -// If the record is too short, a negative count may be returned. -static Sci_Position CountByteCount(Sci_PositionU startPos, Sci_Position uncountedDigits, Accessor &styler) -{ - Sci_Position cnt; - Sci_PositionU pos; - - pos = startPos; - - while (!IsNewline(styler.SafeGetCharAt(pos, '\n'))) { - pos++; - } - - // number of digits in this line minus number of digits of uncounted fields - cnt = static_cast(pos - startPos) - uncountedDigits; - - // Prepare round up if odd (digit pair incomplete), this way the byte - // count is considered to be valid if the checksum is incomplete. - if (cnt >= 0) { - cnt++; - } - - // digit pairs - cnt /= 2; - - return cnt; -} - -// Calculate the checksum of the record. -// is the position of the first character of the starting digit -// pair, is the number of digit pairs. -static int CalcChecksum(Sci_PositionU startPos, Sci_Position cnt, bool twosCompl, Accessor &styler) -{ - int cs = 0; - - for (Sci_PositionU pos = startPos; pos < startPos + cnt; pos += 2) { - int val = GetHexaChar(pos, styler); - - if (val < 0) { - return val; - } - - // overflow does not matter - cs += val; - } - - if (twosCompl) { - // low byte of two's complement - return -cs & 0xFF; - } else { - // low byte of one's complement - return ~cs & 0xFF; - } -} - -// Get the position of the record "start" field (first character in line) in -// the record around position . -static Sci_PositionU GetSrecRecStartPosition(Sci_PositionU pos, Accessor &styler) -{ - while (styler.SafeGetCharAt(pos) != 'S') { - pos--; - } - - return pos; -} - -// Get the value of the "byte count" field, it counts the number of bytes in -// the subsequent fields ("address", "data" and "checksum" fields). -static int GetSrecByteCount(Sci_PositionU recStartPos, Accessor &styler) -{ - int val; - - val = GetHexaChar(recStartPos + 2, styler); - if (val < 0) { - val = 0; - } - - return val; -} - -// Count the number of digit pairs for the "address", "data" and "checksum" -// fields in this record. Has to be equal to the "byte count" field value. -// If the record is too short, a negative count may be returned. -static Sci_Position CountSrecByteCount(Sci_PositionU recStartPos, Accessor &styler) -{ - return CountByteCount(recStartPos, 4, styler); -} - -// Get the size of the "address" field. -static int GetSrecAddressFieldSize(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (styler.SafeGetCharAt(recStartPos + 1)) { - case '0': - case '1': - case '5': - case '9': - return 2; // 16 bit - - case '2': - case '6': - case '8': - return 3; // 24 bit - - case '3': - case '7': - return 4; // 32 bit - - default: - return 0; - } -} - -// Get the type of the "address" field content. -static int GetSrecAddressFieldType(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (styler.SafeGetCharAt(recStartPos + 1)) { - case '0': - return SCE_HEX_NOADDRESS; - - case '1': - case '2': - case '3': - return SCE_HEX_DATAADDRESS; - - case '5': - case '6': - return SCE_HEX_RECCOUNT; - - case '7': - case '8': - case '9': - return SCE_HEX_STARTADDRESS; - - default: // handle possible format extension in the future - return SCE_HEX_ADDRESSFIELD_UNKNOWN; - } -} - -// Get the type of the "data" field content. -static int GetSrecDataFieldType(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (styler.SafeGetCharAt(recStartPos + 1)) { - case '0': - case '1': - case '2': - case '3': - return SCE_HEX_DATA_ODD; - - case '5': - case '6': - case '7': - case '8': - case '9': - return SCE_HEX_DATA_EMPTY; - - default: // handle possible format extension in the future - return SCE_HEX_DATA_UNKNOWN; - } -} - -// Get the required size of the "data" field. Useless for block header and -// ordinary data records (type S0, S1, S2, S3), return the value calculated -// from the "byte count" and "address field" size in this case. -static Sci_Position GetSrecRequiredDataFieldSize(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (styler.SafeGetCharAt(recStartPos + 1)) { - case '5': - case '6': - case '7': - case '8': - case '9': - return 0; - - default: - return GetSrecByteCount(recStartPos, styler) - - GetSrecAddressFieldSize(recStartPos, styler) - - 1; // -1 for checksum field - } -} - -// Get the value of the "checksum" field. -static int GetSrecChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - int byteCount; - - byteCount = GetSrecByteCount(recStartPos, styler); - - return GetHexaChar(recStartPos + 2 + byteCount * 2, styler); -} - -// Calculate the checksum of the record. -static int CalcSrecChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - Sci_Position byteCount; - - byteCount = GetSrecByteCount(recStartPos, styler); - - // sum over "byte count", "address" and "data" fields (6..510 digits) - return CalcChecksum(recStartPos + 2, byteCount * 2, false, styler); -} - -// Get the position of the record "start" field (first character in line) in -// the record around position . -static Sci_PositionU GetIHexRecStartPosition(Sci_PositionU pos, Accessor &styler) -{ - while (styler.SafeGetCharAt(pos) != ':') { - pos--; - } - - return pos; -} - -// Get the value of the "byte count" field, it counts the number of bytes in -// the "data" field. -static int GetIHexByteCount(Sci_PositionU recStartPos, Accessor &styler) -{ - int val; - - val = GetHexaChar(recStartPos + 1, styler); - if (val < 0) { - val = 0; - } - - return val; -} - -// Count the number of digit pairs for the "data" field in this record. Has to -// be equal to the "byte count" field value. -// If the record is too short, a negative count may be returned. -static Sci_Position CountIHexByteCount(Sci_PositionU recStartPos, Accessor &styler) -{ - return CountByteCount(recStartPos, 11, styler); -} - -// Get the type of the "address" field content. -static int GetIHexAddressFieldType(Sci_PositionU recStartPos, Accessor &styler) -{ - if (!PosInSameRecord(recStartPos, recStartPos + 7, styler)) { - // malformed (record too short) - // type cannot be determined - return SCE_HEX_ADDRESSFIELD_UNKNOWN; - } - - switch (GetHexaChar(recStartPos + 7, styler)) { - case 0x00: - return SCE_HEX_DATAADDRESS; - - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - return SCE_HEX_NOADDRESS; - - default: // handle possible format extension in the future - return SCE_HEX_ADDRESSFIELD_UNKNOWN; - } -} - -// Get the type of the "data" field content. -static int GetIHexDataFieldType(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (GetHexaChar(recStartPos + 7, styler)) { - case 0x00: - return SCE_HEX_DATA_ODD; - - case 0x01: - return SCE_HEX_DATA_EMPTY; - - case 0x02: - case 0x04: - return SCE_HEX_EXTENDEDADDRESS; - - case 0x03: - case 0x05: - return SCE_HEX_STARTADDRESS; - - default: // handle possible format extension in the future - return SCE_HEX_DATA_UNKNOWN; - } -} - -// Get the required size of the "data" field. Useless for an ordinary data -// record (type 00), return the "byte count" in this case. -static int GetIHexRequiredDataFieldSize(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (GetHexaChar(recStartPos + 7, styler)) { - case 0x01: - return 0; - - case 0x02: - case 0x04: - return 2; - - case 0x03: - case 0x05: - return 4; - - default: - return GetIHexByteCount(recStartPos, styler); - } -} - -// Get the value of the "checksum" field. -static int GetIHexChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - int byteCount; - - byteCount = GetIHexByteCount(recStartPos, styler); - - return GetHexaChar(recStartPos + 9 + byteCount * 2, styler); -} - -// Calculate the checksum of the record. -static int CalcIHexChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - int byteCount; - - byteCount = GetIHexByteCount(recStartPos, styler); - - // sum over "byte count", "address", "type" and "data" fields (8..518 digits) - return CalcChecksum(recStartPos + 1, 8 + byteCount * 2, true, styler); -} - - -// Get the value of the "record length" field, it counts the number of digits in -// the record excluding the percent. -static int GetTEHexDigitCount(Sci_PositionU recStartPos, Accessor &styler) -{ - int val = GetHexaChar(recStartPos + 1, styler); - if (val < 0) - val = 0; - - return val; -} - -// Count the number of digits in this record. Has to -// be equal to the "record length" field value. -static Sci_Position CountTEHexDigitCount(Sci_PositionU recStartPos, Accessor &styler) -{ - Sci_PositionU pos; - - pos = recStartPos+1; - - while (!IsNewline(styler.SafeGetCharAt(pos, '\n'))) { - pos++; - } - - return static_cast(pos - (recStartPos+1)); -} - -// Get the type of the "address" field content. -static int GetTEHexAddressFieldType(Sci_PositionU recStartPos, Accessor &styler) -{ - switch (styler.SafeGetCharAt(recStartPos + 3)) { - case '6': - return SCE_HEX_DATAADDRESS; - - case '8': - return SCE_HEX_STARTADDRESS; - - default: // handle possible format extension in the future - return SCE_HEX_ADDRESSFIELD_UNKNOWN; - } -} - -// Get the value of the "checksum" field. -static int GetTEHexChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - return GetHexaChar(recStartPos+4, styler); -} - -// Calculate the checksum of the record (excluding the checksum field). -static int CalcTEHexChecksum(Sci_PositionU recStartPos, Accessor &styler) -{ - Sci_PositionU pos = recStartPos +1; - Sci_PositionU length = GetTEHexDigitCount(recStartPos, styler); - - int cs = GetHexaNibble(styler.SafeGetCharAt(pos++));//length - cs += GetHexaNibble(styler.SafeGetCharAt(pos++));//length - - cs += GetHexaNibble(styler.SafeGetCharAt(pos++));//type - - pos += 2;// jump over CS field - - for (; pos <= recStartPos + length; ++pos) { - int val = GetHexaNibble(styler.SafeGetCharAt(pos)); - - if (val < 0) { - return val; - } - - // overflow does not matter - cs += val; - } - - // low byte - return cs & 0xFF; - -} - -static void ColouriseSrecDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) -{ - StyleContext sc(startPos, length, initStyle, styler); - - while (sc.More()) { - Sci_PositionU recStartPos; - int byteCount, reqByteCount, addrFieldSize, addrFieldType, dataFieldSize, dataFieldType; - int cs1, cs2; - - switch (sc.state) { - case SCE_HEX_DEFAULT: - if (sc.atLineStart && sc.Match('S')) { - sc.SetState(SCE_HEX_RECSTART); - } - ForwardWithinLine(sc); - break; - - case SCE_HEX_RECSTART: - recStartPos = sc.currentPos - 1; - addrFieldType = GetSrecAddressFieldType(recStartPos, styler); - - if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) { - sc.SetState(SCE_HEX_RECTYPE_UNKNOWN); - } else { - sc.SetState(SCE_HEX_RECTYPE); - } - - ForwardWithinLine(sc); - break; - - case SCE_HEX_RECTYPE: - case SCE_HEX_RECTYPE_UNKNOWN: - recStartPos = sc.currentPos - 2; - byteCount = GetSrecByteCount(recStartPos, styler); - reqByteCount = GetSrecAddressFieldSize(recStartPos, styler) - + GetSrecRequiredDataFieldSize(recStartPos, styler) - + 1; // +1 for checksum field - - if (byteCount == CountSrecByteCount(recStartPos, styler) - && byteCount == reqByteCount) { - sc.SetState(SCE_HEX_BYTECOUNT); - } else { - sc.SetState(SCE_HEX_BYTECOUNT_WRONG); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_BYTECOUNT: - case SCE_HEX_BYTECOUNT_WRONG: - recStartPos = sc.currentPos - 4; - addrFieldSize = GetSrecAddressFieldSize(recStartPos, styler); - addrFieldType = GetSrecAddressFieldType(recStartPos, styler); - - sc.SetState(addrFieldType); - ForwardWithinLine(sc, addrFieldSize * 2); - break; - - case SCE_HEX_NOADDRESS: - case SCE_HEX_DATAADDRESS: - case SCE_HEX_RECCOUNT: - case SCE_HEX_STARTADDRESS: - case SCE_HEX_ADDRESSFIELD_UNKNOWN: - recStartPos = GetSrecRecStartPosition(sc.currentPos, styler); - dataFieldType = GetSrecDataFieldType(recStartPos, styler); - - // Using the required size here if possible has the effect that the - // checksum is highlighted at a fixed position after this field for - // specific record types, independent on the "byte count" value. - dataFieldSize = GetSrecRequiredDataFieldSize(recStartPos, styler); - - sc.SetState(dataFieldType); - - if (dataFieldType == SCE_HEX_DATA_ODD) { - for (int i = 0; i < dataFieldSize * 2; i++) { - if ((i & 0x3) == 0) { - sc.SetState(SCE_HEX_DATA_ODD); - } else if ((i & 0x3) == 2) { - sc.SetState(SCE_HEX_DATA_EVEN); - } - - if (!ForwardWithinLine(sc)) { - break; - } - } - } else { - ForwardWithinLine(sc, dataFieldSize * 2); - } - break; - - case SCE_HEX_DATA_ODD: - case SCE_HEX_DATA_EVEN: - case SCE_HEX_DATA_EMPTY: - case SCE_HEX_DATA_UNKNOWN: - recStartPos = GetSrecRecStartPosition(sc.currentPos, styler); - cs1 = CalcSrecChecksum(recStartPos, styler); - cs2 = GetSrecChecksum(recStartPos, styler); - - if (cs1 != cs2 || cs1 < 0 || cs2 < 0) { - sc.SetState(SCE_HEX_CHECKSUM_WRONG); - } else { - sc.SetState(SCE_HEX_CHECKSUM); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_CHECKSUM: - case SCE_HEX_CHECKSUM_WRONG: - case SCE_HEX_GARBAGE: - // record finished or line too long - sc.SetState(SCE_HEX_GARBAGE); - ForwardWithinLine(sc); - break; - - default: - // prevent endless loop in faulty state - sc.SetState(SCE_HEX_DEFAULT); - break; - } - } - sc.Complete(); -} - -static void ColouriseIHexDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) -{ - StyleContext sc(startPos, length, initStyle, styler); - - while (sc.More()) { - Sci_PositionU recStartPos; - int byteCount, addrFieldType, dataFieldSize, dataFieldType; - int cs1, cs2; - - switch (sc.state) { - case SCE_HEX_DEFAULT: - if (sc.atLineStart && sc.Match(':')) { - sc.SetState(SCE_HEX_RECSTART); - } - ForwardWithinLine(sc); - break; - - case SCE_HEX_RECSTART: - recStartPos = sc.currentPos - 1; - byteCount = GetIHexByteCount(recStartPos, styler); - dataFieldSize = GetIHexRequiredDataFieldSize(recStartPos, styler); - - if (byteCount == CountIHexByteCount(recStartPos, styler) - && byteCount == dataFieldSize) { - sc.SetState(SCE_HEX_BYTECOUNT); - } else { - sc.SetState(SCE_HEX_BYTECOUNT_WRONG); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_BYTECOUNT: - case SCE_HEX_BYTECOUNT_WRONG: - recStartPos = sc.currentPos - 3; - addrFieldType = GetIHexAddressFieldType(recStartPos, styler); - - sc.SetState(addrFieldType); - ForwardWithinLine(sc, 4); - break; - - case SCE_HEX_NOADDRESS: - case SCE_HEX_DATAADDRESS: - case SCE_HEX_ADDRESSFIELD_UNKNOWN: - recStartPos = sc.currentPos - 7; - addrFieldType = GetIHexAddressFieldType(recStartPos, styler); - - if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) { - sc.SetState(SCE_HEX_RECTYPE_UNKNOWN); - } else { - sc.SetState(SCE_HEX_RECTYPE); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_RECTYPE: - case SCE_HEX_RECTYPE_UNKNOWN: - recStartPos = sc.currentPos - 9; - dataFieldType = GetIHexDataFieldType(recStartPos, styler); - - // Using the required size here if possible has the effect that the - // checksum is highlighted at a fixed position after this field for - // specific record types, independent on the "byte count" value. - dataFieldSize = GetIHexRequiredDataFieldSize(recStartPos, styler); - - sc.SetState(dataFieldType); - - if (dataFieldType == SCE_HEX_DATA_ODD) { - for (int i = 0; i < dataFieldSize * 2; i++) { - if ((i & 0x3) == 0) { - sc.SetState(SCE_HEX_DATA_ODD); - } else if ((i & 0x3) == 2) { - sc.SetState(SCE_HEX_DATA_EVEN); - } - - if (!ForwardWithinLine(sc)) { - break; - } - } - } else { - ForwardWithinLine(sc, dataFieldSize * 2); - } - break; - - case SCE_HEX_DATA_ODD: - case SCE_HEX_DATA_EVEN: - case SCE_HEX_DATA_EMPTY: - case SCE_HEX_EXTENDEDADDRESS: - case SCE_HEX_STARTADDRESS: - case SCE_HEX_DATA_UNKNOWN: - recStartPos = GetIHexRecStartPosition(sc.currentPos, styler); - cs1 = CalcIHexChecksum(recStartPos, styler); - cs2 = GetIHexChecksum(recStartPos, styler); - - if (cs1 != cs2 || cs1 < 0 || cs2 < 0) { - sc.SetState(SCE_HEX_CHECKSUM_WRONG); - } else { - sc.SetState(SCE_HEX_CHECKSUM); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_CHECKSUM: - case SCE_HEX_CHECKSUM_WRONG: - case SCE_HEX_GARBAGE: - // record finished or line too long - sc.SetState(SCE_HEX_GARBAGE); - ForwardWithinLine(sc); - break; - - default: - // prevent endless loop in faulty state - sc.SetState(SCE_HEX_DEFAULT); - break; - } - } - sc.Complete(); -} - -static void FoldIHexDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) -{ - Sci_PositionU endPos = startPos + length; - - Sci_Position lineCurrent = styler.GetLine(startPos); - int levelCurrent = SC_FOLDLEVELBASE; - if (lineCurrent > 0) - levelCurrent = styler.LevelAt(lineCurrent - 1); - - Sci_PositionU lineStartNext = styler.LineStart(lineCurrent + 1); - int levelNext = SC_FOLDLEVELBASE; // default if no specific line found - - for (Sci_PositionU i = startPos; i < endPos; i++) { - bool atEOL = i == (lineStartNext - 1); - int style = styler.StyleAt(i); - - // search for specific lines - if (style == SCE_HEX_EXTENDEDADDRESS) { - // extended addres record - levelNext = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; - } else if (style == SCE_HEX_DATAADDRESS - || (style == SCE_HEX_DEFAULT - && i == (Sci_PositionU)styler.LineStart(lineCurrent))) { - // data record or no record start code at all - if (levelCurrent & SC_FOLDLEVELHEADERFLAG) { - levelNext = SC_FOLDLEVELBASE + 1; - } else { - // continue level 0 or 1, no fold point - levelNext = levelCurrent; - } - } - - if (atEOL || (i == endPos - 1)) { - styler.SetLevel(lineCurrent, levelNext); - - lineCurrent++; - lineStartNext = styler.LineStart(lineCurrent + 1); - levelCurrent = levelNext; - levelNext = SC_FOLDLEVELBASE; - } - } -} - -static void ColouriseTEHexDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *[], Accessor &styler) -{ - StyleContext sc(startPos, length, initStyle, styler); - - while (sc.More()) { - Sci_PositionU recStartPos; - int digitCount, addrFieldType; - int cs1, cs2; - - switch (sc.state) { - case SCE_HEX_DEFAULT: - if (sc.atLineStart && sc.Match('%')) { - sc.SetState(SCE_HEX_RECSTART); - } - ForwardWithinLine(sc); - break; - - case SCE_HEX_RECSTART: - - recStartPos = sc.currentPos - 1; - - if (GetTEHexDigitCount(recStartPos, styler) == CountTEHexDigitCount(recStartPos, styler)) { - sc.SetState(SCE_HEX_BYTECOUNT); - } else { - sc.SetState(SCE_HEX_BYTECOUNT_WRONG); - } - - ForwardWithinLine(sc, 2); - break; - - case SCE_HEX_BYTECOUNT: - case SCE_HEX_BYTECOUNT_WRONG: - recStartPos = sc.currentPos - 3; - addrFieldType = GetTEHexAddressFieldType(recStartPos, styler); - - if (addrFieldType == SCE_HEX_ADDRESSFIELD_UNKNOWN) { - sc.SetState(SCE_HEX_RECTYPE_UNKNOWN); - } else { - sc.SetState(SCE_HEX_RECTYPE); - } - - ForwardWithinLine(sc); - break; - - case SCE_HEX_RECTYPE: - case SCE_HEX_RECTYPE_UNKNOWN: - recStartPos = sc.currentPos - 4; - cs1 = CalcTEHexChecksum(recStartPos, styler); - cs2 = GetTEHexChecksum(recStartPos, styler); - - if (cs1 != cs2 || cs1 < 0 || cs2 < 0) { - sc.SetState(SCE_HEX_CHECKSUM_WRONG); - } else { - sc.SetState(SCE_HEX_CHECKSUM); - } - - ForwardWithinLine(sc, 2); - break; - - - case SCE_HEX_CHECKSUM: - case SCE_HEX_CHECKSUM_WRONG: - recStartPos = sc.currentPos - 6; - addrFieldType = GetTEHexAddressFieldType(recStartPos, styler); - - sc.SetState(addrFieldType); - ForwardWithinLine(sc, 9); - break; - - case SCE_HEX_DATAADDRESS: - case SCE_HEX_STARTADDRESS: - case SCE_HEX_ADDRESSFIELD_UNKNOWN: - recStartPos = sc.currentPos - 15; - digitCount = GetTEHexDigitCount(recStartPos, styler) - 14; - - sc.SetState(SCE_HEX_DATA_ODD); - - for (int i = 0; i < digitCount; i++) { - if ((i & 0x3) == 0) { - sc.SetState(SCE_HEX_DATA_ODD); - } else if ((i & 0x3) == 2) { - sc.SetState(SCE_HEX_DATA_EVEN); - } - - if (!ForwardWithinLine(sc)) { - break; - } - } - break; - - case SCE_HEX_DATA_ODD: - case SCE_HEX_DATA_EVEN: - case SCE_HEX_GARBAGE: - // record finished or line too long - sc.SetState(SCE_HEX_GARBAGE); - ForwardWithinLine(sc); - break; - - default: - // prevent endless loop in faulty state - sc.SetState(SCE_HEX_DEFAULT); - break; - } - } - sc.Complete(); -} - -LexerModule lmSrec(SCLEX_SREC, ColouriseSrecDoc, "srec", 0, NULL); -LexerModule lmIHex(SCLEX_IHEX, ColouriseIHexDoc, "ihex", FoldIHexDoc, NULL); -LexerModule lmTEHex(SCLEX_TEHEX, ColouriseTEHexDoc, "tehex", 0, NULL); diff --git a/scintilla/lexers/LexInno.cxx b/scintilla/lexers/LexInno.cxx deleted file mode 100644 index 5f684400..00000000 --- a/scintilla/lexers/LexInno.cxx +++ /dev/null @@ -1,290 +0,0 @@ -// Scintilla source code edit control -/** @file LexInno.cxx - ** Lexer for Inno Setup scripts. - **/ -// Written by Friedrich Vedder , using code from LexOthers.cxx. -// 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 ColouriseInnoDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *keywordLists[], Accessor &styler) { - int state = SCE_INNO_DEFAULT; - char chPrev; - char ch = 0; - char chNext = styler[startPos]; - Sci_Position lengthDoc = startPos + length; - char *buffer = new char[length+1]; - Sci_Position bufferCount = 0; - bool isBOL, isEOL, isWS, isBOLWS = 0; - bool isCStyleComment = false; - - WordList §ionKeywords = *keywordLists[0]; - WordList &standardKeywords = *keywordLists[1]; - WordList ¶meterKeywords = *keywordLists[2]; - WordList &preprocessorKeywords = *keywordLists[3]; - WordList &pascalKeywords = *keywordLists[4]; - WordList &userKeywords = *keywordLists[5]; - - Sci_Position curLine = styler.GetLine(startPos); - int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : 0; - bool isCode = (curLineState == 1); - - // 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++) { - chPrev = ch; - ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - - if (styler.IsLeadByte(ch)) { - chNext = styler.SafeGetCharAt(i + 2); - i++; - continue; - } - - isBOL = (chPrev == 0) || (chPrev == '\n') || (chPrev == '\r' && ch != '\n'); - isBOLWS = (isBOL) ? 1 : (isBOLWS && (chPrev == ' ' || chPrev == '\t')); - isEOL = (ch == '\n' || ch == '\r'); - isWS = (ch == ' ' || ch == '\t'); - - if ((ch == '\r' && chNext != '\n') || (ch == '\n')) { - // Remember the line state for future incremental lexing - curLine = styler.GetLine(i); - styler.SetLineState(curLine, (isCode ? 1 : 0)); - } - - switch(state) { - case SCE_INNO_DEFAULT: - if (!isCode && ch == ';' && isBOLWS) { - // Start of a comment - state = SCE_INNO_COMMENT; - } else if (ch == '[' && isBOLWS) { - // Start of a section name - bufferCount = 0; - state = SCE_INNO_SECTION; - } else if (ch == '#' && isBOLWS) { - // Start of a preprocessor directive - state = SCE_INNO_PREPROC; - } else if (!isCode && ch == '{' && chNext != '{' && chPrev != '{') { - // Start of an inline expansion - state = SCE_INNO_INLINE_EXPANSION; - } else if (isCode && (ch == '{' || (ch == '(' && chNext == '*'))) { - // Start of a Pascal comment - state = SCE_INNO_COMMENT_PASCAL; - isCStyleComment = false; - } else if (isCode && ch == '/' && chNext == '/') { - // Apparently, C-style comments are legal, too - state = SCE_INNO_COMMENT_PASCAL; - isCStyleComment = true; - } else if (ch == '"') { - // Start of a double-quote string - state = SCE_INNO_STRING_DOUBLE; - } else if (ch == '\'') { - // Start of a single-quote string - state = SCE_INNO_STRING_SINGLE; - } else if (IsASCII(ch) && (isalpha(ch) || (ch == '_'))) { - // Start of an identifier - bufferCount = 0; - buffer[bufferCount++] = static_cast(tolower(ch)); - state = SCE_INNO_IDENTIFIER; - } else { - // Style it the default style - styler.ColourTo(i,SCE_INNO_DEFAULT); - } - break; - - case SCE_INNO_COMMENT: - if (isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_COMMENT); - } - break; - - case SCE_INNO_IDENTIFIER: - if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) { - buffer[bufferCount++] = static_cast(tolower(ch)); - } else { - state = SCE_INNO_DEFAULT; - buffer[bufferCount] = '\0'; - - // Check if the buffer contains a keyword - if (!isCode && standardKeywords.InList(buffer)) { - styler.ColourTo(i-1,SCE_INNO_KEYWORD); - } else if (!isCode && parameterKeywords.InList(buffer)) { - styler.ColourTo(i-1,SCE_INNO_PARAMETER); - } else if (isCode && pascalKeywords.InList(buffer)) { - styler.ColourTo(i-1,SCE_INNO_KEYWORD_PASCAL); - } else if (!isCode && userKeywords.InList(buffer)) { - styler.ColourTo(i-1,SCE_INNO_KEYWORD_USER); - } else { - styler.ColourTo(i-1,SCE_INNO_DEFAULT); - } - - // Push back the faulty character - chNext = styler[i--]; - ch = chPrev; - } - break; - - case SCE_INNO_SECTION: - if (ch == ']') { - state = SCE_INNO_DEFAULT; - buffer[bufferCount] = '\0'; - - // Check if the buffer contains a section name - if (sectionKeywords.InList(buffer)) { - styler.ColourTo(i,SCE_INNO_SECTION); - isCode = !CompareCaseInsensitive(buffer, "code"); - } else { - styler.ColourTo(i,SCE_INNO_DEFAULT); - } - } else if (IsASCII(ch) && (isalnum(ch) || (ch == '_'))) { - buffer[bufferCount++] = static_cast(tolower(ch)); - } else { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_DEFAULT); - } - break; - - case SCE_INNO_PREPROC: - if (isWS || isEOL) { - if (IsASCII(chPrev) && isalpha(chPrev)) { - state = SCE_INNO_DEFAULT; - buffer[bufferCount] = '\0'; - - // Check if the buffer contains a preprocessor directive - if (preprocessorKeywords.InList(buffer)) { - styler.ColourTo(i-1,SCE_INNO_PREPROC); - } else { - styler.ColourTo(i-1,SCE_INNO_DEFAULT); - } - - // Push back the faulty character - chNext = styler[i--]; - ch = chPrev; - } - } else if (IsASCII(ch) && isalpha(ch)) { - if (chPrev == '#' || chPrev == ' ' || chPrev == '\t') - bufferCount = 0; - buffer[bufferCount++] = static_cast(tolower(ch)); - } - break; - - case SCE_INNO_STRING_DOUBLE: - if (ch == '"' || isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_STRING_DOUBLE); - } - break; - - case SCE_INNO_STRING_SINGLE: - if (ch == '\'' || isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_STRING_SINGLE); - } - break; - - case SCE_INNO_INLINE_EXPANSION: - if (ch == '}') { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_INLINE_EXPANSION); - } else if (isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_DEFAULT); - } - break; - - case SCE_INNO_COMMENT_PASCAL: - if (isCStyleComment) { - if (isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_COMMENT_PASCAL); - } - } else { - if (ch == '}' || (ch == ')' && chPrev == '*')) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_COMMENT_PASCAL); - } else if (isEOL) { - state = SCE_INNO_DEFAULT; - styler.ColourTo(i,SCE_INNO_DEFAULT); - } - } - break; - - } - } - delete []buffer; -} - -static const char * const innoWordListDesc[] = { - "Sections", - "Keywords", - "Parameters", - "Preprocessor directives", - "Pascal keywords", - "User defined keywords", - 0 -}; - -static void FoldInnoDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) { - Sci_PositionU endPos = startPos + length; - char chNext = styler[startPos]; - - Sci_Position lineCurrent = styler.GetLine(startPos); - - bool sectionFlag = false; - int levelPrev = lineCurrent > 0 ? styler.LevelAt(lineCurrent - 1) : SC_FOLDLEVELBASE; - int level; - - for (Sci_PositionU i = startPos; i < endPos; i++) { - char ch = chNext; - chNext = styler[i+1]; - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - int style = styler.StyleAt(i); - - if (style == SCE_INNO_SECTION) - sectionFlag = true; - - if (atEOL || i == endPos - 1) { - if (sectionFlag) { - level = SC_FOLDLEVELBASE | SC_FOLDLEVELHEADERFLAG; - if (level == levelPrev) - styler.SetLevel(lineCurrent - 1, levelPrev & ~SC_FOLDLEVELHEADERFLAG); - } else { - level = levelPrev & SC_FOLDLEVELNUMBERMASK; - if (levelPrev & SC_FOLDLEVELHEADERFLAG) - level++; - } - - styler.SetLevel(lineCurrent, level); - - levelPrev = level; - lineCurrent++; - sectionFlag = false; - } - } -} - -LexerModule lmInno(SCLEX_INNOSETUP, ColouriseInnoDoc, "inno", FoldInnoDoc, innoWordListDesc); diff --git a/scintilla/lexers/LexJSON.cxx b/scintilla/lexers/LexJSON.cxx deleted file mode 100644 index 6c1c565d..00000000 --- a/scintilla/lexers/LexJSON.cxx +++ /dev/null @@ -1,497 +0,0 @@ -// Scintilla source code edit control -/** - * @file LexJSON.cxx - * @date February 19, 2016 - * @brief Lexer for JSON and JSON-LD formats - * @author nkmathew - * - * The License.txt file describes the conditions under which this software may - * be distributed. - * - */ - -#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 - -static const char *const JSONWordListDesc[] = { - "JSON Keywords", - "JSON-LD Keywords", - 0 -}; - -/** - * Used to detect compact IRI/URLs in JSON-LD without first looking ahead for the - * colon separating the prefix and suffix - * - * https://www.w3.org/TR/json-ld/#dfn-compact-iri - */ -struct CompactIRI { - int colonCount; - bool foundInvalidChar; - CharacterSet setCompactIRI; - CompactIRI() { - colonCount = 0; - foundInvalidChar = false; - setCompactIRI = CharacterSet(CharacterSet::setAlpha, "$_-"); - } - void resetState() { - colonCount = 0; - foundInvalidChar = false; - } - void checkChar(int ch) { - if (ch == ':') { - colonCount++; - } else { - foundInvalidChar |= !setCompactIRI.Contains(ch); - } - } - bool shouldHighlight() const { - return !foundInvalidChar && colonCount == 1; - } -}; - -/** - * Keeps track of escaped characters in strings as per: - * - * https://tools.ietf.org/html/rfc7159#section-7 - */ -struct EscapeSequence { - int digitsLeft; - CharacterSet setHexDigits; - CharacterSet setEscapeChars; - EscapeSequence() { - digitsLeft = 0; - setHexDigits = CharacterSet(CharacterSet::setDigits, "ABCDEFabcdef"); - setEscapeChars = CharacterSet(CharacterSet::setNone, "\\\"tnbfru/"); - } - // Returns true if the following character is a valid escaped character - bool newSequence(int nextChar) { - digitsLeft = 0; - if (nextChar == 'u') { - digitsLeft = 5; - } else if (!setEscapeChars.Contains(nextChar)) { - return false; - } - return true; - } - bool atEscapeEnd() const { - return digitsLeft <= 0; - } - bool isInvalidChar(int currChar) const { - return !setHexDigits.Contains(currChar); - } -}; - -struct OptionsJSON { - bool foldCompact; - bool fold; - bool allowComments; - bool escapeSequence; - OptionsJSON() { - foldCompact = false; - fold = false; - allowComments = false; - escapeSequence = false; - } -}; - -struct OptionSetJSON : public OptionSet { - OptionSetJSON() { - DefineProperty("lexer.json.escape.sequence", &OptionsJSON::escapeSequence, - "Set to 1 to enable highlighting of escape sequences in strings"); - - DefineProperty("lexer.json.allow.comments", &OptionsJSON::allowComments, - "Set to 1 to enable highlighting of line/block comments in JSON"); - - DefineProperty("fold.compact", &OptionsJSON::foldCompact); - DefineProperty("fold", &OptionsJSON::fold); - DefineWordListSets(JSONWordListDesc); - } -}; - -class LexerJSON : public ILexer { - OptionsJSON options; - OptionSetJSON optSetJSON; - EscapeSequence escapeSeq; - WordList keywordsJSON; - WordList keywordsJSONLD; - CharacterSet setOperators; - CharacterSet setURL; - CharacterSet setKeywordJSONLD; - CharacterSet setKeywordJSON; - CompactIRI compactIRI; - - static bool IsNextNonWhitespace(LexAccessor &styler, Sci_Position start, char ch) { - Sci_Position i = 0; - while (i < 50) { - i++; - char curr = styler.SafeGetCharAt(start+i, '\0'); - char next = styler.SafeGetCharAt(start+i+1, '\0'); - bool atEOL = (curr == '\r' && next != '\n') || (curr == '\n'); - if (curr == ch) { - return true; - } else if (!isspacechar(curr) || atEOL) { - return false; - } - } - return false; - } - - /** - * Looks for the colon following the end quote - * - * Assumes property names of lengths no longer than a 100 characters. - * The colon is also expected to be less than 50 spaces after the end - * quote for the string to be considered a property name - */ - static bool AtPropertyName(LexAccessor &styler, Sci_Position start) { - Sci_Position i = 0; - bool escaped = false; - while (i < 100) { - i++; - char curr = styler.SafeGetCharAt(start+i, '\0'); - if (escaped) { - escaped = false; - continue; - } - escaped = curr == '\\'; - if (curr == '"') { - return IsNextNonWhitespace(styler, start+i, ':'); - } else if (!curr) { - return false; - } - } - return false; - } - - static bool IsNextWordInList(WordList &keywordList, CharacterSet wordSet, - StyleContext &context, LexAccessor &styler) { - char word[51]; - Sci_Position currPos = (Sci_Position) context.currentPos; - int i = 0; - while (i < 50) { - char ch = styler.SafeGetCharAt(currPos + i); - if (!wordSet.Contains(ch)) { - break; - } - word[i] = ch; - i++; - } - word[i] = '\0'; - return keywordList.InList(word); - } - - public: - LexerJSON() : - setOperators(CharacterSet::setNone, "[{}]:,"), - setURL(CharacterSet::setAlphaNum, "-._~:/?#[]@!$&'()*+,),="), - setKeywordJSONLD(CharacterSet::setAlpha, ":@"), - setKeywordJSON(CharacterSet::setAlpha, "$_") { - } - virtual ~LexerJSON() {} - virtual int SCI_METHOD Version() const { - return lvOriginal; - } - virtual void SCI_METHOD Release() { - delete this; - } - virtual const char *SCI_METHOD PropertyNames() { - return optSetJSON.PropertyNames(); - } - virtual int SCI_METHOD PropertyType(const char *name) { - return optSetJSON.PropertyType(name); - } - virtual const char *SCI_METHOD DescribeProperty(const char *name) { - return optSetJSON.DescribeProperty(name); - } - virtual Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) { - if (optSetJSON.PropertySet(&options, key, val)) { - return 0; - } - return -1; - } - virtual Sci_Position SCI_METHOD WordListSet(int n, const char *wl) { - WordList *wordListN = 0; - switch (n) { - case 0: - wordListN = &keywordsJSON; - break; - case 1: - wordListN = &keywordsJSONLD; - break; - } - Sci_Position firstModification = -1; - if (wordListN) { - WordList wlNew; - wlNew.Set(wl); - if (*wordListN != wlNew) { - wordListN->Set(wl); - firstModification = 0; - } - } - return firstModification; - } - virtual void *SCI_METHOD PrivateCall(int, void *) { - return 0; - } - static ILexer *LexerFactoryJSON() { - return new LexerJSON; - } - virtual const char *SCI_METHOD DescribeWordListSets() { - return optSetJSON.DescribeWordListSets(); - } - virtual void SCI_METHOD Lex(Sci_PositionU startPos, - Sci_Position length, - int initStyle, - IDocument *pAccess); - virtual void SCI_METHOD Fold(Sci_PositionU startPos, - Sci_Position length, - int initStyle, - IDocument *pAccess); -}; - -void SCI_METHOD LexerJSON::Lex(Sci_PositionU startPos, - Sci_Position length, - int initStyle, - IDocument *pAccess) { - LexAccessor styler(pAccess); - StyleContext context(startPos, length, initStyle, styler); - int stringStyleBefore = SCE_JSON_STRING; - while (context.More()) { - switch (context.state) { - case SCE_JSON_BLOCKCOMMENT: - if (context.Match("*/")) { - context.Forward(); - context.ForwardSetState(SCE_JSON_DEFAULT); - } - break; - case SCE_JSON_LINECOMMENT: - if (context.atLineEnd) { - context.SetState(SCE_JSON_DEFAULT); - } - break; - case SCE_JSON_STRINGEOL: - if (context.atLineStart) { - context.SetState(SCE_JSON_DEFAULT); - } - break; - case SCE_JSON_ESCAPESEQUENCE: - escapeSeq.digitsLeft--; - if (!escapeSeq.atEscapeEnd()) { - if (escapeSeq.isInvalidChar(context.ch)) { - context.SetState(SCE_JSON_ERROR); - } - break; - } - if (context.ch == '"') { - context.SetState(stringStyleBefore); - context.ForwardSetState(SCE_C_DEFAULT); - } else if (context.ch == '\\') { - if (!escapeSeq.newSequence(context.chNext)) { - context.SetState(SCE_JSON_ERROR); - } - context.Forward(); - } else { - context.SetState(stringStyleBefore); - if (context.atLineEnd) { - context.ChangeState(SCE_JSON_STRINGEOL); - } - } - break; - case SCE_JSON_PROPERTYNAME: - case SCE_JSON_STRING: - if (context.ch == '"') { - if (compactIRI.shouldHighlight()) { - context.ChangeState(SCE_JSON_COMPACTIRI); - context.ForwardSetState(SCE_JSON_DEFAULT); - compactIRI.resetState(); - } else { - context.ForwardSetState(SCE_JSON_DEFAULT); - } - } else if (context.atLineEnd) { - context.ChangeState(SCE_JSON_STRINGEOL); - } else if (context.ch == '\\') { - stringStyleBefore = context.state; - if (options.escapeSequence) { - context.SetState(SCE_JSON_ESCAPESEQUENCE); - if (!escapeSeq.newSequence(context.chNext)) { - context.SetState(SCE_JSON_ERROR); - } - } - context.Forward(); - } else if (context.Match("https://") || - context.Match("http://") || - context.Match("ssh://") || - context.Match("git://") || - context.Match("svn://") || - context.Match("ftp://") || - context.Match("mailto:")) { - // Handle most common URI schemes only - stringStyleBefore = context.state; - context.SetState(SCE_JSON_URI); - } else if (context.ch == '@') { - // https://www.w3.org/TR/json-ld/#dfn-keyword - if (IsNextWordInList(keywordsJSONLD, setKeywordJSONLD, context, styler)) { - stringStyleBefore = context.state; - context.SetState(SCE_JSON_LDKEYWORD); - } - } else { - compactIRI.checkChar(context.ch); - } - break; - case SCE_JSON_LDKEYWORD: - case SCE_JSON_URI: - if ((!setKeywordJSONLD.Contains(context.ch) && - (context.state == SCE_JSON_LDKEYWORD)) || - (!setURL.Contains(context.ch))) { - context.SetState(stringStyleBefore); - } - if (context.ch == '"') { - context.ForwardSetState(SCE_JSON_DEFAULT); - } else if (context.atLineEnd) { - context.ChangeState(SCE_JSON_STRINGEOL); - } - break; - case SCE_JSON_OPERATOR: - case SCE_JSON_NUMBER: - context.SetState(SCE_JSON_DEFAULT); - break; - case SCE_JSON_ERROR: - if (context.atLineEnd) { - context.SetState(SCE_JSON_DEFAULT); - } - break; - case SCE_JSON_KEYWORD: - if (!setKeywordJSON.Contains(context.ch)) { - context.SetState(SCE_JSON_DEFAULT); - } - break; - } - if (context.state == SCE_JSON_DEFAULT) { - if (context.ch == '"') { - compactIRI.resetState(); - context.SetState(SCE_JSON_STRING); - Sci_Position currPos = static_cast(context.currentPos); - if (AtPropertyName(styler, currPos)) { - context.SetState(SCE_JSON_PROPERTYNAME); - } - } else if (setOperators.Contains(context.ch)) { - context.SetState(SCE_JSON_OPERATOR); - } else if (options.allowComments && context.Match("/*")) { - context.SetState(SCE_JSON_BLOCKCOMMENT); - context.Forward(); - } else if (options.allowComments && context.Match("//")) { - context.SetState(SCE_JSON_LINECOMMENT); - } else if (setKeywordJSON.Contains(context.ch)) { - if (IsNextWordInList(keywordsJSON, setKeywordJSON, context, styler)) { - context.SetState(SCE_JSON_KEYWORD); - } - } - bool numberStart = - IsADigit(context.ch) && (context.chPrev == '+'|| - context.chPrev == '-' || - context.atLineStart || - IsASpace(context.chPrev) || - setOperators.Contains(context.chPrev)); - bool exponentPart = - tolower(context.ch) == 'e' && - IsADigit(context.chPrev) && - (IsADigit(context.chNext) || - context.chNext == '+' || - context.chNext == '-'); - bool signPart = - (context.ch == '-' || context.ch == '+') && - ((tolower(context.chPrev) == 'e' && IsADigit(context.chNext)) || - ((IsASpace(context.chPrev) || setOperators.Contains(context.chPrev)) - && IsADigit(context.chNext))); - bool adjacentDigit = - IsADigit(context.ch) && IsADigit(context.chPrev); - bool afterExponent = IsADigit(context.ch) && tolower(context.chPrev) == 'e'; - bool dotPart = context.ch == '.' && - IsADigit(context.chPrev) && - IsADigit(context.chNext); - bool afterDot = IsADigit(context.ch) && context.chPrev == '.'; - if (numberStart || - exponentPart || - signPart || - adjacentDigit || - dotPart || - afterExponent || - afterDot) { - context.SetState(SCE_JSON_NUMBER); - } else if (context.state == SCE_JSON_DEFAULT && !IsASpace(context.ch)) { - context.SetState(SCE_JSON_ERROR); - } - } - context.Forward(); - } - context.Complete(); -} - -void SCI_METHOD LexerJSON::Fold(Sci_PositionU startPos, - Sci_Position length, - int, - IDocument *pAccess) { - if (!options.fold) { - return; - } - LexAccessor styler(pAccess); - Sci_PositionU currLine = styler.GetLine(startPos); - Sci_PositionU endPos = startPos + length; - int currLevel = styler.LevelAt(currLine) & SC_FOLDLEVELNUMBERMASK; - int nextLevel = currLevel; - int visibleChars = 0; - for (Sci_PositionU i = startPos; i < endPos; i++) { - char curr = styler.SafeGetCharAt(i); - char next = styler.SafeGetCharAt(i+1); - bool atEOL = (curr == '\r' && next != '\n') || (curr == '\n'); - if (styler.StyleAt(i) == SCE_JSON_OPERATOR) { - if (curr == '{' || curr == '[') { - nextLevel++; - } else if (curr == '}' || curr == ']') { - nextLevel--; - } - } - if (atEOL || i == (endPos-1)) { - int level = currLevel; - if (!visibleChars && options.foldCompact) { - level |= SC_FOLDLEVELWHITEFLAG; - } else if (nextLevel > currLevel) { - level |= SC_FOLDLEVELHEADERFLAG; - } - if (level != styler.LevelAt(currLine)) { - styler.SetLevel(currLine, level); - } - currLine++; - currLevel = nextLevel; - visibleChars = 0; - } - if (!isspacechar(curr)) { - visibleChars++; - } - } -} - -LexerModule lmJSON(SCLEX_JSON, - LexerJSON::LexerFactoryJSON, - "json", - JSONWordListDesc); diff --git a/scintilla/lexers/LexKVIrc.cxx b/scintilla/lexers/LexKVIrc.cxx deleted file mode 100644 index 8b83b4d5..00000000 --- a/scintilla/lexers/LexKVIrc.cxx +++ /dev/null @@ -1,473 +0,0 @@ -// Scintilla source code edit control -/** @file LexKVIrc.cxx - ** Lexer for KVIrc script. - **/ -// Copyright 2013 by OmegaPhil , based in -// part from LexPython Copyright 1998-2002 by Neil Hodgson -// and LexCmake Copyright 2007 by Cristian Adam - -// 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 - - -/* KVIrc Script syntactic rules: http://www.kvirc.net/doc/doc_syntactic_rules.html */ - -/* Utility functions */ -static inline bool IsAWordChar(int ch) { - - /* Keyword list includes modules, i.e. words including '.', and - * alias namespaces include ':' */ - return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.' - || ch == ':'); -} -static inline bool IsAWordStart(int ch) { - - /* Functions (start with '$') are treated separately to keywords */ - return (ch < 0x80) && (isalnum(ch) || ch == '_' ); -} - -/* Interface function called by Scintilla to request some text to be - syntax highlighted */ -static void ColouriseKVIrcDoc(Sci_PositionU startPos, Sci_Position length, - int initStyle, WordList *keywordlists[], - Accessor &styler) -{ - /* Fetching style context */ - StyleContext sc(startPos, length, initStyle, styler); - - /* Accessing keywords and function-marking keywords */ - WordList &keywords = *keywordlists[0]; - WordList &functionKeywords = *keywordlists[1]; - - /* Looping for all characters - only automatically moving forward - * when asked for (transitions leaving strings and keywords do this - * already) */ - bool next = true; - for( ; sc.More(); next ? sc.Forward() : (void)0 ) - { - /* Resetting next */ - next = true; - - /* Dealing with different states */ - switch (sc.state) - { - case SCE_KVIRC_DEFAULT: - - /* Detecting single-line comments - * Unfortunately KVIrc script allows raw '#' to be used, and appending # to an array returns - * its length... - * Going for a compromise where single line comments not - * starting on a newline are allowed in all cases except - * when they are preceeded with an opening bracket or comma - * (this will probably be the most common style a valid - * string-less channel name will be used with), with the - * array length case included - */ - if ( - (sc.ch == '#' && sc.atLineStart) || - (sc.ch == '#' && ( - sc.chPrev != '(' && sc.chPrev != ',' && - sc.chPrev != ']') - ) - ) - { - sc.SetState(SCE_KVIRC_COMMENT); - break; - } - - /* Detecting multi-line comments */ - if (sc.Match('/', '*')) - { - sc.SetState(SCE_KVIRC_COMMENTBLOCK); - break; - } - - /* Detecting strings */ - if (sc.ch == '"') - { - sc.SetState(SCE_KVIRC_STRING); - break; - } - - /* Detecting functions */ - if (sc.ch == '$') - { - sc.SetState(SCE_KVIRC_FUNCTION); - break; - } - - /* Detecting variables */ - if (sc.ch == '%') - { - sc.SetState(SCE_KVIRC_VARIABLE); - break; - } - - /* Detecting numbers - isdigit is unsafe as it does not - * validate, use CharacterSet.h functions */ - if (IsADigit(sc.ch)) - { - sc.SetState(SCE_KVIRC_NUMBER); - break; - } - - /* Detecting words */ - if (IsAWordStart(sc.ch) && IsAWordChar(sc.chNext)) - { - sc.SetState(SCE_KVIRC_WORD); - sc.Forward(); - break; - } - - /* Detecting operators */ - if (isoperator(sc.ch)) - { - sc.SetState(SCE_KVIRC_OPERATOR); - break; - } - - break; - - case SCE_KVIRC_COMMENT: - - /* Breaking out of single line comment when a newline - * is introduced */ - if (sc.ch == '\r' || sc.ch == '\n') - { - sc.SetState(SCE_KVIRC_DEFAULT); - break; - } - - break; - - case SCE_KVIRC_COMMENTBLOCK: - - /* Detecting end of multi-line comment */ - if (sc.Match('*', '/')) - { - // Moving the current position forward two characters - // so that '*/' is included in the comment - sc.Forward(2); - sc.SetState(SCE_KVIRC_DEFAULT); - - /* Comment has been exited and the current position - * moved forward, yet the new current character - * has yet to be defined - loop without moving - * forward again */ - next = false; - break; - } - - break; - - case SCE_KVIRC_STRING: - - /* Detecting end of string - closing speechmarks */ - if (sc.ch == '"') - { - /* Allowing escaped speechmarks to pass */ - if (sc.chPrev == '\\') - break; - - /* Moving the current position forward to capture the - * terminating speechmarks, and ending string */ - sc.ForwardSetState(SCE_KVIRC_DEFAULT); - - /* String has been exited and the current position - * moved forward, yet the new current character - * has yet to be defined - loop without moving - * forward again */ - next = false; - break; - } - - /* Functions and variables are now highlighted in strings - * Detecting functions */ - if (sc.ch == '$') - { - /* Allowing escaped functions to pass */ - if (sc.chPrev == '\\') - break; - - sc.SetState(SCE_KVIRC_STRING_FUNCTION); - break; - } - - /* Detecting variables */ - if (sc.ch == '%') - { - /* Allowing escaped variables to pass */ - if (sc.chPrev == '\\') - break; - - sc.SetState(SCE_KVIRC_STRING_VARIABLE); - break; - } - - /* Breaking out of a string when a newline is introduced */ - if (sc.ch == '\r' || sc.ch == '\n') - { - /* Allowing escaped newlines */ - if (sc.chPrev == '\\') - break; - - sc.SetState(SCE_KVIRC_DEFAULT); - break; - } - - break; - - case SCE_KVIRC_FUNCTION: - case SCE_KVIRC_VARIABLE: - - /* Detecting the end of a function/variable (word) */ - if (!IsAWordChar(sc.ch)) - { - sc.SetState(SCE_KVIRC_DEFAULT); - - /* Word has been exited yet the current character - * has yet to be defined - loop without moving - * forward again */ - next = false; - break; - } - - break; - - case SCE_KVIRC_STRING_FUNCTION: - case SCE_KVIRC_STRING_VARIABLE: - - /* A function or variable in a string - * Detecting the end of a function/variable (word) */ - if (!IsAWordChar(sc.ch)) - { - sc.SetState(SCE_KVIRC_STRING); - - /* Word has been exited yet the current character - * has yet to be defined - loop without moving - * forward again */ - next = false; - break; - } - - break; - - case SCE_KVIRC_NUMBER: - - /* Detecting the end of a number */ - if (!IsADigit(sc.ch)) - { - sc.SetState(SCE_KVIRC_DEFAULT); - - /* Number has been exited yet the current character - * has yet to be defined - loop without moving - * forward */ - next = false; - break; - } - - break; - - case SCE_KVIRC_OPERATOR: - - /* Because '%' is an operator but is also the marker for - * a variable, I need to always treat operators as single - * character strings and therefore redo their detection - * after every character */ - sc.SetState(SCE_KVIRC_DEFAULT); - - /* Operator has been exited yet the current character - * has yet to be defined - loop without moving - * forward */ - next = false; - break; - - case SCE_KVIRC_WORD: - - /* Detecting the end of a word */ - if (!IsAWordChar(sc.ch)) - { - /* Checking if the word was actually a keyword - - * fetching the current word, NULL-terminated like - * the keyword list */ - char s[100]; - Sci_Position wordLen = sc.currentPos - styler.GetStartSegment(); - if (wordLen > 99) - wordLen = 99; /* Include '\0' in buffer */ - Sci_Position i; - for( i = 0; i < wordLen; ++i ) - { - s[i] = styler.SafeGetCharAt( styler.GetStartSegment() + i ); - } - s[wordLen] = '\0'; - - /* Actually detecting keywords and fixing the state */ - if (keywords.InList(s)) - { - /* The SetState call actually commits the - * previous keyword state */ - sc.ChangeState(SCE_KVIRC_KEYWORD); - } - else if (functionKeywords.InList(s)) - { - // Detecting function keywords and fixing the state - sc.ChangeState(SCE_KVIRC_FUNCTION_KEYWORD); - } - - /* Transitioning to default and committing the previous - * word state */ - sc.SetState(SCE_KVIRC_DEFAULT); - - /* Word has been exited yet the current character - * has yet to be defined - loop without moving - * forward again */ - next = false; - break; - } - - break; - } - } - - /* Indicating processing is complete */ - sc.Complete(); -} - -static void FoldKVIrcDoc(Sci_PositionU startPos, Sci_Position length, int /*initStyle - unused*/, - WordList *[], Accessor &styler) -{ - /* Based on CMake's folder */ - - /* Exiting if folding isnt enabled */ - if ( styler.GetPropertyInt("fold") == 0 ) - return; - - /* Obtaining current line number*/ - Sci_Position currentLine = styler.GetLine(startPos); - - /* Obtaining starting character - indentation is done on a line basis, - * not character */ - Sci_PositionU safeStartPos = styler.LineStart( currentLine ); - - /* Initialising current level - this is defined as indentation level - * in the low 12 bits, with flag bits in the upper four bits. - * It looks like two indentation states are maintained in the returned - * 32bit value - 'nextLevel' in the most-significant bits, 'currentLevel' - * in the least-significant bits. Since the next level is the most - * up to date, this must refer to the current state of indentation. - * So the code bitshifts the old current level out of existence to - * get at the actual current state of indentation - * Based on the LexerCPP.cxx line 958 comment */ - int currentLevel = SC_FOLDLEVELBASE; - if (currentLine > 0) - currentLevel = styler.LevelAt(currentLine - 1) >> 16; - int nextLevel = currentLevel; - - // Looping for characters in range - for (Sci_PositionU i = safeStartPos; i < startPos + length; ++i) - { - /* Folding occurs after syntax highlighting, meaning Scintilla - * already knows where the comments are - * Fetching the current state */ - int state = styler.StyleAt(i) & 31; - - switch( styler.SafeGetCharAt(i) ) - { - case '{': - - /* Indenting only when the braces are not contained in - * a comment */ - if (state != SCE_KVIRC_COMMENT && - state != SCE_KVIRC_COMMENTBLOCK) - ++nextLevel; - break; - - case '}': - - /* Outdenting only when the braces are not contained in - * a comment */ - if (state != SCE_KVIRC_COMMENT && - state != SCE_KVIRC_COMMENTBLOCK) - --nextLevel; - break; - - case '\n': - case '\r': - - /* Preparing indentation information to return - combining - * current and next level data */ - int lev = currentLevel | nextLevel << 16; - - /* If the next level increases the indent level, mark the - * current line as a fold point - current level data is - * in the least significant bits */ - if (nextLevel > currentLevel ) - lev |= SC_FOLDLEVELHEADERFLAG; - - /* Updating indentation level if needed */ - if (lev != styler.LevelAt(currentLine)) - styler.SetLevel(currentLine, lev); - - /* Updating variables */ - ++currentLine; - currentLevel = nextLevel; - - /* Dealing with problematic Windows newlines - - * incrementing to avoid the extra newline breaking the - * fold point */ - if (styler.SafeGetCharAt(i) == '\r' && - styler.SafeGetCharAt(i + 1) == '\n') - ++i; - break; - } - } - - /* At this point the data has ended, so presumably the end of the line? - * Preparing indentation information to return - combining current - * and next level data */ - int lev = currentLevel | nextLevel << 16; - - /* If the next level increases the indent level, mark the current - * line as a fold point - current level data is in the least - * significant bits */ - if (nextLevel > currentLevel ) - lev |= SC_FOLDLEVELHEADERFLAG; - - /* Updating indentation level if needed */ - if (lev != styler.LevelAt(currentLine)) - styler.SetLevel(currentLine, lev); -} - -/* Registering wordlists */ -static const char *const kvircWordListDesc[] = { - "primary", - "function_keywords", - 0 -}; - - -/* Registering functions and wordlists */ -LexerModule lmKVIrc(SCLEX_KVIRC, ColouriseKVIrcDoc, "kvirc", FoldKVIrcDoc, - kvircWordListDesc); diff --git a/scintilla/lexers/LexKix.cxx b/scintilla/lexers/LexKix.cxx deleted file mode 100644 index fc880805..00000000 --- a/scintilla/lexers/LexKix.cxx +++ /dev/null @@ -1,136 +0,0 @@ -// Scintilla source code edit control -/** @file LexKix.cxx - ** Lexer for KIX-Scripts. - **/ -// Copyright 2004 by Manfred Becker -// The License.txt file describes the conditions under which this software may be distributed. -// Edited by Lee Wilmott (24-Jun-2014) added support for block comments - -#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 == '_'; -} - -static inline bool IsOperator(const int ch) { - return (ch == '+' || ch == '-' || ch == '*' || ch == '/' || ch == '&' || ch == '|' || ch == '<' || ch == '>' || ch == '='); -} - -static void ColouriseKixDoc(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]; - - styler.StartAt(startPos); - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - - if (sc.state == SCE_KIX_COMMENT) { - if (sc.atLineEnd) { - sc.SetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_COMMENTSTREAM) { - if (sc.ch == '/' && sc.chPrev == '*') { - sc.ForwardSetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_STRING1) { - // This is a doubles quotes string - if (sc.ch == '\"') { - sc.ForwardSetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_STRING2) { - // This is a single quote string - if (sc.ch == '\'') { - sc.ForwardSetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_NUMBER) { - if (!IsADigit(sc.ch)) { - sc.SetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_VAR) { - if (!IsAWordChar(sc.ch)) { - sc.SetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_MACRO) { - if (!IsAWordChar(sc.ch) && !IsADigit(sc.ch)) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - - if (!keywords3.InList(&s[1])) { - sc.ChangeState(SCE_KIX_DEFAULT); - } - sc.SetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_OPERATOR) { - if (!IsOperator(sc.ch)) { - sc.SetState(SCE_KIX_DEFAULT); - } - } else if (sc.state == SCE_KIX_IDENTIFIER) { - if (!IsAWordChar(sc.ch)) { - char s[100]; - sc.GetCurrentLowered(s, sizeof(s)); - - if (keywords.InList(s)) { - sc.ChangeState(SCE_KIX_KEYWORD); - } else if (keywords2.InList(s)) { - sc.ChangeState(SCE_KIX_FUNCTIONS); - } - sc.SetState(SCE_KIX_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_KIX_DEFAULT) { - if (sc.ch == ';') { - sc.SetState(SCE_KIX_COMMENT); - } else if (sc.ch == '/' && sc.chNext == '*') { - sc.SetState(SCE_KIX_COMMENTSTREAM); - } else if (sc.ch == '\"') { - sc.SetState(SCE_KIX_STRING1); - } else if (sc.ch == '\'') { - sc.SetState(SCE_KIX_STRING2); - } else if (sc.ch == '$') { - sc.SetState(SCE_KIX_VAR); - } else if (sc.ch == '@') { - sc.SetState(SCE_KIX_MACRO); - } else if (IsADigit(sc.ch) || ((sc.ch == '.' || sc.ch == '&') && IsADigit(sc.chNext))) { - sc.SetState(SCE_KIX_NUMBER); - } else if (IsOperator(sc.ch)) { - sc.SetState(SCE_KIX_OPERATOR); - } else if (IsAWordChar(sc.ch)) { - sc.SetState(SCE_KIX_IDENTIFIER); - } - } - } - sc.Complete(); -} - - -LexerModule lmKix(SCLEX_KIX, ColouriseKixDoc, "kix"); - diff --git a/scintilla/lexers/LexLaTeX.cxx b/scintilla/lexers/LexLaTeX.cxx deleted file mode 100644 index 5f2c48e0..00000000 --- a/scintilla/lexers/LexLaTeX.cxx +++ /dev/null @@ -1,540 +0,0 @@ -// Scintilla source code edit control -/** @file LexLaTeX.cxx - ** Lexer for LaTeX2e. - **/ -// Copyright 1998-2001 by Neil Hodgson -// The License.txt file describes the conditions under which this software may be distributed. - -// Modified by G. HU in 2013. Added folding, syntax highting inside math environments, and changed some minor behaviors. - -#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 "LexerModule.h" -#include "LexerBase.h" - -#ifdef SCI_NAMESPACE -using namespace Scintilla; -#endif - -using namespace std; - -struct latexFoldSave { - latexFoldSave() : structLev(0) { - for (int i = 0; i < 8; ++i) openBegins[i] = 0; - } - latexFoldSave(const latexFoldSave &save) : structLev(save.structLev) { - for (int i = 0; i < 8; ++i) openBegins[i] = save.openBegins[i]; - } - int openBegins[8]; - int structLev; -}; - -class LexerLaTeX : public LexerBase { -private: - vector modes; - void setMode(Sci_Position line, int mode) { - if (line >= static_cast(modes.size())) modes.resize(line + 1, 0); - modes[line] = mode; - } - int getMode(Sci_Position line) { - if (line >= 0 && line < static_cast(modes.size())) return modes[line]; - return 0; - } - void truncModes(Sci_Position numLines) { - if (static_cast(modes.size()) > numLines * 2 + 256) - modes.resize(numLines + 128); - } - - vector saves; - void setSave(Sci_Position line, const latexFoldSave &save) { - if (line >= static_cast(saves.size())) saves.resize(line + 1); - saves[line] = save; - } - void getSave(Sci_Position line, latexFoldSave &save) { - if (line >= 0 && line < static_cast(saves.size())) save = saves[line]; - else { - save.structLev = 0; - for (int i = 0; i < 8; ++i) save.openBegins[i] = 0; - } - } - void truncSaves(Sci_Position numLines) { - if (static_cast(saves.size()) > numLines * 2 + 256) - saves.resize(numLines + 128); - } -public: - static ILexer *LexerFactoryLaTeX() { - return new LexerLaTeX(); - } - 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); -}; - -static bool latexIsSpecial(int ch) { - return (ch == '#') || (ch == '$') || (ch == '%') || (ch == '&') || (ch == '_') || - (ch == '{') || (ch == '}') || (ch == ' '); -} - -static bool latexIsBlank(int ch) { - return (ch == ' ') || (ch == '\t'); -} - -static bool latexIsBlankAndNL(int ch) { - return (ch == ' ') || (ch == '\t') || (ch == '\r') || (ch == '\n'); -} - -static bool latexIsLetter(int ch) { - return IsASCII(ch) && isalpha(ch); -} - -static bool latexIsTagValid(Sci_Position &i, Sci_Position l, Accessor &styler) { - while (i < l) { - if (styler.SafeGetCharAt(i) == '{') { - while (i < l) { - i++; - if (styler.SafeGetCharAt(i) == '}') { - return true; - } else if (!latexIsLetter(styler.SafeGetCharAt(i)) && - styler.SafeGetCharAt(i)!='*') { - return false; - } - } - } else if (!latexIsBlank(styler.SafeGetCharAt(i))) { - return false; - } - i++; - } - return false; -} - -static bool latexNextNotBlankIs(Sci_Position i, Accessor &styler, char needle) { - char ch; - while (i < styler.Length()) { - ch = styler.SafeGetCharAt(i); - if (!latexIsBlankAndNL(ch) && ch != '*') { - if (ch == needle) - return true; - else - return false; - } - i++; - } - return false; -} - -static bool latexLastWordIs(Sci_Position start, Accessor &styler, const char *needle) { - Sci_PositionU i = 0; - Sci_PositionU l = static_cast(strlen(needle)); - Sci_Position ini = start-l+1; - char s[32]; - - while (i < l && i < 31) { - s[i] = styler.SafeGetCharAt(ini + i); - i++; - } - s[i] = '\0'; - - return (strcmp(s, needle) == 0); -} - -static bool latexLastWordIsMathEnv(Sci_Position pos, Accessor &styler) { - Sci_Position i, j; - char s[32]; - const char *mathEnvs[] = { "align", "alignat", "flalign", "gather", - "multiline", "displaymath", "eqnarray", "equation" }; - if (styler.SafeGetCharAt(pos) != '}') return false; - for (i = pos - 1; i >= 0; --i) { - if (styler.SafeGetCharAt(i) == '{') break; - if (pos - i >= 20) return false; - } - if (i < 0 || i == pos - 1) return false; - ++i; - for (j = 0; i + j < pos; ++j) - s[j] = styler.SafeGetCharAt(i + j); - s[j] = '\0'; - if (j == 0) return false; - if (s[j - 1] == '*') s[--j] = '\0'; - for (i = 0; i < static_cast(sizeof(mathEnvs) / sizeof(const char *)); ++i) - if (strcmp(s, mathEnvs[i]) == 0) return true; - return false; -} - -static inline void latexStateReset(int &mode, int &state) { - switch (mode) { - case 1: state = SCE_L_MATH; break; - case 2: state = SCE_L_MATH2; break; - default: state = SCE_L_DEFAULT; break; - } -} - -// There are cases not handled correctly, like $abcd\textrm{what is $x+y$}z+w$. -// But I think it's already good enough. -void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { - // startPos is assumed to be the first character of a line - Accessor styler(pAccess, &props); - styler.StartAt(startPos); - int mode = getMode(styler.GetLine(startPos) - 1); - int state = initStyle; - if (state == SCE_L_ERROR || state == SCE_L_SHORTCMD || state == SCE_L_SPECIAL) // should not happen - latexStateReset(mode, state); - - char chNext = styler.SafeGetCharAt(startPos); - char chVerbatimDelim = '\0'; - styler.StartSegment(startPos); - Sci_Position lengthDoc = startPos + length; - - for (Sci_Position i = startPos; i < lengthDoc; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - - if (styler.IsLeadByte(ch)) { - i++; - chNext = styler.SafeGetCharAt(i + 1); - continue; - } - - if (ch == '\r' || ch == '\n') - setMode(styler.GetLine(i), mode); - - switch (state) { - case SCE_L_DEFAULT : - switch (ch) { - case '\\' : - styler.ColourTo(i - 1, state); - if (latexIsLetter(chNext)) { - state = SCE_L_COMMAND; - } else if (latexIsSpecial(chNext)) { - styler.ColourTo(i + 1, SCE_L_SPECIAL); - i++; - chNext = styler.SafeGetCharAt(i + 1); - } else if (chNext == '\r' || chNext == '\n') { - styler.ColourTo(i, SCE_L_ERROR); - } else if (IsASCII(chNext)) { - styler.ColourTo(i + 1, SCE_L_SHORTCMD); - if (chNext == '(') { - mode = 1; - state = SCE_L_MATH; - } else if (chNext == '[') { - mode = 2; - state = SCE_L_MATH2; - } - i++; - chNext = styler.SafeGetCharAt(i + 1); - } - break; - case '$' : - styler.ColourTo(i - 1, state); - if (chNext == '$') { - styler.ColourTo(i + 1, SCE_L_SHORTCMD); - mode = 2; - state = SCE_L_MATH2; - i++; - chNext = styler.SafeGetCharAt(i + 1); - } else { - styler.ColourTo(i, SCE_L_SHORTCMD); - mode = 1; - state = SCE_L_MATH; - } - break; - case '%' : - styler.ColourTo(i - 1, state); - state = SCE_L_COMMENT; - break; - } - break; - // These 3 will never be reached. - case SCE_L_ERROR: - case SCE_L_SPECIAL: - case SCE_L_SHORTCMD: - break; - case SCE_L_COMMAND : - if (!latexIsLetter(chNext)) { - styler.ColourTo(i, state); - if (latexNextNotBlankIs(i + 1, styler, '[' )) { - state = SCE_L_CMDOPT; - } else if (latexLastWordIs(i, styler, "\\begin")) { - state = SCE_L_TAG; - } else if (latexLastWordIs(i, styler, "\\end")) { - state = SCE_L_TAG2; - } else if (latexLastWordIs(i, styler, "\\verb") && chNext != '*' && chNext != ' ') { - chVerbatimDelim = chNext; - state = SCE_L_VERBATIM; - } else { - latexStateReset(mode, state); - } - } - break; - case SCE_L_CMDOPT : - if (ch == ']') { - styler.ColourTo(i, state); - latexStateReset(mode, state); - } - break; - case SCE_L_TAG : - if (latexIsTagValid(i, lengthDoc, styler)) { - styler.ColourTo(i, state); - latexStateReset(mode, state); - if (latexLastWordIs(i, styler, "{verbatim}")) { - state = SCE_L_VERBATIM; - } else if (latexLastWordIs(i, styler, "{comment}")) { - state = SCE_L_COMMENT2; - } else if (latexLastWordIs(i, styler, "{math}") && mode == 0) { - mode = 1; - state = SCE_L_MATH; - } else if (latexLastWordIsMathEnv(i, styler) && mode == 0) { - mode = 2; - state = SCE_L_MATH2; - } - } else { - styler.ColourTo(i, SCE_L_ERROR); - latexStateReset(mode, state); - ch = styler.SafeGetCharAt(i); - if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode); - } - chNext = styler.SafeGetCharAt(i+1); - break; - case SCE_L_TAG2 : - if (latexIsTagValid(i, lengthDoc, styler)) { - styler.ColourTo(i, state); - latexStateReset(mode, state); - } else { - styler.ColourTo(i, SCE_L_ERROR); - latexStateReset(mode, state); - ch = styler.SafeGetCharAt(i); - if (ch == '\r' || ch == '\n') setMode(styler.GetLine(i), mode); - } - chNext = styler.SafeGetCharAt(i+1); - break; - case SCE_L_MATH : - switch (ch) { - case '\\' : - styler.ColourTo(i - 1, state); - if (latexIsLetter(chNext)) { - Sci_Position match = i + 3; - if (latexLastWordIs(match, styler, "\\end")) { - match++; - if (latexIsTagValid(match, lengthDoc, styler)) { - if (latexLastWordIs(match, styler, "{math}")) - mode = 0; - } - } - state = SCE_L_COMMAND; - } else if (latexIsSpecial(chNext)) { - styler.ColourTo(i + 1, SCE_L_SPECIAL); - i++; - chNext = styler.SafeGetCharAt(i + 1); - } else if (chNext == '\r' || chNext == '\n') { - styler.ColourTo(i, SCE_L_ERROR); - } else if (IsASCII(chNext)) { - if (chNext == ')') { - mode = 0; - state = SCE_L_DEFAULT; - } - styler.ColourTo(i + 1, SCE_L_SHORTCMD); - i++; - chNext = styler.SafeGetCharAt(i + 1); - } - break; - case '$' : - styler.ColourTo(i - 1, state); - styler.ColourTo(i, SCE_L_SHORTCMD); - mode = 0; - state = SCE_L_DEFAULT; - break; - case '%' : - styler.ColourTo(i - 1, state); - state = SCE_L_COMMENT; - break; - } - break; - case SCE_L_MATH2 : - switch (ch) { - case '\\' : - styler.ColourTo(i - 1, state); - if (latexIsLetter(chNext)) { - Sci_Position match = i + 3; - if (latexLastWordIs(match, styler, "\\end")) { - match++; - if (latexIsTagValid(match, lengthDoc, styler)) { - if (latexLastWordIsMathEnv(match, styler)) - mode = 0; - } - } - state = SCE_L_COMMAND; - } else if (latexIsSpecial(chNext)) { - styler.ColourTo(i + 1, SCE_L_SPECIAL); - i++; - chNext = styler.SafeGetCharAt(i + 1); - } else if (chNext == '\r' || chNext == '\n') { - styler.ColourTo(i, SCE_L_ERROR); - } else if (IsASCII(chNext)) { - if (chNext == ']') { - mode = 0; - state = SCE_L_DEFAULT; - } - styler.ColourTo(i + 1, SCE_L_SHORTCMD); - i++; - chNext = styler.SafeGetCharAt(i + 1); - } - break; - case '$' : - styler.ColourTo(i - 1, state); - if (chNext == '$') { - styler.ColourTo(i + 1, SCE_L_SHORTCMD); - i++; - chNext = styler.SafeGetCharAt(i + 1); - mode = 0; - state = SCE_L_DEFAULT; - } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation} - styler.ColourTo(i, SCE_L_SHORTCMD); - } - break; - case '%' : - styler.ColourTo(i - 1, state); - state = SCE_L_COMMENT; - break; - } - break; - case SCE_L_COMMENT : - if (ch == '\r' || ch == '\n') { - styler.ColourTo(i - 1, state); - latexStateReset(mode, state); - } - break; - case SCE_L_COMMENT2 : - if (ch == '\\') { - Sci_Position match = i + 3; - if (latexLastWordIs(match, styler, "\\end")) { - match++; - if (latexIsTagValid(match, lengthDoc, styler)) { - if (latexLastWordIs(match, styler, "{comment}")) { - styler.ColourTo(i - 1, state); - state = SCE_L_COMMAND; - } - } - } - } - break; - case SCE_L_VERBATIM : - if (ch == '\\') { - Sci_Position match = i + 3; - if (latexLastWordIs(match, styler, "\\end")) { - match++; - if (latexIsTagValid(match, lengthDoc, styler)) { - if (latexLastWordIs(match, styler, "{verbatim}")) { - styler.ColourTo(i - 1, state); - state = SCE_L_COMMAND; - } - } - } - } else if (chNext == chVerbatimDelim) { - styler.ColourTo(i + 1, state); - latexStateReset(mode, state); - chVerbatimDelim = '\0'; - i++; - chNext = styler.SafeGetCharAt(i + 1); - } else if (chVerbatimDelim != '\0' && (ch == '\n' || ch == '\r')) { - styler.ColourTo(i, SCE_L_ERROR); - latexStateReset(mode, state); - chVerbatimDelim = '\0'; - } - break; - } - } - if (lengthDoc == styler.Length()) truncModes(styler.GetLine(lengthDoc - 1)); - styler.ColourTo(lengthDoc - 1, state); - styler.Flush(); -} - -static int latexFoldSaveToInt(const latexFoldSave &save) { - int sum = 0; - for (int i = 0; i <= save.structLev; ++i) - sum += save.openBegins[i]; - return ((sum + save.structLev + SC_FOLDLEVELBASE) & SC_FOLDLEVELNUMBERMASK); -} - -// Change folding state while processing a line -// Return the level before the first relevant command -void SCI_METHOD LexerLaTeX::Fold(Sci_PositionU startPos, Sci_Position length, int, IDocument *pAccess) { - const char *structWords[7] = {"part", "chapter", "section", "subsection", - "subsubsection", "paragraph", "subparagraph"}; - Accessor styler(pAccess, &props); - Sci_PositionU endPos = startPos + length; - Sci_Position curLine = styler.GetLine(startPos); - latexFoldSave save; - getSave(curLine - 1, save); - do { - char ch, buf[16]; - Sci_Position i, j; - int lev = -1; - bool needFold = false; - for (i = static_cast(startPos); i < static_cast(endPos); ++i) { - ch = styler.SafeGetCharAt(i); - if (ch == '\r' || ch == '\n') break; - if (ch != '\\' || styler.StyleAt(i) != SCE_L_COMMAND) continue; - for (j = 0; j < 15 && i + 1 < static_cast(endPos); ++j, ++i) { - buf[j] = styler.SafeGetCharAt(i + 1); - if (!latexIsLetter(buf[j])) break; - } - buf[j] = '\0'; - if (strcmp(buf, "begin") == 0) { - if (lev < 0) lev = latexFoldSaveToInt(save); - ++save.openBegins[save.structLev]; - needFold = true; - } - else if (strcmp(buf, "end") == 0) { - while (save.structLev > 0 && save.openBegins[save.structLev] == 0) - --save.structLev; - if (lev < 0) lev = latexFoldSaveToInt(save); - if (save.openBegins[save.structLev] > 0) --save.openBegins[save.structLev]; - } - else { - for (j = 0; j < 7; ++j) - if (strcmp(buf, structWords[j]) == 0) break; - if (j >= 7) continue; - save.structLev = j; // level before the command - for (j = save.structLev + 1; j < 8; ++j) { - save.openBegins[save.structLev] += save.openBegins[j]; - save.openBegins[j] = 0; - } - if (lev < 0) lev = latexFoldSaveToInt(save); - ++save.structLev; // level after the command - needFold = true; - } - } - if (lev < 0) lev = latexFoldSaveToInt(save); - if (needFold) lev |= SC_FOLDLEVELHEADERFLAG; - styler.SetLevel(curLine, lev); - setSave(curLine, save); - ++curLine; - startPos = styler.LineStart(curLine); - if (static_cast(startPos) == styler.Length()) { - lev = latexFoldSaveToInt(save); - styler.SetLevel(curLine, lev); - setSave(curLine, save); - truncSaves(curLine); - } - } while (startPos < endPos); - styler.Flush(); -} - -static const char *const emptyWordListDesc[] = { - 0 -}; - -LexerModule lmLatex(SCLEX_LATEX, LexerLaTeX::LexerFactoryLaTeX, "latex", emptyWordListDesc); diff --git a/scintilla/lexers/LexLisp.cxx b/scintilla/lexers/LexLisp.cxx deleted file mode 100644 index 83ea5914..00000000 --- a/scintilla/lexers/LexLisp.cxx +++ /dev/null @@ -1,285 +0,0 @@ -// Scintilla source code edit control -/** @file LexLisp.cxx - ** Lexer for Lisp. - ** Written by Alexey Yutkin. - **/ -// 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 - -#define SCE_LISP_CHARACTER 29 -#define SCE_LISP_MACRO 30 -#define SCE_LISP_MACRO_DISPATCH 31 - -static inline bool isLispoperator(char ch) { - if (IsASCII(ch) && isalnum(ch)) - return false; - if (ch == '\'' || ch == '`' || ch == '(' || ch == ')' || ch == '[' || ch == ']' || ch == '{' || ch == '}') - return true; - return false; -} - -static inline bool isLispwordstart(char ch) { - return IsASCII(ch) && ch != ';' && !isspacechar(ch) && !isLispoperator(ch) && - ch != '\n' && ch != '\r' && ch != '\"'; -} - - -static void classifyWordLisp(Sci_PositionU start, Sci_PositionU end, WordList &keywords, WordList &keywords_kw, Accessor &styler) { - assert(end >= start); - char s[100]; - Sci_PositionU i; - bool digit_flag = true; - for (i = 0; (i < end - start + 1) && (i < 99); i++) { - s[i] = styler[start + i]; - s[i + 1] = '\0'; - if (!isdigit(s[i]) && (s[i] != '.')) digit_flag = false; - } - char chAttr = SCE_LISP_IDENTIFIER; - - if(digit_flag) chAttr = SCE_LISP_NUMBER; - else { - if (keywords.InList(s)) { - chAttr = SCE_LISP_KEYWORD; - } else if (keywords_kw.InList(s)) { - chAttr = SCE_LISP_KEYWORD_KW; - } else if ((s[0] == '*' && s[i-1] == '*') || - (s[0] == '+' && s[i-1] == '+')) { - chAttr = SCE_LISP_SPECIAL; - } - } - styler.ColourTo(end, chAttr); - return; -} - - -static void ColouriseLispDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], - Accessor &styler) { - - WordList &keywords = *keywordlists[0]; - WordList &keywords_kw = *keywordlists[1]; - - styler.StartAt(startPos); - - int state = initStyle, radix = -1; - char chNext = styler[startPos]; - Sci_PositionU lengthDoc = startPos + length; - styler.StartSegment(startPos); - for (Sci_PositionU i = startPos; i < lengthDoc; i++) { - char ch = chNext; - chNext = styler.SafeGetCharAt(i + 1); - - bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n'); - - if (styler.IsLeadByte(ch)) { - chNext = styler.SafeGetCharAt(i + 2); - i += 1; - continue; - } - - if (state == SCE_LISP_DEFAULT) { - if (ch == '#') { - styler.ColourTo(i - 1, state); - radix = -1; - state = SCE_LISP_MACRO_DISPATCH; - } else if (ch == ':' && isLispwordstart(chNext)) { - styler.ColourTo(i - 1, state); - state = SCE_LISP_SYMBOL; - } else if (isLispwordstart(ch)) { - styler.ColourTo(i - 1, state); - state = SCE_LISP_IDENTIFIER; - } - else if (ch == ';') { - styler.ColourTo(i - 1, state); - state = SCE_LISP_COMMENT; - } - else if (isLispoperator(ch) || ch=='\'') { - styler.ColourTo(i - 1, state); - styler.ColourTo(i, SCE_LISP_OPERATOR); - if (ch=='\'' && isLispwordstart(chNext)) { - state = SCE_LISP_SYMBOL; - } - } - else if (ch == '\"') { - styler.ColourTo(i - 1, state); - state = SCE_LISP_STRING; - } - } else if (state == SCE_LISP_IDENTIFIER || state == SCE_LISP_SYMBOL) { - if (!isLispwordstart(ch)) { - if (state == SCE_LISP_IDENTIFIER) { - classifyWordLisp(styler.GetStartSegment(), i - 1, keywords, keywords_kw, styler); - } else { - styler.ColourTo(i - 1, state); - } - state = SCE_LISP_DEFAULT; - } /*else*/ - if (isLispoperator(ch) || ch=='\'') { - styler.ColourTo(i - 1, state); - styler.ColourTo(i, SCE_LISP_OPERATOR); - if (ch=='\'' && isLispwordstart(chNext)) { - state = SCE_LISP_SYMBOL; - } - } - } else if (state == SCE_LISP_MACRO_DISPATCH) { - if (!(IsASCII(ch) && isdigit(ch))) { - if (ch != 'r' && ch != 'R' && (i - styler.GetStartSegment()) > 1) { - state = SCE_LISP_DEFAULT; - } else { - switch (ch) { - case '|': state = SCE_LISP_MULTI_COMMENT; break; - case 'o': - case 'O': radix = 8; state = SCE_LISP_MACRO; break; - case 'x': - case 'X': radix = 16; state = SCE_LISP_MACRO; break; - case 'b': - case 'B': radix = 2; state = SCE_LISP_MACRO; break; - case '\\': state = SCE_LISP_CHARACTER; break; - case ':': - case '-': - case '+': state = SCE_LISP_MACRO; break; - case '\'': if (isLispwordstart(chNext)) { - state = SCE_LISP_SPECIAL; - } else { - styler.ColourTo(i - 1, SCE_LISP_DEFAULT); - styler.ColourTo(i, SCE_LISP_OPERATOR); - state = SCE_LISP_DEFAULT; - } - break; - default: if (isLispoperator(ch)) { - styler.ColourTo(i - 1, SCE_LISP_DEFAULT); - styler.ColourTo(i, SCE_LISP_OPERATOR); - } - state = SCE_LISP_DEFAULT; - break; - } - } - } - } else if (state == SCE_LISP_MACRO) { - if (isLispwordstart(ch) && (radix == -1 || IsADigit(ch, radix))) { - state = SCE_LISP_SPECIAL; - } else { - state = SCE_LISP_DEFAULT; - } - } else if (state == SCE_LISP_CHARACTER) { - if (isLispoperator(ch)) { - styler.ColourTo(i, SCE_LISP_SPECIAL); - state = SCE_LISP_DEFAULT; - } else if (isLispwordstart(ch)) { - styler.ColourTo(i, SCE_LISP_SPECIAL); - state = SCE_LISP_SPECIAL; - } else { - state = SCE_LISP_DEFAULT; - } - } else if (state == SCE_LISP_SPECIAL) { - if (!isLispwordstart(ch) || (radix != -1 && !IsADigit(ch, radix))) { - styler.ColourTo(i - 1, state); - state = SCE_LISP_DEFAULT; - } - if (isLispoperator(ch) || ch=='\'') { - styler.ColourTo(i - 1, state); - styler.ColourTo(i, SCE_LISP_OPERATOR); - if (ch=='\'' && isLispwordstart(chNext)) { - state = SCE_LISP_SYMBOL; - } - } - } else { - if (state == SCE_LISP_COMMENT) { - if (atEOL) { - styler.ColourTo(i - 1, state); - state = SCE_LISP_DEFAULT; - } - } else if (state == SCE_LISP_MULTI_COMMENT) { - if (ch == '|' && chNext == '#') { - i++; - chNext = styler.SafeGetCharAt(i + 1); - styler.ColourTo(i, state); - state = SCE_LISP_DEFAULT; - } - } else if (state == SCE_LISP_STRING) { - if (ch == '\\') { - if (chNext == '\"' || chNext == '\'' || chNext == '\\') { - i++; - chNext = styler.SafeGetCharAt(i + 1); - } - } else if (ch == '\"') { - styler.ColourTo(i, state); - state = SCE_LISP_DEFAULT; - } - } - } - - } - styler.ColourTo(lengthDoc - 1, state); -} - -static void FoldLispDoc(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_LISP_OPERATOR) { - if (ch == '(' || ch == '[' || ch == '{') { - levelCurrent++; - } else if (ch == ')' || ch == ']' || 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 lispWordListDesc[] = { - "Functions and special operators", - "Keywords", - 0 -}; - -LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc); diff --git a/scintilla/lexers/LexLout.cxx b/scintilla/lexers/LexLout.cxx deleted file mode 100644 index 58e7230e..00000000 --- a/scintilla/lexers/LexLout.cxx +++ /dev/null @@ -1,215 +0,0 @@ -// Scintilla source code edit control -/** @file LexLout.cxx - ** Lexer for the Basser Lout (>= version 3) typesetting language - **/ -// Copyright 2003 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 "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) && (isalpha(ch) || ch == '@' || ch == '_'); -} - -static inline bool IsAnOther(const int ch) { - return (ch < 0x80) && (ch == '{' || ch == '}' || - ch == '!' || 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 void ColouriseLoutDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, - WordList *keywordlists[], Accessor &styler) { - - WordList &keywords = *keywordlists[0]; - WordList &keywords2 = *keywordlists[1]; - WordList &keywords3 = *keywordlists[2]; - - int visibleChars = 0; - int firstWordInLine = 0; - int leadingAtSign = 0; - - StyleContext sc(startPos, length, initStyle, styler); - - for (; sc.More(); sc.Forward()) { - - if (sc.atLineStart && (sc.state == SCE_LOUT_STRING)) { - // Prevent SCE_LOUT_STRINGEOL from leaking back to previous line - sc.SetState(SCE_LOUT_STRING); - } - - // Determine if the current state should terminate. - if (sc.state == SCE_LOUT_COMMENT) { - if (sc.atLineEnd) { - sc.SetState(SCE_LOUT_DEFAULT); - visibleChars = 0; - } - } else if (sc.state == SCE_LOUT_NUMBER) { - if (!IsADigit(sc.ch) && sc.ch != '.') { - sc.SetState(SCE_LOUT_DEFAULT); - } - } else if (sc.state == SCE_LOUT_STRING) { - if (sc.ch == '\\') { - if (sc.chNext == '\"' || sc.chNext == '\\') { - sc.Forward(); - } - } else if (sc.ch == '\"') { - sc.ForwardSetState(SCE_LOUT_DEFAULT); - } else if (sc.atLineEnd) { - sc.ChangeState(SCE_LOUT_STRINGEOL); - sc.ForwardSetState(SCE_LOUT_DEFAULT); - visibleChars = 0; - } - } else if (sc.state == SCE_LOUT_IDENTIFIER) { - if (!IsAWordChar(sc.ch)) { - char s[100]; - sc.GetCurrent(s, sizeof(s)); - - if (leadingAtSign) { - if (keywords.InList(s)) { - sc.ChangeState(SCE_LOUT_WORD); - } else { - sc.ChangeState(SCE_LOUT_WORD4); - } - } else if (firstWordInLine && keywords3.InList(s)) { - sc.ChangeState(SCE_LOUT_WORD3); - } - sc.SetState(SCE_LOUT_DEFAULT); - } - } else if (sc.state == SCE_LOUT_OPERATOR) { - if (!IsAnOther(sc.ch)) { - char s[100]; - sc.GetCurrent(s, sizeof(s)); - - if (keywords2.InList(s)) { - sc.ChangeState(SCE_LOUT_WORD2); - } - sc.SetState(SCE_LOUT_DEFAULT); - } - } - - // Determine if a new state should be entered. - if (sc.state == SCE_LOUT_DEFAULT) { - if (sc.ch == '#') { - sc.SetState(SCE_LOUT_COMMENT); - } else if (sc.ch == '\"') { - sc.SetState(SCE_LOUT_STRING); - } else if (IsADigit(sc.ch) || - (sc.ch == '.' && IsADigit(sc.chNext))) { - sc.SetState(SCE_LOUT_NUMBER); - } else if (IsAWordChar(sc.ch)) { - firstWordInLine = (visibleChars == 0); - leadingAtSign = (sc.ch == '@'); - sc.SetState(SCE_LOUT_IDENTIFIER); - } else if (IsAnOther(sc.ch)) { - sc.SetState(SCE_LOUT_OPERATOR); - } - } - - if (sc.atLineEnd) { - // Reset states to begining of colourise so no surprises - // if different sets of lines lexed. - visibleChars = 0; - } - if (!IsASpace(sc.ch)) { - visibleChars++; - } - } - sc.Complete(); -} - -static void FoldLoutDoc(Sci_PositionU startPos, Sci_Position length, int, 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]; - bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; - int styleNext = styler.StyleAt(startPos); - char s[10] = ""; - - 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'); - - if (style == SCE_LOUT_WORD) { - if (ch == '@') { - for (Sci_PositionU j = 0; j < 8; j++) { - if (!IsAWordChar(styler[i + j])) { - break; - } - s[j] = styler[i + j]; - s[j + 1] = '\0'; - } - if (strcmp(s, "@Begin") == 0) { - levelCurrent++; - } else if (strcmp(s, "@End") == 0) { - levelCurrent--; - } - } - } else if (style == SCE_LOUT_OPERATOR) { - if (ch == '{') { - levelCurrent++; - } else if (ch == '}') { - 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 loutWordLists[] = { - "Predefined identifiers", - "Predefined delimiters", - "Predefined keywords", - 0, - }; - -LexerModule lmLout(SCLEX_LOUT, ColouriseLoutDoc, "lout", FoldLoutDoc, loutWordLists); diff --git a/scintilla/lexers/LexLua.cxx b/scintilla/lexers/LexLua.cxx deleted file mode 100644 index 0647d2ca..00000000 --- a/scintilla/lexers/LexLua.cxx +++ /dev/null @@ -1,436 +0,0 @@ -// 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 == ':') { // ::